From 27b7e3f2bbc449d817ba25bf567f2b6badc9371b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 3 Mar 2026 09:56:29 +0100 Subject: [PATCH 01/31] Minimal new module setup including spec --- foundation-models/openai-responses/pom.xml | 126 + .../resources/spec/azure-v1-v1-generated.json | 38873 ++++++++++++++++ .../resources/spec/azure-v1-v1-generated.yaml | 27510 +++++++++++ pom.xml | 8 + 4 files changed, 66517 insertions(+) create mode 100644 foundation-models/openai-responses/pom.xml create mode 100644 foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json create mode 100644 foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml new file mode 100644 index 000000000..9aeb9976c --- /dev/null +++ b/foundation-models/openai-responses/pom.xml @@ -0,0 +1,126 @@ + + + 4.0.0 + + com.sap.ai.sdk + sdk-parent + 1.17.0-SNAPSHOT + ../../pom.xml + + com.sap.ai.sdk.foundationmodels + openai-responses + OpenAI Responses API Client + + + + https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation + + SAP SE + https://www.sap.com + + + + The Apache Software License, Version 2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + + + + + SAP + cloudsdk@sap.com + SAP SE + https://www.sap.com + + + + scm:git:git://github.com/SAP/ai-sdk-java.git + scm:git:ssh://github.com:SAP/ai-sdk-java.git + https://github.com/SAP/ai-sdk-java/tree/main + + + ${project.basedir}/../../ + 100% + 100% + 100% + 100% + 100% + 100% + + + + + com.sap.ai.sdk + core + + + + + generate + + false + + generate + + + + + + com.sap.cloud.sdk.datamodel + openapi-generator-maven-plugin + + ${project.basedir}/src/main/java + true + COMPILE + true + + + + openai + + generate + + generate-sources + + ${project.basedir}/src/main/resources/spec/azure-v1-v1-generated.json + com.sap.ai.sdk.foundationmodels.openai.responses.generated.model + com.sap.ai.sdk.foundationmodels.openai.responses.generated.client + + apache-httpclient + create + protected + true + true + true + true + + + + /batches/** + /chat/completions + /completions + /containers/** + /conversations/** + /embeddings + /evals/** + /files/** + /fine_tuning/** + /models/** + /realtime/** + /threads/** + /vector_stores/** + + + + + true + + + + + + + + + + + diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json new file mode 100644 index 000000000..18a9e41f9 --- /dev/null +++ b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json @@ -0,0 +1,38873 @@ +{ + "openapi": "3.2.0", + "info": { + "title": "Azure AI Foundry Models Service", + "license": { + "name": "MIT", + "url": "https://github.com/openai/openai-openapi/blob/master/LICENSE" + }, + "version": "v1" + }, + "tags": [ + { + "name": "Batch" + }, + { + "name": "Chat" + }, + { + "name": "Completions" + }, + { + "name": "Containers" + }, + { + "name": "Conversations" + }, + { + "name": "Evals" + }, + { + "name": "Files" + }, + { + "name": "Embeddings" + }, + { + "name": "Fine-tuning" + }, + { + "name": "Models" + }, + { + "name": "Realtime" + }, + { + "name": "Responses" + }, + { + "name": "Threads" + }, + { + "name": "Vector Stores" + } + ], + "paths": { + "/batches": { + "post": { + "operationId": "createBatch", + "summary": "Creates and executes a batch from an uploaded file of requests", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "object", + "endpoint", + "completion_window", + "status", + "created_at" + ], + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "enum": [ + "batch" + ], + "description": "The object type, which is always `batch`.", + "x-stainless-const": true + }, + "endpoint": { + "type": "string", + "description": "The OpenAI API endpoint used by the batch." + }, + "model": { + "type": "string", + "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." + }, + "errors": { + "$ref": "#/components/schemas/OpenAI.BatchErrors" + }, + "completion_window": { + "type": "string", + "description": "The time frame within which the batch should be processed." + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "description": "The current status of the batch." + }, + "output_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of successfully executed requests." + }, + "error_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of requests with errors." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was created." + }, + "in_progress_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started processing." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch will expire." + }, + "finalizing_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started finalizing." + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was completed." + }, + "failed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch failed." + }, + "expired_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch expired." + }, + "cancelling_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started cancelling." + }, + "cancelled_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was cancelled." + }, + "request_counts": { + "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" + }, + "usage": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.BatchUsage" + } + ], + "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "input_file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Batch" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "input_file_id": { + "type": "string", + "description": "The ID of an uploaded file that contains requests for the new batch.\n\nSee [upload file](/docs/api-reference/files/create) for how to upload a file.\n\nYour input file must be formatted as a [JSONL file](/docs/api-reference/batch/requestInput),\nand must be uploaded with the purpose `batch`." + }, + "endpoint": { + "type": "string", + "enum": [ + "/v1/chat/completions", + "/v1/embeddings" + ], + "description": "The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions` is supported." + }, + "completion_window": { + "type": "string", + "enum": [ + "24h" + ], + "description": "The time frame within which the batch should be processed. Currently only `24h` is supported." + } + }, + "required": [ + "endpoint", + "completion_window" + ], + "unevaluatedProperties": { + "type": "string" + } + } + } + } + } + }, + "get": { + "operationId": "listBatches", + "summary": "List your organization's batches.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListBatchesResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Batch" + ] + } + }, + "/batches/{batch_id}": { + "get": { + "operationId": "retrieveBatch", + "summary": "Retrieves a batch.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "description": "The ID of the batch to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "object", + "endpoint", + "completion_window", + "status", + "created_at" + ], + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "enum": [ + "batch" + ], + "description": "The object type, which is always `batch`.", + "x-stainless-const": true + }, + "endpoint": { + "type": "string", + "description": "The OpenAI API endpoint used by the batch." + }, + "model": { + "type": "string", + "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." + }, + "errors": { + "$ref": "#/components/schemas/OpenAI.BatchErrors" + }, + "completion_window": { + "type": "string", + "description": "The time frame within which the batch should be processed." + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "description": "The current status of the batch." + }, + "output_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of successfully executed requests." + }, + "error_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of requests with errors." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was created." + }, + "in_progress_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started processing." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch will expire." + }, + "finalizing_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started finalizing." + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was completed." + }, + "failed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch failed." + }, + "expired_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch expired." + }, + "cancelling_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started cancelling." + }, + "cancelled_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was cancelled." + }, + "request_counts": { + "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" + }, + "usage": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.BatchUsage" + } + ], + "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "input_file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Batch" + ] + } + }, + "/batches/{batch_id}/cancel": { + "post": { + "operationId": "cancelBatch", + "summary": "Cancels an in-progress batch.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "description": "The ID of the batch to cancel.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "object", + "endpoint", + "completion_window", + "status", + "created_at" + ], + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "enum": [ + "batch" + ], + "description": "The object type, which is always `batch`.", + "x-stainless-const": true + }, + "endpoint": { + "type": "string", + "description": "The OpenAI API endpoint used by the batch." + }, + "model": { + "type": "string", + "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." + }, + "errors": { + "$ref": "#/components/schemas/OpenAI.BatchErrors" + }, + "completion_window": { + "type": "string", + "description": "The time frame within which the batch should be processed." + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "description": "The current status of the batch." + }, + "output_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of successfully executed requests." + }, + "error_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of requests with errors." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was created." + }, + "in_progress_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started processing." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch will expire." + }, + "finalizing_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started finalizing." + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was completed." + }, + "failed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch failed." + }, + "expired_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch expired." + }, + "cancelling_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started cancelling." + }, + "cancelled_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was cancelled." + }, + "request_counts": { + "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" + }, + "usage": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.BatchUsage" + } + ], + "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "input_file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Batch" + ] + } + }, + "/chat/completions": { + "post": { + "operationId": "createChatCompletion", + "description": "Creates a chat completion.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "object", + "required": [ + "id", + "choices", + "created", + "model", + "object" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the chat completion." + }, + "choices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoices" + }, + "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1." + }, + "created": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) of when the chat completion was created." + }, + "model": { + "type": "string", + "description": "The model used for the chat completion." + }, + "system_fingerprint": { + "type": "string", + "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", + "deprecated": true + }, + "object": { + "type": "string", + "enum": [ + "chat.completion" + ], + "description": "The object type, which is always `chat.completion`.", + "x-stainless-const": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.CompletionUsage" + }, + "prompt_filter_results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "prompt_index": { + "type": "integer", + "format": "int32", + "description": "The index of the input prompt that this content filter result corresponds to." + }, + "content_filter_results": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterResultForPrompt" + } + ], + "description": "The content filter results associated with the indexed input prompt." + } + }, + "required": [ + "prompt_index", + "content_filter_results" + ] + } + } + } + }, + { + "type": "object", + "required": [ + "id", + "choices", + "created", + "model", + "object" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the chat completion. Each chunk has the same ID." + }, + "choices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoices" + }, + "description": "A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the\n last chunk if you set `stream_options: {\"include_usage\": true}`." + }, + "created": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp." + }, + "model": { + "type": "string", + "description": "The model to generate the completion." + }, + "system_fingerprint": { + "type": "string", + "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", + "deprecated": true + }, + "object": { + "type": "string", + "enum": [ + "chat.completion.chunk" + ], + "description": "The object type, which is always `chat.completion.chunk`.", + "x-stainless-const": true + }, + "usage": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CompletionUsage" + } + ], + "description": "An optional field that will only be present when you set\n `stream_options: {\"include_usage\": true}` in your request. When present, it\n contains a null value **except for the last chunk** which contains the\n token usage statistics for the entire request.\n*NOTE:** If the stream is interrupted or cancelled, you may not\n receive the final usage chunk which contains the total token usage for\n the request." + }, + "delta": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta" + }, + "content_filter_results": { + "$ref": "#/components/schemas/AzureContentFilterResultForChoice" + } + } + } + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Chat" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "user": { + "type": "string", + "description": "A unique identifier representing your end-user, which can help to\nmonitor and detect abuse.", + "deprecated": true + }, + "safety_identifier": { + "type": "string", + "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." + }, + "prompt_cache_key": { + "type": "string", + "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." + }, + "prompt_cache_retention": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in-memory", + "24h" + ] + }, + { + "type": "null" + } + ] + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + }, + "minItems": 1, + "description": "A list of messages comprising the conversation so far. Depending on the\nmodel you use, different message types (modalities) are supported,\nlike text, images, and audio." + }, + "model": { + "type": "string", + "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." + }, + "modalities": { + "$ref": "#/components/schemas/OpenAI.ResponseModalities" + }, + "verbosity": { + "$ref": "#/components/schemas/OpenAI.Verbosity" + }, + "reasoning_effort": { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + }, + "max_completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "An upper bound for the number of tokens that can be generated for a\ncompletion, including visible output tokens and reasoning tokens." + }, + "frequency_penalty": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": -2, + "maximum": 2, + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n their existing frequency in the text so far, decreasing the model's\n likelihood to repeat the same line verbatim." + }, + "presence_penalty": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": -2, + "maximum": 2, + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n whether they appear in the text so far, increasing the model's likelihood\n to talk about new topics." + }, + "response_format": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" + } + ], + "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema.\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures\nthe message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model\nto produce JSON yourself via a system or user message. Without this, the\nmodel may generate an unending stream of whitespace until the generation\nreaches the token limit, resulting in a long-running and seemingly \"stuck\"\nrequest. Also note that the message content may be partially cut off if\n`finish_reason=\"length\"`, which indicates the generation exceeded\n`max_tokens` or the conversation exceeded the max context length." + }, + "audio": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestAudio" + }, + { + "type": "null" + } + ], + "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`." + }, + "store": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether or not to store the output of this chat completion request for\nuse in model distillation or evals products." + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "If set to true, the model response data will be streamed to the client\nas it is generated using server-sent events." + }, + "stop": { + "$ref": "#/components/schemas/OpenAI.StopConfiguration" + }, + "logit_bias": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": { + "type": "integer" + } + }, + { + "type": "null" + } + ], + "description": "Modify the likelihood of specified tokens appearing in the completion.\n Accepts a JSON object that maps tokens (specified by their token ID in the\n tokenizer) to an associated bias value from -100 to 100. Mathematically,\n the bias is added to the logits generated by the model prior to sampling.\n The exact effect will vary per model, but values between -1 and 1 should\n decrease or increase likelihood of selection; values like -100 or 100\n should result in a ban or exclusive selection of the relevant token.", + "x-oaiTypeLabel": "map" + }, + "logprobs": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether to return log probabilities of the output tokens or not. If true,\n returns the log probabilities of each output token returned in the\n `content` of `message`." + }, + "max_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "The maximum number of tokens that can be generated in the chat completion.\nThis value can be used to control costs for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with o1 series models.", + "deprecated": true + }, + "n": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 1, + "maximum": 128, + "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", + "default": 1 + }, + "prediction": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.PredictionContent" + } + ], + "description": "Configuration for a predicted output, which can greatly improve\nresponse times when large parts of the model response are known\nahead of time. This is most common when you are regenerating a\nfile with only minor changes to most of the content." + }, + "seed": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "null" + } + ], + "description": "This feature is in Beta.\n If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", + "deprecated": true, + "x-oaiMeta": { + "beta": true + } + }, + "stream_options": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions" + }, + { + "type": "null" + } + ] + }, + "tools": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTool" + }, + { + "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletions" + } + ] + }, + "description": "A list of tools the model may call. You can provide either\n [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or\n [function tools](https://platform.openai.com/docs/guides/function-calling)." + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionToolChoiceOption" + }, + "parallel_tool_calls": { + "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" + }, + "function_call": { + "anyOf": [ + { + "type": "string", + "enum": [ + "none", + "auto" + ] + }, + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctionCallOption" + } + ], + "description": "Deprecated in favor of `tool_choice`.\n Controls which (if any) function is called by the model.\n `none` means the model will not call a function and instead generates a\n message.\n `auto` means the model can pick between generating a message or calling a\n function.\n Specifying a particular function via `{\"name\": \"my_function\"}` forces the\n model to call that function.\n `none` is the default when no functions are present. `auto` is the default\n if functions are present.", + "deprecated": true + }, + "functions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctions" + }, + "minItems": 1, + "maxItems": 128, + "description": "Deprecated in favor of `tools`.\n A list of functions the model may generate JSON inputs for.", + "deprecated": true + }, + "user_security_context": { + "$ref": "#/components/schemas/AzureUserSecurityContext" + } + }, + "required": [ + "messages", + "model" + ] + } + } + } + }, + "x-ms-examples": { + "Create a chat completion": { + "$ref": "./examples/chat_completions.yaml" + } + } + } + }, + "/completions": { + "post": { + "operationId": "createCompletion", + "description": "Creates a completion.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "choices", + "created", + "model", + "object" + ], + "properties": { + "id": { + "type": "string", + "description": "A unique identifier for the completion." + }, + "choices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoices" + }, + "description": "The list of completion choices the model generated for the input prompt." + }, + "created": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) of when the completion was created." + }, + "model": { + "type": "string", + "description": "The model used for completion." + }, + "system_fingerprint": { + "type": "string", + "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism." + }, + "object": { + "type": "string", + "enum": [ + "text_completion" + ], + "description": "The object type, which is always \"text_completion\"", + "x-stainless-const": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.CompletionUsage" + }, + "prompt_filter_results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzureContentFilterResultForPrompt" + } + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Completions" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.", + "x-oaiTypeLabel": "string" + }, + "best_of": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 20, + "description": "Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.\n*Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.", + "default": 1 + }, + "echo": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Echo back the prompt in addition to the completion" + }, + "frequency_penalty": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": -2, + "maximum": 2, + "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)" + }, + "logit_bias": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": { + "type": "integer" + } + }, + { + "type": "null" + } + ], + "description": "Modify the likelihood of specified tokens appearing in the completion.\n Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.\n As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.", + "x-oaiTypeLabel": "map" + }, + "logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 5, + "description": "Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n The maximum value for `logprobs` is 5." + }, + "max_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 0, + "description": "The maximum number of [tokens](/tokenizer) that can be generated in the completion.\n The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.", + "default": 16 + }, + "n": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 1, + "maximum": 128, + "description": "How many completions to generate for each prompt.\n*Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.", + "default": 1 + }, + "presence_penalty": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": -2, + "maximum": 2, + "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.\n [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)" + }, + "seed": { + "anyOf": [ + { + "type": "integer", + "format": "int64" + }, + { + "type": "null" + } + ], + "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend." + }, + "stop": { + "$ref": "#/components/schemas/OpenAI.StopConfiguration" + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions)." + }, + "stream_options": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions" + }, + { + "type": "null" + } + ] + }, + "suffix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The suffix that comes after a completion of inserted text.\n This parameter is only supported for `gpt-3.5-turbo-instruct`." + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 2, + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n We generally recommend altering this or `top_p` but not both.", + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 1, + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or `temperature` but not both.", + "default": 1 + }, + "user": { + "type": "string", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." + }, + "prompt": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "default": "<|endoftext|>" + } + }, + "required": [ + "model" + ] + } + } + } + }, + "x-ms-examples": { + "Create a chat completion": { + "$ref": "./examples/completions.yaml" + } + } + } + }, + "/containers": { + "get": { + "operationId": "listContainers", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ContainerListResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + }, + "post": { + "operationId": "createContainer", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ContainerResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateContainerBody" + } + } + } + } + } + }, + "/containers/{container_id}": { + "get": { + "operationId": "retrieveContainer", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ContainerResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + }, + "delete": { + "operationId": "deleteContainer", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + } + }, + "/containers/{container_id}/files": { + "get": { + "operationId": "listContainerFiles", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container to list files from.", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ContainerFileListResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + }, + "post": { + "operationId": "createContainerFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container to create a file in.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ContainerFileResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateContainerFileBody" + } + } + } + } + } + }, + "/containers/{container_id}/files/{file_id}": { + "get": { + "operationId": "retrieveContainerFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ContainerFileResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + }, + "delete": { + "operationId": "deleteContainerFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + } + }, + "/containers/{container_id}/files/{file_id}/content": { + "get": { + "operationId": "retrieveContainerFileContent", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "container_id", + "in": "path", + "required": true, + "description": "The ID of the container.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to retrieve content from.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/octet-stream": { + "schema": { + "contentMediaType": "application/octet-stream" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Containers" + ] + } + }, + "/conversations": { + "post": { + "operationId": "createConversation", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateConversationBody" + } + } + } + } + } + }, + "/conversations/{conversation_id}": { + "get": { + "operationId": "retrieveConversation", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ] + }, + "post": { + "operationId": "updateConversation", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation to update.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.UpdateConversationBody" + } + } + } + } + }, + "delete": { + "operationId": "deleteConversation", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeletedConversationResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ] + } + }, + "/conversations/{conversation_id}/items": { + "get": { + "operationId": "listConversationItems", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation to list items for.", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "The order to return the input items in. Default is `desc`.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "An item ID to list items after, used in pagination.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "include", + "in": "query", + "required": false, + "description": "Specify additional output data to include in the model response.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.IncludeEnum" + } + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationItemList" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ] + }, + "post": { + "operationId": "createConversationItems", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation to add the item to.", + "schema": { + "type": "string" + } + }, + { + "name": "include", + "in": "query", + "required": false, + "description": "Additional fields to include in the response.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.IncludeEnum" + } + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationItemList" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateConversationItemsParametersBody" + } + } + } + } + } + }, + "/conversations/{conversation_id}/items/{item_id}": { + "get": { + "operationId": "retrieveConversationItem", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation that contains the item.", + "schema": { + "type": "string" + } + }, + { + "name": "item_id", + "in": "path", + "required": true, + "description": "The ID of the item to retrieve.", + "schema": { + "type": "string" + } + }, + { + "name": "include", + "in": "query", + "required": false, + "description": "Additional fields to include in the response.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.IncludeEnum" + } + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ] + }, + "delete": { + "operationId": "deleteConversationItem", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "conversation_id", + "in": "path", + "required": true, + "description": "The ID of the conversation that contains the item.", + "schema": { + "type": "string" + } + }, + { + "name": "item_id", + "in": "path", + "required": true, + "description": "The ID of the item to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ConversationResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Conversations" + ] + } + }, + "/embeddings": { + "post": { + "operationId": "createEmbedding", + "summary": "Creates an embedding vector representing the input text.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Embeddings" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateEmbeddingRequest" + } + } + } + }, + "x-ms-examples": { + "Create an embedding request": { + "$ref": "./examples/embeddings.yaml" + } + } + } + }, + "/evals": { + "get": { + "operationId": "listEvals", + "summary": "List evaluations for a project.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last eval from the previous pagination request.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of evals to be returned in a single pagination response.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order for evals by timestamp. Use `asc` for ascending order or\n`desc` for descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "explode": false + }, + { + "name": "order_by", + "in": "query", + "required": false, + "description": "Evals can be ordered by creation time or last updated time. Use\n`created_at` for creation time or `updated_at` for last updated\ntime.", + "schema": { + "type": "string", + "enum": [ + "created_at", + "updated_at" + ], + "default": "created_at" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalList" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + }, + "post": { + "operationId": "createEval", + "description": "Create the structure of an evaluation that can be used to test a model's\nperformance.\n\nAn evaluation is a set of testing criteria and a datasource. After\ncreating an evaluation, you can run it on different models and model\nparameters. We support several types of graders and datasources.\n\nFor more information, see the [Evals guide](/docs/guides/evals).", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.Eval" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "statusCode": { + "type": "number", + "enum": [ + 201 + ] + }, + "name": { + "type": "string", + "description": "The name of the evaluation." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "data_source_config": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig" + } + ], + "description": "The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation." + }, + "testing_criteria": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalLabelModelGrader" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderPython" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel" + }, + { + "$ref": "#/components/schemas/EvalGraderEndpoint" + } + ] + }, + "description": "A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`)." + } + }, + "required": [ + "statusCode", + "data_source_config", + "testing_criteria" + ] + } + } + } + } + } + }, + "/evals/{eval_id}": { + "get": { + "operationId": "getEval", + "summary": "Retrieve an evaluation by its ID.", + "description": "Retrieves an evaluation by its ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.Eval" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + }, + "post": { + "operationId": "updateEval", + "description": "Update select, mutable properties of a specified evaluation.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.Eval" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "metadata": { + "$ref": "#/components/schemas/OpenAI.Metadata" + } + } + } + } + } + } + }, + "delete": { + "operationId": "deleteEval", + "description": "Delete a specified evaluation.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "object", + "deleted", + "eval_id" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "eval.deleted" + ] + }, + "deleted": { + "type": "boolean" + }, + "eval_id": { + "type": "string" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + } + }, + "/evals/{eval_id}/runs": { + "get": { + "operationId": "getEvalRuns", + "summary": "", + "description": "Retrieve a list of runs for a specified evaluation.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "after", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "explode": false + }, + { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "queued", + "in_progress", + "completed", + "canceled", + "failed" + ] + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalRunList" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + }, + "post": { + "operationId": "createEvalRun", + "description": "Create a new evaluation run, beginning the grading process.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalRun" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateEvalRunRequest" + } + } + } + } + } + }, + "/evals/{eval_id}/runs/{run_id}": { + "get": { + "operationId": "getEvalRun", + "description": "Retrieve a specific evaluation run by its ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalRun" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + }, + "post": { + "operationId": "cancelEvalRun", + "description": "Cancel a specific evaluation run by its ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalRun" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + }, + "delete": { + "operationId": "deleteEvalRun", + "description": "Delete a specific evaluation run by its ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "object", + "deleted", + "eval_run_id" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "eval_run.deleted" + ] + }, + "deleted": { + "type": "boolean" + }, + "eval_run_id": { + "type": "string" + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + } + }, + "/evals/{eval_id}/runs/{run_id}/output_items": { + "get": { + "operationId": "getEvalRunOutputItems", + "description": "Get a list of output items for a specified evaluation run.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "after", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "status", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "fail", + "pass" + ] + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemList" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + } + }, + "/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": { + "get": { + "operationId": "getEvalRunOutputItem", + "description": "Retrieve a specific output item from an evaluation run by its ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "eval_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "output_item_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItem" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Evals" + ] + } + }, + "/files": { + "post": { + "operationId": "createFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "bytes", + "created_at", + "filename", + "object", + "purpose", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The file identifier, which can be referenced in the API endpoints." + }, + "bytes": { + "type": "integer", + "description": "The size of the file, in bytes." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the file was created." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the file will expire." + }, + "filename": { + "type": "string", + "description": "The name of the file." + }, + "object": { + "type": "string", + "enum": [ + "file" + ], + "description": "The object type, which is always `file`.", + "x-stainless-const": true + }, + "status_details": { + "type": "string", + "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", + "deprecated": true + }, + "purpose": { + "type": "string", + "enum": [ + "assistants", + "assistants_output", + "batch", + "batch_output", + "fine-tune", + "fine-tune-results", + "evals" + ], + "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`." + }, + "status": { + "type": "string", + "enum": [ + "uploaded", + "pending", + "running", + "processed", + "error", + "deleting", + "deleted" + ] + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Files" + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateFileRequest" + } + } + } + }, + "x-ms-examples": { + "Create a file request": { + "$ref": "./examples/files.yaml" + } + } + }, + "get": { + "operationId": "listFiles", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "purpose", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer" + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFilesResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Files" + ] + } + }, + "/files/{file_id}": { + "get": { + "operationId": "retrieveFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to use for this request.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "bytes", + "created_at", + "filename", + "object", + "purpose", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The file identifier, which can be referenced in the API endpoints." + }, + "bytes": { + "type": "integer", + "description": "The size of the file, in bytes." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the file was created." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the file will expire." + }, + "filename": { + "type": "string", + "description": "The name of the file." + }, + "object": { + "type": "string", + "enum": [ + "file" + ], + "description": "The object type, which is always `file`.", + "x-stainless-const": true + }, + "status_details": { + "type": "string", + "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", + "deprecated": true + }, + "purpose": { + "type": "string", + "enum": [ + "assistants", + "assistants_output", + "batch", + "batch_output", + "fine-tune", + "fine-tune-results", + "evals" + ], + "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`." + }, + "status": { + "type": "string", + "enum": [ + "uploaded", + "pending", + "running", + "processed", + "error", + "deleting", + "deleted" + ] + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Files" + ] + }, + "delete": { + "operationId": "deleteFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to use for this request.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteFileResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Files" + ] + } + }, + "/files/{file_id}/content": { + "get": { + "operationId": "downloadFile", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to use for this request.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/octet-stream": { + "schema": { + "contentMediaType": "application/octet-stream" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Files" + ] + } + }, + "/fine_tuning/alpha/graders/run": { + "post": { + "operationId": "runGrader", + "summary": "Run a grader.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunGraderResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunGraderRequest" + } + } + } + } + } + }, + "/fine_tuning/alpha/graders/validate": { + "post": { + "operationId": "validateGrader", + "summary": "Validate a grader.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ValidateGraderResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "grader": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.GraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderPython" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderScoreModel" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderMulti" + }, + { + "$ref": "#/components/schemas/GraderEndpoint" + } + ] + } + } + } + } + } + } + } + }, + "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions": { + "get": { + "operationId": "listFineTuningCheckpointPermissions", + "summary": "List checkpoint permissions", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuned_model_checkpoint", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint to get permissions for.", + "schema": { + "type": "string" + } + }, + { + "name": "project_id", + "in": "query", + "required": false, + "description": "The ID of the project to get permissions for.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last permission ID from the previous pagination request.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Number of permissions to retrieve.", + "schema": { + "type": "integer", + "format": "int32", + "default": 10 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "The order in which to retrieve permissions.", + "schema": { + "type": "string", + "enum": [ + "ascending", + "descending" + ], + "default": "descending" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + }, + "post": { + "operationId": "createFineTuningCheckpointPermission", + "summary": "Create checkpoint permissions", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuned_model_checkpoint", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint to create a permission for.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest" + } + } + } + } + } + }, + "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}": { + "delete": { + "operationId": "deleteFineTuningCheckpointPermission", + "summary": "Delete checkpoint permission", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuned_model_checkpoint", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint to delete a permission for.", + "schema": { + "type": "string" + } + }, + { + "name": "permission_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint permission to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs": { + "post": { + "operationId": "createFineTuningJob", + "summary": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.FineTuningJob" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest" + } + } + } + } + }, + "get": { + "operationId": "listPaginatedFineTuningJobs", + "summary": "List your organization's fine-tuning jobs", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last job from the previous pagination request.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Number of fine-tuning jobs to retrieve.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}": { + "get": { + "operationId": "retrieveFineTuningJob", + "summary": "Get info about a fine-tuning job.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.FineTuningJob" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/cancel": { + "post": { + "operationId": "cancelFineTuningJob", + "summary": "Immediately cancel a fine-tune job.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to cancel.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.FineTuningJob" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": { + "get": { + "operationId": "listFineTuningJobCheckpoints", + "summary": "List the checkpoints for a fine-tuning job.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to get checkpoints for.", + "schema": { + "type": "string" + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last checkpoint ID from the previous pagination request.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Number of checkpoints to retrieve.", + "schema": { + "type": "integer", + "format": "int32", + "default": 10 + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy": { + "post": { + "operationId": "FineTuning_CopyCheckpoint", + "description": "Creates a copy of a fine-tuning checkpoint at the given destination account and region.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "aoai-copy-ft-checkpoints", + "in": "header", + "required": true, + "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", + "schema": { + "type": "string", + "enum": [ + "preview" + ] + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "fine_tuning_checkpoint_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CopyModelResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CopyModelRequest" + } + } + } + } + }, + "get": { + "operationId": "FineTuning_GetCheckpoint", + "description": "Gets the status of a fine-tuning checkpoint copy.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "aoai-copy-ft-checkpoints", + "in": "header", + "required": true, + "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", + "schema": { + "type": "string", + "enum": [ + "preview" + ] + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "fine_tuning_checkpoint_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CopyModelResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/events": { + "get": { + "operationId": "listFineTuningEvents", + "summary": "Get status updates for a fine-tuning job.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to get events for.", + "schema": { + "type": "string" + } + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last event from the previous pagination request.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Number of events to retrieve.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/pause": { + "post": { + "operationId": "pauseFineTuningJob", + "summary": "Pause a fine-tune job.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to pause.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.FineTuningJob" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/resume": { + "post": { + "operationId": "resumeFineTuningJob", + "summary": "Resume a paused fine-tune job.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to resume.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.FineTuningJob" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + } + }, + "/models": { + "get": { + "operationId": "listModels", + "summary": "Lists the currently available models, and provides basic information about each one such as the\nowner and availability.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListModelsResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Models" + ] + } + }, + "/models/{model}": { + "get": { + "operationId": "retrieveModel", + "summary": "Retrieves a model instance, providing basic information about the model such as the owner and\npermissioning.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "model", + "in": "path", + "required": true, + "description": "The ID of the model to use for this request.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.Model" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Models" + ] + }, + "delete": { + "operationId": "deleteModel", + "summary": "Deletes a model instance.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "model", + "in": "path", + "required": true, + "description": "The ID of the model to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteModelResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Models" + ] + } + }, + "/realtime/calls": { + "post": { + "operationId": "createRealtimeCall", + "summary": "Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "headers": { + "location": { + "required": false, + "description": "Relative URL containing the call ID for subsequent control requests.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/sdp": { + "schema": { + "type": "string" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeCallCreateRequest" + }, + "encoding": { + "session": { + "contentType": "application/json" + } + } + } + } + } + } + }, + "/realtime/calls/{call_id}/accept": { + "post": { + "operationId": "acceptRealtimeCall", + "summary": "Accept an incoming SIP call and configure the realtime session that will handle it.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "call_id", + "in": "path", + "required": true, + "description": "The identifier for the call provided in the realtime.call.incoming webhook.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA" + } + } + }, + "description": "Session configuration to apply before the caller is bridged to the model." + } + } + }, + "/realtime/calls/{call_id}/hangup": { + "post": { + "operationId": "hangupRealtimeCall", + "summary": "End an active Realtime API call, whether it was initiated over SIP or WebRTC.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "call_id", + "in": "path", + "required": true, + "description": "The identifier for the call.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ] + } + }, + "/realtime/calls/{call_id}/refer": { + "post": { + "operationId": "referRealtimeCall", + "summary": "Transfer an active SIP call to a new destination using the SIP REFER verb.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "call_id", + "in": "path", + "required": true, + "description": "The identifier for the call provided in the realtime.call.incoming webhook.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeCallReferRequest" + } + } + }, + "description": "Destination URI for the REFER request." + } + } + }, + "/realtime/calls/{call_id}/reject": { + "post": { + "operationId": "rejectRealtimeCall", + "summary": "Decline an incoming SIP call by returning a SIP status code to the caller.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "call_id", + "in": "path", + "required": true, + "description": "The identifier for the call provided in the realtime.call.incoming webhook.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeCallRejectRequest" + } + } + }, + "description": "Provide an optional SIP status code. When omitted the API responds with 603 Decline." + } + } + }, + "/realtime/client_secrets": { + "post": { + "operationId": "createRealtimeClientSecret", + "summary": "Create a Realtime client secret with an associated session configuration.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretRequest" + } + } + }, + "description": "Create a client secret with the given session configuration." + } + } + }, + "/realtime/sessions": { + "post": { + "operationId": "createRealtimeSession", + "summary": "Create an ephemeral API token for use in client-side applications with the Realtime API.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequest" + } + } + }, + "description": "Create an ephemeral API key with the given session configuration." + } + } + }, + "/realtime/transcription_sessions": { + "post": { + "operationId": "createRealtimeTranscriptionSession", + "summary": "Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Realtime" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest" + } + } + }, + "description": "Create an ephemeral API key with the given session configuration." + } + } + }, + "/responses": { + "post": { + "operationId": "createResponse", + "description": "Creates a model response.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "error", + "incomplete_details", + "output", + "instructions", + "parallel_tool_calls", + "content_filters" + ], + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "user": { + "type": "string", + "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", + "deprecated": true + }, + "safety_identifier": { + "type": "string", + "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." + }, + "prompt_cache_key": { + "type": "string", + "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." + }, + "prompt_cache_retention": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in-memory", + "24h" + ] + }, + { + "type": "null" + } + ] + }, + "previous_response_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": "string", + "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." + }, + "reasoning": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Reasoning" + }, + { + "type": "null" + } + ] + }, + "background": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "max_tool_calls": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "text": { + "$ref": "#/components/schemas/OpenAI.ResponseTextParam" + }, + "tools": { + "$ref": "#/components/schemas/OpenAI.ToolsArray" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + }, + "truncation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "disabled" + ] + }, + { + "type": "null" + } + ], + "default": "disabled" + }, + "id": { + "type": "string", + "description": "Unique identifier for this Response." + }, + "object": { + "type": "string", + "enum": [ + "response" + ], + "description": "The object type of this resource - always set to `response`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "completed", + "failed", + "in_progress", + "cancelled", + "queued", + "incomplete" + ], + "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) of when this Response was created." + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseError" + }, + { + "type": "null" + } + ] + }, + "incomplete_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" + }, + { + "type": "null" + } + ] + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OutputItem" + }, + "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + }, + { + "type": "null" + } + ] + }, + "output_text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "x-stainless-skip": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.ResponseUsage" + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to allow the model to run tool calls in parallel.", + "default": true + }, + "conversation": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationReference" + }, + { + "type": "null" + } + ] + }, + "content_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" + }, + "description": "The content filter results from RAI." + } + } + } + }, + "text/event-stream": { + "itemSchema": { + "type": "object", + "properties": { + "event": { + "type": "string" + }, + "data": { + "type": "string" + } + }, + "required": [ + "event" + ], + "oneOf": [ + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent" + } + }, + "event": { + "const": "response.audio.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent" + } + }, + "event": { + "const": "response.audio.transcript.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent" + } + }, + "event": { + "const": "response.code_interpreter_call_code.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent" + } + }, + "event": { + "const": "response.code_interpreter_call.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent" + } + }, + "event": { + "const": "response.code_interpreter_call.interpreting" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent" + } + }, + "event": { + "const": "response.content_part.added" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseCreatedEvent" + } + }, + "event": { + "const": "response.created" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseErrorEvent" + } + }, + "event": { + "const": "error" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent" + } + }, + "event": { + "const": "response.file_search_call.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent" + } + }, + "event": { + "const": "response.file_search_call.searching" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent" + } + }, + "event": { + "const": "response.function_call_arguments.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseInProgressEvent" + } + }, + "event": { + "const": "response.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseFailedEvent" + } + }, + "event": { + "const": "response.failed" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseIncompleteEvent" + } + }, + "event": { + "const": "response.incomplete" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent" + } + }, + "event": { + "const": "response.output_item.added" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent" + } + }, + "event": { + "const": "response.reasoning_summary_part.added" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent" + } + }, + "event": { + "const": "response.reasoning_summary_text.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent" + } + }, + "event": { + "const": "response.reasoning_text.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent" + } + }, + "event": { + "const": "response.refusal.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseTextDeltaEvent" + } + }, + "event": { + "const": "response.output_text.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent" + } + }, + "event": { + "const": "response.web_search_call.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent" + } + }, + "event": { + "const": "response.web_search_call.searching" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent" + } + }, + "event": { + "const": "response.image_generation_call.generating" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent" + } + }, + "event": { + "const": "response.image_generation_call.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent" + } + }, + "event": { + "const": "response.image_generation_call.partial_image" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent" + } + }, + "event": { + "const": "response.mcp_call_arguments.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent" + } + }, + "event": { + "const": "response.mcp_call.failed" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent" + } + }, + "event": { + "const": "response.mcp_call.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent" + } + }, + "event": { + "const": "response.mcp_list_tools.failed" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent" + } + }, + "event": { + "const": "response.mcp_list_tools.in_progress" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent" + } + }, + "event": { + "const": "response.output_text.annotation.added" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseQueuedEvent" + } + }, + "event": { + "const": "response.queued" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json", + "contentSchema": { + "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent" + } + }, + "event": { + "const": "response.custom_tool_call_input.delta" + } + } + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + }, + { + "properties": { + "data": { + "contentMediaType": "application/json" + } + }, + "x-ms-sse-terminal-event": true + } + ] + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Responses" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateResponse" + } + } + } + }, + "x-ms-examples": { + "Create a response request": { + "$ref": "./examples/responses.yaml" + } + } + } + }, + "/responses/{response_id}": { + "get": { + "operationId": "getResponse", + "description": "Retrieves a model response with the given ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "include[]", + "in": "query", + "required": false, + "description": "Additional fields to include in the response. See the include parameter for Response creation above for more information.", + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.IncludeEnum" + }, + "default": [] + } + }, + { + "name": "stream", + "in": "query", + "required": false, + "description": "If set to true, the model response data will be streamed to the client as it is generated using server-sent events.", + "schema": { + "type": "boolean" + }, + "explode": false + }, + { + "name": "starting_after", + "in": "query", + "required": false, + "description": "The sequence number of the event after which to start streaming.", + "schema": { + "type": "integer", + "format": "int32" + }, + "explode": false + }, + { + "name": "include_obfuscation", + "in": "query", + "required": false, + "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.", + "schema": { + "type": "boolean", + "default": true + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "error", + "incomplete_details", + "output", + "instructions", + "parallel_tool_calls", + "content_filters" + ], + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "user": { + "type": "string", + "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", + "deprecated": true + }, + "safety_identifier": { + "type": "string", + "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." + }, + "prompt_cache_key": { + "type": "string", + "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." + }, + "prompt_cache_retention": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in-memory", + "24h" + ] + }, + { + "type": "null" + } + ] + }, + "previous_response_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": "string", + "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." + }, + "reasoning": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Reasoning" + }, + { + "type": "null" + } + ] + }, + "background": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "max_tool_calls": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "text": { + "$ref": "#/components/schemas/OpenAI.ResponseTextParam" + }, + "tools": { + "$ref": "#/components/schemas/OpenAI.ToolsArray" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + }, + "truncation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "disabled" + ] + }, + { + "type": "null" + } + ], + "default": "disabled" + }, + "id": { + "type": "string", + "description": "Unique identifier for this Response." + }, + "object": { + "type": "string", + "enum": [ + "response" + ], + "description": "The object type of this resource - always set to `response`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "completed", + "failed", + "in_progress", + "cancelled", + "queued", + "incomplete" + ], + "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) of when this Response was created." + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseError" + }, + { + "type": "null" + } + ] + }, + "incomplete_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" + }, + { + "type": "null" + } + ] + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OutputItem" + }, + "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + }, + { + "type": "null" + } + ] + }, + "output_text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "x-stainless-skip": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.ResponseUsage" + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to allow the model to run tool calls in parallel.", + "default": true + }, + "conversation": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationReference" + }, + { + "type": "null" + } + ] + }, + "content_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" + }, + "description": "The content filter results from RAI." + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Responses" + ] + }, + "delete": { + "operationId": "deleteResponse", + "description": "Deletes a response by ID.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "object", + "id", + "deleted" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "response.deleted" + ] + }, + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean", + "enum": [ + true + ] + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Responses" + ] + } + }, + "/responses/{response_id}/cancel": { + "post": { + "operationId": "cancelResponse", + "description": "Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "error", + "incomplete_details", + "output", + "instructions", + "parallel_tool_calls", + "content_filters" + ], + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "user": { + "type": "string", + "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", + "deprecated": true + }, + "safety_identifier": { + "type": "string", + "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." + }, + "prompt_cache_key": { + "type": "string", + "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." + }, + "prompt_cache_retention": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in-memory", + "24h" + ] + }, + { + "type": "null" + } + ] + }, + "previous_response_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": "string", + "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." + }, + "reasoning": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Reasoning" + }, + { + "type": "null" + } + ] + }, + "background": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "max_tool_calls": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "text": { + "$ref": "#/components/schemas/OpenAI.ResponseTextParam" + }, + "tools": { + "$ref": "#/components/schemas/OpenAI.ToolsArray" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + }, + "truncation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "disabled" + ] + }, + { + "type": "null" + } + ], + "default": "disabled" + }, + "id": { + "type": "string", + "description": "Unique identifier for this Response." + }, + "object": { + "type": "string", + "enum": [ + "response" + ], + "description": "The object type of this resource - always set to `response`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "completed", + "failed", + "in_progress", + "cancelled", + "queued", + "incomplete" + ], + "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) of when this Response was created." + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseError" + }, + { + "type": "null" + } + ] + }, + "incomplete_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" + }, + { + "type": "null" + } + ] + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OutputItem" + }, + "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + }, + { + "type": "null" + } + ] + }, + "output_text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "x-stainless-skip": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.ResponseUsage" + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to allow the model to run tool calls in parallel.", + "default": true + }, + "conversation": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationReference" + }, + { + "type": "null" + } + ] + }, + "content_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" + }, + "description": "The content filter results from RAI." + } + } + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Responses" + ] + } + }, + "/responses/{response_id}/input_items": { + "get": { + "operationId": "listInputItems", + "description": "Returns a list of input items for a given response.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "response_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ResponseItemList" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Responses" + ] + } + }, + "/threads": { + "post": { + "operationId": "createThread", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ThreadObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateThreadRequest" + } + } + } + } + } + }, + "/threads/runs": { + "post": { + "operationId": "createThreadAndRun", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequest" + } + } + } + } + } + }, + "/threads/{thread_id}": { + "delete": { + "operationId": "deleteThread", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteThreadResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + }, + "get": { + "operationId": "retrieveThread", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ThreadObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + }, + "post": { + "operationId": "modifyThread", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ThreadObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ModifyThreadRequest" + } + } + } + } + } + }, + "/threads/{thread_id}/messages": { + "get": { + "operationId": "listMessages", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "run_id", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListMessagesResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + }, + "post": { + "operationId": "createMessage", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.MessageObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateMessageRequest" + } + } + } + } + } + }, + "/threads/{thread_id}/messages/{message_id}": { + "delete": { + "operationId": "deleteMessage", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "message_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteMessageResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + }, + "get": { + "operationId": "retrieveMessage", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "message_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.MessageObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + }, + "post": { + "operationId": "modifyMessage", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "message_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.MessageObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ModifyMessageRequest" + } + } + } + } + } + }, + "/threads/{thread_id}/runs": { + "post": { + "operationId": "createRun", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateRunRequest" + } + } + } + } + }, + "get": { + "operationId": "listRuns", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListRunsResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + } + }, + "/threads/{thread_id}/runs/{run_id}": { + "get": { + "operationId": "retrieveRun", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + }, + "post": { + "operationId": "modifyRun", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ModifyRunRequest" + } + } + } + } + } + }, + "/threads/{thread_id}/runs/{run_id}/cancel": { + "post": { + "operationId": "cancelRun", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + } + }, + "/threads/{thread_id}/runs/{run_id}/steps": { + "get": { + "operationId": "listRunSteps", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "desc" + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListRunStepsResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + } + }, + "/threads/{thread_id}/runs/{run_id}/steps/{step_id}": { + "get": { + "operationId": "getRunStep", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "step_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunStepObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ] + } + }, + "/threads/{thread_id}/runs/{run_id}/submit_tool_outputs": { + "post": { + "operationId": "submitToolOutputsToRun", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "thread_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "run_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Threads" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequest" + } + } + } + } + } + }, + "/vector_stores": { + "get": { + "operationId": "listVectorStores", + "summary": "Returns a list of vector stores.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "schema": { + "type": "string" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListVectorStoresResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + }, + "post": { + "operationId": "createVectorStore", + "summary": "Creates a vector store.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateVectorStoreRequest" + } + } + } + }, + "x-ms-examples": { + "Create a vector store request": { + "$ref": "./examples/vector_stores.yaml" + } + } + } + }, + "/vector_stores/{vector_store_id}": { + "get": { + "operationId": "getVectorStore", + "summary": "Retrieves a vector store.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to retrieve.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + }, + "post": { + "operationId": "modifyVectorStore", + "summary": "Modifies a vector store.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to modify.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreRequest" + } + } + } + } + }, + "delete": { + "operationId": "deleteVectorStore", + "summary": "Delete a vector store.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/file_batches": { + "post": { + "operationId": "createVectorStoreFileBatch", + "summary": "Create a vector store file batch.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store for which to create a file batch.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest" + } + } + } + } + } + }, + "/vector_stores/{vector_store_id}/file_batches/{batch_id}": { + "get": { + "operationId": "getVectorStoreFileBatch", + "summary": "Retrieves a vector store file batch.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store that the file batch belongs to.", + "schema": { + "type": "string" + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "description": "The ID of the file batch being retrieved.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { + "post": { + "operationId": "cancelVectorStoreFileBatch", + "summary": "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store that the file batch belongs to.", + "schema": { + "type": "string" + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "description": "The ID of the file batch to cancel.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { + "get": { + "operationId": "listFilesInVectorStoreBatch", + "summary": "Returns a list of vector store files in a batch.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store that the file batch belongs to.", + "schema": { + "type": "string" + } + }, + { + "name": "batch_id", + "in": "path", + "required": true, + "description": "The ID of the file batch that the files belong to.", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "filter", + "in": "query", + "required": false, + "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.", + "schema": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "failed", + "cancelled" + ] + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/files": { + "get": { + "operationId": "listVectorStoreFiles", + "summary": "Returns a list of vector store files.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store that the files belong to.", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "before", + "in": "query", + "required": false, + "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "filter", + "in": "query", + "required": false, + "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.", + "schema": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "failed", + "cancelled" + ] + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + }, + "post": { + "operationId": "createVectorStoreFile", + "summary": "Create a vector store file by attaching a [File](/docs/api-reference/files) to a [vector store](/docs/api-reference/vector-stores/object).", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store for which to create a File.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest" + } + } + } + } + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}": { + "get": { + "operationId": "getVectorStoreFile", + "summary": "Retrieves a vector store file.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store that the file belongs to.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file being retrieved.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + }, + "post": { + "operationId": "updateVectorStoreFileAttributes", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest" + } + } + } + } + }, + "delete": { + "operationId": "deleteVectorStoreFile", + "summary": "Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store that the file belongs to.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to delete.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreFileResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "operationId": "retrieveVectorStoreFileContent", + "summary": "Retrieve vector store file content", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to search.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to retrieve content for.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/search": { + "post": { + "operationId": "searchVectorStore", + "summary": "Search vector store", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to search.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequest" + } + } + } + } + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + }, + { + "ApiKeyAuth_": [] + }, + { + "OAuth2Auth": [ + "https://cognitiveservices.azure.com/.default" + ] + } + ], + "components": { + "schemas": { + "AudioSegment": { + "type": "object", + "required": [ + "id", + "start", + "end", + "text", + "temperature", + "avg_logprob", + "compression_ratio", + "no_speech_prob", + "tokens", + "seek" + ], + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The 0-based index of this segment within a translation." + }, + "start": { + "type": "number", + "format": "float", + "description": "The time at which this segment started relative to the beginning of the translated audio." + }, + "end": { + "type": "number", + "format": "float", + "description": "The time at which this segment ended relative to the beginning of the translated audio." + }, + "text": { + "type": "string", + "description": "The translated text that was part of this audio segment." + }, + "temperature": { + "type": "number", + "format": "float", + "description": "The temperature score associated with this audio segment." + }, + "avg_logprob": { + "type": "number", + "format": "float", + "description": "The average log probability associated with this audio segment." + }, + "compression_ratio": { + "type": "number", + "format": "float", + "description": "The compression ratio of this audio segment." + }, + "no_speech_prob": { + "type": "number", + "format": "float", + "description": "The probability of no speech detection within this audio segment." + }, + "tokens": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "The token IDs matching the translated text in this audio segment." + }, + "seek": { + "type": "integer", + "format": "int32", + "description": "The seek position associated with the processing of this audio segment.\nSeek positions are expressed as hundredths of seconds.\nThe model may process several segments from a single seek position, so while the seek position will never represent\na later time than the segment's start, the segment's start may represent a significantly later time than the\nsegment's associated seek position." + } + } + }, + "AudioTaskLabel": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "transcribe", + "translate" + ] + } + ], + "description": "Defines the possible descriptors for available audio operation responses." + }, + "AudioTranslationSegment": { + "type": "object", + "required": [ + "id", + "start", + "end", + "text", + "temperature", + "avg_logprob", + "compression_ratio", + "no_speech_prob", + "tokens", + "seek" + ], + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "The 0-based index of this segment within a translation." + }, + "start": { + "type": "number", + "format": "float", + "description": "The time at which this segment started relative to the beginning of the translated audio." + }, + "end": { + "type": "number", + "format": "float", + "description": "The time at which this segment ended relative to the beginning of the translated audio." + }, + "text": { + "type": "string", + "description": "The translated text that was part of this audio segment." + }, + "temperature": { + "type": "number", + "format": "float", + "description": "The temperature score associated with this audio segment." + }, + "avg_logprob": { + "type": "number", + "format": "float", + "description": "The average log probability associated with this audio segment." + }, + "compression_ratio": { + "type": "number", + "format": "float", + "description": "The compression ratio of this audio segment." + }, + "no_speech_prob": { + "type": "number", + "format": "float", + "description": "The probability of no speech detection within this audio segment." + }, + "tokens": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "The token IDs matching the translated text in this audio segment." + }, + "seek": { + "type": "integer", + "format": "int32", + "description": "The seek position associated with the processing of this audio segment.\nSeek positions are expressed as hundredths of seconds.\nThe model may process several segments from a single seek position, so while the seek position will never represent\na later time than the segment's start, the segment's start may represent a significantly later time than the\nsegment's associated seek position." + } + }, + "description": "Extended information about a single segment of translated audio data.\nSegments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not\nnecessarily sentences." + }, + "AzureAIFoundryModelsApiVersion": { + "type": "string", + "enum": [ + "v1", + "preview" + ] + }, + "AzureAudioTranscriptionResponse": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string", + "description": "The transcribed text for the provided audio data." + }, + "task": { + "allOf": [ + { + "$ref": "#/components/schemas/AudioTaskLabel" + } + ], + "description": "The label that describes which operation type generated the accompanying response data." + }, + "language": { + "type": "string", + "description": "The spoken language that was detected in the transcribed audio data.\nThis is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'." + }, + "duration": { + "type": "number", + "format": "float", + "description": "The total duration of the audio processed to produce accompanying transcription information." + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.TranscriptionSegment" + }, + "description": "A collection of information about the timing, probabilities, and other detail of each processed audio segment." + }, + "words": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.TranscriptionWord" + }, + "description": "A collection of information about the timing of each processed word." + } + }, + "description": "Result information for an operation that transcribed spoken audio into written text." + }, + "AzureAudioTranslationResponse": { + "type": "object", + "required": [ + "text" + ], + "properties": { + "text": { + "type": "string", + "description": "The translated text for the provided audio data." + }, + "task": { + "allOf": [ + { + "$ref": "#/components/schemas/AudioTaskLabel" + } + ], + "description": "The label that describes which operation type generated the accompanying response data." + }, + "language": { + "type": "string", + "description": "The spoken language that was detected in the translated audio data.\nThis is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'." + }, + "duration": { + "type": "number", + "format": "float", + "description": "The total duration of the audio processed to produce accompanying translation information." + }, + "segments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AudioTranslationSegment" + }, + "description": "A collection of information about the timing, probabilities, and other detail of each processed audio segment." + } + }, + "description": "Result information for an operation that translated spoken audio into written text." + }, + "AzureCompletionsSamplingParams": { + "type": "object", + "properties": { + "max_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of tokens in the generated output." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams" + } + ], + "description": "Sampling parameters for controlling the behavior of completions." + }, + "AzureContentFilterBlocklistIdResult": { + "type": "object", + "required": [ + "id", + "filtered" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the custom blocklist associated with the filtered status." + }, + "filtered": { + "type": "boolean", + "description": "Whether the associated blocklist resulted in the content being filtered." + } + }, + "description": "A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not\nthe corresponding blocklist resulted in content being filtered." + }, + "AzureContentFilterBlocklistResult": { + "type": "object", + "required": [ + "filtered" + ], + "properties": { + "filtered": { + "type": "boolean", + "description": "A value indicating whether any of the detailed blocklists resulted in a filtering action." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "filtered": { + "type": "boolean", + "description": "A value indicating whether the blocklist produced a filtering action." + }, + "id": { + "type": "string", + "description": "The ID of the custom blocklist evaluated." + } + }, + "required": [ + "filtered", + "id" + ] + }, + "description": "The pairs of individual blocklist IDs and whether they resulted in a filtering action." + } + }, + "description": "A collection of true/false filtering results for configured custom blocklists." + }, + "AzureContentFilterCompletionTextSpan": { + "type": "object", + "required": [ + "completion_start_offset", + "completion_end_offset" + ], + "properties": { + "completion_start_offset": { + "type": "integer", + "format": "int32", + "description": "Offset of the UTF32 code point which begins the span." + }, + "completion_end_offset": { + "type": "integer", + "format": "int32", + "description": "Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans." + } + }, + "description": "A representation of a span of completion text as used by Azure OpenAI content filter results." + }, + "AzureContentFilterCompletionTextSpanDetectionResult": { + "type": "object", + "required": [ + "filtered", + "detected", + "details" + ], + "properties": { + "filtered": { + "type": "boolean", + "description": "Whether the content detection resulted in a content filtering action." + }, + "detected": { + "type": "boolean", + "description": "Whether the labeled content category was detected in the content." + }, + "details": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpan" + }, + "description": "Detailed information about the detected completion text spans." + } + } + }, + "AzureContentFilterCustomTopicIdResult": { + "type": "object", + "required": [ + "id", + "detected" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the custom topic associated with the detected status." + }, + "detected": { + "type": "boolean", + "description": "Whether the associated custom topic resulted in the content being detected." + } + }, + "description": "A content filter result item that associates an existing custom topic ID with a value indicating whether or not\nthe corresponding topic resulted in content being detected." + }, + "AzureContentFilterCustomTopicResult": { + "type": "object", + "required": [ + "filtered" + ], + "properties": { + "filtered": { + "type": "boolean", + "description": "A value indicating whether any of the detailed topics resulted in a filtering action." + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "detected": { + "type": "boolean", + "description": "A value indicating whether the topic is detected." + }, + "id": { + "type": "string", + "description": "The ID of the custom topic evaluated." + } + }, + "required": [ + "detected", + "id" + ] + }, + "description": "The pairs of individual topic IDs and whether they are detected." + } + }, + "description": "A collection of true/false filtering results for configured custom topics." + }, + "AzureContentFilterDetectionResult": { + "type": "object", + "required": [ + "filtered", + "detected" + ], + "properties": { + "filtered": { + "type": "boolean", + "description": "Whether the content detection resulted in a content filtering action." + }, + "detected": { + "type": "boolean", + "description": "Whether the labeled content category was detected in the content." + } + }, + "description": "A labeled content filter result item that indicates whether the content was detected and whether the content was\nfiltered." + }, + "AzureContentFilterForResponsesAPI": { + "type": "object", + "required": [ + "blocked", + "source_type", + "content_filter_results", + "content_filter_offsets" + ], + "properties": { + "blocked": { + "type": "boolean", + "description": "Indicate if the response is blocked." + }, + "source_type": { + "type": "string", + "description": "The name of the source type of the message." + }, + "content_filter_results": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterResultsForResponsesAPI" + } + ], + "description": "A content filter result for a single response item produced by a generative AI system." + }, + "content_filter_offsets": { + "$ref": "#/components/schemas/AzureContentFilterResultOffsets" + } + } + }, + "AzureContentFilterHarmExtensions": { + "type": "object", + "properties": { + "pii_sub_categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzurePiiSubCategory" + }, + "description": "Configuration for PIIHarmSubCategory(s)." + } + }, + "description": "Extensions for harm categories, providing additional configuration options." + }, + "AzureContentFilterImagePromptResults": { + "type": "object", + "required": [ + "jailbreak" + ], + "properties": { + "profanity": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." + }, + "custom_blocklists": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom blocklists." + }, + "custom_topics": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom topics." + }, + "jailbreak": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterImageResponseResults" + } + ], + "description": "A content filter result for an image generation operation's input request content." + }, + "AzureContentFilterImageResponseResults": { + "type": "object", + "properties": { + "sexual": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." + }, + "violence": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." + }, + "hate": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." + }, + "self_harm": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." + } + }, + "description": "A content filter result for an image generation operation's output response content." + }, + "AzureContentFilterPersonallyIdentifiableInformationResult": { + "type": "object", + "properties": { + "redacted_text": { + "type": "string", + "description": "The redacted text with PII information removed or masked." + }, + "sub_categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzurePiiSubCategoryResult" + }, + "description": "Detailed results for individual PIIHarmSubCategory(s)." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A content filter detection result for Personally Identifiable Information that includes harm extensions." + }, + "AzureContentFilterResultForChoice": { + "type": "object", + "properties": { + "sexual": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." + }, + "hate": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." + }, + "violence": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." + }, + "self_harm": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." + }, + "profanity": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." + }, + "custom_blocklists": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom blocklists." + }, + "custom_topics": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom topics." + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "A distinct, machine-readable code associated with the error." + }, + "message": { + "type": "string", + "description": "A human-readable message associated with the error." + } + }, + "required": [ + "code", + "message" + ], + "description": "If present, details about an error that prevented content filtering from completing its evaluation." + }, + "protected_material_text": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes a match against text protected under copyright or other status." + }, + "protected_material_code": { + "type": "object", + "properties": { + "filtered": { + "type": "boolean", + "description": "Whether the content detection resulted in a content filtering action." + }, + "detected": { + "type": "boolean", + "description": "Whether the labeled content category was detected in the content." + }, + "citation": { + "type": "object", + "properties": { + "license": { + "type": "string", + "description": "The name or identifier of the license associated with the detection." + }, + "URL": { + "type": "string", + "format": "uri", + "description": "The URL associated with the license." + } + }, + "description": "If available, the citation details describing the associated license and its location." + } + }, + "required": [ + "filtered", + "detected" + ], + "description": "A detection result that describes a match against licensed code or other protected source material." + }, + "ungrounded_material": { + "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult" + }, + "personally_identifiable_information": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult" + } + ], + "description": "A detection result that describes matches against Personal Identifiable Information with configurable subcategories." + } + }, + "description": "A content filter result for a single response item produced by a generative AI system." + }, + "AzureContentFilterResultForPrompt": { + "type": "object", + "properties": { + "prompt_index": { + "type": "integer", + "format": "int32", + "description": "The index of the input prompt associated with the accompanying content filter result categories." + }, + "content_filter_results": { + "type": "object", + "properties": { + "sexual": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." + }, + "hate": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." + }, + "violence": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." + }, + "self_harm": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." + }, + "profanity": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." + }, + "custom_blocklists": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom blocklists." + }, + "custom_topics": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom topics." + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "A distinct, machine-readable code associated with the error." + }, + "message": { + "type": "string", + "description": "A human-readable message associated with the error." + } + }, + "required": [ + "code", + "message" + ], + "description": "If present, details about an error that prevented content filtering from completing its evaluation." + }, + "jailbreak": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions." + }, + "indirect_attack": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user." + } + }, + "required": [ + "jailbreak", + "indirect_attack" + ], + "description": "The content filter category details for the result." + } + }, + "description": "A content filter result associated with a single input prompt item into a generative AI system." + }, + "AzureContentFilterResultOffsets": { + "type": "object", + "required": [ + "start_offset", + "end_offset", + "check_offset" + ], + "properties": { + "start_offset": { + "type": "integer", + "format": "int32" + }, + "end_offset": { + "type": "integer", + "format": "int32" + }, + "check_offset": { + "type": "integer", + "format": "int32" + } + } + }, + "AzureContentFilterResultsForResponsesAPI": { + "type": "object", + "required": [ + "jailbreak", + "task_adherence" + ], + "properties": { + "sexual": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." + }, + "hate": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." + }, + "violence": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." + }, + "self_harm": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterSeverityResult" + } + ], + "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." + }, + "profanity": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." + }, + "custom_blocklists": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom blocklists." + }, + "custom_topics": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" + } + ], + "description": "A collection of binary filtering outcomes for configured custom topics." + }, + "error": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "description": "A distinct, machine-readable code associated with the error." + }, + "message": { + "type": "string", + "description": "A human-readable message associated with the error." + } + }, + "required": [ + "code", + "message" + ], + "description": "If present, details about an error that prevented content filtering from completing its evaluation." + }, + "jailbreak": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions." + }, + "task_adherence": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that indicates if the execution flow still sticks the plan." + }, + "protected_material_text": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes a match against text protected under copyright or other status." + }, + "protected_material_code": { + "type": "object", + "properties": { + "filtered": { + "type": "boolean", + "description": "Whether the content detection resulted in a content filtering action." + }, + "detected": { + "type": "boolean", + "description": "Whether the labeled content category was detected in the content." + }, + "citation": { + "type": "object", + "properties": { + "license": { + "type": "string", + "description": "The name or identifier of the license associated with the detection." + }, + "URL": { + "type": "string", + "format": "uri", + "description": "The URL associated with the license." + } + }, + "description": "If available, the citation details describing the associated license and its location." + } + }, + "required": [ + "filtered", + "detected" + ], + "description": "A detection result that describes a match against licensed code or other protected source material." + }, + "ungrounded_material": { + "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult" + }, + "personally_identifiable_information": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult" + } + ], + "description": "A detection result that describes matches against Personal Identifiable Information with configurable subcategories." + }, + "indirect_attack": { + "allOf": [ + { + "$ref": "#/components/schemas/AzureContentFilterDetectionResult" + } + ], + "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user." + } + } + }, + "AzureContentFilterSeverityResult": { + "type": "object", + "required": [ + "filtered", + "severity" + ], + "properties": { + "filtered": { + "type": "boolean", + "description": "Whether the content severity resulted in a content filtering action." + }, + "severity": { + "type": "string", + "enum": [ + "safe", + "low", + "medium", + "high" + ], + "description": "The labeled severity of the content." + } + }, + "description": "A labeled content filter result item that indicates whether the content was filtered and what the qualitative\nseverity level of the content was, as evaluated against content filter configuration for the category." + }, + "AzureFileExpiryAnchor": { + "type": "string", + "enum": [ + "created_at" + ] + }, + "AzureFineTuneReinforcementMethod": { + "type": "object", + "required": [ + "grader" + ], + "properties": { + "grader": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.GraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderScoreModel" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderMulti" + }, + { + "$ref": "#/components/schemas/GraderEndpoint" + } + ] + }, + "response_format": { + "allOf": [ + { + "$ref": "#/components/schemas/ResponseFormatJSONSchemaRequest" + } + ], + "description": "Response format to be used while sampling during RFT training" + }, + "hyperparameters": { + "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters" + } + } + }, + "AzurePiiSubCategory": { + "type": "object", + "required": [ + "sub_category", + "detect", + "redact", + "filter" + ], + "properties": { + "sub_category": { + "type": "string", + "description": "The PIIHarmSubCategory being configured." + }, + "detect": { + "type": "boolean", + "description": "Whether detection is enabled for this subcategory." + }, + "redact": { + "type": "boolean", + "description": "Whether content containing this subcategory should be redacted." + }, + "filter": { + "type": "boolean", + "description": "Whether content containing this subcategory should be blocked." + } + }, + "description": "Configuration for individual PIIHarmSubCategory(s) within the harm extensions framework." + }, + "AzurePiiSubCategoryResult": { + "type": "object", + "required": [ + "sub_category", + "filtered", + "detected", + "redacted" + ], + "properties": { + "sub_category": { + "type": "string", + "description": "The PIIHarmSubCategory that was evaluated." + }, + "filtered": { + "type": "boolean", + "description": "Whether the content detection resulted in a content filtering action for this subcategory." + }, + "detected": { + "type": "boolean", + "description": "Whether the labeled content subcategory was detected in the content." + }, + "redacted": { + "type": "boolean", + "description": "Whether the content was redacted for this subcategory." + } + }, + "description": "Result details for individual PIIHarmSubCategory(s)." + }, + "AzureResponsesSamplingParams": { + "type": "object", + "properties": { + "max_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of tokens in the generated output." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams" + } + ], + "description": "Sampling parameters for controlling the behavior of responses." + }, + "AzureUserSecurityContext": { + "type": "object", + "properties": { + "application_name": { + "type": "string", + "description": "The name of the application. Sensitive personal information should not be included in this field." + }, + "end_user_id": { + "type": "string", + "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field." + }, + "end_user_tenant_id": { + "type": "string", + "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant." + }, + "source_ip": { + "type": "string", + "description": "Captures the original client's IP address." + } + }, + "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud." + }, + "CopiedAccountDetails": { + "type": "object", + "required": [ + "destinationResourceId", + "region", + "status" + ], + "properties": { + "destinationResourceId": { + "type": "string", + "description": "The ID of the destination resource where the model was copied to." + }, + "region": { + "type": "string", + "description": "The region where the model was copied to." + }, + "status": { + "type": "string", + "enum": [ + "Completed", + "Failed", + "InProgress" + ], + "description": "The status of the copy operation." + } + } + }, + "CopyModelRequest": { + "type": "object", + "required": [ + "destinationResourceId", + "region" + ], + "properties": { + "destinationResourceId": { + "type": "string", + "description": "The ID of the destination Resource to copy." + }, + "region": { + "type": "string", + "description": "The region to copy the model to." + } + } + }, + "CopyModelResponse": { + "type": "object", + "required": [ + "checkpointedModelName", + "fineTuningJobId", + "copiedAccountDetails" + ], + "properties": { + "checkpointedModelName": { + "type": "string", + "description": "The ID of the copied model." + }, + "fineTuningJobId": { + "type": "string", + "description": "The ID of the fine-tuning job that the checkpoint was copied from." + }, + "copiedAccountDetails": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CopiedAccountDetails" + }, + "description": "The ID of the destination resource id where it was copied" + } + } + }, + "CreateVideoBody": { + "type": "object", + "required": [ + "model", + "prompt" + ], + "properties": { + "model": { + "type": "string", + "description": "The name of the deployment to use for this request." + }, + "prompt": { + "type": "string", + "minLength": 1, + "description": "Text prompt that describes the video to generate." + }, + "seconds": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoSeconds" + } + ], + "description": "Clip duration in seconds. Defaults to 4 seconds.", + "default": "4" + }, + "size": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoSize" + } + ], + "description": "Output resolution formatted as width x height. Defaults to 720x1280.", + "default": "720x1280" + } + } + }, + "CreateVideoBodyWithInputReference": { + "type": "object", + "required": [ + "model", + "prompt", + "input_reference" + ], + "properties": { + "model": { + "type": "object", + "description": "The name of the deployment to use for this request." + }, + "prompt": { + "type": "object", + "description": "Text prompt that describes the video to generate." + }, + "seconds": { + "type": "object", + "description": "Clip duration in seconds. Defaults to 4 seconds." + }, + "size": { + "type": "object", + "description": "Output resolution formatted as width x height. Defaults to 720x1280." + }, + "input_reference": { + "type": "object", + "description": "Optional image reference that guides generation.", + "x-oaiTypeLabel": "file" + } + }, + "description": "The properties of a video generation job request with media files." + }, + "CreateVideoRemixBody": { + "type": "object", + "required": [ + "prompt" + ], + "properties": { + "prompt": { + "type": "string", + "minLength": 1, + "description": "Updated text prompt that directs the remix generation." + } + }, + "description": "Parameters for remixing an existing generated video." + }, + "DeletedVideoResource": { + "type": "object", + "required": [ + "object", + "deleted", + "id" + ], + "properties": { + "object": { + "type": "string", + "description": "The object type that signals the deletion response.", + "default": "video.deleted" + }, + "deleted": { + "type": "boolean", + "description": "Indicates that the video resource was deleted.", + "default": true + }, + "id": { + "type": "string", + "description": "Identifier of the deleted video." + } + }, + "description": "Confirmation payload returned after deleting a video." + }, + "Error": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + } + }, + "EvalGraderEndpoint": { + "type": "object", + "required": [ + "type", + "name", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "endpoint" + ], + "default": "endpoint" + }, + "name": { + "type": "string", + "description": "The name of the grader" + }, + "url": { + "type": "string", + "pattern": "^https://", + "description": "The HTTPS URL of the endpoint to call for grading" + }, + "headers": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Optional HTTP headers to include in requests to the endpoint" + }, + "rate_limit": { + "anyOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "null" + } + ], + "description": "Optional rate limit for requests per second to the endpoint\nMust be a positive integer" + }, + "pass_threshold": { + "anyOf": [ + { + "type": "number", + "format": "decimal" + }, + { + "type": "null" + } + ], + "description": "Optional threshold score above which the grade is considered passing\nIf not specified, all scores are considered valid" + } + } + }, + "GraderEndpoint": { + "type": "object", + "required": [ + "type", + "name", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "endpoint" + ], + "default": "endpoint" + }, + "name": { + "type": "string", + "description": "The name of the grader" + }, + "url": { + "type": "string", + "pattern": "^https://", + "description": "The HTTPS URL of the endpoint to call for grading" + }, + "headers": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Optional HTTP headers to include in requests to the endpoint" + }, + "rate_limit": { + "anyOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "null" + } + ], + "description": "Optional rate limit for requests per second to the endpoint\nMust be a positive integer" + }, + "pass_threshold": { + "anyOf": [ + { + "type": "number", + "format": "decimal" + }, + { + "type": "null" + } + ], + "description": "Optional threshold score above which the grade is considered passing\nIf not specified, all scores are considered valid" + } + }, + "description": "Endpoint grader configuration for external HTTP endpoint evaluation" + }, + "OpenAI.Annotation": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.AnnotationType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "file_citation": "#/components/schemas/OpenAI.FileCitationBody", + "url_citation": "#/components/schemas/OpenAI.UrlCitationBody", + "container_file_citation": "#/components/schemas/OpenAI.ContainerFileCitationBody", + "file_path": "#/components/schemas/OpenAI.FilePath" + } + }, + "description": "An annotation that applies to a span of output text." + }, + "OpenAI.AnnotationType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "file_citation", + "url_citation", + "container_file_citation", + "file_path" + ] + } + ] + }, + "OpenAI.ApplyPatchCallOutputStatus": { + "type": "string", + "enum": [ + "completed", + "failed" + ] + }, + "OpenAI.ApplyPatchCallStatus": { + "type": "string", + "enum": [ + "in_progress", + "completed" + ] + }, + "OpenAI.ApplyPatchCreateFileOperation": { + "type": "object", + "required": [ + "type", + "path", + "diff" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "create_file" + ], + "description": "Create a new file with the provided diff.", + "x-stainless-const": true, + "default": "create_file" + }, + "path": { + "type": "string", + "description": "Path of the file to create." + }, + "diff": { + "type": "string", + "description": "Diff to apply." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" + } + ], + "description": "Instruction describing how to create a file via the apply_patch tool.", + "title": "Apply patch create file operation" + }, + "OpenAI.ApplyPatchDeleteFileOperation": { + "type": "object", + "required": [ + "type", + "path" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "delete_file" + ], + "description": "Delete the specified file.", + "x-stainless-const": true, + "default": "delete_file" + }, + "path": { + "type": "string", + "description": "Path of the file to delete." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" + } + ], + "description": "Instruction describing how to delete a file via the apply_patch tool.", + "title": "Apply patch delete file operation" + }, + "OpenAI.ApplyPatchFileOperation": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperationType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperation", + "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation", + "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation" + } + }, + "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.", + "title": "Apply patch operation" + }, + "OpenAI.ApplyPatchFileOperationType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "create_file", + "delete_file", + "update_file" + ] + } + ] + }, + "OpenAI.ApplyPatchToolParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch" + ], + "description": "The type of the tool. Always `apply_patch`.", + "x-stainless-const": true, + "default": "apply_patch" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "Allows the assistant to create, delete, or update files using unified diffs.", + "title": "Apply patch tool" + }, + "OpenAI.ApplyPatchUpdateFileOperation": { + "type": "object", + "required": [ + "type", + "path", + "diff" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "update_file" + ], + "description": "Update an existing file with the provided diff.", + "x-stainless-const": true, + "default": "update_file" + }, + "path": { + "type": "string", + "description": "Path of the file to update." + }, + "diff": { + "type": "string", + "description": "Diff to apply." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" + } + ], + "description": "Instruction describing how to update a file via the apply_patch tool.", + "title": "Apply patch update file operation" + }, + "OpenAI.ApproximateLocation": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "approximate" + ], + "description": "The type of location approximation. Always `approximate`.", + "x-stainless-const": true, + "default": "approximate" + }, + "country": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "region": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "city": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "timezone": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.AssistantTool": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.AssistantToolType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "code_interpreter": "#/components/schemas/OpenAI.AssistantToolsCode", + "file_search": "#/components/schemas/OpenAI.AssistantToolsFileSearch", + "function": "#/components/schemas/OpenAI.AssistantToolsFunction" + } + } + }, + "OpenAI.AssistantToolType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "code_interpreter", + "file_search", + "function" + ] + } + ] + }, + "OpenAI.AssistantToolsCode": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "code_interpreter" + ], + "description": "The type of tool being defined: `code_interpreter`", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.AssistantTool" + } + ], + "title": "Code interpreter tool" + }, + "OpenAI.AssistantToolsFileSearch": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_search" + ], + "description": "The type of tool being defined: `file_search`", + "x-stainless-const": true + }, + "file_search": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch" + } + ], + "description": "Overrides for the file search tool." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.AssistantTool" + } + ], + "title": "FileSearch tool" + }, + "OpenAI.AssistantToolsFileSearchFileSearch": { + "type": "object", + "properties": { + "max_num_results": { + "type": "integer", + "minimum": 1, + "maximum": 50 + }, + "ranking_options": { + "$ref": "#/components/schemas/OpenAI.FileSearchRankingOptions" + } + } + }, + "OpenAI.AssistantToolsFileSearchTypeOnly": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_search" + ], + "description": "The type of tool being defined: `file_search`", + "x-stainless-const": true + } + }, + "title": "AssistantToolsFileSearchTypeOnly" + }, + "OpenAI.AssistantToolsFunction": { + "type": "object", + "required": [ + "type", + "function" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool being defined: `function`", + "x-stainless-const": true + }, + "function": { + "$ref": "#/components/schemas/OpenAI.FunctionObject" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.AssistantTool" + } + ], + "title": "Function tool" + }, + "OpenAI.AssistantsApiResponseFormatOption": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatText" + }, + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject" + }, + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema" + } + ], + "description": "Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n*Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length." + }, + "OpenAI.AssistantsApiToolChoiceOption": { + "anyOf": [ + { + "type": "string", + "enum": [ + "none", + "auto", + "required" + ] + }, + { + "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoice" + } + ], + "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool." + }, + "OpenAI.AssistantsNamedToolChoice": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "function", + "code_interpreter", + "file_search" + ], + "description": "The type of the tool. If type is `function`, the function name must be set" + }, + "function": { + "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction" + } + }, + "description": "Specifies a tool the model should use. Use to force the model to call a specific tool." + }, + "OpenAI.AssistantsNamedToolChoiceFunction": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "OpenAI.AudioTranscription": { + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels." + }, + "language": { + "type": "string", + "description": "The language of the input audio. Supplying the input language in\n [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format\n will improve accuracy and latency." + }, + "prompt": { + "type": "string", + "description": "An optional text to guide the model's style or continue a previous audio\n segment.\n For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).\n For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example \"expect words related to technology\"." + } + } + }, + "OpenAI.AutoChunkingStrategyRequestParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "auto" + ], + "description": "Always `auto`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" + } + ], + "description": "The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.", + "title": "Auto Chunking Strategy" + }, + "OpenAI.Batch": { + "type": "object", + "required": [ + "id", + "object", + "endpoint", + "completion_window", + "status", + "created_at" + ], + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "enum": [ + "batch" + ], + "description": "The object type, which is always `batch`.", + "x-stainless-const": true + }, + "endpoint": { + "type": "string", + "description": "The OpenAI API endpoint used by the batch." + }, + "model": { + "type": "string", + "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." + }, + "errors": { + "$ref": "#/components/schemas/OpenAI.BatchErrors" + }, + "completion_window": { + "type": "string", + "description": "The time frame within which the batch should be processed." + }, + "status": { + "type": "string", + "enum": [ + "validating", + "failed", + "in_progress", + "finalizing", + "completed", + "expired", + "cancelling", + "cancelled" + ], + "description": "The current status of the batch." + }, + "output_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of successfully executed requests." + }, + "error_file_id": { + "type": "string", + "description": "The ID of the file containing the outputs of requests with errors." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was created." + }, + "in_progress_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started processing." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch will expire." + }, + "finalizing_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started finalizing." + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was completed." + }, + "failed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch failed." + }, + "expired_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch expired." + }, + "cancelling_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch started cancelling." + }, + "cancelled_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the batch was cancelled." + }, + "request_counts": { + "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" + }, + "usage": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.BatchUsage" + } + ], + "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "input_file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "x-oaiMeta": { + "name": "The batch object", + "example": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \"model\": \"gpt-5-2025-08-07\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"usage\": {\n \"input_tokens\": 1500,\n \"input_tokens_details\": {\n \"cached_tokens\": 1024\n },\n \"output_tokens\": 500,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 300\n },\n \"total_tokens\": 2000\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n" + } + }, + "OpenAI.BatchError": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "An error code identifying the error type." + }, + "message": { + "type": "string", + "description": "A human-readable message providing more details about the error." + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "line": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.BatchErrors": { + "type": "object", + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.BatchError" + } + } + } + }, + "OpenAI.BatchRequestCounts": { + "type": "object", + "required": [ + "total", + "completed", + "failed" + ], + "properties": { + "total": { + "type": "integer", + "description": "Total number of requests in the batch." + }, + "completed": { + "type": "integer", + "description": "Number of requests that have been completed successfully." + }, + "failed": { + "type": "integer", + "description": "Number of requests that have failed." + } + }, + "description": "The request counts for different statuses within the batch." + }, + "OpenAI.BatchUsage": { + "type": "object", + "required": [ + "input_tokens", + "input_tokens_details", + "output_tokens", + "output_tokens_details", + "total_tokens" + ], + "properties": { + "input_tokens": { + "type": "integer" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/OpenAI.BatchUsageInputTokensDetails" + }, + "output_tokens": { + "type": "integer" + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OpenAI.BatchUsageOutputTokensDetails" + }, + "total_tokens": { + "type": "integer" + } + } + }, + "OpenAI.BatchUsageInputTokensDetails": { + "type": "object", + "required": [ + "cached_tokens" + ], + "properties": { + "cached_tokens": { + "type": "integer" + } + } + }, + "OpenAI.BatchUsageOutputTokensDetails": { + "type": "object", + "required": [ + "reasoning_tokens" + ], + "properties": { + "reasoning_tokens": { + "type": "integer" + } + } + }, + "OpenAI.ChatCompletionAllowedTools": { + "type": "object", + "required": [ + "mode", + "tools" + ], + "properties": { + "mode": { + "type": "string", + "enum": [ + "auto", + "required" + ], + "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools." + }, + "tools": { + "type": "array", + "items": { + "type": "object", + "unevaluatedProperties": {} + }, + "description": "A list of tool definitions that the model should be allowed to call.\n For the Chat Completions API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n ]\n ```" + } + }, + "description": "Constrains the tools available to the model to a pre-defined set.", + "title": "Allowed tools" + }, + "OpenAI.ChatCompletionAllowedToolsChoice": { + "type": "object", + "required": [ + "type", + "allowed_tools" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "allowed_tools" + ], + "description": "Allowed tool configuration type. Always `allowed_tools`.", + "x-stainless-const": true + }, + "allowed_tools": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedTools" + } + }, + "description": "Constrains the tools available to the model to a pre-defined set.", + "title": "Allowed tools" + }, + "OpenAI.ChatCompletionFunctionCallOption": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the function to call." + } + }, + "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", + "x-stainless-variantName": "function_call_option" + }, + "OpenAI.ChatCompletionFunctions": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "description": { + "type": "string", + "description": "A description of what the function does, used by the model to choose when and how to call the function." + }, + "name": { + "type": "string", + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." + }, + "parameters": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionParameters" + } + ], + "description": "The parameters the functions accepts, described as a JSON Schema object.\nSee the [JSON Schema reference](https://json-schema.org/understanding-json-schema/)\nfor documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list." + } + }, + "deprecated": true + }, + "OpenAI.ChatCompletionMessageCustomToolCall": { + "type": "object", + "required": [ + "id", + "type", + "custom" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call." + }, + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "The type of the tool. Always `custom`.", + "x-stainless-const": true + }, + "custom": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom" + } + ], + "description": "The custom tool that the model called." + } + }, + "description": "A call to a custom tool created by the model.", + "title": "Custom tool call" + }, + "OpenAI.ChatCompletionMessageCustomToolCallCustom": { + "type": "object", + "required": [ + "name", + "input" + ], + "properties": { + "name": { + "type": "string" + }, + "input": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionMessageToolCall": { + "type": "object", + "required": [ + "id", + "type", + "function" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call." + }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of the tool. Currently, only `function` is supported.", + "x-stainless-const": true + }, + "function": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction" + } + ], + "description": "The function that the model called." + } + }, + "description": "A call to a function tool created by the model.", + "title": "Function tool call" + }, + "OpenAI.ChatCompletionMessageToolCallChunk": { + "type": "object", + "required": [ + "index" + ], + "properties": { + "index": { + "type": "integer" + }, + "id": { + "type": "string", + "description": "The ID of the tool call." + }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of the tool. Currently, only `function` is supported.", + "x-stainless-const": true + }, + "function": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunkFunction" + } + } + }, + "OpenAI.ChatCompletionMessageToolCallChunkFunction": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "arguments": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionMessageToolCallFunction": { + "type": "object", + "required": [ + "name", + "arguments" + ], + "properties": { + "name": { + "type": "string" + }, + "arguments": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionMessageToolCalls": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall" + }, + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall" + } + ] + }, + "description": "The tool calls generated by the model, such as function calls." + }, + "OpenAI.ChatCompletionMessageToolCallsItem": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall" + }, + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall" + } + ] + }, + "description": "The tool calls generated by the model, such as function calls." + }, + "OpenAI.ChatCompletionNamedToolChoice": { + "type": "object", + "required": [ + "type", + "function" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "For function calling, the type is always `function`.", + "x-stainless-const": true + }, + "function": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction" + } + }, + "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", + "title": "Function tool choice" + }, + "OpenAI.ChatCompletionNamedToolChoiceCustom": { + "type": "object", + "required": [ + "type", + "custom" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "For custom tool calling, the type is always `custom`.", + "x-stainless-const": true + }, + "custom": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom" + } + }, + "description": "Specifies a tool the model should use. Use to force the model to call a specific custom tool.", + "title": "Custom tool choice" + }, + "OpenAI.ChatCompletionNamedToolChoiceCustomCustom": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionNamedToolChoiceFunction": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionRequestAssistantMessage": { + "type": "object", + "required": [ + "role" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart" + } + }, + { + "type": "null" + } + ] + }, + "refusal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "role": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "The role of the messages author, in this case `assistant`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." + }, + "audio": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio" + }, + { + "type": "null" + } + ], + "description": "Data about a previous audio response from the model." + }, + "tool_calls": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCalls" + }, + "function_call": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + } + ], + "description": "Messages sent by the model in response to user messages.", + "title": "Assistant message", + "x-stainless-soft-required": [ + "content" + ] + }, + "OpenAI.ChatCompletionRequestAssistantMessageAudio": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionRequestAssistantMessageContentPart": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "refusal": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal", + "text": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText" + } + } + }, + "OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of the content part.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "The text content." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart" + } + ], + "description": "Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation).", + "title": "Text content part", + "x-stainless-naming": { + "go": { + "variant_constructor": "TextContentPart" + } + } + }, + "OpenAI.ChatCompletionRequestAssistantMessageContentPartType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "text", + "refusal" + ] + } + ] + }, + "OpenAI.ChatCompletionRequestAssistantMessageFunctionCall": { + "type": "object", + "required": [ + "arguments", + "name" + ], + "properties": { + "arguments": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionRequestDeveloperMessage": { + "type": "object", + "required": [ + "content", + "role" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" + } + } + ], + "description": "The contents of the developer message." + }, + "role": { + "type": "string", + "enum": [ + "developer" + ], + "description": "The role of the messages author, in this case `developer`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + } + ], + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.", + "title": "Developer message", + "x-stainless-naming": { + "go": { + "variant_constructor": "DeveloperMessage" + } + } + }, + "OpenAI.ChatCompletionRequestFunctionMessage": { + "type": "object", + "required": [ + "role", + "content", + "name" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "function" + ], + "description": "The role of the messages author, in this case `function`.", + "x-stainless-const": true + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "name": { + "type": "string", + "description": "The name of the function to call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + } + ], + "title": "Function message", + "deprecated": true + }, + "OpenAI.ChatCompletionRequestMessage": { + "type": "object", + "required": [ + "role" + ], + "properties": { + "role": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageType" + } + }, + "discriminator": { + "propertyName": "role", + "mapping": { + "assistant": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage", + "developer": "#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage", + "function": "#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage", + "system": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage", + "user": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessage", + "tool": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessage" + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartAudio": { + "type": "object", + "required": [ + "type", + "input_audio" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_audio" + ], + "description": "The type of the content part. Always `input_audio`.", + "x-stainless-const": true + }, + "input_audio": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" + } + ], + "description": "", + "title": "Audio content part", + "x-stainless-naming": { + "go": { + "variant_constructor": "InputAudioContentPart" + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio": { + "type": "object", + "required": [ + "data", + "format" + ], + "properties": { + "data": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "wav", + "mp3" + ] + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartFile": { + "type": "object", + "required": [ + "type", + "file" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file" + ], + "description": "The type of the content part. Always `file`.", + "x-stainless-const": true + }, + "file": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile" + } + ], + "x-stainless-naming": { + "java": { + "type_name": "FileObject" + }, + "kotlin": { + "type_name": "FileObject" + } + } + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" + } + ], + "description": "Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text generation.", + "title": "File content part", + "x-stainless-naming": { + "go": { + "variant_constructor": "FileContentPart" + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartFileFile": { + "type": "object", + "properties": { + "filename": { + "type": "string" + }, + "file_data": { + "type": "string" + }, + "file_id": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartImage": { + "type": "object", + "required": [ + "type", + "image_url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_url" + ], + "description": "The type of the content part.", + "x-stainless-const": true + }, + "image_url": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" + } + ], + "description": "", + "title": "Image content part", + "x-stainless-naming": { + "go": { + "variant_constructor": "ImageContentPart" + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri" + }, + "detail": { + "type": "string", + "enum": [ + "auto", + "low", + "high" + ], + "default": "auto" + } + } + }, + "OpenAI.ChatCompletionRequestMessageContentPartRefusal": { + "type": "object", + "required": [ + "type", + "refusal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "refusal" + ], + "description": "The type of the content part.", + "x-stainless-const": true + }, + "refusal": { + "type": "string", + "description": "The refusal message generated by the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart" + } + ], + "title": "Refusal content part" + }, + "OpenAI.ChatCompletionRequestMessageContentPartText": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of the content part.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "The text content." + } + }, + "description": "", + "title": "Text content part", + "x-stainless-naming": { + "go": { + "variant_constructor": "TextContentPart" + } + } + }, + "OpenAI.ChatCompletionRequestMessageType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "developer", + "system", + "user", + "assistant", + "tool", + "function" + ] + } + ] + }, + "OpenAI.ChatCompletionRequestSystemMessage": { + "type": "object", + "required": [ + "content", + "role" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart" + } + } + ], + "description": "The contents of the system message." + }, + "role": { + "type": "string", + "enum": [ + "system" + ], + "description": "The role of the messages author, in this case `system`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + } + ], + "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.", + "title": "System message", + "x-stainless-naming": { + "go": { + "variant_constructor": "SystemMessage" + } + } + }, + "OpenAI.ChatCompletionRequestSystemMessageContentPart": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" + }, + "OpenAI.ChatCompletionRequestToolMessage": { + "type": "object", + "required": [ + "role", + "content", + "tool_call_id" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "tool" + ], + "description": "The role of the messages author, in this case `tool`.", + "x-stainless-const": true + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart" + } + } + ], + "description": "The contents of the tool message." + }, + "tool_call_id": { + "type": "string", + "description": "Tool call that this message is responding to." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + } + ], + "title": "Tool message", + "x-stainless-naming": { + "go": { + "variant_constructor": "ToolMessage" + } + } + }, + "OpenAI.ChatCompletionRequestToolMessageContentPart": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" + }, + "OpenAI.ChatCompletionRequestUserMessage": { + "type": "object", + "required": [ + "content", + "role" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" + } + } + ], + "description": "The contents of the user message." + }, + "role": { + "type": "string", + "enum": [ + "user" + ], + "description": "The role of the messages author, in this case `user`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" + } + ], + "description": "Messages sent by an end user, containing prompts or additional context\ninformation.", + "title": "User message", + "x-stainless-naming": { + "go": { + "variant_constructor": "UserMessage" + } + } + }, + "OpenAI.ChatCompletionRequestUserMessageContentPart": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "image_url": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage", + "input_audio": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio", + "file": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile", + "text": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText" + } + } + }, + "OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of the content part.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "The text content." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" + } + ], + "description": "Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation).", + "title": "Text content part", + "x-stainless-naming": { + "go": { + "variant_constructor": "TextContentPart" + } + } + }, + "OpenAI.ChatCompletionRequestUserMessageContentPartType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "text", + "image_url", + "input_audio", + "file" + ] + } + ] + }, + "OpenAI.ChatCompletionResponseMessage": { + "type": "object", + "required": [ + "content", + "refusal", + "role" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "refusal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tool_calls": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem" + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations" + }, + "description": "Annotations for the message, when applicable, as when using the\n [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat)." + }, + "role": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "The role of the author of this message.", + "x-stainless-const": true + }, + "function_call": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall" + } + ], + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", + "deprecated": true + }, + "audio": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio" + }, + { + "type": "null" + } + ] + }, + "reasoning_content": { + "type": "string", + "description": "An Azure-specific extension property containing generated reasoning content from supported models." + } + }, + "description": "If the audio output modality is requested, this object contains data\nabout the audio response from the model." + }, + "OpenAI.ChatCompletionResponseMessageAnnotations": { + "type": "object", + "required": [ + "type", + "url_citation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "url_citation" + ], + "x-stainless-const": true + }, + "url_citation": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation" + } + } + }, + "OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation": { + "type": "object", + "required": [ + "end_index", + "start_index", + "url", + "title" + ], + "properties": { + "end_index": { + "type": "integer" + }, + "start_index": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "title": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionResponseMessageAudio": { + "type": "object", + "required": [ + "id", + "expires_at", + "data", + "transcript" + ], + "properties": { + "id": { + "type": "string" + }, + "expires_at": { + "type": "integer", + "format": "unixtime" + }, + "data": { + "type": "string" + }, + "transcript": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionResponseMessageFunctionCall": { + "type": "object", + "required": [ + "arguments", + "name" + ], + "properties": { + "arguments": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionStreamOptions": { + "type": "object", + "properties": { + "include_usage": { + "type": "boolean", + "description": "If set, an additional chunk will be streamed before the `data: [DONE]`\n message. The `usage` field on this chunk shows the token usage statistics\n for the entire request, and the `choices` field will always be an empty\n array.\n All other chunks will also include a `usage` field, but with a null\n value. **NOTE:** If the stream is interrupted, you may not receive the\n final usage chunk which contains the total token usage for the request." + }, + "include_obfuscation": { + "type": "boolean", + "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API." + } + }, + "description": "Options for streaming response. Only set this when you set `stream: true`." + }, + "OpenAI.ChatCompletionStreamResponseDelta": { + "type": "object", + "properties": { + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "function_call": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamResponseDeltaFunctionCall" + } + ], + "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", + "deprecated": true + }, + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunk" + } + }, + "role": { + "type": "string", + "enum": [ + "developer", + "system", + "user", + "assistant", + "tool" + ], + "description": "The role of the author of this message." + }, + "refusal": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "reasoning_content": { + "type": "string", + "description": "An Azure-specific extension property containing generated reasoning content from supported models." + } + }, + "description": "A chat completion delta generated by streamed model responses." + }, + "OpenAI.ChatCompletionStreamResponseDeltaFunctionCall": { + "type": "object", + "properties": { + "arguments": { + "type": "string" + }, + "name": { + "type": "string" + } + } + }, + "OpenAI.ChatCompletionTokenLogprob": { + "type": "object", + "required": [ + "token", + "logprob", + "bytes", + "top_logprobs" + ], + "properties": { + "token": { + "type": "string", + "description": "The token." + }, + "logprob": { + "type": "number", + "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely." + }, + "bytes": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs" + }, + "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned." + } + } + }, + "OpenAI.ChatCompletionTokenLogprobTopLogprobs": { + "type": "object", + "required": [ + "token", + "logprob", + "bytes" + ], + "properties": { + "token": { + "type": "string" + }, + "logprob": { + "type": "number" + }, + "bytes": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.ChatCompletionTool": { + "type": "object", + "required": [ + "type", + "function" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of the tool. Currently, only `function` is supported.", + "x-stainless-const": true + }, + "function": { + "$ref": "#/components/schemas/OpenAI.FunctionObject" + } + }, + "description": "A function tool that can be used to generate a response.", + "title": "Function tool" + }, + "OpenAI.ChatCompletionToolChoiceOption": { + "anyOf": [ + { + "type": "string", + "enum": [ + "none", + "auto", + "required" + ] + }, + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice" + }, + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoice" + }, + { + "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom" + } + ], + "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n`none` is the default when no tools are present. `auto` is the default if tools are present.", + "x-stainless-go-variant-constructor": { + "naming": "tool_choice_option_{variant}" + } + }, + "OpenAI.ChunkingStrategyRequestParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParamType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam", + "static": "#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam" + } + }, + "description": "The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty." + }, + "OpenAI.ChunkingStrategyRequestParamType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "auto", + "static" + ] + } + ] + }, + "OpenAI.ChunkingStrategyResponse": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponseType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "static": "#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam", + "other": "#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam" + } + }, + "description": "The strategy used to chunk the file." + }, + "OpenAI.ChunkingStrategyResponseType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "static", + "other" + ] + } + ] + }, + "OpenAI.ClickButtonType": { + "type": "string", + "enum": [ + "left", + "right", + "wheel", + "back", + "forward" + ] + }, + "OpenAI.ClickParam": { + "type": "object", + "required": [ + "type", + "button", + "x", + "y" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "click" + ], + "description": "Specifies the event type. For a click action, this property is always `click`.", + "x-stainless-const": true, + "default": "click" + }, + "button": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ClickButtonType" + } + ], + "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`." + }, + "x": { + "type": "integer", + "description": "The x-coordinate where the click occurred." + }, + "y": { + "type": "integer", + "description": "The y-coordinate where the click occurred." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A click action.", + "title": "Click" + }, + "OpenAI.CodeInterpreterContainerAuto": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "auto" + ], + "description": "Always `auto`.", + "x-stainless-const": true, + "default": "auto" + }, + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 50, + "description": "An optional list of uploaded files to make available to your code." + }, + "memory_limit": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit" + }, + { + "type": "null" + } + ] + } + }, + "description": "Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.", + "title": "CodeInterpreterToolAuto", + "x-stainless-naming": { + "go": { + "type_name": "ToolCodeInterpreterContainerCodeInterpreterContainerAuto" + } + } + }, + "OpenAI.CodeInterpreterOutputImage": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image" + ], + "description": "The type of the output. Always `image`.", + "x-stainless-const": true, + "default": "image" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the image output from the code interpreter." + } + }, + "description": "The image output from the code interpreter.", + "title": "Code interpreter output image" + }, + "OpenAI.CodeInterpreterOutputLogs": { + "type": "object", + "required": [ + "type", + "logs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "logs" + ], + "description": "The type of the output. Always `logs`.", + "x-stainless-const": true, + "default": "logs" + }, + "logs": { + "type": "string", + "description": "The logs output from the code interpreter." + } + }, + "description": "The logs output from the code interpreter.", + "title": "Code interpreter output logs" + }, + "OpenAI.CodeInterpreterTool": { + "type": "object", + "required": [ + "type", + "container" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "code_interpreter" + ], + "description": "The type of the code interpreter tool. Always `code_interpreter`.", + "x-stainless-const": true + }, + "container": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterContainerAuto" + } + ], + "description": "The code interpreter container. Can be a container ID or an object that\n specifies uploaded file IDs to make available to your code, along with an\n optional `memory_limit` setting." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A tool that runs Python code to help generate a response to a prompt.", + "title": "Code interpreter" + }, + "OpenAI.ComparisonFilter": { + "type": "object", + "required": [ + "type", + "key", + "value" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "eq", + "ne", + "gt", + "gte", + "lt", + "lte" + ], + "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n - `eq`: equals\n - `ne`: not equal\n - `gt`: greater than\n - `gte`: greater than or equal\n - `lt`: less than\n - `lte`: less than or equal\n - `in`: in\n - `nin`: not in", + "default": "eq" + }, + "key": { + "type": "string", + "description": "The key to compare against the value." + }, + "value": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ComparisonFilterValueItems" + } + } + ], + "description": "The value to compare against the attribute key; supports string, number, or boolean types." + } + }, + "description": "A filter used to compare a specified attribute key to a given value using a defined comparison operation.", + "title": "Comparison Filter", + "x-oaiMeta": { + "name": "ComparisonFilter" + } + }, + "OpenAI.ComparisonFilterValueItems": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + } + ] + }, + "OpenAI.CompletionUsage": { + "type": "object", + "required": [ + "completion_tokens", + "prompt_tokens", + "total_tokens" + ], + "properties": { + "completion_tokens": { + "type": "integer", + "description": "Number of tokens in the generated completion." + }, + "prompt_tokens": { + "type": "integer", + "description": "Number of tokens in the prompt." + }, + "total_tokens": { + "type": "integer", + "description": "Total number of tokens used in the request (prompt + completion)." + }, + "completion_tokens_details": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails" + } + ], + "description": "Breakdown of tokens used in a completion." + }, + "prompt_tokens_details": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails" + } + ], + "description": "Breakdown of tokens used in the prompt." + } + }, + "description": "Usage statistics for the completion request." + }, + "OpenAI.CompletionUsageCompletionTokensDetails": { + "type": "object", + "properties": { + "accepted_prediction_tokens": { + "type": "integer" + }, + "audio_tokens": { + "type": "integer" + }, + "reasoning_tokens": { + "type": "integer" + }, + "rejected_prediction_tokens": { + "type": "integer" + } + } + }, + "OpenAI.CompletionUsagePromptTokensDetails": { + "type": "object", + "properties": { + "audio_tokens": { + "type": "integer" + }, + "cached_tokens": { + "type": "integer" + } + } + }, + "OpenAI.CompoundFilter": { + "type": "object", + "required": [ + "type", + "filters" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "and", + "or" + ], + "description": "Type of operation: `and` or `or`." + }, + "filters": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComparisonFilter" + }, + {} + ] + }, + "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`." + } + }, + "description": "Combine multiple filters using `and` or `or`.", + "title": "Compound Filter", + "x-oaiMeta": { + "name": "CompoundFilter" + } + }, + "OpenAI.ComputerAction": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ComputerActionType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "click": "#/components/schemas/OpenAI.ClickParam", + "double_click": "#/components/schemas/OpenAI.DoubleClickAction", + "drag": "#/components/schemas/OpenAI.Drag", + "keypress": "#/components/schemas/OpenAI.KeyPressAction", + "move": "#/components/schemas/OpenAI.Move", + "screenshot": "#/components/schemas/OpenAI.Screenshot", + "scroll": "#/components/schemas/OpenAI.Scroll", + "type": "#/components/schemas/OpenAI.Type", + "wait": "#/components/schemas/OpenAI.Wait" + } + } + }, + "OpenAI.ComputerActionType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "click", + "double_click", + "drag", + "keypress", + "move", + "screenshot", + "scroll", + "type", + "wait" + ] + } + ] + }, + "OpenAI.ComputerCallSafetyCheckParam": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the pending safety check." + }, + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "description": "A pending safety check for the computer call." + }, + "OpenAI.ComputerEnvironment": { + "type": "string", + "enum": [ + "windows", + "mac", + "linux", + "ubuntu", + "browser" + ] + }, + "OpenAI.ComputerScreenshotContent": { + "type": "object", + "required": [ + "type", + "image_url", + "file_id" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_screenshot" + ], + "description": "Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.", + "x-stainless-const": true, + "default": "computer_screenshot" + }, + "image_url": { + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "description": "A screenshot of a computer.", + "title": "Computer screenshot" + }, + "OpenAI.ComputerScreenshotImage": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_screenshot" + ], + "description": "Specifies the event type. For a computer screenshot, this property is\n always set to `computer_screenshot`.", + "x-stainless-const": true, + "default": "computer_screenshot" + }, + "image_url": { + "type": "string", + "format": "uri", + "description": "The URL of the screenshot image." + }, + "file_id": { + "type": "string", + "description": "The identifier of an uploaded file that contains the screenshot." + } + }, + "description": "A computer screenshot image used with the computer use tool." + }, + "OpenAI.ComputerUsePreviewTool": { + "type": "object", + "required": [ + "type", + "environment", + "display_width", + "display_height" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_use_preview" + ], + "description": "The type of the computer use tool. Always `computer_use_preview`.", + "x-stainless-const": true, + "default": "computer_use_preview" + }, + "environment": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerEnvironment" + } + ], + "description": "The type of computer environment to control." + }, + "display_width": { + "type": "integer", + "description": "The width of the computer display." + }, + "display_height": { + "type": "integer", + "description": "The height of the computer display." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).", + "title": "Computer use preview" + }, + "OpenAI.ContainerFileCitationBody": { + "type": "object", + "required": [ + "type", + "container_id", + "file_id", + "start_index", + "end_index", + "filename" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "container_file_citation" + ], + "description": "The type of the container file citation. Always `container_file_citation`.", + "x-stainless-const": true, + "default": "container_file_citation" + }, + "container_id": { + "type": "string", + "description": "The ID of the container file." + }, + "file_id": { + "type": "string", + "description": "The ID of the file." + }, + "start_index": { + "type": "integer", + "description": "The index of the first character of the container file citation in the message." + }, + "end_index": { + "type": "integer", + "description": "The index of the last character of the container file citation in the message." + }, + "filename": { + "type": "string", + "description": "The filename of the container file cited." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Annotation" + } + ], + "description": "A citation for a container file used to generate a model response.", + "title": "Container file citation" + }, + "OpenAI.ContainerFileListResource": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object returned, must be 'list'." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ContainerFileResource" + }, + "description": "A list of container files." + }, + "first_id": { + "type": "string", + "description": "The ID of the first file in the list." + }, + "last_id": { + "type": "string", + "description": "The ID of the last file in the list." + }, + "has_more": { + "type": "boolean", + "description": "Whether there are more files available." + } + } + }, + "OpenAI.ContainerFileResource": { + "type": "object", + "required": [ + "id", + "object", + "container_id", + "created_at", + "bytes", + "path", + "source" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the file." + }, + "object": { + "type": "string", + "enum": [ + "container.file" + ], + "description": "The type of this object (`container.file`)." + }, + "container_id": { + "type": "string", + "description": "The container this file belongs to." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) when the file was created." + }, + "bytes": { + "type": "integer", + "description": "Size of the file in bytes." + }, + "path": { + "type": "string", + "description": "Path of the file in the container." + }, + "source": { + "type": "string", + "description": "Source of the file (e.g., `user`, `assistant`)." + } + }, + "title": "The container file object", + "x-oaiMeta": { + "name": "The container file object", + "example": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n" + } + }, + "OpenAI.ContainerListResource": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object returned, must be 'list'." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ContainerResource" + }, + "description": "A list of containers." + }, + "first_id": { + "type": "string", + "description": "The ID of the first container in the list." + }, + "last_id": { + "type": "string", + "description": "The ID of the last container in the list." + }, + "has_more": { + "type": "boolean", + "description": "Whether there are more containers available." + } + } + }, + "OpenAI.ContainerMemoryLimit": { + "type": "string", + "enum": [ + "1g", + "4g", + "16g", + "64g" + ] + }, + "OpenAI.ContainerResource": { + "type": "object", + "required": [ + "id", + "object", + "name", + "created_at", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the container." + }, + "object": { + "type": "string", + "description": "The type of this object." + }, + "name": { + "type": "string", + "description": "Name of the container." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) when the container was created." + }, + "status": { + "type": "string", + "description": "Status of the container (e.g., active, deleted)." + }, + "last_active_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) when the container was last active." + }, + "expires_after": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ContainerResourceExpiresAfter" + } + ], + "description": "The container will expire after this time period.\n The anchor is the reference point for the expiration.\n The minutes is the number of minutes after the anchor before the container expires." + }, + "memory_limit": { + "type": "string", + "enum": [ + "1g", + "4g", + "16g", + "64g" + ], + "description": "The memory limit configured for the container." + } + }, + "title": "The container object", + "x-oaiMeta": { + "name": "The container object", + "example": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"1g\",\n \"name\": \"My Container\"\n}\n" + } + }, + "OpenAI.ContainerResourceExpiresAfter": { + "type": "object", + "properties": { + "anchor": { + "type": "string", + "enum": [ + "last_active_at" + ] + }, + "minutes": { + "type": "integer" + } + } + }, + "OpenAI.ConversationItem": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ConversationItemType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "message": "#/components/schemas/OpenAI.ConversationItemMessage", + "function_call": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallResource", + "function_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutputResource", + "file_search_call": "#/components/schemas/OpenAI.ConversationItemFileSearchToolCall", + "web_search_call": "#/components/schemas/OpenAI.ConversationItemWebSearchToolCall", + "image_generation_call": "#/components/schemas/OpenAI.ConversationItemImageGenToolCall", + "computer_call": "#/components/schemas/OpenAI.ConversationItemComputerToolCall", + "computer_call_output": "#/components/schemas/OpenAI.ConversationItemComputerToolCallOutputResource", + "reasoning": "#/components/schemas/OpenAI.ConversationItemReasoningItem", + "code_interpreter_call": "#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall", + "local_shell_call": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCall", + "local_shell_call_output": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput", + "shell_call": "#/components/schemas/OpenAI.ConversationItemFunctionShellCall", + "shell_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput", + "apply_patch_call": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall", + "apply_patch_call_output": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput", + "mcp_list_tools": "#/components/schemas/OpenAI.ConversationItemMcpListTools", + "mcp_approval_request": "#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource", + "mcp_call": "#/components/schemas/OpenAI.ConversationItemMcpToolCall", + "custom_tool_call": "#/components/schemas/OpenAI.ConversationItemCustomToolCall", + "custom_tool_call_output": "#/components/schemas/OpenAI.ConversationItemCustomToolCallOutput" + } + }, + "description": "A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output).", + "title": "Conversation item" + }, + "OpenAI.ConversationItemApplyPatchToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "status", + "operation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch_call" + ], + "description": "The type of the item. Always `apply_patch_call`.", + "x-stainless-const": true, + "default": "apply_patch_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the apply patch tool call generated by the model." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus" + } + ], + "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." + }, + "operation": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" + } + ], + "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A tool call that applies file diffs by creating, deleting, or updating files.", + "title": "Apply patch tool call" + }, + "OpenAI.ConversationItemApplyPatchToolCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch_call_output" + ], + "description": "The type of the item. Always `apply_patch_call_output`.", + "x-stainless-const": true, + "default": "apply_patch_call_output" + }, + "id": { + "type": "string", + "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the apply patch tool call generated by the model." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus" + } + ], + "description": "The status of the apply patch tool call output. One of `completed` or `failed`." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call output." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "The output emitted by an apply patch tool call.", + "title": "Apply patch tool call output" + }, + "OpenAI.ConversationItemCodeInterpreterToolCall": { + "type": "object", + "required": [ + "type", + "id", + "status", + "container_id", + "code", + "outputs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "code_interpreter_call" + ], + "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.", + "x-stainless-const": true, + "default": "code_interpreter_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the code interpreter tool call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete", + "interpreting", + "failed" + ], + "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." + }, + "container_id": { + "type": "string", + "description": "The ID of the container used to run the code." + }, + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs" + }, + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage" + } + ] + } + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A tool call to run code.", + "title": "Code interpreter tool call" + }, + "OpenAI.ConversationItemComputerToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "pending_safety_checks", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_call" + ], + "description": "The type of the computer call. Always `computer_call`.", + "default": "computer_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the computer call." + }, + "call_id": { + "type": "string", + "description": "An identifier used when responding to the tool call with output." + }, + "action": { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + }, + "pending_safety_checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" + }, + "description": "The pending safety checks for the computer call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.", + "title": "Computer tool call" + }, + "OpenAI.ConversationItemComputerToolCallOutputResource": { + "type": "object", + "required": [ + "type", + "call_id", + "output" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_call_output" + ], + "description": "The type of the computer tool call output. Always `computer_call_output`.", + "x-stainless-const": true, + "default": "computer_call_output" + }, + "id": { + "type": "string", + "description": "The ID of the computer tool call output." + }, + "call_id": { + "type": "string", + "description": "The ID of the computer tool call that produced the output." + }, + "acknowledged_safety_checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" + }, + "description": "The safety checks reported by the API that have been acknowledged by the\n developer." + }, + "output": { + "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage" + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ] + }, + "OpenAI.ConversationItemCustomToolCall": { + "type": "object", + "required": [ + "type", + "call_id", + "name", + "input" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "description": "The type of the custom tool call. Always `custom_tool_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the custom tool call in the OpenAI platform." + }, + "call_id": { + "type": "string", + "description": "An identifier used to map this custom tool call to a tool call output." + }, + "name": { + "type": "string", + "description": "The name of the custom tool being called." + }, + "input": { + "type": "string", + "description": "The input for the custom tool call generated by the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A call to a custom tool created by the model.", + "title": "Custom tool call" + }, + "OpenAI.ConversationItemCustomToolCallOutput": { + "type": "object", + "required": [ + "type", + "call_id", + "output" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom_tool_call_output" + ], + "description": "The type of the custom tool call output. Always `custom_tool_call_output`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the custom tool call output in the OpenAI platform." + }, + "call_id": { + "type": "string", + "description": "The call ID, used to map this custom tool call output to a custom tool call." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" + } + } + ], + "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "The output of a custom tool call from your code, being sent back to the model.", + "title": "Custom tool call output" + }, + "OpenAI.ConversationItemFileSearchToolCall": { + "type": "object", + "required": [ + "id", + "type", + "status", + "queries" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the file search tool call." + }, + "type": { + "type": "string", + "enum": [ + "file_search_call" + ], + "description": "The type of the file search tool call. Always `file_search_call`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "searching", + "completed", + "incomplete", + "failed" + ], + "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`," + }, + "queries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The queries used to search for files." + }, + "results": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults" + } + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.", + "title": "File search tool call" + }, + "OpenAI.ConversationItemFunctionShellCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell_call" + ], + "description": "The type of the item. Always `shell_call`.", + "x-stainless-const": true, + "default": "shell_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the shell tool call. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the shell tool call generated by the model." + }, + "action": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionShellAction" + } + ], + "description": "The shell commands and limits that describe how to run the tool call." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.LocalShellCallStatus" + } + ], + "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A tool call that executes one or more shell commands in a managed environment.", + "title": "Shell tool call" + }, + "OpenAI.ConversationItemFunctionShellCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "output", + "max_output_length" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell_call_output" + ], + "description": "The type of the shell call output. Always `shell_call_output`.", + "x-stainless-const": true, + "default": "shell_call_output" + }, + "id": { + "type": "string", + "description": "The unique ID of the shell call output. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the shell tool call generated by the model." + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent" + }, + "description": "An array of shell call output contents" + }, + "max_output_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "string", + "description": "The identifier of the actor that created the item." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "The output of a shell tool call that was emitted.", + "title": "Shell call output" + }, + "OpenAI.ConversationItemFunctionToolCallOutputResource": { + "type": "object", + "required": [ + "type", + "call_id", + "output" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API." + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "description": "The type of the function tool call output. Always `function_call_output`.", + "x-stainless-const": true + }, + "call_id": { + "type": "string", + "description": "The unique ID of the function tool call generated by the model." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" + } + } + ], + "description": "The output from the function call generated by your code.\n Can be a string or an list of output content." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ] + }, + "OpenAI.ConversationItemFunctionToolCallResource": { + "type": "object", + "required": [ + "type", + "call_id", + "name", + "arguments" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the function tool call." + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "description": "The type of the function tool call. Always `function_call`.", + "x-stainless-const": true + }, + "call_id": { + "type": "string", + "description": "The unique ID of the function tool call generated by the model." + }, + "name": { + "type": "string", + "description": "The name of the function to run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of the arguments to pass to the function." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ] + }, + "OpenAI.ConversationItemImageGenToolCall": { + "type": "object", + "required": [ + "type", + "id", + "status", + "result" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "description": "The type of the image generation call. Always `image_generation_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the image generation call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "generating", + "failed" + ], + "description": "The status of the image generation call." + }, + "result": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "An image generation request made by the model.", + "title": "Image generation call" + }, + "OpenAI.ConversationItemList": { + "type": "object", + "required": [ + "object", + "data", + "has_more", + "first_id", + "last_id" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object returned, must be `list`.", + "x-stainless-const": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + }, + "description": "A list of conversation items." + }, + "has_more": { + "type": "boolean", + "description": "Whether there are more items available." + }, + "first_id": { + "type": "string", + "description": "The ID of the first item in the list." + }, + "last_id": { + "type": "string", + "description": "The ID of the last item in the list." + } + }, + "description": "A list of Conversation items.", + "title": "The conversation item list", + "x-oaiMeta": { + "name": "The item list", + "group": "conversations" + } + }, + "OpenAI.ConversationItemLocalShellToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "description": "The type of the local shell call. Always `local_shell_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the local shell call." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the local shell tool call generated by the model." + }, + "action": { + "$ref": "#/components/schemas/OpenAI.LocalShellExecAction" + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the local shell call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A tool call to run a command on the local shell.", + "title": "Local shell call" + }, + "OpenAI.ConversationItemLocalShellToolCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "output" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local_shell_call_output" + ], + "description": "The type of the local shell tool call output. Always `local_shell_call_output`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the local shell tool call generated by the model." + }, + "output": { + "type": "string", + "description": "A JSON string of the output of the local shell tool call." + }, + "status": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ] + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "The output of a local shell tool call.", + "title": "Local shell call output" + }, + "OpenAI.ConversationItemMcpApprovalRequest": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "name", + "arguments" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_approval_request" + ], + "description": "The type of the item. Always `mcp_approval_request`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the approval request." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server making the request." + }, + "name": { + "type": "string", + "description": "The name of the tool to run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of arguments for the tool." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A request for human approval of a tool invocation.", + "title": "MCP approval request" + }, + "OpenAI.ConversationItemMcpApprovalResponseResource": { + "type": "object", + "required": [ + "type", + "id", + "approval_request_id", + "approve" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_approval_response" + ], + "description": "The type of the item. Always `mcp_approval_response`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the approval response" + }, + "approval_request_id": { + "type": "string", + "description": "The ID of the approval request being answered." + }, + "approve": { + "type": "boolean", + "description": "Whether the request was approved." + }, + "reason": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A response to an MCP approval request.", + "title": "MCP approval response" + }, + "OpenAI.ConversationItemMcpListTools": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "tools" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_list_tools" + ], + "description": "The type of the item. Always `mcp_list_tools`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the list." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.MCPListToolsTool" + }, + "description": "The tools available on the server." + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A list of tools available on an MCP server.", + "title": "MCP list tools" + }, + "OpenAI.ConversationItemMcpToolCall": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "name", + "arguments" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_call" + ], + "description": "The type of the item. Always `mcp_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the tool call." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server running the tool." + }, + "name": { + "type": "string", + "description": "The name of the tool that was run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of the arguments passed to the tool." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus" + } + ], + "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`." + }, + "approval_request_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "An invocation of a tool on an MCP server.", + "title": "MCP tool call" + }, + "OpenAI.ConversationItemMessage": { + "type": "object", + "required": [ + "type", + "id", + "status", + "role", + "content" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "message" + ], + "description": "The type of the message. Always set to `message`.", + "x-stainless-const": true, + "default": "message" + }, + "id": { + "type": "string", + "description": "The unique ID of the message." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageStatus" + } + ], + "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API." + }, + "role": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageRole" + } + ], + "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`." + }, + "content": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputTextContent" + }, + { + "$ref": "#/components/schemas/OpenAI.OutputTextContent" + }, + { + "$ref": "#/components/schemas/OpenAI.TextContent" + }, + { + "$ref": "#/components/schemas/OpenAI.SummaryTextContent" + }, + { + "$ref": "#/components/schemas/OpenAI.ReasoningTextContent" + }, + { + "$ref": "#/components/schemas/OpenAI.RefusalContent" + }, + { + "$ref": "#/components/schemas/OpenAI.InputImageContent" + }, + { + "$ref": "#/components/schemas/OpenAI.ComputerScreenshotContent" + }, + { + "$ref": "#/components/schemas/OpenAI.InputFileContent" + } + ] + }, + "description": "The content of the message" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A message to or from the model.", + "title": "Message" + }, + "OpenAI.ConversationItemReasoningItem": { + "type": "object", + "required": [ + "type", + "id", + "summary" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "description": "The type of the object. Always `reasoning`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique identifier of the reasoning content." + }, + "encrypted_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Summary" + }, + "description": "Reasoning summary content." + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ReasoningTextContent" + }, + "description": "Reasoning text content." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state).", + "title": "Reasoning" + }, + "OpenAI.ConversationItemType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "message", + "function_call", + "function_call_output", + "file_search_call", + "web_search_call", + "image_generation_call", + "computer_call", + "computer_call_output", + "reasoning", + "code_interpreter_call", + "local_shell_call", + "local_shell_call_output", + "shell_call", + "shell_call_output", + "apply_patch_call", + "apply_patch_call_output", + "mcp_list_tools", + "mcp_approval_request", + "mcp_approval_response", + "mcp_call", + "custom_tool_call", + "custom_tool_call_output" + ] + } + ] + }, + "OpenAI.ConversationItemWebSearchToolCall": { + "type": "object", + "required": [ + "id", + "type", + "status", + "action" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the web search tool call." + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "description": "The type of the web search tool call. Always `web_search_call`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "searching", + "completed", + "failed" + ], + "description": "The status of the web search tool call." + }, + "action": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch" + }, + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage" + }, + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionFind" + } + ], + "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find)." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationItem" + } + ], + "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.", + "title": "Web search tool call" + }, + "OpenAI.ConversationParam": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/OpenAI.ConversationParam-2" + } + ], + "description": "The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.\nInput items and output items from this response are automatically added to this conversation after this response completes." + }, + "OpenAI.ConversationParam-2": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the conversation." + } + }, + "description": "The conversation that this response belongs to.", + "title": "Conversation object" + }, + "OpenAI.ConversationReference": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the conversation that this response was associated with." + } + }, + "description": "The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.", + "title": "Conversation" + }, + "OpenAI.ConversationResource": { + "type": "object", + "required": [ + "id", + "object", + "metadata", + "created_at" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the conversation." + }, + "object": { + "type": "string", + "enum": [ + "conversation" + ], + "description": "The object type, which is always `conversation`.", + "x-stainless-const": true, + "default": "conversation" + }, + "metadata": { + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." + } + } + }, + "OpenAI.CreateChatCompletionRequestAudio": { + "type": "object", + "required": [ + "voice", + "format" + ], + "properties": { + "voice": { + "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" + }, + "format": { + "type": "string", + "enum": [ + "wav", + "aac", + "mp3", + "flac", + "opus", + "pcm16" + ] + } + } + }, + "OpenAI.CreateChatCompletionRequestResponseFormat": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "json_schema": "#/components/schemas/OpenAI.ResponseFormatJsonSchema", + "text": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText", + "json_object": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject" + } + }, + "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](https://platform.openai.com/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it." + }, + "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "json_object" + ], + "description": "The type of response format being defined. Always `json_object`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" + } + ], + "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.", + "title": "JSON object" + }, + "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of response format being defined. Always `text`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" + } + ], + "description": "Default response format. Used to generate text responses.", + "title": "Text" + }, + "OpenAI.CreateChatCompletionRequestResponseFormatType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "text", + "json_schema", + "json_object" + ] + } + ] + }, + "OpenAI.CreateChatCompletionResponseChoices": { + "type": "object", + "required": [ + "finish_reason", + "index", + "message", + "logprobs" + ], + "properties": { + "finish_reason": { + "type": "string", + "enum": [ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call" + ] + }, + "index": { + "type": "integer" + }, + "message": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessage" + }, + "logprobs": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs" + }, + { + "type": "null" + } + ] + }, + "content_filter_results": { + "$ref": "#/components/schemas/AzureContentFilterResultForChoice" + } + } + }, + "OpenAI.CreateChatCompletionResponseChoicesLogprobs": { + "type": "object", + "required": [ + "content", + "refusal" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" + } + }, + { + "type": "null" + } + ] + }, + "refusal": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" + } + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateChatCompletionStreamResponseChoices": { + "type": "object", + "required": [ + "delta", + "finish_reason", + "index" + ], + "properties": { + "delta": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta" + }, + "logprobs": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs" + }, + { + "type": "null" + } + ] + }, + "finish_reason": { + "anyOf": [ + { + "type": "string", + "enum": [ + "stop", + "length", + "tool_calls", + "content_filter", + "function_call" + ] + }, + { + "type": "null" + } + ] + }, + "index": { + "type": "integer" + } + } + }, + "OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs": { + "type": "object", + "required": [ + "content", + "refusal" + ], + "properties": { + "content": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" + } + }, + { + "type": "null" + } + ] + }, + "refusal": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" + } + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateCompletionResponseChoices": { + "type": "object", + "required": [ + "finish_reason", + "index", + "logprobs", + "text" + ], + "properties": { + "finish_reason": { + "type": "string", + "enum": [ + "stop", + "length", + "content_filter" + ] + }, + "index": { + "type": "integer", + "format": "int32" + }, + "logprobs": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs" + }, + { + "type": "null" + } + ] + }, + "text": { + "type": "string" + }, + "content_filter_results": { + "$ref": "#/components/schemas/AzureContentFilterResultForChoice" + } + } + }, + "OpenAI.CreateCompletionResponseChoicesLogprobs": { + "type": "object", + "properties": { + "text_offset": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + } + }, + "token_logprobs": { + "type": "array", + "items": { + "type": "number", + "format": "float" + } + }, + "tokens": { + "type": "array", + "items": { + "type": "string" + } + }, + "top_logprobs": { + "type": "array", + "items": { + "type": "object", + "unevaluatedProperties": { + "type": "number", + "format": "float" + } + } + } + } + }, + "OpenAI.CreateContainerBody": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the container to create." + }, + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of files to copy to the container." + }, + "expires_after": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter" + } + ], + "description": "Container expiration time in seconds relative to the 'anchor' time." + }, + "memory_limit": { + "type": "string", + "enum": [ + "1g", + "4g", + "16g", + "64g" + ], + "description": "Optional memory limit for the container. Defaults to \"1g\"." + } + } + }, + "OpenAI.CreateContainerBodyExpiresAfter": { + "type": "object", + "required": [ + "anchor", + "minutes" + ], + "properties": { + "anchor": { + "type": "string", + "enum": [ + "last_active_at" + ] + }, + "minutes": { + "type": "integer" + } + } + }, + "OpenAI.CreateContainerFileBody": { + "type": "object", + "properties": { + "file_id": { + "type": "string", + "description": "Name of the file to create." + }, + "file": { + "description": "The File object (not file name) to be uploaded." + } + }, + "required": [] + }, + "OpenAI.CreateConversationBody": { + "type": "object", + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "items": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateConversationItemsParametersBody": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + }, + "maxItems": 20 + } + } + }, + "OpenAI.CreateEmbeddingRequest": { + "type": "object", + "required": [ + "input", + "model" + ], + "properties": { + "input": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "array", + "items": { + "type": "integer" + } + }, + { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "integer" + } + } + } + ], + "description": "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request." + }, + "model": { + "type": "string", + "description": "ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.", + "x-oaiTypeLabel": "string" + }, + "encoding_format": { + "type": "string", + "enum": [ + "float", + "base64" + ], + "description": "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).", + "default": "float" + }, + "dimensions": { + "type": "integer", + "minimum": 1, + "description": "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models." + }, + "user": { + "type": "string", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." + } + } + }, + "OpenAI.CreateEmbeddingResponse": { + "type": "object", + "required": [ + "data", + "model", + "object", + "usage" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Embedding" + }, + "description": "The list of embeddings generated by the model." + }, + "model": { + "type": "string", + "description": "The name of the model used to generate the embedding." + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The object type, which is always \"list\".", + "x-stainless-const": true + }, + "usage": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponseUsage" + } + ], + "description": "The usage information for the request." + } + } + }, + "OpenAI.CreateEmbeddingResponseUsage": { + "type": "object", + "required": [ + "prompt_tokens", + "total_tokens" + ], + "properties": { + "prompt_tokens": { + "type": "integer" + }, + "total_tokens": { + "type": "integer" + } + } + }, + "OpenAI.CreateEvalCompletionsRunDataSource": { + "type": "object", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "completions" + ], + "description": "The type of run data source. Always `completions`.", + "default": "completions" + }, + "input_messages": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference" + } + ], + "description": "Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace." + }, + "sampling_params": { + "$ref": "#/components/schemas/AzureCompletionsSamplingParams" + }, + "model": { + "type": "string", + "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")." + }, + "source": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsSource" + } + ], + "description": "Determines what populates the `item` namespace in this run's data source." + } + }, + "description": "A CompletionsRunDataSource object describing a model sampling configuration.", + "title": "CompletionsRunDataSource", + "x-oaiMeta": { + "name": "The completions data source object used to configure an individual run", + "group": "eval runs", + "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"completions\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n" + } + }, + "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference": { + "type": "object", + "required": [ + "type", + "item_reference" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "item_reference" + ] + }, + "item_reference": { + "type": "string" + } + } + }, + "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate": { + "type": "object", + "required": [ + "type", + "template" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "template" + ] + }, + "template": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EasyInputMessage" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalItem" + } + ] + } + } + } + }, + "OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams": { + "type": "object", + "properties": { + "reasoning_effort": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + } + ], + "description": "Controls the level of reasoning effort applied during generation." + }, + "temperature": { + "type": "number", + "description": "A higher temperature increases randomness in the outputs.", + "default": 1 + }, + "max_completion_tokens": { + "type": "integer" + }, + "top_p": { + "type": "number", + "description": "An alternative to temperature for nucleus sampling; 1.0 includes all tokens.", + "default": 1 + }, + "seed": { + "type": "integer", + "description": "A seed value initializes the randomness during sampling.", + "default": 42 + }, + "response_format": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatText" + }, + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema" + }, + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject" + } + ] + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionTool" + } + } + } + }, + "OpenAI.CreateEvalCustomDataSourceConfig": { + "type": "object", + "required": [ + "type", + "item_schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "The type of data source. Always `custom`.", + "x-stainless-const": true, + "default": "custom" + }, + "item_schema": { + "type": "object", + "unevaluatedProperties": {}, + "description": "The json schema for each row in the data source." + }, + "include_sample_schema": { + "type": "boolean", + "description": "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)" + } + }, + "description": "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run", + "title": "CustomDataSourceConfig", + "x-oaiMeta": { + "name": "The eval file data source config object", + "group": "evals", + "example": "{\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n },\n \"include_sample_schema\": true\n}\n" + } + }, + "OpenAI.CreateEvalItem": { + "type": "object", + "required": [ + "role", + "content" + ], + "properties": { + "role": { + "type": "string", + "description": "The role of the message (e.g. \"system\", \"assistant\", \"user\")." + }, + "content": { + "type": "string", + "description": "The content of the message." + } + }, + "description": "A chat message that makes up the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.", + "title": "SimpleInputMessage", + "x-oaiMeta": { + "name": "The chat message object used to configure an individual run" + } + }, + "OpenAI.CreateEvalJsonlRunDataSource": { + "type": "object", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "jsonl" + ], + "description": "The type of data source. Always `jsonl`.", + "x-stainless-const": true, + "default": "jsonl" + }, + "source": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource" + } + ], + "description": "Determines what populates the `item` namespace in the data source." + } + }, + "description": "A JsonlRunDataSource object with that specifies a JSONL file that matches the eval", + "title": "JsonlRunDataSource", + "x-oaiMeta": { + "name": "The file data source object for the eval run configuration", + "group": "evals", + "example": "{\n \"type\": \"jsonl\",\n \"source\": {\n \"type\": \"file_id\",\n \"id\": \"file-9GYS6xbkWgWhmE7VoLUWFg\"\n }\n}\n" + } + }, + "OpenAI.CreateEvalLabelModelGrader": { + "type": "object", + "required": [ + "type", + "name", + "model", + "input", + "labels", + "passing_labels" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "label_model" + ], + "description": "The object type, which is always `label_model`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "model": { + "type": "string", + "description": "The model to use for the evaluation. Must support structured outputs." + }, + "input": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateEvalItem" + }, + "description": "A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}." + }, + "labels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The labels to classify to each item in the evaluation." + }, + "passing_labels": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The labels that indicate a passing result. Must be a subset of labels." + } + }, + "description": "A LabelModelGrader object which uses a model to assign labels to each item\nin the evaluation.", + "title": "LabelModelGrader", + "x-oaiMeta": { + "name": "The eval label model grader object", + "group": "evals", + "example": "{\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Statement: {{item.response}}\"\n }\n ],\n \"passing_labels\": [\"positive\"],\n \"labels\": [\"positive\", \"neutral\", \"negative\"],\n \"name\": \"Sentiment label grader\"\n}\n" + } + }, + "OpenAI.CreateEvalLogsDataSourceConfig": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "logs" + ], + "description": "The type of data source. Always `logs`.", + "x-stainless-const": true, + "default": "logs" + }, + "metadata": { + "type": "object", + "unevaluatedProperties": {}, + "description": "Metadata filters for the logs data source." + } + }, + "description": "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.", + "title": "LogsDataSourceConfig", + "x-oaiMeta": { + "name": "The logs data source object for evals", + "group": "evals", + "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n" + } + }, + "OpenAI.CreateEvalResponsesRunDataSource": { + "type": "object", + "required": [ + "type", + "source" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "responses" + ], + "description": "The type of run data source. Always `responses`.", + "default": "responses" + }, + "input_messages": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference" + } + ], + "description": "Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace." + }, + "sampling_params": { + "$ref": "#/components/schemas/AzureResponsesSamplingParams" + }, + "model": { + "type": "string", + "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")." + }, + "source": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalResponsesSource" + } + ], + "description": "Determines what populates the `item` namespace in this run's data source." + } + }, + "description": "A ResponsesRunDataSource object describing a model sampling configuration.", + "title": "CreateEvalResponsesRunDataSource", + "x-oaiMeta": { + "name": "The completions data source object used to configure an individual run", + "group": "eval runs", + "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"responses\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n" + } + }, + "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference": { + "type": "object", + "required": [ + "type", + "item_reference" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "item_reference" + ] + }, + "item_reference": { + "type": "string" + } + } + }, + "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate": { + "type": "object", + "required": [ + "type", + "template" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "template" + ] + }, + "template": { + "type": "array", + "items": { + "anyOf": [ + { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "content": { + "type": "string" + } + }, + "required": [ + "role", + "content" + ] + }, + { + "$ref": "#/components/schemas/OpenAI.EvalItem" + } + ] + } + } + } + }, + "OpenAI.CreateEvalResponsesRunDataSourceSamplingParams": { + "type": "object", + "properties": { + "reasoning_effort": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + } + ], + "description": "Controls the level of reasoning effort applied during generation." + }, + "temperature": { + "type": "number", + "description": "A higher temperature increases randomness in the outputs.", + "default": 1 + }, + "top_p": { + "type": "number", + "description": "An alternative to temperature for nucleus sampling; 1.0 includes all tokens.", + "default": 1 + }, + "seed": { + "type": "integer", + "description": "A seed value initializes the randomness during sampling.", + "default": 42 + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Tool" + } + }, + "text": { + "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText" + } + } + }, + "OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText": { + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" + } + } + }, + "OpenAI.CreateEvalRunRequest": { + "type": "object", + "required": [ + "data_source" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the run." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "data_source": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource" + } + ], + "description": "Details about the run's data source." + } + }, + "title": "CreateEvalRunRequest" + }, + "OpenAI.CreateEvalStoredCompletionsDataSourceConfig": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stored_completions" + ], + "description": "The type of data source. Always `stored_completions`.", + "x-stainless-const": true, + "default": "stored_completions" + }, + "metadata": { + "type": "object", + "unevaluatedProperties": {}, + "description": "Metadata filters for the stored completions data source." + } + }, + "description": "Deprecated in favor of LogsDataSourceConfig.", + "title": "StoredCompletionsDataSourceConfig", + "deprecated": true, + "x-oaiMeta": { + "name": "The stored completions data source object for evals", + "group": "evals", + "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n" + } + }, + "OpenAI.CreateFileRequest": { + "type": "object", + "properties": { + "file": { + "description": "The File object (not file name) to be uploaded.", + "x-oaiMeta": { + "exampleFilePath": "fine-tune.jsonl" + } + }, + "expires_after": { + "type": "object", + "properties": { + "seconds": { + "type": "integer", + "format": "int32" + }, + "anchor": { + "$ref": "#/components/schemas/AzureFileExpiryAnchor" + } + }, + "required": [ + "seconds", + "anchor" + ] + }, + "purpose": { + "type": "string", + "enum": [ + "assistants", + "batch", + "fine-tune", + "evals" + ], + "description": "The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `evals`: Used for eval data sets" + } + }, + "required": [ + "file", + "expires_after", + "purpose" + ] + }, + "OpenAI.CreateFineTuningCheckpointPermissionRequest": { + "type": "object", + "required": [ + "project_ids" + ], + "properties": { + "project_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The project identifiers to grant access to." + } + } + }, + "OpenAI.CreateFineTuningJobRequest": { + "type": "object", + "required": [ + "model", + "training_file" + ], + "properties": { + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "babbage-002", + "davinci-002", + "gpt-3.5-turbo", + "gpt-4o-mini" + ] + } + ], + "description": "The name of the model to fine-tune. You can select one of the\n [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned).", + "x-oaiTypeLabel": "string" + }, + "training_file": { + "type": "string", + "description": "The ID of an uploaded file that contains training data.\n See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file.\n Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format.\n See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details." + }, + "hyperparameters": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters" + } + ], + "description": "The hyperparameters used for the fine-tuning job.\n This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.", + "deprecated": true + }, + "suffix": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "minLength": 1, + "maxLength": 64, + "description": "A string of up to 64 characters that will be added to your fine-tuned model name.\n For example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`." + }, + "validation_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The ID of an uploaded file that contains validation data.\n If you provide this file, the data is used to generate validation\n metrics periodically during fine-tuning. These metrics can be viewed in\n the fine-tuning results file.\n The same data should not be present in both train and validation files.\n Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details." + }, + "integrations": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations" + } + }, + { + "type": "null" + } + ], + "description": "A list of integrations to enable for your fine-tuning job." + }, + "seed": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 2147483647, + "description": "The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases.\n If a seed is not specified, one will be generated for you." + }, + "method": { + "$ref": "#/components/schemas/OpenAI.FineTuneMethod" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateFineTuningJobRequestHyperparameters": { + "type": "object", + "properties": { + "batch_size": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "default": "auto" + }, + "learning_rate_multiplier": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ] + }, + "n_epochs": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "default": "auto" + } + } + }, + "OpenAI.CreateFineTuningJobRequestIntegrations": { + "type": "object", + "required": [ + "type", + "wandb" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "wandb" + ], + "x-stainless-const": true + }, + "wandb": { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb" + } + } + }, + "OpenAI.CreateFineTuningJobRequestIntegrationsWandb": { + "type": "object", + "required": [ + "project" + ], + "properties": { + "project": { + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "entity": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "OpenAI.CreateMessageRequest": { + "type": "object", + "required": [ + "role", + "content" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "user", + "assistant" + ], + "description": "The role of the entity that is creating the message. Allowed values include:\n - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation." + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObject" + }, + { + "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObject" + }, + { + "$ref": "#/components/schemas/OpenAI.MessageRequestContentTextObject" + } + ] + } + } + ] + }, + "attachments": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateMessageRequestAttachments" + } + }, + { + "type": "null" + } + ] + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateMessageRequestAttachments": { + "type": "object", + "properties": { + "file_id": { + "type": "string" + }, + "tools": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.AssistantToolsCode" + }, + { + "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly" + } + ] + } + } + } + }, + "OpenAI.CreateResponse": { + "type": "object", + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "user": { + "type": "string", + "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", + "deprecated": true + }, + "safety_identifier": { + "type": "string", + "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." + }, + "prompt_cache_key": { + "type": "string", + "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." + }, + "prompt_cache_retention": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in-memory", + "24h" + ] + }, + { + "type": "null" + } + ] + }, + "previous_response_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": "string", + "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." + }, + "reasoning": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Reasoning" + }, + { + "type": "null" + } + ] + }, + "background": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "max_tool_calls": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "text": { + "$ref": "#/components/schemas/OpenAI.ResponseTextParam" + }, + "tools": { + "$ref": "#/components/schemas/OpenAI.ToolsArray", + "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\n\nThe two categories of tools you can provide the model are:\n\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\n model's capabilities, like file search.\n- **Function calls (custom tools)**: Functions that are defined by you,\n enabling the model to call your own code." + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + }, + "truncation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "disabled" + ] + }, + { + "type": "null" + } + ], + "default": "disabled" + }, + "input": { + "$ref": "#/components/schemas/OpenAI.InputParam" + }, + "include": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.IncludeEnum" + } + }, + { + "type": "null" + } + ] + }, + "parallel_tool_calls": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true + }, + "store": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "default": true + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "stream_options": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseStreamOptions" + }, + { + "type": "null" + } + ] + }, + "conversation": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationParam" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateRunRequest": { + "type": "object", + "required": [ + "assistant_id" + ], + "properties": { + "assistant_id": { + "type": "string", + "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run." + }, + "model": { + "type": "string", + "description": "The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.", + "x-oaiTypeLabel": "string" + }, + "reasoning_effort": { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis." + }, + "additional_instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions." + }, + "additional_messages": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateMessageRequest" + } + }, + { + "type": "null" + } + ], + "description": "Adds additional messages to the thread before creating the run." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.AssistantTool" + }, + "maxItems": 20, + "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 2, + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 1, + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or temperature but not both.", + "default": 1 + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message." + }, + "max_prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 256, + "description": "The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." + }, + "max_completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 256, + "description": "The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." + }, + "truncation_strategy": { + "$ref": "#/components/schemas/OpenAI.TruncationObject" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption" + }, + "parallel_tool_calls": { + "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" + }, + "response_format": { + "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption" + } + } + }, + "OpenAI.CreateThreadAndRunRequest": { + "type": "object", + "required": [ + "assistant_id" + ], + "properties": { + "assistant_id": { + "type": "string", + "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run." + }, + "thread": { + "$ref": "#/components/schemas/OpenAI.CreateThreadRequest" + }, + "model": { + "type": "string", + "description": "The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.", + "x-oaiTypeLabel": "string" + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.AssistantTool" + }, + "maxItems": 20, + "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis." + }, + "tool_resources": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources" + }, + { + "type": "null" + } + ], + "description": "A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 2, + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 1, + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or temperature but not both.", + "default": 1 + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message." + }, + "max_prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 256, + "description": "The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." + }, + "max_completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 256, + "description": "The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." + }, + "truncation_strategy": { + "$ref": "#/components/schemas/OpenAI.TruncationObject" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption" + }, + "parallel_tool_calls": { + "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" + }, + "response_format": { + "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption" + } + } + }, + "OpenAI.CreateThreadAndRunRequestToolResources": { + "type": "object", + "properties": { + "code_interpreter": { + "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter" + }, + "file_search": { + "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch" + } + } + }, + "OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 20, + "default": [] + } + } + }, + "OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch": { + "type": "object", + "properties": { + "vector_store_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 1 + } + } + }, + "OpenAI.CreateThreadRequest": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateMessageRequest" + }, + "description": "A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with." + }, + "tool_resources": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResources" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "description": "Options to create a new thread. If no thread is provided when running a\nrequest, an empty thread will be created." + }, + "OpenAI.CreateThreadRequestToolResources": { + "type": "object", + "properties": { + "code_interpreter": { + "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter" + }, + "file_search": { + "anyOf": [ + {}, + {} + ] + } + } + }, + "OpenAI.CreateThreadRequestToolResourcesCodeInterpreter": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 20 + } + } + }, + "OpenAI.CreateVectorStoreFileBatchRequest": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "minItems": 1, + "maxItems": 500, + "description": "A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. Mutually exclusive with `files`." + }, + "files": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest" + }, + "minItems": 1, + "maxItems": 500, + "description": "A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. Mutually exclusive with `file_ids`." + }, + "chunking_strategy": { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" + }, + "attributes": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateVectorStoreFileRequest": { + "type": "object", + "required": [ + "file_id" + ], + "properties": { + "file_id": { + "type": "string", + "description": "A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files." + }, + "chunking_strategy": { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" + }, + "attributes": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CreateVectorStoreRequest": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 500, + "description": "A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files." + }, + "name": { + "type": "string", + "description": "The name of the vector store." + }, + "description": { + "type": "string", + "description": "A description for the vector store. Can be used to describe the vector store's purpose." + }, + "expires_after": { + "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter" + }, + "chunking_strategy": { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.CustomGrammarFormatParam": { + "type": "object", + "required": [ + "type", + "syntax", + "definition" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "grammar" + ], + "description": "Grammar format. Always `grammar`.", + "x-stainless-const": true, + "default": "grammar" + }, + "syntax": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.GrammarSyntax1" + } + ], + "description": "The syntax of the grammar definition. One of `lark` or `regex`." + }, + "definition": { + "type": "string", + "description": "The grammar definition." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat" + } + ], + "description": "A grammar defined by the user.", + "title": "Grammar format" + }, + "OpenAI.CustomTextFormatParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "Unconstrained text format. Always `text`.", + "x-stainless-const": true, + "default": "text" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat" + } + ], + "description": "Unconstrained free-form text.", + "title": "Text format" + }, + "OpenAI.CustomToolChatCompletions": { + "type": "object", + "required": [ + "type", + "custom" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "The type of the custom tool. Always `custom`.", + "x-stainless-const": true + }, + "custom": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustom" + } + ], + "description": "Properties of the custom tool.", + "title": "Custom tool properties" + } + }, + "description": "A custom tool that processes input using a specified format.", + "title": "Custom tool" + }, + "OpenAI.CustomToolChatCompletionsCustom": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "format": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText" + }, + { + "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar" + } + ] + } + } + }, + "OpenAI.CustomToolChatCompletionsCustomFormatGrammar": { + "type": "object", + "required": [ + "type", + "grammar" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "grammar" + ], + "x-stainless-const": true + }, + "grammar": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar" + } + ], + "title": "Grammar format" + } + } + }, + "OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar": { + "type": "object", + "required": [ + "definition", + "syntax" + ], + "properties": { + "definition": { + "type": "string" + }, + "syntax": { + "type": "string", + "enum": [ + "lark", + "regex" + ] + } + } + }, + "OpenAI.CustomToolChatCompletionsCustomFormatText": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.CustomToolParam": { + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "The type of the custom tool. Always `custom`.", + "x-stainless-const": true, + "default": "custom" + }, + "name": { + "type": "string", + "description": "The name of the custom tool, used to identify it in tool calls." + }, + "description": { + "type": "string", + "description": "Optional description of the custom tool, used to provide more context." + }, + "format": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat" + } + ], + "description": "The input format for the custom tool. Default is unconstrained text." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)", + "title": "Custom tool" + }, + "OpenAI.CustomToolParamFormat": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.CustomToolParamFormatType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "text": "#/components/schemas/OpenAI.CustomTextFormatParam", + "grammar": "#/components/schemas/OpenAI.CustomGrammarFormatParam" + } + }, + "description": "The input format for the custom tool. Default is unconstrained text." + }, + "OpenAI.CustomToolParamFormatType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "text", + "grammar" + ] + } + ] + }, + "OpenAI.DeleteFileResponse": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string" + }, + "object": { + "type": "string", + "enum": [ + "file" + ], + "x-stainless-const": true + }, + "deleted": { + "type": "boolean" + } + } + }, + "OpenAI.DeleteFineTuningCheckpointPermissionResponse": { + "type": "object", + "required": [ + "id", + "object", + "deleted" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the fine-tuned model checkpoint permission that was deleted." + }, + "object": { + "type": "string", + "enum": [ + "checkpoint.permission" + ], + "description": "The object type, which is always \"checkpoint.permission\".", + "x-stainless-const": true + }, + "deleted": { + "type": "boolean", + "description": "Whether the fine-tuned model checkpoint permission was successfully deleted." + } + } + }, + "OpenAI.DeleteMessageResponse": { + "type": "object", + "required": [ + "id", + "deleted", + "object" + ], + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "object": { + "type": "string", + "enum": [ + "thread.message.deleted" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.DeleteModelResponse": { + "type": "object", + "required": [ + "id", + "deleted", + "object" + ], + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "object": { + "type": "string" + } + } + }, + "OpenAI.DeleteThreadResponse": { + "type": "object", + "required": [ + "id", + "deleted", + "object" + ], + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "object": { + "type": "string", + "enum": [ + "thread.deleted" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.DeleteVectorStoreFileResponse": { + "type": "object", + "required": [ + "id", + "deleted", + "object" + ], + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "object": { + "type": "string", + "enum": [ + "vector_store.file.deleted" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.DeleteVectorStoreResponse": { + "type": "object", + "required": [ + "id", + "deleted", + "object" + ], + "properties": { + "id": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "object": { + "type": "string", + "enum": [ + "vector_store.deleted" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.DeletedConversationResource": { + "type": "object", + "required": [ + "object", + "deleted", + "id" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "conversation.deleted" + ], + "x-stainless-const": true, + "default": "conversation.deleted" + }, + "deleted": { + "type": "boolean" + }, + "id": { + "type": "string" + } + } + }, + "OpenAI.DoubleClickAction": { + "type": "object", + "required": [ + "type", + "x", + "y" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "double_click" + ], + "description": "Specifies the event type. For a double click action, this property is always set to `double_click`.", + "x-stainless-const": true, + "default": "double_click" + }, + "x": { + "type": "integer", + "description": "The x-coordinate where the double click occurred." + }, + "y": { + "type": "integer", + "description": "The y-coordinate where the double click occurred." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A double click action.", + "title": "DoubleClick" + }, + "OpenAI.Drag": { + "type": "object", + "required": [ + "type", + "path" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "drag" + ], + "description": "Specifies the event type. For a drag action, this property is\n always set to `drag`.", + "x-stainless-const": true, + "default": "drag" + }, + "path": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.DragPoint" + }, + "description": "An array of coordinates representing the path of the drag action. Coordinates will appear as an array\n of objects, eg\n ```\n [\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n ]\n ```" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A drag action.", + "title": "Drag" + }, + "OpenAI.DragPoint": { + "type": "object", + "required": [ + "x", + "y" + ], + "properties": { + "x": { + "type": "integer", + "description": "The x-coordinate." + }, + "y": { + "type": "integer", + "description": "The y-coordinate." + } + }, + "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.", + "title": "Coordinate" + }, + "OpenAI.EasyInputMessage": { + "type": "object", + "required": [ + "role", + "content", + "type" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "user", + "assistant", + "system", + "developer" + ], + "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`." + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/OpenAI.InputMessageContentList" + } + ], + "description": "Text, image, or audio input to the model, used to generate a response.\n Can also contain previous assistant responses." + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "description": "The type of the message input. Always `message`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + ], + "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.", + "title": "Input message" + }, + "OpenAI.Embedding": { + "type": "object", + "required": [ + "index", + "embedding", + "object" + ], + "properties": { + "index": { + "type": "integer", + "description": "The index of the embedding in the list of embeddings." + }, + "embedding": { + "type": "array", + "items": { + "type": "number", + "format": "float" + }, + "description": "The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings)." + }, + "object": { + "type": "string", + "enum": [ + "embedding" + ], + "description": "The object type, which is always \"embedding\".", + "x-stainless-const": true + } + }, + "description": "Represents an embedding vector returned by embedding endpoint.", + "x-oaiMeta": { + "name": "The embedding object", + "example": "{\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n}\n" + } + }, + "OpenAI.Eval": { + "type": "object", + "required": [ + "object", + "id", + "name", + "data_source_config", + "testing_criteria", + "created_at", + "metadata" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "eval" + ], + "description": "The object type.", + "x-stainless-const": true, + "default": "eval" + }, + "id": { + "type": "string", + "description": "Unique identifier for the evaluation." + }, + "name": { + "type": "string", + "description": "The name of the evaluation." + }, + "data_source_config": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalCustomDataSourceConfig" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalLogsDataSourceConfig" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsDataSourceConfig" + } + ], + "description": "Configuration of data sources used in runs of the evaluation." + }, + "testing_criteria": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalLabelModelGrader" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderPython" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel" + }, + { + "$ref": "#/components/schemas/EvalGraderEndpoint" + } + ] + }, + "description": "A list of testing criteria." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the eval was created." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "description": "An Eval object with a data source config and testing criteria.\nAn Eval represents a task to be done for your LLM integration.\nLike:\n- Improve the quality of my chatbot\n- See how well my chatbot handles customer support\n- Check if o4-mini is better at my usecase than gpt-4o", + "title": "Eval", + "x-oaiMeta": { + "name": "The eval object", + "group": "evals", + "example": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n },\n \"include_sample_schema\": true\n },\n \"testing_criteria\": [\n {\n \"name\": \"My string check grader\",\n \"type\": \"string_check\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\",\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"test\": \"synthetics\",\n }\n}\n" + } + }, + "OpenAI.EvalApiError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "description": "The error code." + }, + "message": { + "type": "string", + "description": "The error message." + } + }, + "description": "An object representing an error response from the Eval API.", + "title": "EvalApiError", + "x-oaiMeta": { + "name": "The API error object", + "group": "evals", + "example": "{\n \"code\": \"internal_error\",\n \"message\": \"The eval run failed due to an internal error.\"\n}\n" + } + }, + "OpenAI.EvalCustomDataSourceConfig": { + "type": "object", + "required": [ + "type", + "schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "The type of data source. Always `custom`.", + "x-stainless-const": true, + "default": "custom" + }, + "schema": { + "type": "object", + "unevaluatedProperties": {}, + "description": "The json schema for the run data source items.\n Learn how to build JSON schemas [here](https://json-schema.org/)." + } + }, + "description": "A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.\nThe response schema defines the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run", + "title": "CustomDataSourceConfig", + "x-oaiMeta": { + "name": "The eval custom data source config object", + "group": "evals", + "example": "{\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n }\n },\n \"required\": [\"item\"]\n }\n}\n" + } + }, + "OpenAI.EvalGraderPython": { + "type": "object", + "required": [ + "type", + "name", + "source" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "python" + ], + "description": "The object type, which is always `python`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "source": { + "type": "string", + "description": "The source code of the python script." + }, + "image_tag": { + "type": "string", + "description": "The image tag to use for the python script." + }, + "pass_threshold": { + "type": "number", + "description": "The threshold for the score." + } + }, + "title": "EvalGraderPython" + }, + "OpenAI.EvalGraderScoreModel": { + "type": "object", + "required": [ + "type", + "name", + "model", + "input" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "score_model" + ], + "description": "The object type, which is always `score_model`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "model": { + "type": "string", + "description": "The model to use for the evaluation." + }, + "sampling_params": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams" + } + ], + "description": "The sampling parameters for the model." + }, + "input": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalItem" + }, + "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings." + }, + "range": { + "type": "array", + "items": { + "type": "number" + }, + "description": "The range of the score. Defaults to `[0, 1]`." + }, + "pass_threshold": { + "type": "number", + "description": "The threshold for the score." + } + }, + "title": "EvalGraderScoreModel" + }, + "OpenAI.EvalGraderScoreModelSamplingParams": { + "type": "object", + "properties": { + "seed": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "max_completions_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "reasoning_effort": { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + } + } + }, + "OpenAI.EvalGraderStringCheck": { + "type": "object", + "required": [ + "type", + "name", + "input", + "reference", + "operation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "string_check" + ], + "description": "The object type, which is always `string_check`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "input": { + "type": "string", + "description": "The input text. This may include template strings." + }, + "reference": { + "type": "string", + "description": "The reference text. This may include template strings." + }, + "operation": { + "type": "string", + "enum": [ + "eq", + "ne", + "like", + "ilike" + ], + "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`." + } + }, + "title": "StringCheckGrader" + }, + "OpenAI.EvalGraderTextSimilarity": { + "type": "object", + "required": [ + "type", + "name", + "input", + "reference", + "evaluation_metric", + "pass_threshold" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text_similarity" + ], + "description": "The type of grader.", + "x-stainless-const": true, + "default": "text_similarity" + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "input": { + "type": "string", + "description": "The text being graded." + }, + "reference": { + "type": "string", + "description": "The text being graded against." + }, + "evaluation_metric": { + "type": "string", + "enum": [ + "cosine", + "fuzzy_match", + "bleu", + "gleu", + "meteor", + "rouge_1", + "rouge_2", + "rouge_3", + "rouge_4", + "rouge_5", + "rouge_l" + ], + "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`." + }, + "pass_threshold": { + "type": "number", + "description": "The threshold for the score." + } + }, + "title": "EvalGraderTextSimilarity" + }, + "OpenAI.EvalItem": { + "type": "object", + "required": [ + "role", + "content" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "user", + "assistant", + "system", + "developer" + ], + "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`." + }, + "content": { + "$ref": "#/components/schemas/OpenAI.EvalItemContent" + }, + "type": { + "type": "string", + "enum": [ + "message" + ], + "description": "The type of the message input. Always `message`.", + "x-stainless-const": true + } + }, + "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.", + "title": "EvalItem" + }, + "OpenAI.EvalItemContent": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItem" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentArray" + } + ], + "description": "Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.", + "title": "Eval content" + }, + "OpenAI.EvalItemContentArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItem" + }, + "description": "A list of inputs, each of which may be either an input text, output text, input\nimage, or input audio object.", + "title": "An array of Input text, Output text, Input image, and Input audio" + }, + "OpenAI.EvalItemContentItem": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentText" + }, + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" + } + ], + "description": "A single content item: input text, output text, input image, or input audio.", + "title": "Eval content item", + "x-stainless-naming": { + "ruby": { + "model_name": "GraderInputItem" + } + } + }, + "OpenAI.EvalItemContentItemObject": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObjectType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAI.EvalItemContentOutputText", + "input_image": "#/components/schemas/OpenAI.EvalItemInputImage", + "input_audio": "#/components/schemas/OpenAI.InputAudio", + "input_text": "#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent" + } + }, + "description": "A single content item: input text, output text, input image, or input audio.", + "title": "Eval content item", + "x-stainless-naming": { + "ruby": { + "model_name": "GraderInputItem" + } + } + }, + "OpenAI.EvalItemContentItemObjectInputTextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "description": "The type of the input item. Always `input_text`.", + "x-stainless-const": true, + "default": "input_text" + }, + "text": { + "type": "string", + "description": "The text input to the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" + } + ], + "description": "A text input to the model.", + "title": "Input text" + }, + "OpenAI.EvalItemContentItemObjectType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "input_text", + "output_text", + "input_image", + "input_audio" + ] + } + ] + }, + "OpenAI.EvalItemContentOutputText": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "description": "The type of the output text. Always `output_text`.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "The text output from the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" + } + ], + "description": "A text output from the model.", + "title": "Output text" + }, + "OpenAI.EvalItemContentText": { + "type": "string", + "description": "A text input to the model.", + "title": "Text input" + }, + "OpenAI.EvalItemInputImage": { + "type": "object", + "required": [ + "type", + "image_url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "description": "The type of the image input. Always `input_image`.", + "x-stainless-const": true + }, + "image_url": { + "type": "string", + "format": "uri", + "description": "The URL of the image input." + }, + "detail": { + "type": "string", + "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" + } + ], + "description": "An image input block used within EvalItem content arrays.", + "title": "Input image" + }, + "OpenAI.EvalJsonlFileContentSource": { + "type": "object", + "required": [ + "type", + "content" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_content" + ], + "description": "The type of jsonl source. Always `file_content`.", + "x-stainless-const": true, + "default": "file_content" + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent" + }, + "description": "The content of the jsonl file." + } + }, + "title": "EvalJsonlFileContentSource" + }, + "OpenAI.EvalJsonlFileContentSourceContent": { + "type": "object", + "required": [ + "item" + ], + "properties": { + "item": { + "type": "object", + "unevaluatedProperties": {} + }, + "sample": { + "type": "object", + "unevaluatedProperties": {} + } + } + }, + "OpenAI.EvalJsonlFileIdSource": { + "type": "object", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_id" + ], + "description": "The type of jsonl source. Always `file_id`.", + "x-stainless-const": true, + "default": "file_id" + }, + "id": { + "type": "string", + "description": "The identifier of the file." + } + }, + "title": "EvalJsonlFileIdSource" + }, + "OpenAI.EvalList": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of this object. It is always set to \"list\".", + "x-stainless-const": true, + "default": "list" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Eval" + }, + "description": "An array of eval objects." + }, + "first_id": { + "type": "string", + "description": "The identifier of the first eval in the data array." + }, + "last_id": { + "type": "string", + "description": "The identifier of the last eval in the data array." + }, + "has_more": { + "type": "boolean", + "description": "Indicates whether there are more evals available." + } + }, + "description": "An object representing a list of evals.", + "title": "EvalList", + "x-oaiMeta": { + "name": "The eval list object", + "group": "evals", + "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"string\"\n },\n \"ground_truth\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"input\",\n \"ground_truth\"\n ]\n }\n },\n \"required\": [\n \"item\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"String check\",\n \"id\": \"String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2\",\n \"type\": \"string_check\",\n \"input\": \"{{item.input}}\",\n \"reference\": \"{{item.ground_truth}}\",\n \"operation\": \"eq\"\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {},\n }\n ],\n \"first_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"last_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"has_more\": true\n}\n" + } + }, + "OpenAI.EvalLogsDataSourceConfig": { + "type": "object", + "required": [ + "type", + "schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "logs" + ], + "description": "The type of data source. Always `logs`.", + "x-stainless-const": true, + "default": "logs" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "object", + "unevaluatedProperties": {}, + "description": "The json schema for the run data source items.\n Learn how to build JSON schemas [here](https://json-schema.org/)." + } + }, + "description": "A LogsDataSourceConfig which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.\nThe schema returned by this data source config is used to defined what variables are available in your evals.\n`item` and `sample` are both defined when using this data source config.", + "title": "LogsDataSourceConfig", + "x-oaiMeta": { + "name": "The logs data source object for evals", + "group": "evals", + "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"language\": \"english\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n }\n}\n" + } + }, + "OpenAI.EvalResponsesSource": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "responses" + ], + "description": "The type of run data source. Always `responses`." + }, + "metadata": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": {} + }, + { + "type": "null" + } + ] + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "instructions_search": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_after": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "created_before": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "reasoning_effort": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ] + }, + "users": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "tools": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + }, + "description": "A EvalResponsesSource object describing a run data source configuration.", + "title": "EvalResponsesSource", + "x-oaiMeta": { + "name": "The run data source object used to configure an individual run", + "group": "eval runs", + "example": "{\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"users\": [\"user1\", \"user2\"],\n \"tools\": [\"tool1\", \"tool2\"],\n \"instructions_search\": \"You are a coding assistant\"\n}\n" + } + }, + "OpenAI.EvalRun": { + "type": "object", + "required": [ + "object", + "id", + "eval_id", + "status", + "model", + "name", + "created_at", + "report_url", + "result_counts", + "per_model_usage", + "per_testing_criteria_results", + "data_source", + "metadata", + "error" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "eval.run" + ], + "description": "The type of the object. Always \"eval.run\".", + "x-stainless-const": true, + "default": "eval.run" + }, + "id": { + "type": "string", + "description": "Unique identifier for the evaluation run." + }, + "eval_id": { + "type": "string", + "description": "The identifier of the associated evaluation." + }, + "status": { + "type": "string", + "description": "The status of the evaluation run." + }, + "model": { + "type": "string", + "description": "The model that is evaluated, if applicable." + }, + "name": { + "type": "string", + "description": "The name of the evaluation run." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) when the evaluation run was created." + }, + "report_url": { + "type": "string", + "format": "uri", + "description": "The URL to the rendered evaluation run report on the UI dashboard." + }, + "result_counts": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalRunResultCounts" + } + ], + "description": "Counters summarizing the outcomes of the evaluation run." + }, + "per_model_usage": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRunPerModelUsage" + }, + "description": "Usage statistics for each model during the evaluation run." + }, + "per_testing_criteria_results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults" + }, + "description": "Results per testing criteria applied during the evaluation run." + }, + "data_source": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource" + }, + { + "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource" + } + ], + "description": "Information about the run's data source." + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "error": { + "$ref": "#/components/schemas/OpenAI.EvalApiError" + } + }, + "description": "A schema representing an evaluation run.", + "title": "EvalRun", + "x-oaiMeta": { + "name": "The eval run object", + "group": "evals", + "example": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n" + } + }, + "OpenAI.EvalRunList": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of this object. It is always set to \"list\".", + "x-stainless-const": true, + "default": "list" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRun" + }, + "description": "An array of eval run objects." + }, + "first_id": { + "type": "string", + "description": "The identifier of the first eval run in the data array." + }, + "last_id": { + "type": "string", + "description": "The identifier of the last eval run in the data array." + }, + "has_more": { + "type": "boolean", + "description": "Indicates whether there are more evals available." + } + }, + "description": "An object representing a list of runs for an evaluation.", + "title": "EvalRunList", + "x-oaiMeta": { + "name": "The eval run list object", + "group": "evals", + "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67b7fbdad46c819092f6fe7a14189620\",\n \"eval_id\": \"eval_67b7fa9a81a88190ab4aa417e397ea21\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67b7fa9a81a88190ab4aa417e397ea21?run_id=evalrun_67b7fbdad46c819092f6fe7a14189620\",\n \"status\": \"completed\",\n \"model\": \"o3-mini\",\n \"name\": \"Academic Assistant\",\n \"created_at\": 1740110812,\n \"result_counts\": {\n \"total\": 171,\n \"errored\": 0,\n \"failed\": 80,\n \"passed\": 91\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": [\n {\n \"testing_criteria\": \"String check grader\",\n \"passed\": 91,\n \"failed\": 80\n }\n ],\n \"run_data_source\": {\n \"type\": \"completions\",\n \"template_messages\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"You are a helpful assistant.\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Hello, can you help me with my homework?\"\n }\n }\n ],\n \"datasource_reference\": null,\n \"model\": \"o3-mini\",\n \"max_completion_tokens\": null,\n \"seed\": null,\n \"temperature\": null,\n \"top_p\": null\n },\n \"error\": null,\n \"metadata\": {\"test\": \"synthetics\"}\n }\n ],\n \"first_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"last_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"has_more\": false\n}\n" + } + }, + "OpenAI.EvalRunOutputItem": { + "type": "object", + "required": [ + "object", + "id", + "run_id", + "eval_id", + "created_at", + "status", + "datasource_item_id", + "datasource_item", + "results", + "sample" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "eval.run.output_item" + ], + "description": "The type of the object. Always \"eval.run.output_item\".", + "x-stainless-const": true, + "default": "eval.run.output_item" + }, + "id": { + "type": "string", + "description": "Unique identifier for the evaluation run output item." + }, + "run_id": { + "type": "string", + "description": "The identifier of the evaluation run associated with this output item." + }, + "eval_id": { + "type": "string", + "description": "The identifier of the evaluation group." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) when the evaluation run was created." + }, + "status": { + "type": "string", + "description": "The status of the evaluation run." + }, + "datasource_item_id": { + "type": "integer", + "description": "The identifier for the data source item." + }, + "datasource_item": { + "type": "object", + "unevaluatedProperties": {}, + "description": "Details of the input data source item." + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemResult" + }, + "description": "A list of grader results for this output item." + }, + "sample": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSample" + } + ], + "description": "A sample containing the input and output of the evaluation run." + } + }, + "description": "A schema representing an evaluation run output item.", + "title": "EvalRunOutputItem", + "x-oaiMeta": { + "name": "The eval run output item object", + "group": "evals", + "example": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n" + } + }, + "OpenAI.EvalRunOutputItemList": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of this object. It is always set to \"list\".", + "x-stainless-const": true, + "default": "list" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItem" + }, + "description": "An array of eval run output item objects." + }, + "first_id": { + "type": "string", + "description": "The identifier of the first eval run output item in the data array." + }, + "last_id": { + "type": "string", + "description": "The identifier of the last eval run output item in the data array." + }, + "has_more": { + "type": "boolean", + "description": "Indicates whether there are more eval run output items available." + } + }, + "description": "An object representing a list of output items for an evaluation run.", + "title": "EvalRunOutputItemList", + "x-oaiMeta": { + "name": "The eval run output item list object", + "group": "evals", + "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n },\n ],\n \"first_id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"last_id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"has_more\": false\n}\n" + } + }, + "OpenAI.EvalRunOutputItemResult": { + "type": "object", + "required": [ + "name", + "score", + "passed" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the grader." + }, + "type": { + "type": "string", + "description": "The grader type (for example, \"string-check-grader\")." + }, + "score": { + "type": "number", + "description": "The numeric score produced by the grader." + }, + "passed": { + "type": "boolean", + "description": "Whether the grader considered the output a pass." + }, + "sample": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": {} + }, + { + "type": "null" + } + ], + "description": "Optional sample or intermediate data produced by the grader." + } + }, + "unevaluatedProperties": {}, + "description": "A single grader result for an evaluation run output item.", + "title": "EvalRunOutputItemResult" + }, + "OpenAI.EvalRunOutputItemSample": { + "type": "object", + "required": [ + "input", + "output", + "finish_reason", + "model", + "usage", + "error", + "temperature", + "max_completion_tokens", + "top_p", + "seed" + ], + "properties": { + "input": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleInput" + } + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleOutput" + } + }, + "finish_reason": { + "type": "string" + }, + "model": { + "type": "string" + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage" + }, + "error": { + "$ref": "#/components/schemas/OpenAI.EvalApiError" + }, + "temperature": { + "type": "number" + }, + "max_completion_tokens": { + "type": "integer" + }, + "top_p": { + "type": "number" + }, + "seed": { + "type": "integer" + } + } + }, + "OpenAI.EvalRunOutputItemSampleInput": { + "type": "object", + "required": [ + "role", + "content" + ], + "properties": { + "role": { + "type": "string" + }, + "content": { + "type": "string" + } + } + }, + "OpenAI.EvalRunOutputItemSampleOutput": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "content": { + "type": "string" + } + } + }, + "OpenAI.EvalRunOutputItemSampleUsage": { + "type": "object", + "required": [ + "total_tokens", + "completion_tokens", + "prompt_tokens", + "cached_tokens" + ], + "properties": { + "total_tokens": { + "type": "integer" + }, + "completion_tokens": { + "type": "integer" + }, + "prompt_tokens": { + "type": "integer" + }, + "cached_tokens": { + "type": "integer" + } + } + }, + "OpenAI.EvalRunPerModelUsage": { + "type": "object", + "required": [ + "model_name", + "invocation_count", + "prompt_tokens", + "completion_tokens", + "total_tokens", + "cached_tokens" + ], + "properties": { + "model_name": { + "type": "string", + "x-stainless-naming": { + "python": { + "property_name": "run_model_name" + } + } + }, + "invocation_count": { + "type": "integer" + }, + "prompt_tokens": { + "type": "integer" + }, + "completion_tokens": { + "type": "integer" + }, + "total_tokens": { + "type": "integer" + }, + "cached_tokens": { + "type": "integer" + } + } + }, + "OpenAI.EvalRunPerTestingCriteriaResults": { + "type": "object", + "required": [ + "testing_criteria", + "passed", + "failed" + ], + "properties": { + "testing_criteria": { + "type": "string" + }, + "passed": { + "type": "integer" + }, + "failed": { + "type": "integer" + } + } + }, + "OpenAI.EvalRunResultCounts": { + "type": "object", + "required": [ + "total", + "errored", + "failed", + "passed" + ], + "properties": { + "total": { + "type": "integer" + }, + "errored": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "passed": { + "type": "integer" + } + } + }, + "OpenAI.EvalStoredCompletionsDataSourceConfig": { + "type": "object", + "required": [ + "type", + "schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stored_completions" + ], + "description": "The type of data source. Always `stored_completions`.", + "x-stainless-const": true, + "default": "stored_completions" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "schema": { + "type": "object", + "unevaluatedProperties": {}, + "description": "The json schema for the run data source items.\n Learn how to build JSON schemas [here](https://json-schema.org/)." + } + }, + "description": "Deprecated in favor of LogsDataSourceConfig.", + "title": "StoredCompletionsDataSourceConfig", + "deprecated": true, + "x-oaiMeta": { + "name": "The stored completions data source object for evals", + "group": "evals", + "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"language\": \"english\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n }\n}\n" + } + }, + "OpenAI.EvalStoredCompletionsSource": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "stored_completions" + ], + "description": "The type of source. Always `stored_completions`.", + "x-stainless-const": true, + "default": "stored_completions" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_after": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "created_before": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "limit": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "description": "A StoredCompletionsRunDataSource configuration describing a set of filters", + "title": "StoredCompletionsRunDataSource", + "x-oaiMeta": { + "name": "The stored completions data source object used to configure an individual run", + "group": "eval runs", + "example": "{\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o\",\n \"created_after\": 1668124800,\n \"created_before\": 1668124900,\n \"limit\": 100,\n \"metadata\": {}\n}\n" + } + }, + "OpenAI.FileCitationBody": { + "type": "object", + "required": [ + "type", + "file_id", + "index", + "filename" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_citation" + ], + "description": "The type of the file citation. Always `file_citation`.", + "x-stainless-const": true, + "default": "file_citation" + }, + "file_id": { + "type": "string", + "description": "The ID of the file." + }, + "index": { + "type": "integer", + "description": "The index of the file in the list of files." + }, + "filename": { + "type": "string", + "description": "The filename of the file cited." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Annotation" + } + ], + "description": "A citation to a file.", + "title": "File citation" + }, + "OpenAI.FilePath": { + "type": "object", + "required": [ + "type", + "file_id", + "index" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_path" + ], + "description": "The type of the file path. Always `file_path`.", + "x-stainless-const": true + }, + "file_id": { + "type": "string", + "description": "The ID of the file." + }, + "index": { + "type": "integer", + "description": "The index of the file in the list of files." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Annotation" + } + ], + "description": "A path to a file.", + "title": "File path" + }, + "OpenAI.FileSearchRanker": { + "type": "string", + "enum": [ + "auto", + "default_2024_08_21" + ], + "description": "The ranker to use for the file search. If not specified will use the `auto` ranker." + }, + "OpenAI.FileSearchRankingOptions": { + "type": "object", + "required": [ + "score_threshold" + ], + "properties": { + "ranker": { + "$ref": "#/components/schemas/OpenAI.FileSearchRanker" + }, + "score_threshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1." + } + }, + "description": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\nSee the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", + "title": "File search tool call ranking options" + }, + "OpenAI.FileSearchTool": { + "type": "object", + "required": [ + "type", + "vector_store_ids" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_search" + ], + "description": "The type of the file search tool. Always `file_search`.", + "x-stainless-const": true, + "default": "file_search" + }, + "vector_store_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The IDs of the vector stores to search." + }, + "max_num_results": { + "type": "integer", + "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive." + }, + "ranking_options": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RankingOptions" + } + ], + "description": "Ranking options for search." + }, + "filters": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Filters" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).", + "title": "File search" + }, + "OpenAI.FileSearchToolCallResults": { + "type": "object", + "properties": { + "file_id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "attributes": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" + }, + { + "type": "null" + } + ] + }, + "score": { + "type": "number", + "format": "float" + } + } + }, + "OpenAI.Filters": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComparisonFilter" + }, + { + "$ref": "#/components/schemas/OpenAI.CompoundFilter" + } + ] + }, + "OpenAI.FineTuneDPOHyperparameters": { + "type": "object", + "properties": { + "beta": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ], + "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model." + }, + "batch_size": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", + "default": "auto" + }, + "learning_rate_multiplier": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ], + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." + }, + "n_epochs": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", + "default": "auto" + } + }, + "description": "The hyperparameters used for the DPO fine-tuning job." + }, + "OpenAI.FineTuneDPOMethod": { + "type": "object", + "properties": { + "hyperparameters": { + "$ref": "#/components/schemas/OpenAI.FineTuneDPOHyperparameters" + } + }, + "description": "Configuration for the DPO fine-tuning method." + }, + "OpenAI.FineTuneMethod": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "supervised", + "dpo", + "reinforcement" + ], + "description": "The type of method. Is either `supervised`, `dpo`, or `reinforcement`." + }, + "supervised": { + "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedMethod" + }, + "dpo": { + "$ref": "#/components/schemas/OpenAI.FineTuneDPOMethod" + }, + "reinforcement": { + "$ref": "#/components/schemas/AzureFineTuneReinforcementMethod" + } + }, + "description": "The method used for fine-tuning." + }, + "OpenAI.FineTuneReinforcementHyperparameters": { + "type": "object", + "properties": { + "batch_size": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", + "default": "auto" + }, + "learning_rate_multiplier": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ], + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." + }, + "n_epochs": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", + "default": "auto" + }, + "reasoning_effort": { + "type": "string", + "enum": [ + "default", + "low", + "medium", + "high" + ], + "description": "Level of reasoning effort.", + "default": "default" + }, + "compute_multiplier": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ], + "description": "Multiplier on amount of compute used for exploring search space during training." + }, + "eval_interval": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "The number of training steps between evaluation runs.", + "default": "auto" + }, + "eval_samples": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "Number of evaluation samples to generate per training step.", + "default": "auto" + } + }, + "description": "The hyperparameters used for the reinforcement fine-tuning job." + }, + "OpenAI.FineTuneSupervisedHyperparameters": { + "type": "object", + "properties": { + "batch_size": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", + "default": "auto" + }, + "learning_rate_multiplier": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ], + "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." + }, + "n_epochs": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", + "default": "auto" + } + }, + "description": "The hyperparameters used for the fine-tuning job." + }, + "OpenAI.FineTuneSupervisedMethod": { + "type": "object", + "properties": { + "hyperparameters": { + "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters" + } + }, + "description": "Configuration for the supervised fine-tuning method." + }, + "OpenAI.FineTuningCheckpointPermission": { + "type": "object", + "required": [ + "id", + "created_at", + "project_id", + "object" + ], + "properties": { + "id": { + "type": "string", + "description": "The permission identifier, which can be referenced in the API endpoints." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the permission was created." + }, + "project_id": { + "type": "string", + "description": "The project identifier that the permission is for." + }, + "object": { + "type": "string", + "enum": [ + "checkpoint.permission" + ], + "description": "The object type, which is always \"checkpoint.permission\".", + "x-stainless-const": true + } + }, + "description": "The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.", + "title": "FineTuningCheckpointPermission", + "x-oaiMeta": { + "name": "The fine-tuned model checkpoint permission object", + "example": "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1712211699,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n}\n" + } + }, + "OpenAI.FineTuningIntegration": { + "type": "object", + "required": [ + "type", + "wandb" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "wandb" + ], + "description": "The type of the integration being enabled for the fine-tuning job", + "x-stainless-const": true + }, + "wandb": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FineTuningIntegrationWandb" + } + ], + "description": "The settings for your integration with Weights and Biases. This payload specifies the project that\n metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\n to your run, and set a default entity (team, username, etc) to be associated with your run." + } + }, + "title": "Fine-Tuning Job Integration" + }, + "OpenAI.FineTuningIntegrationWandb": { + "type": "object", + "required": [ + "project" + ], + "properties": { + "project": { + "type": "string" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "entity": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "OpenAI.FineTuningJob": { + "type": "object", + "required": [ + "id", + "created_at", + "error", + "fine_tuned_model", + "finished_at", + "hyperparameters", + "model", + "object", + "organization_id", + "result_files", + "status", + "trained_tokens", + "training_file", + "validation_file", + "seed" + ], + "properties": { + "id": { + "type": "string", + "description": "The object identifier, which can be referenced in the API endpoints." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created." + }, + "error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.FineTuningJobError" + }, + { + "type": "null" + } + ] + }, + "fine_tuned_model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "finished_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "hyperparameters": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FineTuningJobHyperparameters" + } + ], + "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs." + }, + "model": { + "type": "string", + "description": "The base model that is being fine-tuned." + }, + "object": { + "type": "string", + "enum": [ + "fine_tuning.job" + ], + "description": "The object type, which is always \"fine_tuning.job\".", + "x-stainless-const": true + }, + "organization_id": { + "type": "string", + "description": "The organization that owns the fine-tuning job." + }, + "result_files": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents)." + }, + "status": { + "type": "string", + "enum": [ + "validating_files", + "queued", + "running", + "succeeded", + "failed", + "cancelled" + ], + "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`." + }, + "trained_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "training_file": { + "type": "string", + "description": "The file ID used for training. You can retrieve the training data with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents)." + }, + "validation_file": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "integrations": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FineTuningIntegration" + } + }, + { + "type": "null" + } + ] + }, + "seed": { + "type": "integer", + "description": "The seed used for the fine-tuning job." + }, + "estimated_finish": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "method": { + "$ref": "#/components/schemas/OpenAI.FineTuneMethod" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.", + "title": "FineTuningJob", + "x-oaiMeta": { + "name": "The fine-tuning job object", + "example": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n" + } + }, + "OpenAI.FineTuningJobCheckpoint": { + "type": "object", + "required": [ + "id", + "created_at", + "fine_tuned_model_checkpoint", + "step_number", + "metrics", + "fine_tuning_job_id", + "object" + ], + "properties": { + "id": { + "type": "string", + "description": "The checkpoint identifier, which can be referenced in the API endpoints." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the checkpoint was created." + }, + "fine_tuned_model_checkpoint": { + "type": "string", + "description": "The name of the fine-tuned checkpoint model that is created." + }, + "step_number": { + "type": "integer", + "description": "The step number that the checkpoint was created at." + }, + "metrics": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics" + } + ], + "description": "Metrics at the step number during the fine-tuning job." + }, + "fine_tuning_job_id": { + "type": "string", + "description": "The name of the fine-tuning job that this checkpoint was created from." + }, + "object": { + "type": "string", + "enum": [ + "fine_tuning.job.checkpoint" + ], + "description": "The object type, which is always \"fine_tuning.job.checkpoint\".", + "x-stainless-const": true + } + }, + "description": "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.", + "title": "FineTuningJobCheckpoint", + "x-oaiMeta": { + "name": "The fine-tuning job checkpoint object", + "example": "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n" + } + }, + "OpenAI.FineTuningJobCheckpointMetrics": { + "type": "object", + "properties": { + "step": { + "type": "number" + }, + "train_loss": { + "type": "number" + }, + "train_mean_token_accuracy": { + "type": "number" + }, + "valid_loss": { + "type": "number" + }, + "valid_mean_token_accuracy": { + "type": "number" + }, + "full_valid_loss": { + "type": "number" + }, + "full_valid_mean_token_accuracy": { + "type": "number" + } + } + }, + "OpenAI.FineTuningJobError": { + "type": "object", + "required": [ + "code", + "message", + "param" + ], + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.FineTuningJobEvent": { + "type": "object", + "required": [ + "object", + "id", + "created_at", + "level", + "message" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "fine_tuning.job.event" + ], + "description": "The object type, which is always \"fine_tuning.job.event\".", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The object identifier." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created." + }, + "level": { + "type": "string", + "enum": [ + "info", + "warn", + "error" + ], + "description": "The log level of the event." + }, + "message": { + "type": "string", + "description": "The message of the event." + }, + "type": { + "type": "string", + "enum": [ + "message", + "metrics" + ], + "description": "The type of event." + }, + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FineTuningJobEventData" + } + ], + "description": "The data associated with the event." + } + }, + "description": "Fine-tuning job event object", + "x-oaiMeta": { + "name": "The fine-tuning job event object", + "example": "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n" + } + }, + "OpenAI.FineTuningJobEventData": { + "type": "object" + }, + "OpenAI.FineTuningJobHyperparameters": { + "type": "object", + "properties": { + "batch_size": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": "auto" + }, + "learning_rate_multiplier": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number" + } + ] + }, + "n_epochs": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "integer" + } + ], + "default": "auto" + } + } + }, + "OpenAI.FunctionAndCustomToolCallOutput": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "input_text": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent", + "input_image": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent", + "input_file": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent" + } + } + }, + "OpenAI.FunctionAndCustomToolCallOutputInputFileContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_file" + ], + "description": "The type of the input item. Always `input_file`.", + "x-stainless-const": true, + "default": "input_file" + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "filename": { + "type": "string", + "description": "The name of the file to be sent to the model." + }, + "file_url": { + "type": "string", + "format": "uri", + "description": "The URL of the file to be sent to the model." + }, + "file_data": { + "type": "string", + "description": "The content of the file to be sent to the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" + } + ], + "description": "A file input to the model.", + "title": "Input file" + }, + "OpenAI.FunctionAndCustomToolCallOutputInputImageContent": { + "type": "object", + "required": [ + "type", + "detail" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "description": "The type of the input item. Always `input_image`.", + "x-stainless-const": true, + "default": "input_image" + }, + "image_url": { + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "detail": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ImageDetail" + } + ], + "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" + } + ], + "description": "An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).", + "title": "Input image" + }, + "OpenAI.FunctionAndCustomToolCallOutputInputTextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "description": "The type of the input item. Always `input_text`.", + "x-stainless-const": true, + "default": "input_text" + }, + "text": { + "type": "string", + "description": "The text input to the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" + } + ], + "description": "A text input to the model.", + "title": "Input text" + }, + "OpenAI.FunctionAndCustomToolCallOutputType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "input_text", + "input_image", + "input_file" + ] + } + ] + }, + "OpenAI.FunctionObject": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "description": { + "type": "string", + "description": "A description of what the function does, used by the model to choose when and how to call the function." + }, + "name": { + "type": "string", + "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." + }, + "parameters": { + "$ref": "#/components/schemas/OpenAI.FunctionParameters" + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.FunctionParameters": { + "type": "object", + "unevaluatedProperties": {}, + "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\nOmitting `parameters` defines a function with an empty parameter list." + }, + "OpenAI.FunctionShellAction": { + "type": "object", + "required": [ + "commands", + "timeout_ms", + "max_output_length" + ], + "properties": { + "commands": { + "type": "array", + "items": { + "type": "string" + } + }, + "timeout_ms": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "max_output_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "description": "Execute a shell command.", + "title": "Shell exec action" + }, + "OpenAI.FunctionShellCallOutputContent": { + "type": "object", + "required": [ + "stdout", + "stderr", + "outcome" + ], + "properties": { + "stdout": { + "type": "string", + "description": "The standard output that was captured." + }, + "stderr": { + "type": "string", + "description": "The standard error output that was captured." + }, + "outcome": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome" + } + ], + "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk." + }, + "created_by": { + "type": "string", + "description": "The identifier of the actor that created the item." + } + }, + "description": "The content of a shell tool call output that was emitted.", + "title": "Shell call output content" + }, + "OpenAI.FunctionShellCallOutputExitOutcome": { + "type": "object", + "required": [ + "type", + "exit_code" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "exit" + ], + "description": "The outcome type. Always `exit`.", + "x-stainless-const": true, + "default": "exit" + }, + "exit_code": { + "type": "integer", + "description": "Exit code from the shell process." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome" + } + ], + "description": "Indicates that the shell commands finished and returned an exit code.", + "title": "Shell call exit outcome" + }, + "OpenAI.FunctionShellCallOutputOutcome": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome", + "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome" + } + }, + "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.", + "title": "Shell call outcome" + }, + "OpenAI.FunctionShellCallOutputOutcomeType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "timeout", + "exit" + ] + } + ] + }, + "OpenAI.FunctionShellCallOutputTimeoutOutcome": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "timeout" + ], + "description": "The outcome type. Always `timeout`.", + "x-stainless-const": true, + "default": "timeout" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome" + } + ], + "description": "Indicates that the shell call exceeded its configured time limit.", + "title": "Shell call timeout outcome" + }, + "OpenAI.FunctionShellToolParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell" + ], + "description": "The type of the shell tool. Always `shell`.", + "x-stainless-const": true, + "default": "shell" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A tool that allows the model to execute shell commands.", + "title": "Shell tool" + }, + "OpenAI.FunctionTool": { + "type": "object", + "required": [ + "type", + "name", + "parameters", + "strict" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of the function tool. Always `function`.", + "x-stainless-const": true, + "default": "function" + }, + "name": { + "type": "string", + "description": "The name of the function to call." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "parameters": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": {} + }, + { + "type": "null" + } + ] + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).", + "title": "Function" + }, + "OpenAI.GraderMulti": { + "type": "object", + "required": [ + "type", + "name", + "graders", + "calculate_output" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "multi" + ], + "description": "The object type, which is always `multi`.", + "x-stainless-const": true, + "default": "multi" + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "graders": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.GraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderScoreModel" + }, + { + "$ref": "#/components/schemas/GraderEndpoint" + } + ] + }, + "calculate_output": { + "type": "string", + "description": "A formula to calculate the output based on grader results." + } + }, + "description": "A MultiGrader object combines the output of multiple graders to produce a single score.", + "title": "MultiGrader", + "x-oaiMeta": { + "name": "Multi Grader", + "group": "graders", + "example": "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n" + } + }, + "OpenAI.GraderPython": { + "type": "object", + "required": [ + "type", + "name", + "source" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "python" + ], + "description": "The object type, which is always `python`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "source": { + "type": "string", + "description": "The source code of the python script." + }, + "image_tag": { + "type": "string", + "description": "The image tag to use for the python script." + } + }, + "description": "A PythonGrader object that runs a python script on the input.", + "title": "PythonGrader", + "x-oaiMeta": { + "name": "Python Grader", + "group": "graders", + "example": "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n" + } + }, + "OpenAI.GraderScoreModel": { + "type": "object", + "required": [ + "type", + "name", + "model", + "input" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "score_model" + ], + "description": "The object type, which is always `score_model`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "model": { + "type": "string", + "description": "The model to use for the evaluation." + }, + "sampling_params": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams" + } + ], + "description": "The sampling parameters for the model." + }, + "input": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.EvalItem" + }, + "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings." + }, + "range": { + "type": "array", + "items": { + "type": "number" + }, + "description": "The range of the score. Defaults to `[0, 1]`." + } + }, + "description": "A ScoreModelGrader object that uses a model to assign a score to the input.", + "title": "ScoreModelGrader", + "x-oaiMeta": { + "name": "Score Model Grader", + "group": "graders", + "example": "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\n\n\"\n \" Reference answer: {{item.label}}\n\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n" + } + }, + "OpenAI.GraderStringCheck": { + "type": "object", + "required": [ + "type", + "name", + "input", + "reference", + "operation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "string_check" + ], + "description": "The object type, which is always `string_check`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "input": { + "type": "string", + "description": "The input text. This may include template strings." + }, + "reference": { + "type": "string", + "description": "The reference text. This may include template strings." + }, + "operation": { + "type": "string", + "enum": [ + "eq", + "ne", + "like", + "ilike" + ], + "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`." + } + }, + "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.", + "title": "StringCheckGrader", + "x-oaiMeta": { + "name": "String Check Grader", + "group": "graders", + "example": "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n" + } + }, + "OpenAI.GraderTextSimilarity": { + "type": "object", + "required": [ + "type", + "name", + "input", + "reference", + "evaluation_metric" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text_similarity" + ], + "description": "The type of grader.", + "x-stainless-const": true, + "default": "text_similarity" + }, + "name": { + "type": "string", + "description": "The name of the grader." + }, + "input": { + "type": "string", + "description": "The text being graded." + }, + "reference": { + "type": "string", + "description": "The text being graded against." + }, + "evaluation_metric": { + "type": "string", + "enum": [ + "cosine", + "fuzzy_match", + "bleu", + "gleu", + "meteor", + "rouge_1", + "rouge_2", + "rouge_3", + "rouge_4", + "rouge_5", + "rouge_l" + ], + "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`." + } + }, + "description": "A TextSimilarityGrader object which grades text based on similarity metrics.", + "title": "TextSimilarityGrader", + "x-oaiMeta": { + "name": "Text Similarity Grader", + "group": "graders", + "example": "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n" + } + }, + "OpenAI.GrammarSyntax1": { + "type": "string", + "enum": [ + "lark", + "regex" + ] + }, + "OpenAI.HybridSearchOptions": { + "type": "object", + "required": [ + "embedding_weight", + "text_weight" + ], + "properties": { + "embedding_weight": { + "type": "number", + "description": "The weight of the embedding in the reciprocal ranking fusion." + }, + "text_weight": { + "type": "number", + "description": "The weight of the text in the reciprocal ranking fusion." + } + } + }, + "OpenAI.ImageDetail": { + "type": "string", + "enum": [ + "low", + "high", + "auto" + ] + }, + "OpenAI.ImageGenTool": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_generation" + ], + "description": "The type of the image generation tool. Always `image_generation`.", + "x-stainless-const": true, + "default": "image_generation" + }, + "model": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "gpt-image-1", + "gpt-image-1-mini" + ] + } + ], + "default": "gpt-image-1" + }, + "quality": { + "type": "string", + "enum": [ + "low", + "medium", + "high", + "auto" + ], + "description": "The quality of the generated image. One of `low`, `medium`, `high`,\n or `auto`. Default: `auto`.", + "default": "auto" + }, + "size": { + "type": "string", + "enum": [ + "1024x1024", + "1024x1536", + "1536x1024", + "auto" + ], + "description": "The size of the generated image. One of `1024x1024`, `1024x1536`,\n `1536x1024`, or `auto`. Default: `auto`.", + "default": "auto" + }, + "output_format": { + "type": "string", + "enum": [ + "png", + "webp", + "jpeg" + ], + "description": "The output format of the generated image. One of `png`, `webp`, or\n `jpeg`. Default: `png`.", + "default": "png" + }, + "output_compression": { + "type": "integer", + "minimum": 0, + "maximum": 100, + "description": "Compression level for the output image. Default: 100.", + "default": 100 + }, + "moderation": { + "type": "string", + "enum": [ + "auto", + "low" + ], + "description": "Moderation level for the generated image. Default: `auto`.", + "default": "auto" + }, + "background": { + "type": "string", + "enum": [ + "transparent", + "opaque", + "auto" + ], + "description": "Background type for the generated image. One of `transparent`,\n `opaque`, or `auto`. Default: `auto`.", + "default": "auto" + }, + "input_fidelity": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputFidelity" + }, + { + "type": "null" + } + ] + }, + "input_image_mask": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ImageGenToolInputImageMask" + } + ], + "description": "Optional mask for inpainting. Contains `image_url`\n (string, optional) and `file_id` (string, optional)." + }, + "partial_images": { + "type": "integer", + "minimum": 0, + "maximum": 3, + "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A tool that generates images using the GPT image models.", + "title": "Image generation tool" + }, + "OpenAI.ImageGenToolInputImageMask": { + "type": "object", + "properties": { + "image_url": { + "type": "string" + }, + "file_id": { + "type": "string" + } + } + }, + "OpenAI.IncludeEnum": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "file_search_call.results", + "web_search_call.results", + "web_search_call.action.sources", + "message.input_image.image_url", + "computer_call_output.output.image_url", + "code_interpreter_call.outputs", + "reasoning.encrypted_content", + "message.output_text.logprobs" + ] + } + ], + "description": "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program)." + }, + "OpenAI.InputAudio": { + "type": "object", + "required": [ + "type", + "input_audio" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_audio" + ], + "description": "The type of the input item. Always `input_audio`.", + "x-stainless-const": true + }, + "input_audio": { + "$ref": "#/components/schemas/OpenAI.InputAudioInputAudio" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" + } + ], + "description": "An audio input to the model.", + "title": "Input audio" + }, + "OpenAI.InputAudioInputAudio": { + "type": "object", + "required": [ + "data", + "format" + ], + "properties": { + "data": { + "type": "string" + }, + "format": { + "type": "string", + "enum": [ + "mp3", + "wav" + ] + } + } + }, + "OpenAI.InputContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.InputContentType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "input_text": "#/components/schemas/OpenAI.InputContentInputTextContent", + "input_image": "#/components/schemas/OpenAI.InputContentInputImageContent", + "input_file": "#/components/schemas/OpenAI.InputContentInputFileContent" + } + } + }, + "OpenAI.InputContentInputFileContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_file" + ], + "description": "The type of the input item. Always `input_file`.", + "x-stainless-const": true, + "default": "input_file" + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "filename": { + "type": "string", + "description": "The name of the file to be sent to the model." + }, + "file_url": { + "type": "string", + "format": "uri", + "description": "The URL of the file to be sent to the model." + }, + "file_data": { + "type": "string", + "description": "The content of the file to be sent to the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputContent" + } + ], + "description": "A file input to the model.", + "title": "Input file" + }, + "OpenAI.InputContentInputImageContent": { + "type": "object", + "required": [ + "type", + "detail" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "description": "The type of the input item. Always `input_image`.", + "x-stainless-const": true, + "default": "input_image" + }, + "image_url": { + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "detail": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ImageDetail" + } + ], + "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputContent" + } + ], + "description": "An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).", + "title": "Input image" + }, + "OpenAI.InputContentInputTextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "description": "The type of the input item. Always `input_text`.", + "x-stainless-const": true, + "default": "input_text" + }, + "text": { + "type": "string", + "description": "The text input to the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputContent" + } + ], + "description": "A text input to the model.", + "title": "Input text" + }, + "OpenAI.InputContentType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "input_text", + "input_image", + "input_file" + ] + } + ] + }, + "OpenAI.InputFidelity": { + "type": "string", + "enum": [ + "high", + "low" + ], + "description": "Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`." + }, + "OpenAI.InputFileContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_file" + ], + "description": "The type of the input item. Always `input_file`.", + "x-stainless-const": true, + "default": "input_file" + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "filename": { + "type": "string", + "description": "The name of the file to be sent to the model." + }, + "file_url": { + "type": "string", + "format": "uri", + "description": "The URL of the file to be sent to the model." + }, + "file_data": { + "type": "string", + "description": "The content of the file to be sent to the model." + } + }, + "description": "A file input to the model.", + "title": "Input file" + }, + "OpenAI.InputImageContent": { + "type": "object", + "required": [ + "type", + "detail" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_image" + ], + "description": "The type of the input item. Always `input_image`.", + "x-stainless-const": true, + "default": "input_image" + }, + "image_url": { + "anyOf": [ + { + "type": "string", + "format": "uri" + }, + { + "type": "null" + } + ] + }, + "file_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "detail": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ImageDetail" + } + ], + "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." + } + }, + "description": "An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).", + "title": "Input image" + }, + "OpenAI.InputItem": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.InputItemType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "message": "#/components/schemas/OpenAI.EasyInputMessage", + "item_reference": "#/components/schemas/OpenAI.ItemReferenceParam" + } + } + }, + "OpenAI.InputItemType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "message", + "item_reference" + ] + } + ] + }, + "OpenAI.InputMessageContentList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputContent" + }, + "description": "A list of one or many input items to the model, containing different content\ntypes.", + "title": "Input item content list" + }, + "OpenAI.InputMessageResource": { + "type": "object", + "required": [ + "type", + "role", + "content", + "id" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "message" + ], + "description": "The type of the message input. Always set to `message`.", + "x-stainless-const": true + }, + "role": { + "type": "string", + "enum": [ + "user", + "system", + "developer" + ], + "description": "The role of the message input. One of `user`, `system`, or `developer`." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + }, + "content": { + "$ref": "#/components/schemas/OpenAI.InputMessageContentList" + }, + "id": { + "type": "string", + "description": "The unique ID of the message input." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ] + }, + "OpenAI.InputParam": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + } + ], + "description": "Text, image, or file inputs to the model, used to generate a response.\nLearn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Image inputs](https://platform.openai.com/docs/guides/images)\n- [File inputs](https://platform.openai.com/docs/guides/pdf-files)\n- [Conversation state](https://platform.openai.com/docs/guides/conversation-state)\n- [Function calling](https://platform.openai.com/docs/guides/function-calling)" + }, + "OpenAI.InputTextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "input_text" + ], + "description": "The type of the input item. Always `input_text`.", + "x-stainless-const": true, + "default": "input_text" + }, + "text": { + "type": "string", + "description": "The text input to the model." + } + }, + "description": "A text input to the model.", + "title": "Input text" + }, + "OpenAI.ItemReferenceParam": { + "type": "object", + "required": [ + "type", + "id" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "item_reference" + ], + "description": "The type of item to reference. Always `item_reference`.", + "x-stainless-const": true, + "default": "item_reference" + }, + "id": { + "type": "string", + "description": "The ID of the item to reference." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + ], + "description": "An internal identifier for an item to reference.", + "title": "Item reference" + }, + "OpenAI.ItemResource": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ItemResourceType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "message": "#/components/schemas/OpenAI.InputMessageResource", + "output_message": "#/components/schemas/OpenAI.ItemResourceOutputMessage", + "file_search_call": "#/components/schemas/OpenAI.ItemResourceFileSearchToolCall", + "computer_call": "#/components/schemas/OpenAI.ItemResourceComputerToolCall", + "computer_call_output": "#/components/schemas/OpenAI.ItemResourceComputerToolCallOutputResource", + "web_search_call": "#/components/schemas/OpenAI.ItemResourceWebSearchToolCall", + "function_call": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallResource", + "function_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutputResource", + "image_generation_call": "#/components/schemas/OpenAI.ItemResourceImageGenToolCall", + "code_interpreter_call": "#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall", + "local_shell_call": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCall", + "local_shell_call_output": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput", + "shell_call": "#/components/schemas/OpenAI.ItemResourceFunctionShellCall", + "shell_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput", + "apply_patch_call": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall", + "apply_patch_call_output": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput", + "mcp_list_tools": "#/components/schemas/OpenAI.ItemResourceMcpListTools", + "mcp_approval_request": "#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest", + "mcp_approval_response": "#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource", + "mcp_call": "#/components/schemas/OpenAI.ItemResourceMcpToolCall" + } + }, + "description": "Content item used to generate a response." + }, + "OpenAI.ItemResourceApplyPatchToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "status", + "operation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch_call" + ], + "description": "The type of the item. Always `apply_patch_call`.", + "x-stainless-const": true, + "default": "apply_patch_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the apply patch tool call generated by the model." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus" + } + ], + "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." + }, + "operation": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" + } + ], + "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A tool call that applies file diffs by creating, deleting, or updating files.", + "title": "Apply patch tool call" + }, + "OpenAI.ItemResourceApplyPatchToolCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch_call_output" + ], + "description": "The type of the item. Always `apply_patch_call_output`.", + "x-stainless-const": true, + "default": "apply_patch_call_output" + }, + "id": { + "type": "string", + "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the apply patch tool call generated by the model." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus" + } + ], + "description": "The status of the apply patch tool call output. One of `completed` or `failed`." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call output." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "The output emitted by an apply patch tool call.", + "title": "Apply patch tool call output" + }, + "OpenAI.ItemResourceCodeInterpreterToolCall": { + "type": "object", + "required": [ + "type", + "id", + "status", + "container_id", + "code", + "outputs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "code_interpreter_call" + ], + "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.", + "x-stainless-const": true, + "default": "code_interpreter_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the code interpreter tool call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete", + "interpreting", + "failed" + ], + "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." + }, + "container_id": { + "type": "string", + "description": "The ID of the container used to run the code." + }, + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs" + }, + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage" + } + ] + } + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A tool call to run code.", + "title": "Code interpreter tool call" + }, + "OpenAI.ItemResourceComputerToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "pending_safety_checks", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_call" + ], + "description": "The type of the computer call. Always `computer_call`.", + "default": "computer_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the computer call." + }, + "call_id": { + "type": "string", + "description": "An identifier used when responding to the tool call with output." + }, + "action": { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + }, + "pending_safety_checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" + }, + "description": "The pending safety checks for the computer call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.", + "title": "Computer tool call" + }, + "OpenAI.ItemResourceComputerToolCallOutputResource": { + "type": "object", + "required": [ + "type", + "call_id", + "output" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_call_output" + ], + "description": "The type of the computer tool call output. Always `computer_call_output`.", + "x-stainless-const": true, + "default": "computer_call_output" + }, + "id": { + "type": "string", + "description": "The ID of the computer tool call output." + }, + "call_id": { + "type": "string", + "description": "The ID of the computer tool call that produced the output." + }, + "acknowledged_safety_checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" + }, + "description": "The safety checks reported by the API that have been acknowledged by the\n developer." + }, + "output": { + "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage" + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ] + }, + "OpenAI.ItemResourceFileSearchToolCall": { + "type": "object", + "required": [ + "id", + "type", + "status", + "queries" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the file search tool call." + }, + "type": { + "type": "string", + "enum": [ + "file_search_call" + ], + "description": "The type of the file search tool call. Always `file_search_call`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "searching", + "completed", + "incomplete", + "failed" + ], + "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`," + }, + "queries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The queries used to search for files." + }, + "results": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults" + } + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.", + "title": "File search tool call" + }, + "OpenAI.ItemResourceFunctionShellCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell_call" + ], + "description": "The type of the item. Always `shell_call`.", + "x-stainless-const": true, + "default": "shell_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the shell tool call. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the shell tool call generated by the model." + }, + "action": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionShellAction" + } + ], + "description": "The shell commands and limits that describe how to run the tool call." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.LocalShellCallStatus" + } + ], + "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A tool call that executes one or more shell commands in a managed environment.", + "title": "Shell tool call" + }, + "OpenAI.ItemResourceFunctionShellCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "output", + "max_output_length" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell_call_output" + ], + "description": "The type of the shell call output. Always `shell_call_output`.", + "x-stainless-const": true, + "default": "shell_call_output" + }, + "id": { + "type": "string", + "description": "The unique ID of the shell call output. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the shell tool call generated by the model." + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent" + }, + "description": "An array of shell call output contents" + }, + "max_output_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "string", + "description": "The identifier of the actor that created the item." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "The output of a shell tool call that was emitted.", + "title": "Shell call output" + }, + "OpenAI.ItemResourceFunctionToolCallOutputResource": { + "type": "object", + "required": [ + "type", + "call_id", + "output" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API." + }, + "type": { + "type": "string", + "enum": [ + "function_call_output" + ], + "description": "The type of the function tool call output. Always `function_call_output`.", + "x-stainless-const": true + }, + "call_id": { + "type": "string", + "description": "The unique ID of the function tool call generated by the model." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" + } + } + ], + "description": "The output from the function call generated by your code.\n Can be a string or an list of output content." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ] + }, + "OpenAI.ItemResourceFunctionToolCallResource": { + "type": "object", + "required": [ + "type", + "call_id", + "name", + "arguments" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the function tool call." + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "description": "The type of the function tool call. Always `function_call`.", + "x-stainless-const": true + }, + "call_id": { + "type": "string", + "description": "The unique ID of the function tool call generated by the model." + }, + "name": { + "type": "string", + "description": "The name of the function to run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of the arguments to pass to the function." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ] + }, + "OpenAI.ItemResourceImageGenToolCall": { + "type": "object", + "required": [ + "type", + "id", + "status", + "result" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "description": "The type of the image generation call. Always `image_generation_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the image generation call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "generating", + "failed" + ], + "description": "The status of the image generation call." + }, + "result": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "An image generation request made by the model.", + "title": "Image generation call" + }, + "OpenAI.ItemResourceLocalShellToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "description": "The type of the local shell call. Always `local_shell_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the local shell call." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the local shell tool call generated by the model." + }, + "action": { + "$ref": "#/components/schemas/OpenAI.LocalShellExecAction" + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the local shell call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A tool call to run a command on the local shell.", + "title": "Local shell call" + }, + "OpenAI.ItemResourceLocalShellToolCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "output" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local_shell_call_output" + ], + "description": "The type of the local shell tool call output. Always `local_shell_call_output`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the local shell tool call generated by the model." + }, + "output": { + "type": "string", + "description": "A JSON string of the output of the local shell tool call." + }, + "status": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ] + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "The output of a local shell tool call.", + "title": "Local shell call output" + }, + "OpenAI.ItemResourceMcpApprovalRequest": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "name", + "arguments" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_approval_request" + ], + "description": "The type of the item. Always `mcp_approval_request`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the approval request." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server making the request." + }, + "name": { + "type": "string", + "description": "The name of the tool to run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of arguments for the tool." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A request for human approval of a tool invocation.", + "title": "MCP approval request" + }, + "OpenAI.ItemResourceMcpApprovalResponseResource": { + "type": "object", + "required": [ + "type", + "id", + "approval_request_id", + "approve" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_approval_response" + ], + "description": "The type of the item. Always `mcp_approval_response`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the approval response" + }, + "approval_request_id": { + "type": "string", + "description": "The ID of the approval request being answered." + }, + "approve": { + "type": "boolean", + "description": "Whether the request was approved." + }, + "reason": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A response to an MCP approval request.", + "title": "MCP approval response" + }, + "OpenAI.ItemResourceMcpListTools": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "tools" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_list_tools" + ], + "description": "The type of the item. Always `mcp_list_tools`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the list." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.MCPListToolsTool" + }, + "description": "The tools available on the server." + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "A list of tools available on an MCP server.", + "title": "MCP list tools" + }, + "OpenAI.ItemResourceMcpToolCall": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "name", + "arguments" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_call" + ], + "description": "The type of the item. Always `mcp_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the tool call." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server running the tool." + }, + "name": { + "type": "string", + "description": "The name of the tool that was run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of the arguments passed to the tool." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus" + } + ], + "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`." + }, + "approval_request_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "An invocation of a tool on an MCP server.", + "title": "MCP tool call" + }, + "OpenAI.ItemResourceOutputMessage": { + "type": "object", + "required": [ + "id", + "type", + "role", + "content", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the output message.", + "x-stainless-go-json": "omitzero" + }, + "type": { + "type": "string", + "enum": [ + "output_message" + ], + "description": "The type of the output message. Always `message`.", + "x-stainless-const": true + }, + "role": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "The role of the output message. Always `assistant`.", + "x-stainless-const": true + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OutputMessageContent" + }, + "description": "The content of the output message." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "An output message from the model.", + "title": "Output message" + }, + "OpenAI.ItemResourceType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "message", + "output_message", + "file_search_call", + "computer_call", + "computer_call_output", + "web_search_call", + "function_call", + "function_call_output", + "image_generation_call", + "code_interpreter_call", + "local_shell_call", + "local_shell_call_output", + "shell_call", + "shell_call_output", + "apply_patch_call", + "apply_patch_call_output", + "mcp_list_tools", + "mcp_approval_request", + "mcp_approval_response", + "mcp_call" + ] + } + ] + }, + "OpenAI.ItemResourceWebSearchToolCall": { + "type": "object", + "required": [ + "id", + "type", + "status", + "action" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the web search tool call." + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "description": "The type of the web search tool call. Always `web_search_call`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "searching", + "completed", + "failed" + ], + "description": "The status of the web search tool call." + }, + "action": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch" + }, + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage" + }, + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionFind" + } + ], + "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find)." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ItemResource" + } + ], + "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.", + "title": "Web search tool call" + }, + "OpenAI.KeyPressAction": { + "type": "object", + "required": [ + "type", + "keys" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "keypress" + ], + "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`.", + "x-stainless-const": true, + "default": "keypress" + }, + "keys": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A collection of keypresses the model would like to perform.", + "title": "KeyPress" + }, + "OpenAI.ListBatchesResponse": { + "type": "object", + "required": [ + "data", + "has_more", + "object" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Batch" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.ListFilesResponse": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OpenAIFile" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListFineTuningCheckpointPermissionResponse": { + "type": "object", + "required": [ + "data", + "object", + "has_more" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FineTuningCheckpointPermission" + } + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "x-stainless-const": true + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListFineTuningJobCheckpointsResponse": { + "type": "object", + "required": [ + "data", + "object", + "has_more" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpoint" + } + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "x-stainless-const": true + }, + "first_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "last_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListFineTuningJobEventsResponse": { + "type": "object", + "required": [ + "data", + "object", + "has_more" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FineTuningJobEvent" + } + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "x-stainless-const": true + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListMessagesResponse": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.MessageObject" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListModelsResponse": { + "type": "object", + "required": [ + "object", + "data" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "x-stainless-const": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Model" + } + } + } + }, + "OpenAI.ListPaginatedFineTuningJobsResponse": { + "type": "object", + "required": [ + "data", + "has_more", + "object" + ], + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FineTuningJob" + } + }, + "has_more": { + "type": "boolean" + }, + "object": { + "type": "string", + "enum": [ + "list" + ], + "x-stainless-const": true + } + } + }, + "OpenAI.ListRunStepsResponse": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RunStepObject" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListRunsResponse": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RunObject" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListVectorStoreFilesResponse": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.ListVectorStoresResponse": { + "type": "object", + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ], + "properties": { + "object": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.VectorStoreObject" + } + }, + "first_id": { + "type": "string" + }, + "last_id": { + "type": "string" + }, + "has_more": { + "type": "boolean" + } + } + }, + "OpenAI.LocalShellCallStatus": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ] + }, + "OpenAI.LocalShellExecAction": { + "type": "object", + "required": [ + "type", + "command", + "env" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "exec" + ], + "description": "The type of the local shell action. Always `exec`.", + "x-stainless-const": true, + "default": "exec" + }, + "command": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The command to run." + }, + "timeout_ms": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "working_directory": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "env": { + "type": "object", + "unevaluatedProperties": { + "type": "string" + }, + "description": "Environment variables to set for the command.", + "x-oaiTypeLabel": "map" + }, + "user": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "description": "Execute a shell command on the server.", + "title": "Local shell exec action" + }, + "OpenAI.LocalShellToolParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local_shell" + ], + "description": "The type of the local shell tool. Always `local_shell`.", + "x-stainless-const": true, + "default": "local_shell" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "A tool that allows the model to execute shell commands in a local environment.", + "title": "Local shell tool" + }, + "OpenAI.LogProb": { + "type": "object", + "required": [ + "token", + "logprob", + "bytes", + "top_logprobs" + ], + "properties": { + "token": { + "type": "string" + }, + "logprob": { + "type": "number" + }, + "bytes": { + "type": "array", + "items": { + "type": "integer" + } + }, + "top_logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.TopLogProb" + } + } + }, + "description": "The log probability of a token.", + "title": "Log probability" + }, + "OpenAI.MCPListToolsTool": { + "type": "object", + "required": [ + "name", + "input_schema" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the tool." + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "input_schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MCPListToolsToolInputSchema" + } + ], + "description": "The JSON schema describing the tool's input." + }, + "annotations": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.MCPListToolsToolAnnotations" + }, + { + "type": "null" + } + ] + } + }, + "description": "A tool available on an MCP server.", + "title": "MCP list tools tool" + }, + "OpenAI.MCPListToolsToolAnnotations": { + "type": "object" + }, + "OpenAI.MCPListToolsToolInputSchema": { + "type": "object" + }, + "OpenAI.MCPTool": { + "type": "object", + "required": [ + "type", + "server_label" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp" + ], + "description": "The type of the MCP tool. Always `mcp`.", + "x-stainless-const": true + }, + "server_label": { + "type": "string", + "description": "A label for this MCP server, used to identify it in tool calls." + }, + "server_url": { + "type": "string", + "format": "uri", + "description": "The URL for the MCP server. One of `server_url` or `connector_id` must be\n provided." + }, + "connector_id": { + "type": "string", + "enum": [ + "connector_dropbox", + "connector_gmail", + "connector_googlecalendar", + "connector_googledrive", + "connector_microsoftteams", + "connector_outlookcalendar", + "connector_outlookemail", + "connector_sharepoint" + ], + "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url` or `connector_id` must be provided. Learn more about service\n connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`" + }, + "authorization": { + "type": "string", + "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here." + }, + "server_description": { + "type": "string", + "description": "Optional description of the MCP server, used to provide more context." + }, + "headers": { + "anyOf": [ + { + "type": "object", + "unevaluatedProperties": { + "type": "string" + } + }, + { + "type": "null" + } + ] + }, + "allowed_tools": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "$ref": "#/components/schemas/OpenAI.MCPToolFilter" + }, + { + "type": "null" + } + ] + }, + "require_approval": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval" + }, + { + "type": "string", + "enum": [ + "always", + "never" + ] + }, + { + "type": "null" + } + ], + "default": "always" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).", + "title": "MCP tool" + }, + "OpenAI.MCPToolCallStatus": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete", + "calling", + "failed" + ] + }, + "OpenAI.MCPToolFilter": { + "type": "object", + "properties": { + "tool_names": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of allowed tool names.", + "title": "MCP allowed tools" + }, + "read_only": { + "type": "boolean", + "description": "Indicates whether or not a tool modifies data or is read-only. If an\n MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\n it will match this filter." + } + }, + "description": "A filter object to specify which tools are allowed.", + "title": "MCP tool filter" + }, + "OpenAI.MCPToolRequireApproval": { + "type": "object", + "properties": { + "always": { + "$ref": "#/components/schemas/OpenAI.MCPToolFilter" + }, + "never": { + "$ref": "#/components/schemas/OpenAI.MCPToolFilter" + } + } + }, + "OpenAI.MessageContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.MessageContentType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "image_url": "#/components/schemas/OpenAI.MessageContentImageUrlObject", + "text": "#/components/schemas/OpenAI.MessageContentTextObject", + "refusal": "#/components/schemas/OpenAI.MessageContentRefusalObject" + } + } + }, + "OpenAI.MessageContentImageFileObject": { + "type": "object", + "required": [ + "type", + "image_file" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_file" + ], + "description": "Always `image_file`.", + "x-stainless-const": true + }, + "image_file": { + "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageContent" + } + ], + "description": "References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message.", + "title": "Image file" + }, + "OpenAI.MessageContentImageFileObjectImageFile": { + "type": "object", + "required": [ + "file_id" + ], + "properties": { + "file_id": { + "type": "string" + }, + "detail": { + "type": "string", + "enum": [ + "auto", + "low", + "high" + ], + "default": "auto" + } + } + }, + "OpenAI.MessageContentImageUrlObject": { + "type": "object", + "required": [ + "type", + "image_url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_url" + ], + "description": "The type of the content part.", + "x-stainless-const": true + }, + "image_url": { + "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageContent" + } + ], + "description": "References an image URL in the content of a message.", + "title": "Image URL" + }, + "OpenAI.MessageContentImageUrlObjectImageUrl": { + "type": "object", + "required": [ + "url" + ], + "properties": { + "url": { + "type": "string", + "format": "uri" + }, + "detail": { + "type": "string", + "enum": [ + "auto", + "low", + "high" + ], + "default": "auto" + } + } + }, + "OpenAI.MessageContentRefusalObject": { + "type": "object", + "required": [ + "type", + "refusal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "refusal" + ], + "description": "Always `refusal`.", + "x-stainless-const": true + }, + "refusal": { + "type": "string" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageContent" + } + ], + "description": "The refusal content generated by the assistant.", + "title": "Refusal" + }, + "OpenAI.MessageContentTextAnnotationsFileCitationObject": { + "type": "object", + "required": [ + "type", + "text", + "file_citation", + "start_index", + "end_index" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_citation" + ], + "description": "Always `file_citation`.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "The text in the message content that needs to be replaced." + }, + "file_citation": { + "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation" + }, + "start_index": { + "type": "integer", + "minimum": 0 + }, + "end_index": { + "type": "integer", + "minimum": 0 + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.TextAnnotation" + } + ], + "description": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", + "title": "File citation" + }, + "OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation": { + "type": "object", + "required": [ + "file_id" + ], + "properties": { + "file_id": { + "type": "string" + } + } + }, + "OpenAI.MessageContentTextAnnotationsFilePathObject": { + "type": "object", + "required": [ + "type", + "text", + "file_path", + "start_index", + "end_index" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_path" + ], + "description": "Always `file_path`.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "The text in the message content that needs to be replaced." + }, + "file_path": { + "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath" + }, + "start_index": { + "type": "integer", + "minimum": 0 + }, + "end_index": { + "type": "integer", + "minimum": 0 + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.TextAnnotation" + } + ], + "description": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", + "title": "File path" + }, + "OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath": { + "type": "object", + "required": [ + "file_id" + ], + "properties": { + "file_id": { + "type": "string" + } + } + }, + "OpenAI.MessageContentTextObject": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "Always `text`.", + "x-stainless-const": true + }, + "text": { + "$ref": "#/components/schemas/OpenAI.MessageContentTextObjectText" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageContent" + } + ], + "description": "The text content that is part of a message.", + "title": "Text" + }, + "OpenAI.MessageContentTextObjectText": { + "type": "object", + "required": [ + "value", + "annotations" + ], + "properties": { + "value": { + "type": "string" + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.TextAnnotation" + } + } + } + }, + "OpenAI.MessageContentType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "image_file", + "image_url", + "text", + "refusal" + ] + } + ] + }, + "OpenAI.MessageObject": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "thread_id", + "status", + "incomplete_details", + "completed_at", + "incomplete_at", + "role", + "content", + "assistant_id", + "run_id", + "attachments", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "thread.message" + ], + "description": "The object type, which is always `thread.message`.", + "x-stainless-const": true + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the message was created." + }, + "thread_id": { + "type": "string", + "description": "The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "incomplete", + "completed" + ], + "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`." + }, + "incomplete_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.MessageObjectIncompleteDetails" + }, + { + "type": "null" + } + ] + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "incomplete_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "role": { + "type": "string", + "enum": [ + "user", + "assistant" + ], + "description": "The entity that produced the message. One of `user` or `assistant`." + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.MessageContent" + }, + "description": "The content of the message in array of text and/or images." + }, + "assistant_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "run_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "attachments": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.MessageObjectAttachments" + } + }, + { + "type": "null" + } + ] + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "description": "Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads).", + "title": "The message object", + "x-oaiMeta": { + "name": "The message object", + "beta": true, + "example": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1698983503,\n \"thread_id\": \"thread_abc123\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"Hi! How can I help you today?\",\n \"annotations\": []\n }\n }\n ],\n \"assistant_id\": \"asst_abc123\",\n \"run_id\": \"run_abc123\",\n \"attachments\": [],\n \"metadata\": {}\n}\n" + } + }, + "OpenAI.MessageObjectAttachments": { + "type": "object", + "properties": { + "file_id": { + "type": "string" + }, + "tools": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.AssistantToolsCode" + }, + { + "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly" + } + ] + } + } + } + }, + "OpenAI.MessageObjectIncompleteDetails": { + "type": "object", + "required": [ + "reason" + ], + "properties": { + "reason": { + "type": "string", + "enum": [ + "content_filter", + "max_tokens", + "run_cancelled", + "run_expired", + "run_failed" + ] + } + } + }, + "OpenAI.MessageRequestContentTextObject": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "Always `text`.", + "x-stainless-const": true + }, + "text": { + "type": "string", + "description": "Text content to be sent to the model" + } + }, + "description": "The text content that is part of a message.", + "title": "Text" + }, + "OpenAI.MessageRole": { + "type": "string", + "enum": [ + "unknown", + "user", + "assistant", + "system", + "critic", + "discriminator", + "developer", + "tool" + ] + }, + "OpenAI.MessageStatus": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ] + }, + "OpenAI.Metadata": { + "type": "object", + "unevaluatedProperties": { + "type": "string" + }, + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", + "x-oaiTypeLabel": "map" + }, + "OpenAI.Model": { + "type": "object", + "required": [ + "id", + "created", + "object", + "owned_by" + ], + "properties": { + "id": { + "type": "string", + "description": "The model identifier, which can be referenced in the API endpoints." + }, + "created": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) when the model was created." + }, + "object": { + "type": "string", + "enum": [ + "model" + ], + "description": "The object type, which is always \"model\".", + "x-stainless-const": true + }, + "owned_by": { + "type": "string", + "description": "The organization that owns the model." + } + }, + "description": "Describes an OpenAI model offering that can be used with the API.", + "title": "Model", + "x-oaiMeta": { + "name": "The model object", + "example": "{\n \"id\": \"VAR_chat_model_id\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n}\n" + } + }, + "OpenAI.ModifyMessageRequest": { + "type": "object", + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.ModifyRunRequest": { + "type": "object", + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.ModifyThreadRequest": { + "type": "object", + "properties": { + "tool_resources": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResources" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.ModifyThreadRequestToolResources": { + "type": "object", + "properties": { + "code_interpreter": { + "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter" + }, + "file_search": { + "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch" + } + } + }, + "OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 20 + } + } + }, + "OpenAI.ModifyThreadRequestToolResourcesFileSearch": { + "type": "object", + "properties": { + "vector_store_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 1 + } + } + }, + "OpenAI.Move": { + "type": "object", + "required": [ + "type", + "x", + "y" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "move" + ], + "description": "Specifies the event type. For a move action, this property is\n always set to `move`.", + "x-stainless-const": true, + "default": "move" + }, + "x": { + "type": "integer", + "description": "The x-coordinate to move to." + }, + "y": { + "type": "integer", + "description": "The y-coordinate to move to." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A mouse move action.", + "title": "Move" + }, + "OpenAI.NoiseReductionType": { + "type": "string", + "enum": [ + "near_field", + "far_field" + ], + "description": "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones." + }, + "OpenAI.OpenAIFile": { + "type": "object", + "required": [ + "id", + "bytes", + "created_at", + "filename", + "object", + "purpose", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The file identifier, which can be referenced in the API endpoints." + }, + "bytes": { + "type": "integer", + "description": "The size of the file, in bytes." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the file was created." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the file will expire." + }, + "filename": { + "type": "string", + "description": "The name of the file." + }, + "object": { + "type": "string", + "enum": [ + "file" + ], + "description": "The object type, which is always `file`.", + "x-stainless-const": true + }, + "status_details": { + "type": "string", + "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", + "deprecated": true + }, + "purpose": { + "type": "string", + "enum": [ + "assistants", + "assistants_output", + "batch", + "batch_output", + "fine-tune", + "fine-tune-results", + "evals" + ], + "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`." + }, + "status": { + "type": "string", + "enum": [ + "uploaded", + "pending", + "running", + "processed", + "error", + "deleting", + "deleted" + ] + } + }, + "description": "The `File` object represents a document that has been uploaded to OpenAI.", + "title": "OpenAIFile", + "x-oaiMeta": { + "name": "The file object", + "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1680202602,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n}\n" + } + }, + "OpenAI.OtherChunkingStrategyResponseParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "other" + ], + "description": "Always `other`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse" + } + ], + "description": "This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API.", + "title": "Other Chunking Strategy" + }, + "OpenAI.OutputContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.OutputContentType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAI.OutputContentOutputTextContent", + "refusal": "#/components/schemas/OpenAI.OutputContentRefusalContent" + } + } + }, + "OpenAI.OutputContentOutputTextContent": { + "type": "object", + "required": [ + "type", + "text", + "annotations" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "description": "The type of the output text. Always `output_text`.", + "x-stainless-const": true, + "default": "output_text" + }, + "text": { + "type": "string", + "description": "The text output from the model." + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Annotation" + }, + "description": "The annotations of the text output." + }, + "logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.LogProb" + } + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputContent" + } + ], + "description": "A text output from the model.", + "title": "Output text" + }, + "OpenAI.OutputContentRefusalContent": { + "type": "object", + "required": [ + "type", + "refusal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "refusal" + ], + "description": "The type of the refusal. Always `refusal`.", + "x-stainless-const": true, + "default": "refusal" + }, + "refusal": { + "type": "string", + "description": "The refusal explanation from the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputContent" + } + ], + "description": "A refusal from the model.", + "title": "Refusal" + }, + "OpenAI.OutputContentType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "output_text", + "refusal", + "reasoning_text" + ] + } + ] + }, + "OpenAI.OutputItem": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.OutputItemType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "output_message": "#/components/schemas/OpenAI.OutputItemOutputMessage", + "file_search_call": "#/components/schemas/OpenAI.OutputItemFileSearchToolCall", + "function_call": "#/components/schemas/OpenAI.OutputItemFunctionToolCall", + "web_search_call": "#/components/schemas/OpenAI.OutputItemWebSearchToolCall", + "computer_call": "#/components/schemas/OpenAI.OutputItemComputerToolCall", + "reasoning": "#/components/schemas/OpenAI.OutputItemReasoningItem", + "compaction": "#/components/schemas/OpenAI.OutputItemCompactionBody", + "image_generation_call": "#/components/schemas/OpenAI.OutputItemImageGenToolCall", + "code_interpreter_call": "#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall", + "local_shell_call": "#/components/schemas/OpenAI.OutputItemLocalShellToolCall", + "shell_call": "#/components/schemas/OpenAI.OutputItemFunctionShellCall", + "shell_call_output": "#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput", + "apply_patch_call": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCall", + "apply_patch_call_output": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput", + "mcp_call": "#/components/schemas/OpenAI.OutputItemMcpToolCall", + "mcp_list_tools": "#/components/schemas/OpenAI.OutputItemMcpListTools", + "mcp_approval_request": "#/components/schemas/OpenAI.OutputItemMcpApprovalRequest", + "custom_tool_call": "#/components/schemas/OpenAI.OutputItemCustomToolCall" + } + } + }, + "OpenAI.OutputItemApplyPatchToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "status", + "operation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch_call" + ], + "description": "The type of the item. Always `apply_patch_call`.", + "x-stainless-const": true, + "default": "apply_patch_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the apply patch tool call generated by the model." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus" + } + ], + "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." + }, + "operation": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" + } + ], + "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A tool call that applies file diffs by creating, deleting, or updating files.", + "title": "Apply patch tool call" + }, + "OpenAI.OutputItemApplyPatchToolCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch_call_output" + ], + "description": "The type of the item. Always `apply_patch_call_output`.", + "x-stainless-const": true, + "default": "apply_patch_call_output" + }, + "id": { + "type": "string", + "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the apply patch tool call generated by the model." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus" + } + ], + "description": "The status of the apply patch tool call output. One of `completed` or `failed`." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call output." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "The output emitted by an apply patch tool call.", + "title": "Apply patch tool call output" + }, + "OpenAI.OutputItemCodeInterpreterToolCall": { + "type": "object", + "required": [ + "type", + "id", + "status", + "container_id", + "code", + "outputs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "code_interpreter_call" + ], + "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.", + "x-stainless-const": true, + "default": "code_interpreter_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the code interpreter tool call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete", + "interpreting", + "failed" + ], + "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." + }, + "container_id": { + "type": "string", + "description": "The ID of the container used to run the code." + }, + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "outputs": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs" + }, + { + "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage" + } + ] + } + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A tool call to run code.", + "title": "Code interpreter tool call" + }, + "OpenAI.OutputItemCompactionBody": { + "type": "object", + "required": [ + "type", + "id", + "encrypted_content" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "compaction" + ], + "description": "The type of the item. Always `compaction`.", + "x-stainless-const": true, + "default": "compaction" + }, + "id": { + "type": "string", + "description": "The unique ID of the compaction item." + }, + "encrypted_content": { + "type": "string", + "description": "The encrypted content that was produced by compaction." + }, + "created_by": { + "type": "string", + "description": "The identifier of the actor that created the item." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).", + "title": "Compaction item" + }, + "OpenAI.OutputItemComputerToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "pending_safety_checks", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_call" + ], + "description": "The type of the computer call. Always `computer_call`.", + "default": "computer_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the computer call." + }, + "call_id": { + "type": "string", + "description": "An identifier used when responding to the tool call with output." + }, + "action": { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + }, + "pending_safety_checks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" + }, + "description": "The pending safety checks for the computer call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.", + "title": "Computer tool call" + }, + "OpenAI.OutputItemCustomToolCall": { + "type": "object", + "required": [ + "type", + "call_id", + "name", + "input" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom_tool_call" + ], + "description": "The type of the custom tool call. Always `custom_tool_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the custom tool call in the OpenAI platform." + }, + "call_id": { + "type": "string", + "description": "An identifier used to map this custom tool call to a tool call output." + }, + "name": { + "type": "string", + "description": "The name of the custom tool being called." + }, + "input": { + "type": "string", + "description": "The input for the custom tool call generated by the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A call to a custom tool created by the model.", + "title": "Custom tool call" + }, + "OpenAI.OutputItemFileSearchToolCall": { + "type": "object", + "required": [ + "id", + "type", + "status", + "queries" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the file search tool call." + }, + "type": { + "type": "string", + "enum": [ + "file_search_call" + ], + "description": "The type of the file search tool call. Always `file_search_call`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "searching", + "completed", + "incomplete", + "failed" + ], + "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`," + }, + "queries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The queries used to search for files." + }, + "results": { + "anyOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults" + } + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.", + "title": "File search tool call" + }, + "OpenAI.OutputItemFunctionShellCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell_call" + ], + "description": "The type of the item. Always `shell_call`.", + "x-stainless-const": true, + "default": "shell_call" + }, + "id": { + "type": "string", + "description": "The unique ID of the shell tool call. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the shell tool call generated by the model." + }, + "action": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.FunctionShellAction" + } + ], + "description": "The shell commands and limits that describe how to run the tool call." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.LocalShellCallStatus" + } + ], + "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." + }, + "created_by": { + "type": "string", + "description": "The ID of the entity that created this tool call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A tool call that executes one or more shell commands in a managed environment.", + "title": "Shell tool call" + }, + "OpenAI.OutputItemFunctionShellCallOutput": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "output", + "max_output_length" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell_call_output" + ], + "description": "The type of the shell call output. Always `shell_call_output`.", + "x-stainless-const": true, + "default": "shell_call_output" + }, + "id": { + "type": "string", + "description": "The unique ID of the shell call output. Populated when this item is returned via API." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the shell tool call generated by the model." + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent" + }, + "description": "An array of shell call output contents" + }, + "max_output_length": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "created_by": { + "type": "string", + "description": "The identifier of the actor that created the item." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "The output of a shell tool call that was emitted.", + "title": "Shell call output" + }, + "OpenAI.OutputItemFunctionToolCall": { + "type": "object", + "required": [ + "type", + "call_id", + "name", + "arguments" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the function tool call." + }, + "type": { + "type": "string", + "enum": [ + "function_call" + ], + "description": "The type of the function tool call. Always `function_call`.", + "x-stainless-const": true + }, + "call_id": { + "type": "string", + "description": "The unique ID of the function tool call generated by the model." + }, + "name": { + "type": "string", + "description": "The name of the function to run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of the arguments to pass to the function." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A tool call to run a function. See the\n[function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.", + "title": "Function tool call" + }, + "OpenAI.OutputItemImageGenToolCall": { + "type": "object", + "required": [ + "type", + "id", + "status", + "result" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_generation_call" + ], + "description": "The type of the image generation call. Always `image_generation_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the image generation call." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "generating", + "failed" + ], + "description": "The status of the image generation call." + }, + "result": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "An image generation request made by the model.", + "title": "Image generation call" + }, + "OpenAI.OutputItemLocalShellToolCall": { + "type": "object", + "required": [ + "type", + "id", + "call_id", + "action", + "status" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "local_shell_call" + ], + "description": "The type of the local shell call. Always `local_shell_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the local shell call." + }, + "call_id": { + "type": "string", + "description": "The unique ID of the local shell tool call generated by the model." + }, + "action": { + "$ref": "#/components/schemas/OpenAI.LocalShellExecAction" + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the local shell call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A tool call to run a command on the local shell.", + "title": "Local shell call" + }, + "OpenAI.OutputItemMcpApprovalRequest": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "name", + "arguments" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_approval_request" + ], + "description": "The type of the item. Always `mcp_approval_request`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the approval request." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server making the request." + }, + "name": { + "type": "string", + "description": "The name of the tool to run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of arguments for the tool." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A request for human approval of a tool invocation.", + "title": "MCP approval request" + }, + "OpenAI.OutputItemMcpListTools": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "tools" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_list_tools" + ], + "description": "The type of the item. Always `mcp_list_tools`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the list." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.MCPListToolsTool" + }, + "description": "The tools available on the server." + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A list of tools available on an MCP server.", + "title": "MCP list tools" + }, + "OpenAI.OutputItemMcpToolCall": { + "type": "object", + "required": [ + "type", + "id", + "server_label", + "name", + "arguments" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp_call" + ], + "description": "The type of the item. Always `mcp_call`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique ID of the tool call." + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server running the tool." + }, + "name": { + "type": "string", + "description": "The name of the tool that was run." + }, + "arguments": { + "type": "string", + "description": "A JSON string of the arguments passed to the tool." + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "error": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus" + } + ], + "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`." + }, + "approval_request_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "An invocation of a tool on an MCP server.", + "title": "MCP tool call" + }, + "OpenAI.OutputItemOutputMessage": { + "type": "object", + "required": [ + "id", + "type", + "role", + "content", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the output message.", + "x-stainless-go-json": "omitzero" + }, + "type": { + "type": "string", + "enum": [ + "output_message" + ], + "description": "The type of the output message. Always `message`.", + "x-stainless-const": true + }, + "role": { + "type": "string", + "enum": [ + "assistant" + ], + "description": "The role of the output message. Always `assistant`.", + "x-stainless-const": true + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OutputMessageContent" + }, + "description": "The content of the output message." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "An output message from the model.", + "title": "Output message" + }, + "OpenAI.OutputItemReasoningItem": { + "type": "object", + "required": [ + "type", + "id", + "summary" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "reasoning" + ], + "description": "The type of the object. Always `reasoning`.", + "x-stainless-const": true + }, + "id": { + "type": "string", + "description": "The unique identifier of the reasoning content." + }, + "encrypted_content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "summary": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Summary" + }, + "description": "Reasoning summary content." + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ReasoningTextContent" + }, + "description": "Reasoning text content." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "incomplete" + ], + "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state).", + "title": "Reasoning" + }, + "OpenAI.OutputItemType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "output_message", + "file_search_call", + "function_call", + "web_search_call", + "computer_call", + "reasoning", + "compaction", + "image_generation_call", + "code_interpreter_call", + "local_shell_call", + "shell_call", + "shell_call_output", + "apply_patch_call", + "apply_patch_call_output", + "mcp_call", + "mcp_list_tools", + "mcp_approval_request", + "custom_tool_call" + ] + } + ] + }, + "OpenAI.OutputItemWebSearchToolCall": { + "type": "object", + "required": [ + "id", + "type", + "status", + "action" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique ID of the web search tool call." + }, + "type": { + "type": "string", + "enum": [ + "web_search_call" + ], + "description": "The type of the web search tool call. Always `web_search_call`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "searching", + "completed", + "failed" + ], + "description": "The status of the web search tool call." + }, + "action": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch" + }, + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage" + }, + { + "$ref": "#/components/schemas/OpenAI.WebSearchActionFind" + } + ], + "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find)." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.", + "title": "Web search tool call" + }, + "OpenAI.OutputMessageContent": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.OutputMessageContentType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "output_text": "#/components/schemas/OpenAI.OutputMessageContentOutputTextContent", + "refusal": "#/components/schemas/OpenAI.OutputMessageContentRefusalContent" + } + } + }, + "OpenAI.OutputMessageContentOutputTextContent": { + "type": "object", + "required": [ + "type", + "text", + "annotations" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "description": "The type of the output text. Always `output_text`.", + "x-stainless-const": true, + "default": "output_text" + }, + "text": { + "type": "string", + "description": "The text output from the model." + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Annotation" + }, + "description": "The annotations of the text output." + }, + "logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.LogProb" + } + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputMessageContent" + } + ], + "description": "A text output from the model.", + "title": "Output text" + }, + "OpenAI.OutputMessageContentRefusalContent": { + "type": "object", + "required": [ + "type", + "refusal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "refusal" + ], + "description": "The type of the refusal. Always `refusal`.", + "x-stainless-const": true, + "default": "refusal" + }, + "refusal": { + "type": "string", + "description": "The refusal explanation from the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputMessageContent" + } + ], + "description": "A refusal from the model.", + "title": "Refusal" + }, + "OpenAI.OutputMessageContentType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "output_text", + "refusal" + ] + } + ] + }, + "OpenAI.OutputTextContent": { + "type": "object", + "required": [ + "type", + "text", + "annotations" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "output_text" + ], + "description": "The type of the output text. Always `output_text`.", + "x-stainless-const": true, + "default": "output_text" + }, + "text": { + "type": "string", + "description": "The text output from the model." + }, + "annotations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Annotation" + }, + "description": "The annotations of the text output." + }, + "logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.LogProb" + } + } + }, + "description": "A text output from the model.", + "title": "Output text" + }, + "OpenAI.ParallelToolCalls": { + "type": "boolean", + "description": "Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use." + }, + "OpenAI.PredictionContent": { + "type": "object", + "required": [ + "type", + "content" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "content" + ], + "description": "The type of the predicted content you want to provide. This type is\n currently always `content`.", + "x-stainless-const": true + }, + "content": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" + } + } + ], + "description": "The content that should be matched when generating a model response.\n If generated tokens would match this content, the entire model response\n can be returned much more quickly." + } + }, + "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.", + "title": "Static Content" + }, + "OpenAI.Prompt": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "id": { + "type": "string", + "description": "The unique identifier of the prompt template to use." + }, + "version": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "variables": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponsePromptVariables" + }, + { + "type": "null" + } + ] + } + }, + "description": "Reference to a prompt template and its variables.\n[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts)." + }, + "OpenAI.RankerVersionType": { + "type": "string", + "enum": [ + "auto", + "default-2024-11-15" + ] + }, + "OpenAI.RankingOptions": { + "type": "object", + "properties": { + "ranker": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RankerVersionType" + } + ], + "description": "The ranker to use for the file search." + }, + "score_threshold": { + "type": "number", + "description": "The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results." + }, + "hybrid_search": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.HybridSearchOptions" + } + ], + "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled." + } + } + }, + "OpenAI.RealtimeAudioFormats": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormatsType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "audio/pcm": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm", + "audio/pcmu": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu", + "audio/pcma": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma" + } + } + }, + "OpenAI.RealtimeAudioFormatsAudioPcm": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "audio/pcm" + ] + }, + "rate": { + "type": "number", + "enum": [ + 24000 + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + } + ] + }, + "OpenAI.RealtimeAudioFormatsAudioPcma": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "audio/pcma" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + } + ] + }, + "OpenAI.RealtimeAudioFormatsAudioPcmu": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "audio/pcmu" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + } + ] + }, + "OpenAI.RealtimeAudioFormatsType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "audio/pcm", + "audio/pcmu", + "audio/pcma" + ] + } + ] + }, + "OpenAI.RealtimeCallCreateRequest": { + "type": "object", + "properties": { + "sdp": { + "type": "string", + "description": "WebRTC Session Description Protocol (SDP) offer generated by the caller." + }, + "session": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA" + } + ], + "description": "Optional session configuration to apply before the realtime session is\n created. Use the same parameters you would send in a [`create client secret`](https://platform.openai.com/docs/api-reference/realtime-sessions/create-realtime-client-secret)\n request." + } + }, + "required": [ + "sdp" + ] + }, + "OpenAI.RealtimeCallReferRequest": { + "type": "object", + "required": [ + "target_uri" + ], + "properties": { + "target_uri": { + "type": "string", + "description": "URI that should appear in the SIP Refer-To header. Supports values like\n `tel:+14155550123` or `sip:agent\\@example.com`." + } + }, + "description": "Parameters required to transfer a SIP call to a new destination using the\nRealtime API.", + "title": "Realtime call refer request" + }, + "OpenAI.RealtimeCallRejectRequest": { + "type": "object", + "properties": { + "status_code": { + "type": "integer", + "description": "SIP response code to send back to the caller. Defaults to `603` (Decline)\n when omitted." + } + }, + "description": "Parameters used to decline an incoming SIP call handled by the Realtime API.", + "title": "Realtime call reject request" + }, + "OpenAI.RealtimeCreateClientSecretRequest": { + "type": "object", + "properties": { + "expires_after": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter" + } + ], + "description": "Configuration for the client secret expiration. Expiration refers to the time after which\n a client secret will no longer be valid for creating sessions. The session itself may\n continue after that time once started. A secret can be used to create multiple sessions\n until it expires.", + "title": "Client secret expiration" + }, + "session": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion" + } + ], + "description": "Session configuration to use for the client secret. Choose either a realtime\n session or a transcription session." + } + }, + "description": "Create a session and client secret for the Realtime API. The request can specify\neither a realtime or a transcription session configuration.\n[Learn more about the Realtime API](https://platform.openai.com/docs/guides/realtime).", + "title": "Realtime client secret creation request" + }, + "OpenAI.RealtimeCreateClientSecretRequestExpiresAfter": { + "type": "object", + "properties": { + "anchor": { + "type": "string", + "enum": [ + "created_at" + ], + "x-stainless-const": true, + "default": "created_at" + }, + "seconds": { + "type": "integer", + "minimum": 10, + "maximum": 7200, + "default": 600 + } + } + }, + "OpenAI.RealtimeCreateClientSecretResponse": { + "type": "object", + "required": [ + "value", + "expires_at", + "session" + ], + "properties": { + "value": { + "type": "string", + "description": "The generated client secret value." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "Expiration timestamp for the client secret, in seconds since epoch." + }, + "session": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion" + } + ], + "description": "The session configuration for either a realtime or transcription session." + } + }, + "description": "Response from creating a session and client secret for the Realtime API.", + "title": "Realtime session and client secret", + "x-oaiMeta": { + "name": "Session response object", + "group": "realtime", + "example": "{\n \"value\": \"ek_68af296e8e408191a1120ab6383263c2\",\n \"expires_at\": 1756310470,\n \"session\": {\n \"type\": \"realtime\",\n \"object\": \"realtime.session\",\n \"id\": \"sess_C9CiUVUzUzYIssh3ELY1d\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"output_modalities\": [\n \"audio\"\n ],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"auto\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": null,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"expires_at\": 0,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": null,\n \"noise_reduction\": null,\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200,\n \"idle_timeout_ms\": null,\n \"create_response\": true,\n \"interrupt_response\": true\n }\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n },\n \"include\": null\n }\n}\n" + } + }, + "OpenAI.RealtimeFunctionTool": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of the tool, i.e. `function`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the function." + }, + "description": { + "type": "string", + "description": "The description of the function, including guidance on when and how\n to call it, and guidance about what to tell the user when calling\n (if anything)." + }, + "parameters": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeFunctionToolParameters" + } + ], + "description": "Parameters of the function in JSON Schema." + } + }, + "title": "Function tool" + }, + "OpenAI.RealtimeFunctionToolParameters": { + "type": "object" + }, + "OpenAI.RealtimeSessionCreateRequest": { + "type": "object", + "required": [ + "client_secret", + "type" + ], + "properties": { + "client_secret": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret" + } + ], + "description": "Ephemeral key returned by the API." + }, + "modalities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"].", + "default": [ + "text", + "audio" + ] + }, + "instructions": { + "type": "string", + "description": "The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.\n Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session." + }, + "voice": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" + } + ], + "description": "The voice the model uses to respond. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the session once the model has responded with audio at least once." + }, + "input_audio_format": { + "type": "string", + "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`." + }, + "output_audio_format": { + "type": "string", + "description": "The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`." + }, + "input_audio_transcription": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription" + } + ], + "description": "Configuration for input audio transcription, defaults to off and can be\n set to `null` to turn off once on. Input audio transcription is not native\n to the model, since the model consumes audio directly. Transcription runs\n asynchronously and should be treated as rough guidance\n rather than the representation understood by the model." + }, + "speed": { + "type": "number", + "minimum": 0.25, + "maximum": 1.5, + "description": "The speed of the model's spoken response. 1.0 is the default speed. 0.25 is\n the minimum speed. 1.5 is the maximum speed. This value can only be changed\n in between model turns, not while a response is in progress.", + "default": 1 + }, + "tracing": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": { + "workflow_name": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "unevaluatedProperties": {} + } + } + } + ], + "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.", + "title": "Tracing Configuration", + "default": "auto" + }, + "turn_detection": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection" + } + ], + "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools" + }, + "description": "Tools (functions) available to the model." + }, + "tool_choice": { + "type": "string", + "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function." + }, + "temperature": { + "type": "number", + "description": "Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8." + }, + "max_response_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "enum": [ + "inf" + ] + } + ], + "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`." + }, + "truncation": { + "$ref": "#/components/schemas/OpenAI.RealtimeTruncation" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + }, + "type": { + "type": "string", + "enum": [ + "realtime" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion" + } + ], + "description": "A new Realtime session configuration, with an ephemeral key. Default TTL\nfor keys is one minute.", + "x-oaiMeta": { + "name": "The session object", + "group": "realtime", + "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"modalities\": [\"audio\", \"text\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"voice\": \"alloy\",\n \"input_audio_format\": \"pcm16\",\n \"output_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"whisper-1\"\n },\n \"turn_detection\": null,\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"temperature\": 0.7,\n \"speed\": 1.1,\n \"tracing\": \"auto\",\n \"max_response_output_tokens\": 200,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"client_secret\": {\n \"value\": \"ek_abc123\",\n \"expires_at\": 1234567890\n }\n}\n" + } + }, + "OpenAI.RealtimeSessionCreateRequestClientSecret": { + "type": "object", + "required": [ + "value", + "expires_at" + ], + "properties": { + "value": { + "type": "string" + }, + "expires_at": { + "type": "integer", + "format": "unixtime" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestGA": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "realtime" + ], + "description": "The type of session to create. Always `realtime` for the Realtime API.", + "x-stainless-const": true + }, + "output_modalities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "description": "The set of modalities the model can respond with. It defaults to `[\"audio\"]`, indicating\n that the model will respond with audio plus a transcript. `[\"text\"]` can be used to make\n the model respond with text only. It is not possible to request both `text` and `audio` at the same time.", + "default": [ + "audio" + ] + }, + "model": { + "type": "string", + "description": "The Realtime model used for this session." + }, + "instructions": { + "type": "string", + "description": "The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.\n Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session." + }, + "audio": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio" + } + ], + "description": "Configuration for input and output audio." + }, + "include": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "item.input_audio_transcription.logprobs" + ] + }, + "description": "Additional fields to include in server outputs.\n `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription." + }, + "tracing": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing" + }, + { + "type": "null" + } + ], + "description": "Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.", + "title": "Tracing Configuration", + "default": "auto" + }, + "tools": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool" + }, + { + "$ref": "#/components/schemas/OpenAI.MCPTool" + } + ] + }, + "description": "Tools available to the model." + }, + "tool_choice": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions" + }, + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceFunction" + }, + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceMCP" + } + ], + "description": "How the model chooses tools. Provide one of the string modes or force a specific\n function/MCP tool.", + "default": "auto" + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "enum": [ + "inf" + ] + } + ], + "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`." + }, + "truncation": { + "$ref": "#/components/schemas/OpenAI.RealtimeTruncation" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + } + }, + "description": "Realtime session object configuration.", + "title": "Realtime session configuration" + }, + "OpenAI.RealtimeSessionCreateRequestGAAudio": { + "type": "object", + "properties": { + "input": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput" + }, + "output": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestGAAudioInput": { + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + }, + "transcription": { + "$ref": "#/components/schemas/OpenAI.AudioTranscription" + }, + "noise_reduction": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction" + }, + "turn_detection": { + "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.NoiseReductionType" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestGAAudioOutput": { + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + }, + "voice": { + "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" + }, + "speed": { + "type": "number", + "minimum": 0.25, + "maximum": 1.5, + "default": 1 + } + } + }, + "OpenAI.RealtimeSessionCreateRequestGATracing": { + "type": "object", + "properties": { + "workflow_name": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "unevaluatedProperties": {} + } + } + }, + "OpenAI.RealtimeSessionCreateRequestInputAudioTranscription": { + "type": "object", + "properties": { + "model": { + "type": "string" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestTools": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "x-stainless-const": true + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "parameters": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestToolsParameters": { + "type": "object" + }, + "OpenAI.RealtimeSessionCreateRequestTurnDetection": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "prefix_padding_ms": { + "type": "integer" + }, + "silence_duration_ms": { + "type": "integer" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestUnion": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateRequest", + "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest" + } + } + }, + "OpenAI.RealtimeSessionCreateRequestUnionType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "realtime", + "transcription" + ] + } + ] + }, + "OpenAI.RealtimeSessionCreateResponse": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`." + }, + "object": { + "type": "string", + "description": "The object type. Always `realtime.session`." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "Expiration timestamp for the session, in seconds since epoch." + }, + "include": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "item.input_audio_transcription.logprobs" + ] + }, + "description": "Additional fields to include in server outputs.\n - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription." + }, + "model": { + "type": "string", + "description": "The Realtime model used for this session." + }, + "output_modalities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]." + }, + "instructions": { + "type": "string", + "description": "The default system instructions (i.e. system message) prepended to model\n calls. This field allows the client to guide the model on desired\n responses. The model can be instructed on response content and format,\n (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good\n responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion\n into your voice\", \"laugh frequently\"). The instructions are not guaranteed\n to be followed by the model, but they provide guidance to the model on the\n desired behavior.\n Note that the server sets default instructions which will be used if this\n field is not set and are visible in the `session.created` event at the\n start of the session." + }, + "audio": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio" + } + ], + "description": "Configuration for input and output audio for the session." + }, + "tracing": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "object", + "properties": { + "workflow_name": { + "type": "string" + }, + "group_id": { + "type": "string" + }, + "metadata": { + "type": "object", + "unevaluatedProperties": {} + } + } + } + ], + "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.", + "title": "Tracing Configuration", + "default": "auto" + }, + "turn_detection": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection" + } + ], + "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool" + }, + "description": "Tools (functions) available to the model." + }, + "tool_choice": { + "type": "string", + "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function." + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "enum": [ + "inf" + ] + } + ], + "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`." + }, + "type": { + "type": "string", + "enum": [ + "realtime" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion" + } + ], + "description": "A Realtime session configuration object.", + "title": "Realtime session configuration object", + "x-oaiMeta": { + "name": "The session object", + "group": "realtime", + "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"expires_at\": 1742188264,\n \"model\": \"gpt-realtime\",\n \"output_modalities\": [\"audio\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": \"auto\",\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": { \"model\": \"whisper-1\" },\n \"noise_reduction\": null,\n \"turn_detection\": null\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n }\n}\n" + } + }, + "OpenAI.RealtimeSessionCreateResponseAudio": { + "type": "object", + "properties": { + "input": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput" + }, + "output": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseAudioInput": { + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + }, + "transcription": { + "$ref": "#/components/schemas/OpenAI.AudioTranscription" + }, + "noise_reduction": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction" + }, + "turn_detection": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.NoiseReductionType" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "prefix_padding_ms": { + "type": "integer" + }, + "silence_duration_ms": { + "type": "integer" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseAudioOutput": { + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" + }, + "voice": { + "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" + }, + "speed": { + "type": "number" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseTurnDetection": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "prefix_padding_ms": { + "type": "integer" + }, + "silence_duration_ms": { + "type": "integer" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseUnion": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateResponse", + "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse" + } + } + }, + "OpenAI.RealtimeSessionCreateResponseUnionType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "realtime", + "transcription" + ] + } + ] + }, + "OpenAI.RealtimeTranscriptionSessionCreateRequest": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "turn_detection": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection" + } + ], + "description": "Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech." + }, + "input_audio_noise_reduction": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction" + } + ], + "description": "Configuration for input audio noise reduction. This can be set to `null` to turn off.\n Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\n Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio." + }, + "input_audio_format": { + "type": "string", + "enum": [ + "pcm16", + "g711_ulaw", + "g711_alaw" + ], + "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.\n For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,\n single channel (mono), and little-endian byte order.", + "default": "pcm16" + }, + "input_audio_transcription": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.AudioTranscription" + } + ], + "description": "Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service." + }, + "include": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "item.input_audio_transcription.logprobs" + ] + }, + "description": "The set of items to include in the transcription. Current available items are:\n `item.input_audio_transcription.logprobs`" + }, + "type": { + "type": "string", + "enum": [ + "transcription" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion" + } + ], + "description": "Realtime transcription session object configuration.", + "title": "Realtime transcription session configuration" + }, + "OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction": { + "type": "object", + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.NoiseReductionType" + } + } + }, + "OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "server_vad" + ] + }, + "threshold": { + "type": "number" + }, + "prefix_padding_ms": { + "type": "integer" + }, + "silence_duration_ms": { + "type": "integer" + } + } + }, + "OpenAI.RealtimeTranscriptionSessionCreateResponse": { + "type": "object", + "required": [ + "client_secret", + "type" + ], + "properties": { + "client_secret": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret" + } + ], + "description": "Ephemeral key returned by the API. Only present when the session is\n created on the server via REST API." + }, + "modalities": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "audio" + ] + }, + "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]." + }, + "input_audio_format": { + "type": "string", + "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`." + }, + "input_audio_transcription": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.AudioTranscription" + } + ], + "description": "Configuration of the transcription model." + }, + "turn_detection": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection" + } + ], + "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech." + }, + "type": { + "type": "string", + "enum": [ + "transcription" + ], + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion" + } + ], + "description": "A new Realtime transcription session configuration.\nWhen a session is created on the server via REST API, the session object\nalso contains an ephemeral key. Default TTL for keys is 10 minutes. This\nproperty is not present when a session is updated via the WebSocket API.", + "x-oaiMeta": { + "name": "The transcription session object", + "group": "realtime", + "example": "{\n \"id\": \"sess_BBwZc7cFV3XizEyKGDCGL\",\n \"object\": \"realtime.transcription_session\",\n \"expires_at\": 1742188264,\n \"modalities\": [\"audio\", \"text\"],\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200\n },\n \"input_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"gpt-4o-transcribe\",\n \"language\": null,\n \"prompt\": \"\"\n },\n \"client_secret\": null\n}\n" + } + }, + "OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret": { + "type": "object", + "required": [ + "value", + "expires_at" + ], + "properties": { + "value": { + "type": "string" + }, + "expires_at": { + "type": "integer", + "format": "unixtime" + } + } + }, + "OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection": { + "type": "object", + "properties": { + "type": { + "type": "string" + }, + "threshold": { + "type": "number" + }, + "prefix_padding_ms": { + "type": "integer" + }, + "silence_duration_ms": { + "type": "integer" + } + } + }, + "OpenAI.RealtimeTruncation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "disabled" + ] + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "retention_ratio" + ], + "x-stainless-const": true + }, + "retention_ratio": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "token_limits": { + "$ref": "#/components/schemas/OpenAI.TokenLimits" + } + }, + "required": [ + "type", + "retention_ratio" + ] + } + ], + "description": "When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.\nClients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.\nTruncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.\nTruncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.", + "title": "Realtime Truncation Controls" + }, + "OpenAI.RealtimeTurnDetection": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetectionType" + } + }, + "discriminator": { + "propertyName": "type" + } + }, + "OpenAI.RealtimeTurnDetectionType": { + "type": "string" + }, + "OpenAI.Reasoning": { + "type": "object", + "properties": { + "effort": { + "$ref": "#/components/schemas/OpenAI.ReasoningEffort" + }, + "summary": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "type": "null" + } + ] + }, + "generate_summary": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "concise", + "detailed" + ] + }, + { + "type": "null" + } + ] + } + }, + "description": "**gpt-5 and o-series models only**\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).", + "title": "Reasoning" + }, + "OpenAI.ReasoningEffort": { + "anyOf": [ + { + "type": "string", + "enum": [ + "none", + "minimal", + "low", + "medium", + "high", + "xhigh" + ] + }, + { + "type": "null" + } + ], + "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`." + }, + "OpenAI.ReasoningTextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "reasoning_text" + ], + "description": "The type of the reasoning text. Always `reasoning_text`.", + "x-stainless-const": true, + "default": "reasoning_text" + }, + "text": { + "type": "string", + "description": "The reasoning text from the model." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputContent" + } + ], + "description": "Reasoning text from the model.", + "title": "ReasoningTextContent" + }, + "OpenAI.RefusalContent": { + "type": "object", + "required": [ + "type", + "refusal" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "refusal" + ], + "description": "The type of the refusal. Always `refusal`.", + "x-stainless-const": true, + "default": "refusal" + }, + "refusal": { + "type": "string", + "description": "The refusal explanation from the model." + } + }, + "description": "A refusal from the model.", + "title": "Refusal" + }, + "OpenAI.Response": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "error", + "incomplete_details", + "output", + "instructions", + "parallel_tool_calls", + "content_filters" + ], + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "top_logprobs": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1 + }, + "user": { + "type": "string", + "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", + "deprecated": true + }, + "safety_identifier": { + "type": "string", + "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." + }, + "prompt_cache_key": { + "type": "string", + "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." + }, + "prompt_cache_retention": { + "anyOf": [ + { + "type": "string", + "enum": [ + "in-memory", + "24h" + ] + }, + { + "type": "null" + } + ] + }, + "previous_response_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "model": { + "type": "string", + "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." + }, + "reasoning": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Reasoning" + }, + { + "type": "null" + } + ] + }, + "background": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "max_output_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "max_tool_calls": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "text": { + "$ref": "#/components/schemas/OpenAI.ResponseTextParam" + }, + "tools": { + "$ref": "#/components/schemas/OpenAI.ToolsArray" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + }, + "prompt": { + "$ref": "#/components/schemas/OpenAI.Prompt" + }, + "truncation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "disabled" + ] + }, + { + "type": "null" + } + ], + "default": "disabled" + }, + "id": { + "type": "string", + "description": "Unique identifier for this Response." + }, + "object": { + "type": "string", + "enum": [ + "response" + ], + "description": "The object type of this resource - always set to `response`.", + "x-stainless-const": true + }, + "status": { + "type": "string", + "enum": [ + "completed", + "failed", + "in_progress", + "cancelled", + "queued", + "incomplete" + ], + "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (in seconds) of when this Response was created." + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseError" + }, + { + "type": "null" + } + ] + }, + "incomplete_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" + }, + { + "type": "null" + } + ] + }, + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.OutputItem" + }, + "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." + }, + "instructions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.InputItem" + } + }, + { + "type": "null" + } + ] + }, + "output_text": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "x-stainless-skip": true + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.ResponseUsage" + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to allow the model to run tool calls in parallel.", + "default": true + }, + "conversation": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ConversationReference" + }, + { + "type": "null" + } + ] + }, + "content_filters": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" + }, + "description": "The content filter results from RAI." + } + }, + "title": "The response object" + }, + "OpenAI.ResponseAudioDeltaEvent": { + "type": "object", + "required": [ + "type", + "sequence_number", + "delta" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.audio.delta" + ], + "description": "The type of the event. Always `response.audio.delta`.", + "x-stainless-const": true + }, + "sequence_number": { + "type": "integer", + "description": "A sequence number for this chunk of the stream response." + }, + "delta": { + "type": "string", + "contentEncoding": "base64", + "description": "A chunk of Base64 encoded response audio bytes." + } + }, + "description": "Emitted when there is a partial audio response.", + "x-oaiMeta": { + "name": "response.audio.delta", + "group": "responses", + "example": "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseAudioTranscriptDeltaEvent": { + "type": "object", + "required": [ + "type", + "delta", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.audio.transcript.delta" + ], + "description": "The type of the event. Always `response.audio.transcript.delta`.", + "x-stainless-const": true + }, + "delta": { + "type": "string", + "description": "The partial transcript of the audio response." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when there is a partial transcript of audio.", + "x-oaiMeta": { + "name": "response.audio.transcript.delta", + "group": "responses", + "example": "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "delta", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.code_interpreter_call_code.delta" + ], + "description": "The type of the event. Always `response.code_interpreter_call_code.delta`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response for which the code is being streamed." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the code interpreter tool call item." + }, + "delta": { + "type": "string", + "description": "The partial code snippet being streamed by the code interpreter." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event, used to order streaming events." + } + }, + "description": "Emitted when a partial code snippet is streamed by the code interpreter.", + "x-oaiMeta": { + "name": "response.code_interpreter_call_code.delta", + "group": "responses", + "example": "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseCodeInterpreterCallInProgressEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.code_interpreter_call.in_progress" + ], + "description": "The type of the event. Always `response.code_interpreter_call.in_progress`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response for which the code interpreter call is in progress." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the code interpreter tool call item." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event, used to order streaming events." + } + }, + "description": "Emitted when a code interpreter call is in progress.", + "x-oaiMeta": { + "name": "response.code_interpreter_call.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseCodeInterpreterCallInterpretingEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.code_interpreter_call.interpreting" + ], + "description": "The type of the event. Always `response.code_interpreter_call.interpreting`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response for which the code interpreter is interpreting code." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the code interpreter tool call item." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event, used to order streaming events." + } + }, + "description": "Emitted when the code interpreter is actively interpreting the code snippet.", + "x-oaiMeta": { + "name": "response.code_interpreter_call.interpreting", + "group": "responses", + "example": "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseContentPartAddedEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "content_index", + "part", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.content_part.added" + ], + "description": "The type of the event. Always `response.content_part.added`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the output item that the content part was added to." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the content part was added to." + }, + "content_index": { + "type": "integer", + "description": "The index of the content part that was added." + }, + "part": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputContent" + } + ], + "description": "The content part that was added." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when a new content part is added.", + "x-oaiMeta": { + "name": "response.content_part.added", + "group": "responses", + "example": "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \"annotations\": []\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseCreatedEvent": { + "type": "object", + "required": [ + "type", + "response", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.created" + ], + "description": "The type of the event. Always `response.created`.", + "x-stainless-const": true + }, + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Response" + } + ], + "description": "The response that was created." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number for this event." + } + }, + "description": "An event that is emitted when a response is created.", + "x-oaiMeta": { + "name": "response.created", + "group": "responses", + "example": "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseCustomToolCallInputDeltaEvent": { + "type": "object", + "required": [ + "type", + "sequence_number", + "output_index", + "item_id", + "delta" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.custom_tool_call_input.delta" + ], + "description": "The event type identifier.", + "x-stainless-const": true + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "output_index": { + "type": "integer", + "description": "The index of the output this delta applies to." + }, + "item_id": { + "type": "string", + "description": "Unique identifier for the API item associated with this event." + }, + "delta": { + "type": "string", + "description": "The incremental input data (delta) for the custom tool call." + } + }, + "description": "Event representing a delta (partial update) to the input of a custom tool call.", + "title": "ResponseCustomToolCallInputDelta", + "x-oaiMeta": { + "name": "response.custom_tool_call_input.delta", + "group": "responses", + "example": "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n" + } + }, + "OpenAI.ResponseError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "$ref": "#/components/schemas/OpenAI.ResponseErrorCode" + }, + "message": { + "type": "string", + "description": "A human-readable description of the error." + } + }, + "description": "An error object returned when the model fails to generate a Response." + }, + "OpenAI.ResponseErrorCode": { + "type": "string", + "enum": [ + "server_error", + "rate_limit_exceeded", + "invalid_prompt", + "vector_store_timeout", + "invalid_image", + "invalid_image_format", + "invalid_base64_image", + "invalid_image_url", + "image_too_large", + "image_too_small", + "image_parse_error", + "image_content_policy_violation", + "invalid_image_mode", + "image_file_too_large", + "unsupported_image_media_type", + "empty_image_file", + "failed_to_download_image", + "image_file_not_found" + ], + "description": "The error code for the response." + }, + "OpenAI.ResponseErrorEvent": { + "type": "object", + "required": [ + "type", + "code", + "message", + "param", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "error" + ], + "description": "The type of the event. Always `error`.", + "x-stainless-const": true + }, + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string", + "description": "The error message." + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when an error occurs.", + "x-oaiMeta": { + "name": "error", + "group": "responses", + "example": "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseFailedEvent": { + "type": "object", + "required": [ + "type", + "sequence_number", + "response" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.failed" + ], + "description": "The type of the event. Always `response.failed`.", + "x-stainless-const": true + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Response" + } + ], + "description": "The response that failed." + } + }, + "description": "An event that is emitted when a response fails.", + "x-oaiMeta": { + "name": "response.failed", + "group": "responses", + "example": "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n" + } + }, + "OpenAI.ResponseFileSearchCallInProgressEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.file_search_call.in_progress" + ], + "description": "The type of the event. Always `response.file_search_call.in_progress`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the file search call is initiated." + }, + "item_id": { + "type": "string", + "description": "The ID of the output item that the file search call is initiated." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when a file search call is initiated.", + "x-oaiMeta": { + "name": "response.file_search_call.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseFileSearchCallSearchingEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.file_search_call.searching" + ], + "description": "The type of the event. Always `response.file_search_call.searching`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the file search call is searching." + }, + "item_id": { + "type": "string", + "description": "The ID of the output item that the file search call is initiated." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when a file search is currently searching.", + "x-oaiMeta": { + "name": "response.file_search_call.searching", + "group": "responses", + "example": "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseFormatJsonObject": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "json_object" + ], + "description": "The type of response format being defined. Always `json_object`.", + "x-stainless-const": true + } + }, + "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.", + "title": "JSON object" + }, + "OpenAI.ResponseFormatJsonSchema": { + "type": "object", + "required": [ + "type", + "json_schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "json_schema" + ], + "description": "The type of response format being defined. Always `json_schema`.", + "x-stainless-const": true + }, + "json_schema": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema" + } + ], + "description": "Structured Outputs configuration options, including a JSON Schema.", + "title": "JSON schema" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" + } + ], + "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).", + "title": "JSON schema" + }, + "OpenAI.ResponseFormatJsonSchemaJsonSchema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schema": { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema" + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.ResponseFormatJsonSchemaSchema": { + "type": "object", + "unevaluatedProperties": {}, + "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).", + "title": "JSON schema" + }, + "OpenAI.ResponseFormatText": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of response format being defined. Always `text`.", + "x-stainless-const": true + } + }, + "description": "Default response format. Used to generate text responses.", + "title": "Text" + }, + "OpenAI.ResponseFunctionCallArgumentsDeltaEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "sequence_number", + "delta" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.function_call_arguments.delta" + ], + "description": "The type of the event. Always `response.function_call_arguments.delta`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the output item that the function-call arguments delta is added to." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the function-call arguments delta is added to." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "delta": { + "type": "string", + "description": "The function-call arguments delta that is added." + } + }, + "description": "Emitted when there is a partial function-call arguments delta.", + "x-oaiMeta": { + "name": "response.function_call_arguments.delta", + "group": "responses", + "example": "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"delta\": \"{ \"arg\":\"\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseImageGenCallGeneratingEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.image_generation_call.generating" + ], + "description": "The type of the event. Always 'response.image_generation_call.generating'.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response's output array." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the image generation item being processed." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of the image generation item being processed." + } + }, + "description": "Emitted when an image generation tool call is actively generating an image (intermediate state).", + "title": "ResponseImageGenCallGeneratingEvent", + "x-oaiMeta": { + "name": "response.image_generation_call.generating", + "group": "responses", + "example": "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n" + } + }, + "OpenAI.ResponseImageGenCallInProgressEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.image_generation_call.in_progress" + ], + "description": "The type of the event. Always 'response.image_generation_call.in_progress'.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response's output array." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the image generation item being processed." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of the image generation item being processed." + } + }, + "description": "Emitted when an image generation tool call is in progress.", + "title": "ResponseImageGenCallInProgressEvent", + "x-oaiMeta": { + "name": "response.image_generation_call.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n" + } + }, + "OpenAI.ResponseImageGenCallPartialImageEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number", + "partial_image_index", + "partial_image_b64" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.image_generation_call.partial_image" + ], + "description": "The type of the event. Always 'response.image_generation_call.partial_image'.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response's output array." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the image generation item being processed." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of the image generation item being processed." + }, + "partial_image_index": { + "type": "integer", + "description": "0-based index for the partial image (backend is 1-based, but this is 0-based for the user)." + }, + "partial_image_b64": { + "type": "string", + "description": "Base64-encoded partial image data, suitable for rendering as an image." + } + }, + "description": "Emitted when a partial image is available during image generation streaming.", + "title": "ResponseImageGenCallPartialImageEvent", + "x-oaiMeta": { + "name": "response.image_generation_call.partial_image", + "group": "responses", + "example": "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \"partial_image_b64\": \"...\"\n}\n" + } + }, + "OpenAI.ResponseInProgressEvent": { + "type": "object", + "required": [ + "type", + "response", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.in_progress" + ], + "description": "The type of the event. Always `response.in_progress`.", + "x-stainless-const": true + }, + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Response" + } + ], + "description": "The response that is in progress." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when the response is in progress.", + "x-oaiMeta": { + "name": "response.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseIncompleteDetails": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "enum": [ + "max_output_tokens", + "content_filter" + ] + } + } + }, + "OpenAI.ResponseIncompleteEvent": { + "type": "object", + "required": [ + "type", + "response", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.incomplete" + ], + "description": "The type of the event. Always `response.incomplete`.", + "x-stainless-const": true + }, + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Response" + } + ], + "description": "The response that was incomplete." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "An event that is emitted when a response finishes as incomplete.", + "x-oaiMeta": { + "name": "response.incomplete", + "group": "responses", + "example": "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseItemList": { + "type": "object", + "required": [ + "object", + "data", + "has_more", + "first_id", + "last_id" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ], + "description": "The type of object returned, must be `list`.", + "x-stainless-const": true + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ItemResource" + }, + "description": "A list of items used to generate this response." + }, + "has_more": { + "type": "boolean", + "description": "Whether there are more items available." + }, + "first_id": { + "type": "string", + "description": "The ID of the first item in the list." + }, + "last_id": { + "type": "string", + "description": "The ID of the last item in the list." + } + }, + "description": "A list of Response items.", + "x-oaiMeta": { + "name": "The input item list", + "group": "responses", + "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"msg_abc123\",\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Tell me a three sentence bedtime story about a unicorn.\"\n }\n ]\n }\n ],\n \"first_id\": \"msg_abc123\",\n \"last_id\": \"msg_abc123\",\n \"has_more\": false\n}\n" + } + }, + "OpenAI.ResponseLogProb": { + "type": "object", + "required": [ + "token", + "logprob" + ], + "properties": { + "token": { + "type": "string", + "description": "A possible text token." + }, + "logprob": { + "type": "number", + "description": "The log probability of this token." + }, + "top_logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ResponseLogProbTopLogprobs" + }, + "description": "The log probability of the top 20 most likely tokens." + } + }, + "description": "A logprob is the logarithmic probability that the model assigns to producing\na particular token at a given position in the sequence. Less-negative (higher)\nlogprob values indicate greater model confidence in that token choice." + }, + "OpenAI.ResponseLogProbTopLogprobs": { + "type": "object", + "properties": { + "token": { + "type": "string" + }, + "logprob": { + "type": "number" + } + } + }, + "OpenAI.ResponseMCPCallArgumentsDeltaEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "delta", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.mcp_call_arguments.delta" + ], + "description": "The type of the event. Always 'response.mcp_call_arguments.delta'.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response's output array." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the MCP tool call item being processed." + }, + "delta": { + "type": "string", + "description": "A JSON string containing the partial update to the arguments for the MCP tool call." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when there is a delta (partial update) to the arguments of an MCP tool call.", + "title": "ResponseMCPCallArgumentsDeltaEvent", + "x-oaiMeta": { + "name": "response.mcp_call_arguments.delta", + "group": "responses", + "example": "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseMCPCallFailedEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.mcp_call.failed" + ], + "description": "The type of the event. Always 'response.mcp_call.failed'.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the MCP tool call item that failed." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that failed." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when an MCP tool call has failed.", + "title": "ResponseMCPCallFailedEvent", + "x-oaiMeta": { + "name": "response.mcp_call.failed", + "group": "responses", + "example": "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n" + } + }, + "OpenAI.ResponseMCPCallInProgressEvent": { + "type": "object", + "required": [ + "type", + "sequence_number", + "output_index", + "item_id" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.mcp_call.in_progress" + ], + "description": "The type of the event. Always 'response.mcp_call.in_progress'.", + "x-stainless-const": true + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response's output array." + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the MCP tool call item being processed." + } + }, + "description": "Emitted when an MCP tool call is in progress.", + "title": "ResponseMCPCallInProgressEvent", + "x-oaiMeta": { + "name": "response.mcp_call.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n" + } + }, + "OpenAI.ResponseMCPListToolsFailedEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.mcp_list_tools.failed" + ], + "description": "The type of the event. Always 'response.mcp_list_tools.failed'.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the MCP tool call item that failed." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that failed." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when the attempt to list available MCP tools has failed.", + "title": "ResponseMCPListToolsFailedEvent", + "x-oaiMeta": { + "name": "response.mcp_list_tools.failed", + "group": "responses", + "example": "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" + } + }, + "OpenAI.ResponseMCPListToolsInProgressEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.mcp_list_tools.in_progress" + ], + "description": "The type of the event. Always 'response.mcp_list_tools.in_progress'.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the MCP tool call item that is being processed." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that is being processed." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when the system is in the process of retrieving the list of available MCP tools.", + "title": "ResponseMCPListToolsInProgressEvent", + "x-oaiMeta": { + "name": "response.mcp_list_tools.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" + } + }, + "OpenAI.ResponseModalities": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string", + "enum": [ + "text", + "audio" + ] + } + }, + { + "type": "null" + } + ], + "description": "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n`[\"text\"]`\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](https://platform.openai.com/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n`[\"text\", \"audio\"]`" + }, + "OpenAI.ResponseOutputItemAddedEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "sequence_number", + "item" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.output_item.added" + ], + "description": "The type of the event. Always `response.output_item.added`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that was added." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "item": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.OutputItem" + } + ], + "description": "The output item that was added." + } + }, + "description": "Emitted when a new output item is added.", + "x-oaiMeta": { + "name": "response.output_item.added", + "group": "responses", + "example": "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseOutputTextAnnotationAddedEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "content_index", + "annotation_index", + "sequence_number", + "annotation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.output_text.annotation.added" + ], + "description": "The type of the event. Always 'response.output_text.annotation.added'.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The unique identifier of the item to which the annotation is being added." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item in the response's output array." + }, + "content_index": { + "type": "integer", + "description": "The index of the content part within the output item." + }, + "annotation_index": { + "type": "integer", + "description": "The index of the annotation within the content part." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "annotation": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Annotation" + } + ], + "description": "The annotation object being added. (See annotation schema for details.)" + } + }, + "description": "Emitted when an annotation is added to output text content.", + "title": "ResponseOutputTextAnnotationAddedEvent", + "x-oaiMeta": { + "name": "response.output_text.annotation.added", + "group": "responses", + "example": "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"text_annotation\",\n \"text\": \"This is a test annotation\",\n \"start\": 0,\n \"end\": 10\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponsePromptVariables": { + "type": "object", + "unevaluatedProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/OpenAI.InputTextContent" + }, + { + "$ref": "#/components/schemas/OpenAI.InputImageContent" + }, + { + "$ref": "#/components/schemas/OpenAI.InputFileContent" + } + ] + }, + "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files.", + "title": "Prompt Variables", + "x-oaiExpandable": true, + "x-oaiTypeLabel": "map" + }, + "OpenAI.ResponseQueuedEvent": { + "type": "object", + "required": [ + "type", + "response", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.queued" + ], + "description": "The type of the event. Always 'response.queued'.", + "x-stainless-const": true + }, + "response": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Response" + } + ], + "description": "The full response object that is queued." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number for this event." + } + }, + "description": "Emitted when a response is queued and waiting to be processed.", + "title": "ResponseQueuedEvent", + "x-oaiMeta": { + "name": "response.queued", + "group": "responses", + "example": "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseReasoningSummaryPartAddedEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "summary_index", + "sequence_number", + "part" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.reasoning_summary_part.added" + ], + "description": "The type of the event. Always `response.reasoning_summary_part.added`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the item this summary part is associated with." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item this summary part is associated with." + }, + "summary_index": { + "type": "integer", + "description": "The index of the summary part within the reasoning summary." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + }, + "part": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart" + } + ], + "description": "The summary part that was added." + } + }, + "description": "Emitted when a new reasoning summary part is added.", + "x-oaiMeta": { + "name": "response.reasoning_summary_part.added", + "group": "responses", + "example": "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseReasoningSummaryPartAddedEventPart": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "x-stainless-const": true + }, + "text": { + "type": "string" + } + } + }, + "OpenAI.ResponseReasoningSummaryTextDeltaEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "summary_index", + "delta", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.reasoning_summary_text.delta" + ], + "description": "The type of the event. Always `response.reasoning_summary_text.delta`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the item this summary text delta is associated with." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item this summary text delta is associated with." + }, + "summary_index": { + "type": "integer", + "description": "The index of the summary part within the reasoning summary." + }, + "delta": { + "type": "string", + "description": "The text delta that was added to the summary." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when a delta is added to a reasoning summary text.", + "x-oaiMeta": { + "name": "response.reasoning_summary_text.delta", + "group": "responses", + "example": "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseReasoningTextDeltaEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "content_index", + "delta", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.reasoning_text.delta" + ], + "description": "The type of the event. Always `response.reasoning_text.delta`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the item this reasoning text delta is associated with." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item this reasoning text delta is associated with." + }, + "content_index": { + "type": "integer", + "description": "The index of the reasoning content part this delta is associated with." + }, + "delta": { + "type": "string", + "description": "The text delta that was added to the reasoning content." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when a delta is added to a reasoning text.", + "x-oaiMeta": { + "name": "response.reasoning_text.delta", + "group": "responses", + "example": "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseRefusalDeltaEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "content_index", + "delta", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.refusal.delta" + ], + "description": "The type of the event. Always `response.refusal.delta`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the output item that the refusal text is added to." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the refusal text is added to." + }, + "content_index": { + "type": "integer", + "description": "The index of the content part that the refusal text is added to." + }, + "delta": { + "type": "string", + "description": "The refusal text that is added." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of this event." + } + }, + "description": "Emitted when there is a partial refusal text.", + "x-oaiMeta": { + "name": "response.refusal.delta", + "group": "responses", + "example": "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseStreamOptions": { + "type": "object", + "properties": { + "include_obfuscation": { + "type": "boolean", + "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API." + } + }, + "description": "Options for streaming responses. Only set this when you set `stream: true`." + }, + "OpenAI.ResponseTextDeltaEvent": { + "type": "object", + "required": [ + "type", + "item_id", + "output_index", + "content_index", + "delta", + "sequence_number", + "logprobs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.output_text.delta" + ], + "description": "The type of the event. Always `response.output_text.delta`.", + "x-stainless-const": true + }, + "item_id": { + "type": "string", + "description": "The ID of the output item that the text delta was added to." + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the text delta was added to." + }, + "content_index": { + "type": "integer", + "description": "The index of the content part that the text delta was added to." + }, + "delta": { + "type": "string", + "description": "The text delta that was added." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number for this event." + }, + "logprobs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.ResponseLogProb" + }, + "description": "The log probabilities of the tokens in the delta." + } + }, + "description": "Emitted when there is an additional text delta.", + "x-oaiMeta": { + "name": "response.output_text.delta", + "group": "responses", + "example": "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n" + } + }, + "OpenAI.ResponseTextParam": { + "type": "object", + "properties": { + "format": { + "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" + }, + "verbosity": { + "$ref": "#/components/schemas/OpenAI.Verbosity" + } + }, + "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)" + }, + "OpenAI.ResponseUsage": { + "type": "object", + "required": [ + "input_tokens", + "input_tokens_details", + "output_tokens", + "output_tokens_details", + "total_tokens" + ], + "properties": { + "input_tokens": { + "type": "integer", + "description": "The number of input tokens." + }, + "input_tokens_details": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails" + } + ], + "description": "A detailed breakdown of the input tokens." + }, + "output_tokens": { + "type": "integer", + "description": "The number of output tokens." + }, + "output_tokens_details": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails" + } + ], + "description": "A detailed breakdown of the output tokens." + }, + "total_tokens": { + "type": "integer", + "description": "The total number of tokens used." + } + }, + "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used." + }, + "OpenAI.ResponseUsageInputTokensDetails": { + "type": "object", + "required": [ + "cached_tokens" + ], + "properties": { + "cached_tokens": { + "type": "integer" + } + } + }, + "OpenAI.ResponseUsageOutputTokensDetails": { + "type": "object", + "required": [ + "reasoning_tokens" + ], + "properties": { + "reasoning_tokens": { + "type": "integer" + } + } + }, + "OpenAI.ResponseWebSearchCallInProgressEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.web_search_call.in_progress" + ], + "description": "The type of the event. Always `response.web_search_call.in_progress`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the web search call is associated with." + }, + "item_id": { + "type": "string", + "description": "Unique ID for the output item associated with the web search call." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of the web search call being processed." + } + }, + "description": "Note: web_search is not yet available via Azure OpenAI.", + "x-oaiMeta": { + "name": "response.web_search_call.in_progress", + "group": "responses", + "example": "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" + } + }, + "OpenAI.ResponseWebSearchCallSearchingEvent": { + "type": "object", + "required": [ + "type", + "output_index", + "item_id", + "sequence_number" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "response.web_search_call.searching" + ], + "description": "The type of the event. Always `response.web_search_call.searching`.", + "x-stainless-const": true + }, + "output_index": { + "type": "integer", + "description": "The index of the output item that the web search call is associated with." + }, + "item_id": { + "type": "string", + "description": "Unique ID for the output item associated with the web search call." + }, + "sequence_number": { + "type": "integer", + "description": "The sequence number of the web search call being processed." + } + }, + "description": "Note: web_search is not yet available via Azure OpenAI.", + "x-oaiMeta": { + "name": "response.web_search_call.searching", + "group": "responses", + "example": "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" + } + }, + "OpenAI.RunCompletionUsage": { + "type": "object", + "required": [ + "completion_tokens", + "prompt_tokens", + "total_tokens" + ], + "properties": { + "completion_tokens": { + "type": "integer", + "description": "Number of completion tokens used over the course of the run." + }, + "prompt_tokens": { + "type": "integer", + "description": "Number of prompt tokens used over the course of the run." + }, + "total_tokens": { + "type": "integer", + "description": "Total number of tokens used (prompt + completion)." + } + }, + "description": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.)." + }, + "OpenAI.RunGraderRequest": { + "type": "object", + "required": [ + "grader", + "model_sample" + ], + "properties": { + "grader": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.GraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderPython" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderScoreModel" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderMulti" + }, + { + "$ref": "#/components/schemas/GraderEndpoint" + } + ], + "description": "The grader used for the fine-tuning job." + }, + "item": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunGraderRequestItem" + } + ], + "description": "The dataset item provided to the grader. This will be used to populate\n the `item` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details." + }, + "model_sample": { + "type": "string", + "description": "The model sample to be evaluated. This value will be used to populate\n the `sample` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details.\n The `output_json` variable will be populated if the model sample is a\n valid JSON string." + } + }, + "title": "RunGraderRequest" + }, + "OpenAI.RunGraderRequestItem": { + "type": "object" + }, + "OpenAI.RunGraderResponse": { + "type": "object", + "required": [ + "reward", + "metadata", + "sub_rewards", + "model_grader_token_usage_per_model" + ], + "properties": { + "reward": { + "type": "number" + }, + "metadata": { + "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadata" + }, + "sub_rewards": { + "type": "object", + "unevaluatedProperties": {} + }, + "model_grader_token_usage_per_model": { + "type": "object", + "unevaluatedProperties": {} + } + } + }, + "OpenAI.RunGraderResponseMetadata": { + "type": "object", + "required": [ + "name", + "type", + "errors", + "execution_time", + "scores", + "token_usage", + "sampled_model_name" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "errors": { + "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadataErrors" + }, + "execution_time": { + "type": "number" + }, + "scores": { + "type": "object", + "unevaluatedProperties": {} + }, + "token_usage": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "sampled_model_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.RunGraderResponseMetadataErrors": { + "type": "object", + "required": [ + "formula_parse_error", + "sample_parse_error", + "truncated_observation_error", + "unresponsive_reward_error", + "invalid_variable_error", + "other_error", + "python_grader_server_error", + "python_grader_server_error_type", + "python_grader_runtime_error", + "python_grader_runtime_error_details", + "model_grader_server_error", + "model_grader_refusal_error", + "model_grader_parse_error", + "model_grader_server_error_details" + ], + "properties": { + "formula_parse_error": { + "type": "boolean" + }, + "sample_parse_error": { + "type": "boolean" + }, + "truncated_observation_error": { + "type": "boolean" + }, + "unresponsive_reward_error": { + "type": "boolean" + }, + "invalid_variable_error": { + "type": "boolean" + }, + "other_error": { + "type": "boolean" + }, + "python_grader_server_error": { + "type": "boolean" + }, + "python_grader_server_error_type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "python_grader_runtime_error": { + "type": "boolean" + }, + "python_grader_runtime_error_details": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "model_grader_server_error": { + "type": "boolean" + }, + "model_grader_refusal_error": { + "type": "boolean" + }, + "model_grader_parse_error": { + "type": "boolean" + }, + "model_grader_server_error_details": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.RunObject": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "thread_id", + "assistant_id", + "status", + "required_action", + "last_error", + "expires_at", + "started_at", + "cancelled_at", + "failed_at", + "completed_at", + "incomplete_details", + "model", + "instructions", + "tools", + "metadata", + "usage", + "max_prompt_tokens", + "max_completion_tokens", + "truncation_strategy", + "tool_choice", + "parallel_tool_calls", + "response_format" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "thread.run" + ], + "description": "The object type, which is always `thread.run`.", + "x-stainless-const": true + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the run was created." + }, + "thread_id": { + "type": "string", + "description": "The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run." + }, + "assistant_id": { + "type": "string", + "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run." + }, + "status": { + "$ref": "#/components/schemas/OpenAI.RunStatus" + }, + "required_action": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunObjectRequiredAction" + }, + { + "type": "null" + } + ], + "description": "Details on the action required to continue the run. Will be `null` if no action is required." + }, + "last_error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunObjectLastError" + }, + { + "type": "null" + } + ], + "description": "The last error associated with this run. Will be `null` if there are no errors." + }, + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp", + "description": "The Unix timestamp (in seconds) for when the run will expire." + }, + "started_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp", + "description": "The Unix timestamp (in seconds) for when the run was started." + }, + "cancelled_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp", + "description": "The Unix timestamp (in seconds) for when the run was cancelled." + }, + "failed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp", + "description": "The Unix timestamp (in seconds) for when the run failed." + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp", + "description": "The Unix timestamp (in seconds) for when the run was completed." + }, + "incomplete_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunObjectIncompleteDetails" + }, + { + "type": "null" + } + ], + "description": "Details on why the run is incomplete. Will be `null` if the run is not incomplete." + }, + "model": { + "type": "string", + "description": "The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run." + }, + "instructions": { + "type": "string", + "description": "The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run." + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.AssistantTool" + }, + "maxItems": 20, + "description": "The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.", + "default": [] + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "usage": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunCompletionUsage" + }, + { + "type": "null" + } + ] + }, + "temperature": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "The sampling temperature used for this run. If not set, defaults to 1." + }, + "top_p": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "description": "The nucleus sampling value used for this run. If not set, defaults to 1." + }, + "max_prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 256, + "description": "The maximum number of prompt tokens specified to have been used over the course of the run." + }, + "max_completion_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 256, + "description": "The maximum number of completion tokens specified to have been used over the course of the run." + }, + "truncation_strategy": { + "$ref": "#/components/schemas/OpenAI.TruncationObject" + }, + "tool_choice": { + "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption" + }, + "parallel_tool_calls": { + "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" + }, + "response_format": { + "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption" + } + }, + "description": "Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads).", + "title": "A run on a thread", + "x-oaiMeta": { + "name": "The run object", + "beta": true, + "example": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1698107661,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699073476,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699073498,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [{\"type\": \"file_search\"}, {\"type\": \"code_interpreter\"}],\n \"metadata\": {},\n \"incomplete_details\": null,\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n" + } + }, + "OpenAI.RunObjectIncompleteDetails": { + "type": "object", + "properties": { + "reason": { + "type": "string", + "enum": [ + "max_completion_tokens", + "max_prompt_tokens" + ] + } + } + }, + "OpenAI.RunObjectLastError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "server_error", + "rate_limit_exceeded", + "invalid_prompt" + ] + }, + "message": { + "type": "string" + } + } + }, + "OpenAI.RunObjectRequiredAction": { + "type": "object", + "required": [ + "type", + "submit_tool_outputs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "submit_tool_outputs" + ], + "x-stainless-const": true + }, + "submit_tool_outputs": { + "$ref": "#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs" + } + } + }, + "OpenAI.RunObjectRequiredActionSubmitToolOutputs": { + "type": "object", + "required": [ + "tool_calls" + ], + "properties": { + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RunToolCallObject" + } + } + } + }, + "OpenAI.RunStatus": { + "type": "string", + "enum": [ + "queued", + "in_progress", + "requires_action", + "cancelling", + "cancelled", + "failed", + "completed", + "incomplete", + "expired" + ], + "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`." + }, + "OpenAI.RunStepCompletionUsage": { + "type": "object", + "required": [ + "completion_tokens", + "prompt_tokens", + "total_tokens" + ], + "properties": { + "completion_tokens": { + "type": "integer", + "description": "Number of completion tokens used over the course of the run step." + }, + "prompt_tokens": { + "type": "integer", + "description": "Number of prompt tokens used over the course of the run step." + }, + "total_tokens": { + "type": "integer", + "description": "Total number of tokens used (prompt + completion)." + } + }, + "description": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`." + }, + "OpenAI.RunStepDetailsMessageCreationObject": { + "type": "object", + "required": [ + "type", + "message_creation" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "message_creation" + ], + "description": "Always `message_creation`.", + "x-stainless-const": true + }, + "message_creation": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation" + } + }, + "description": "Details of the message creation by the run step.", + "title": "Message creation" + }, + "OpenAI.RunStepDetailsMessageCreationObjectMessageCreation": { + "type": "object", + "required": [ + "message_id" + ], + "properties": { + "message_id": { + "type": "string" + } + } + }, + "OpenAI.RunStepDetailsToolCall": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "code_interpreter": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject", + "file_search": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject", + "function": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject" + } + } + }, + "OpenAI.RunStepDetailsToolCallType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "code_interpreter", + "file_search", + "function" + ] + } + ] + }, + "OpenAI.RunStepDetailsToolCallsCodeObject": { + "type": "object", + "required": [ + "id", + "type", + "code_interpreter" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call." + }, + "type": { + "type": "string", + "enum": [ + "code_interpreter" + ], + "description": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", + "x-stainless-const": true + }, + "code_interpreter": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter" + } + ], + "description": "The Code Interpreter tool call definition." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" + } + ], + "description": "Details of the Code Interpreter tool call the run step was involved in.", + "title": "Code Interpreter tool call" + }, + "OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter": { + "type": "object", + "required": [ + "input", + "outputs" + ], + "properties": { + "input": { + "type": "string" + }, + "outputs": { + "type": "array", + "items": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject" + }, + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject" + } + ] + } + } + } + }, + "OpenAI.RunStepDetailsToolCallsCodeOutputImageObject": { + "type": "object", + "required": [ + "type", + "image" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image" + ], + "description": "Always `image`.", + "x-stainless-const": true + }, + "image": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage" + } + }, + "title": "Code Interpreter image output", + "x-stainless-naming": { + "java": { + "type_name": "ImageOutput" + }, + "kotlin": { + "type_name": "ImageOutput" + } + } + }, + "OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage": { + "type": "object", + "required": [ + "file_id" + ], + "properties": { + "file_id": { + "type": "string" + } + } + }, + "OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject": { + "type": "object", + "required": [ + "type", + "logs" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "logs" + ], + "description": "Always `logs`.", + "x-stainless-const": true + }, + "logs": { + "type": "string", + "description": "The text output from the Code Interpreter tool call." + } + }, + "description": "Text output from the Code Interpreter tool call as part of a run step.", + "title": "Code Interpreter log output", + "x-stainless-naming": { + "java": { + "type_name": "LogsOutput" + }, + "kotlin": { + "type_name": "LogsOutput" + } + } + }, + "OpenAI.RunStepDetailsToolCallsFileSearchObject": { + "type": "object", + "required": [ + "id", + "type", + "file_search" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call object." + }, + "type": { + "type": "string", + "enum": [ + "file_search" + ], + "description": "The type of tool call. This is always going to be `file_search` for this type of tool call.", + "x-stainless-const": true + }, + "file_search": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch" + } + ], + "description": "For now, this is always going to be an empty object.", + "x-oaiTypeLabel": "map" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" + } + ], + "title": "File search tool call" + }, + "OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch": { + "type": "object", + "properties": { + "ranking_options": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject" + } + } + } + }, + "OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject": { + "type": "object", + "required": [ + "ranker", + "score_threshold" + ], + "properties": { + "ranker": { + "$ref": "#/components/schemas/OpenAI.FileSearchRanker" + }, + "score_threshold": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1." + } + }, + "description": "The ranking options for the file search.", + "title": "File search tool call ranking options" + }, + "OpenAI.RunStepDetailsToolCallsFileSearchResultObject": { + "type": "object", + "required": [ + "file_id", + "file_name", + "score" + ], + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the file that result was found in." + }, + "file_name": { + "type": "string", + "description": "The name of the file that result was found in." + }, + "score": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The score of the result. All values must be a floating point number between 0 and 1." + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent" + }, + "description": "The content of the result that was found. The content is only included if requested via the include query parameter." + } + }, + "description": "A result instance of the file search.", + "title": "File search tool call result", + "x-oaiTypeLabel": "map" + }, + "OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "x-stainless-const": true + }, + "text": { + "type": "string" + } + } + }, + "OpenAI.RunStepDetailsToolCallsFunctionObject": { + "type": "object", + "required": [ + "id", + "type", + "function" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call object." + }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool call. This is always going to be `function` for this type of tool call.", + "x-stainless-const": true + }, + "function": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction" + } + ], + "description": "The definition of the function that was called." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" + } + ], + "title": "Function tool call" + }, + "OpenAI.RunStepDetailsToolCallsFunctionObjectFunction": { + "type": "object", + "required": [ + "name", + "arguments", + "output" + ], + "properties": { + "name": { + "type": "string" + }, + "arguments": { + "type": "string" + }, + "output": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.RunStepDetailsToolCallsObject": { + "type": "object", + "required": [ + "type", + "tool_calls" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "tool_calls" + ], + "description": "Always `tool_calls`.", + "x-stainless-const": true + }, + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" + }, + "description": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`." + } + }, + "description": "Details of the tool call.", + "title": "Tool calls" + }, + "OpenAI.RunStepObject": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "assistant_id", + "thread_id", + "run_id", + "type", + "status", + "step_details", + "last_error", + "expired_at", + "cancelled_at", + "failed_at", + "completed_at", + "metadata", + "usage" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier of the run step, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "thread.run.step" + ], + "description": "The object type, which is always `thread.run.step`.", + "x-stainless-const": true + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the run step was created." + }, + "assistant_id": { + "type": "string", + "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step." + }, + "thread_id": { + "type": "string", + "description": "The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run." + }, + "run_id": { + "type": "string", + "description": "The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of." + }, + "type": { + "type": "string", + "enum": [ + "message_creation", + "tool_calls" + ], + "description": "The type of run step, which can be either `message_creation` or `tool_calls`." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "cancelled", + "failed", + "completed", + "expired" + ], + "description": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`." + }, + "step_details": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject" + }, + { + "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsObject" + } + ], + "description": "The details of the run step." + }, + "last_error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunStepObjectLastError" + }, + { + "type": "null" + } + ] + }, + "expired_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "cancelled_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "failed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "completed_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.RunStepCompletionUsage" + } + }, + "description": "Represents a step in execution of a run.", + "title": "Run steps", + "x-oaiMeta": { + "name": "The run step object", + "beta": true, + "example": "{\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n}\n" + } + }, + "OpenAI.RunStepObjectLastError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "server_error", + "rate_limit_exceeded" + ] + }, + "message": { + "type": "string" + } + } + }, + "OpenAI.RunToolCallObject": { + "type": "object", + "required": [ + "id", + "type", + "function" + ], + "properties": { + "id": { + "type": "string", + "description": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint." + }, + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "The type of tool call the output is required for. For now, this is always `function`.", + "x-stainless-const": true + }, + "function": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.RunToolCallObjectFunction" + } + ], + "description": "The function definition." + } + }, + "description": "Tool call objects" + }, + "OpenAI.RunToolCallObjectFunction": { + "type": "object", + "required": [ + "name", + "arguments" + ], + "properties": { + "name": { + "type": "string" + }, + "arguments": { + "type": "string" + } + } + }, + "OpenAI.Screenshot": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "screenshot" + ], + "description": "Specifies the event type. For a screenshot action, this property is\n always set to `screenshot`.", + "x-stainless-const": true, + "default": "screenshot" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A screenshot action.", + "title": "Screenshot" + }, + "OpenAI.Scroll": { + "type": "object", + "required": [ + "type", + "x", + "y", + "scroll_x", + "scroll_y" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "scroll" + ], + "description": "Specifies the event type. For a scroll action, this property is\n always set to `scroll`.", + "x-stainless-const": true, + "default": "scroll" + }, + "x": { + "type": "integer", + "description": "The x-coordinate where the scroll occurred." + }, + "y": { + "type": "integer", + "description": "The y-coordinate where the scroll occurred." + }, + "scroll_x": { + "type": "integer", + "description": "The horizontal scroll distance." + }, + "scroll_y": { + "type": "integer", + "description": "The vertical scroll distance." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A scroll action.", + "title": "Scroll" + }, + "OpenAI.SearchContextSize": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + "OpenAI.SpecificApplyPatchParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "apply_patch" + ], + "description": "The tool to call. Always `apply_patch`.", + "x-stainless-const": true, + "default": "apply_patch" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Forces the model to call the apply_patch tool when executing a tool call.", + "title": "Specific apply patch tool choice" + }, + "OpenAI.SpecificFunctionShellParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "shell" + ], + "description": "The tool to call. Always `shell`.", + "x-stainless-const": true, + "default": "shell" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Forces the model to call the shell tool when a tool call is required.", + "title": "Specific shell tool choice" + }, + "OpenAI.StaticChunkingStrategy": { + "type": "object", + "required": [ + "max_chunk_size_tokens", + "chunk_overlap_tokens" + ], + "properties": { + "max_chunk_size_tokens": { + "type": "integer", + "minimum": 100, + "maximum": 4096, + "description": "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`." + }, + "chunk_overlap_tokens": { + "type": "integer", + "description": "The number of tokens that overlap between chunks. The default value is `400`.\n Note that the overlap must not exceed half of `max_chunk_size_tokens`." + } + } + }, + "OpenAI.StaticChunkingStrategyRequestParam": { + "type": "object", + "required": [ + "type", + "static" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "static" + ], + "description": "Always `static`.", + "x-stainless-const": true + }, + "static": { + "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" + } + ], + "description": "Customize your own chunking strategy by setting chunk size and chunk overlap.", + "title": "Static Chunking Strategy" + }, + "OpenAI.StaticChunkingStrategyResponseParam": { + "type": "object", + "required": [ + "type", + "static" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "static" + ], + "description": "Always `static`.", + "x-stainless-const": true + }, + "static": { + "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse" + } + ], + "title": "Static Chunking Strategy" + }, + "OpenAI.StopConfiguration": { + "anyOf": [ + { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ], + "description": "Not supported with latest reasoning models `o3` and `o4-mini`.\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence." + }, + "OpenAI.SubmitToolOutputsRunRequest": { + "type": "object", + "required": [ + "tool_outputs" + ], + "properties": { + "tool_outputs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs" + }, + "description": "A list of tools for which the outputs are being submitted." + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.SubmitToolOutputsRunRequestToolOutputs": { + "type": "object", + "properties": { + "tool_call_id": { + "type": "string" + }, + "output": { + "type": "string" + } + } + }, + "OpenAI.Summary": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "description": "The type of the object. Always `summary_text`.", + "x-stainless-const": true, + "default": "summary_text" + }, + "text": { + "type": "string", + "description": "A summary of the reasoning output from the model so far." + } + }, + "description": "A summary text from the model.", + "title": "Summary text" + }, + "OpenAI.SummaryTextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "summary_text" + ], + "description": "The type of the object. Always `summary_text`.", + "x-stainless-const": true, + "default": "summary_text" + }, + "text": { + "type": "string", + "description": "A summary of the reasoning output from the model so far." + } + }, + "description": "A summary text from the model.", + "title": "Summary text" + }, + "OpenAI.TextAnnotation": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.TextAnnotationType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "file_citation": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject", + "file_path": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject" + } + } + }, + "OpenAI.TextAnnotationType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "file_citation", + "file_path" + ] + } + ] + }, + "OpenAI.TextContent": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "x-stainless-const": true, + "default": "text" + }, + "text": { + "type": "string" + } + }, + "description": "A text content.", + "title": "Text Content" + }, + "OpenAI.TextResponseFormatConfiguration": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfigurationType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "json_schema": "#/components/schemas/OpenAI.TextResponseFormatJsonSchema", + "text": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText", + "json_object": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject" + } + }, + "description": "An object specifying the format that the model must output.\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n*Not recommended for gpt-4o and newer models:**\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it." + }, + "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "json_object" + ], + "description": "The type of response format being defined. Always `json_object`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" + } + ], + "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.", + "title": "JSON object" + }, + "OpenAI.TextResponseFormatConfigurationResponseFormatText": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of response format being defined. Always `text`.", + "x-stainless-const": true + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" + } + ], + "description": "Default response format. Used to generate text responses.", + "title": "Text" + }, + "OpenAI.TextResponseFormatConfigurationType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "text", + "json_schema", + "json_object" + ] + } + ] + }, + "OpenAI.TextResponseFormatJsonSchema": { + "type": "object", + "required": [ + "type", + "name", + "schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "json_schema" + ], + "description": "The type of response format being defined. Always `json_schema`.", + "x-stainless-const": true + }, + "description": { + "type": "string", + "description": "A description of what the response format is for, used by the model to\n determine how to respond in the format." + }, + "name": { + "type": "string", + "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\n underscores and dashes, with a maximum length of 64." + }, + "schema": { + "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema" + }, + "strict": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" + } + ], + "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).", + "title": "JSON schema" + }, + "OpenAI.ThreadObject": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "tool_resources", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "thread" + ], + "description": "The object type, which is always `thread`.", + "x-stainless-const": true + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the thread was created." + }, + "tool_resources": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResources" + }, + { + "type": "null" + } + ] + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "description": "Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages).", + "title": "Thread", + "x-oaiMeta": { + "name": "The thread object", + "beta": true, + "example": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1698107661,\n \"metadata\": {}\n}\n" + } + }, + "OpenAI.ThreadObjectToolResources": { + "type": "object", + "properties": { + "code_interpreter": { + "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter" + }, + "file_search": { + "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch" + } + } + }, + "OpenAI.ThreadObjectToolResourcesCodeInterpreter": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 20 + } + } + }, + "OpenAI.ThreadObjectToolResourcesFileSearch": { + "type": "object", + "properties": { + "vector_store_ids": { + "type": "array", + "items": { + "type": "string" + }, + "maxItems": 1 + } + } + }, + "OpenAI.TokenLimits": { + "type": "object", + "properties": { + "post_instructions": { + "type": "integer", + "minimum": 0 + } + } + }, + "OpenAI.Tool": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ToolType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "code_interpreter": "#/components/schemas/OpenAI.CodeInterpreterTool", + "function": "#/components/schemas/OpenAI.FunctionTool", + "file_search": "#/components/schemas/OpenAI.FileSearchTool", + "computer_use_preview": "#/components/schemas/OpenAI.ComputerUsePreviewTool", + "web_search": "#/components/schemas/OpenAI.WebSearchTool", + "mcp": "#/components/schemas/OpenAI.MCPTool", + "image_generation": "#/components/schemas/OpenAI.ImageGenTool", + "local_shell": "#/components/schemas/OpenAI.LocalShellToolParam", + "shell": "#/components/schemas/OpenAI.FunctionShellToolParam", + "custom": "#/components/schemas/OpenAI.CustomToolParam", + "web_search_preview": "#/components/schemas/OpenAI.WebSearchPreviewTool", + "apply_patch": "#/components/schemas/OpenAI.ApplyPatchToolParam" + } + }, + "description": "A tool that can be used to generate a response." + }, + "OpenAI.ToolChoiceAllowed": { + "type": "object", + "required": [ + "type", + "mode", + "tools" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "allowed_tools" + ], + "description": "Allowed tool configuration type. Always `allowed_tools`.", + "x-stainless-const": true + }, + "mode": { + "type": "string", + "enum": [ + "auto", + "required" + ], + "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools." + }, + "tools": { + "type": "array", + "items": { + "type": "object", + "unevaluatedProperties": {} + }, + "description": "A list of tool definitions that the model should be allowed to call.\n For the Responses API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n ]\n ```" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Constrains the tools available to the model to a pre-defined set.", + "title": "Allowed tools" + }, + "OpenAI.ToolChoiceCodeInterpreter": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "code_interpreter" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." + }, + "OpenAI.ToolChoiceComputerUsePreview": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "computer_use_preview" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." + }, + "OpenAI.ToolChoiceCustom": { + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "custom" + ], + "description": "For custom tool calling, the type is always `custom`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the custom tool to call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Use this option to force the model to call a specific custom tool.", + "title": "Custom tool" + }, + "OpenAI.ToolChoiceFileSearch": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "file_search" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." + }, + "OpenAI.ToolChoiceFunction": { + "type": "object", + "required": [ + "type", + "name" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "function" + ], + "description": "For function calling, the type is always `function`.", + "x-stainless-const": true + }, + "name": { + "type": "string", + "description": "The name of the function to call." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Use this option to force the model to call a specific function.", + "title": "Function tool" + }, + "OpenAI.ToolChoiceImageGeneration": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "image_generation" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." + }, + "OpenAI.ToolChoiceMCP": { + "type": "object", + "required": [ + "type", + "server_label" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "mcp" + ], + "description": "For MCP tools, the type is always `mcp`.", + "x-stainless-const": true + }, + "server_label": { + "type": "string", + "description": "The label of the MCP server to use." + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Use this option to force the model to call a specific tool on a remote MCP server.", + "title": "MCP tool" + }, + "OpenAI.ToolChoiceOptions": { + "type": "string", + "enum": [ + "none", + "auto", + "required" + ], + "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n`required` means the model must call one or more tools.", + "title": "Tool choice mode" + }, + "OpenAI.ToolChoiceParam": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParamType" + } + }, + "discriminator": { + "propertyName": "type", + "mapping": { + "allowed_tools": "#/components/schemas/OpenAI.ToolChoiceAllowed", + "mcp": "#/components/schemas/OpenAI.ToolChoiceMCP", + "custom": "#/components/schemas/OpenAI.ToolChoiceCustom", + "apply_patch": "#/components/schemas/OpenAI.SpecificApplyPatchParam", + "shell": "#/components/schemas/OpenAI.SpecificFunctionShellParam", + "file_search": "#/components/schemas/OpenAI.ToolChoiceFileSearch", + "web_search_preview": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview", + "computer_use_preview": "#/components/schemas/OpenAI.ToolChoiceComputerUsePreview", + "web_search_preview_2025_03_11": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311", + "image_generation": "#/components/schemas/OpenAI.ToolChoiceImageGeneration", + "code_interpreter": "#/components/schemas/OpenAI.ToolChoiceCodeInterpreter" + } + }, + "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call." + }, + "OpenAI.ToolChoiceParamType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "allowed_tools", + "function", + "mcp", + "custom", + "apply_patch", + "shell", + "file_search", + "web_search_preview", + "computer_use_preview", + "web_search_preview_2025_03_11", + "image_generation", + "code_interpreter" + ] + } + ] + }, + "OpenAI.ToolChoiceWebSearchPreview": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "web_search_preview" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Note: web_search is not yet available via Azure OpenAI." + }, + "OpenAI.ToolChoiceWebSearchPreview20250311": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "web_search_preview_2025_03_11" + ] + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" + } + ], + "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." + }, + "OpenAI.ToolType": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "function", + "file_search", + "computer_use_preview", + "web_search", + "mcp", + "code_interpreter", + "image_generation", + "local_shell", + "shell", + "custom", + "web_search_preview", + "apply_patch" + ] + } + ] + }, + "OpenAI.ToolsArray": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Tool" + }, + "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\nmodel's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search)\nor [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about\n[built-in tools](https://platform.openai.com/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\nor predefined connectors such as Google Drive and SharePoint. Learn more about\n[MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\nenabling the model to call your own code with strongly typed arguments\nand outputs. Learn more about\n[function calling](https://platform.openai.com/docs/guides/function-calling). You can also use\ncustom tools to call your own code." + }, + "OpenAI.TopLogProb": { + "type": "object", + "required": [ + "token", + "logprob", + "bytes" + ], + "properties": { + "token": { + "type": "string" + }, + "logprob": { + "type": "number" + }, + "bytes": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "description": "The top log probability of a token.", + "title": "Top log probability" + }, + "OpenAI.TranscriptionSegment": { + "type": "object", + "required": [ + "id", + "seek", + "start", + "end", + "text", + "tokens", + "temperature", + "avg_logprob", + "compression_ratio", + "no_speech_prob" + ], + "properties": { + "id": { + "type": "integer", + "description": "Unique identifier of the segment." + }, + "seek": { + "type": "integer", + "description": "Seek offset of the segment." + }, + "start": { + "type": "number", + "format": "float", + "description": "Start time of the segment in seconds." + }, + "end": { + "type": "number", + "format": "float", + "description": "End time of the segment in seconds." + }, + "text": { + "type": "string", + "description": "Text content of the segment." + }, + "tokens": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "Array of token IDs for the text content." + }, + "temperature": { + "type": "number", + "format": "float", + "description": "Temperature parameter used for generating the segment." + }, + "avg_logprob": { + "type": "number", + "format": "float", + "description": "Average logprob of the segment. If the value is lower than -1, consider the logprobs failed." + }, + "compression_ratio": { + "type": "number", + "format": "float", + "description": "Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed." + }, + "no_speech_prob": { + "type": "number", + "format": "float", + "description": "Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent." + } + } + }, + "OpenAI.TranscriptionWord": { + "type": "object", + "required": [ + "word", + "start", + "end" + ], + "properties": { + "word": { + "type": "string", + "description": "The text content of the word." + }, + "start": { + "type": "number", + "format": "float", + "description": "Start time of the word in seconds." + }, + "end": { + "type": "number", + "format": "float", + "description": "End time of the word in seconds." + } + } + }, + "OpenAI.TruncationObject": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "auto", + "last_messages" + ], + "description": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`." + }, + "last_messages": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + } + }, + "description": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", + "title": "Thread Truncation Controls" + }, + "OpenAI.Type": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "type" + ], + "description": "Specifies the event type. For a type action, this property is\n always set to `type`.", + "x-stainless-const": true, + "default": "type" + }, + "text": { + "type": "string", + "description": "The text to type." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "An action to type in text.", + "title": "Type" + }, + "OpenAI.UpdateConversationBody": { + "type": "object", + "required": [ + "metadata" + ], + "properties": { + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ], + "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters." + } + } + }, + "OpenAI.UpdateVectorStoreFileAttributesRequest": { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" + }, + { + "type": "null" + } + ] + } + }, + "x-oaiMeta": { + "name": "Update vector store file attributes request" + } + }, + "OpenAI.UpdateVectorStoreRequest": { + "type": "object", + "properties": { + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The name of the vector store." + }, + "expires_after": { + "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + } + }, + "OpenAI.UrlCitationBody": { + "type": "object", + "required": [ + "type", + "url", + "start_index", + "end_index", + "title" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "url_citation" + ], + "description": "The type of the URL citation. Always `url_citation`.", + "x-stainless-const": true, + "default": "url_citation" + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the web resource." + }, + "start_index": { + "type": "integer", + "description": "The index of the first character of the URL citation in the message." + }, + "end_index": { + "type": "integer", + "description": "The index of the last character of the URL citation in the message." + }, + "title": { + "type": "string", + "description": "The title of the web resource." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Annotation" + } + ], + "description": "A citation for a web resource used to generate a model response.", + "title": "URL citation" + }, + "OpenAI.ValidateGraderResponse": { + "type": "object", + "properties": { + "grader": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.GraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderPython" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderScoreModel" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderMulti" + }, + { + "$ref": "#/components/schemas/GraderEndpoint" + } + ], + "description": "The grader used for the fine-tuning job." + } + }, + "title": "ValidateGraderResponse" + }, + "OpenAI.VectorStoreExpirationAfter": { + "type": "object", + "required": [ + "anchor", + "days" + ], + "properties": { + "anchor": { + "type": "string", + "enum": [ + "last_active_at" + ], + "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.", + "x-stainless-const": true + }, + "days": { + "type": "integer", + "minimum": 1, + "maximum": 365, + "description": "The number of days after the anchor time that the vector store will expire." + } + }, + "description": "The expiration policy for a vector store.", + "title": "Vector store expiration policy" + }, + "OpenAI.VectorStoreFileAttributes": { + "type": "object", + "unevaluatedProperties": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.", + "x-oaiTypeLabel": "map" + }, + "OpenAI.VectorStoreFileBatchObject": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "vector_store_id", + "status", + "file_counts" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "vector_store.files_batch" + ], + "description": "The object type, which is always `vector_store.file_batch`.", + "x-stainless-const": true + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store files batch was created." + }, + "vector_store_id": { + "type": "string", + "description": "The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "cancelled", + "failed" + ], + "description": "The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`." + }, + "file_counts": { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts" + } + }, + "description": "A batch of files attached to a vector store.", + "title": "Vector store file batch", + "x-oaiMeta": { + "name": "The vector store files batch object", + "beta": true, + "example": "{\n \"id\": \"vsfb_123\",\n \"object\": \"vector_store.files_batch\",\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 100\n }\n}\n" + } + }, + "OpenAI.VectorStoreFileBatchObjectFileCounts": { + "type": "object", + "required": [ + "in_progress", + "completed", + "failed", + "cancelled", + "total" + ], + "properties": { + "in_progress": { + "type": "integer" + }, + "completed": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "cancelled": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "OpenAI.VectorStoreFileObject": { + "type": "object", + "required": [ + "id", + "object", + "usage_bytes", + "created_at", + "vector_store_id", + "status", + "last_error" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "vector_store.file" + ], + "description": "The object type, which is always `vector_store.file`.", + "x-stainless-const": true + }, + "usage_bytes": { + "type": "integer", + "description": "The total vector store usage in bytes. Note that this may be different from the original file size." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store file was created." + }, + "vector_store_id": { + "type": "string", + "description": "The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to." + }, + "status": { + "type": "string", + "enum": [ + "in_progress", + "completed", + "cancelled", + "failed" + ], + "description": "The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use." + }, + "last_error": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileObjectLastError" + }, + { + "type": "null" + } + ] + }, + "chunking_strategy": { + "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse" + }, + "attributes": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" + }, + { + "type": "null" + } + ] + } + }, + "description": "A list of files attached to a vector store.", + "title": "Vector store files", + "x-oaiMeta": { + "name": "The vector store file object", + "beta": true, + "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"static\": {\n \"max_chunk_size_tokens\": 800,\n \"chunk_overlap_tokens\": 400\n }\n }\n}\n" + } + }, + "OpenAI.VectorStoreFileObjectLastError": { + "type": "object", + "required": [ + "code", + "message" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "server_error", + "unsupported_file", + "invalid_file" + ] + }, + "message": { + "type": "string" + } + } + }, + "OpenAI.VectorStoreObject": { + "type": "object", + "required": [ + "id", + "object", + "created_at", + "name", + "usage_bytes", + "file_counts", + "status", + "last_active_at", + "metadata" + ], + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "enum": [ + "vector_store" + ], + "description": "The object type, which is always `vector_store`.", + "x-stainless-const": true + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store was created." + }, + "name": { + "type": "string", + "description": "The name of the vector store." + }, + "usage_bytes": { + "type": "integer", + "description": "The total number of bytes used by the files in the vector store." + }, + "file_counts": { + "$ref": "#/components/schemas/OpenAI.VectorStoreObjectFileCounts" + }, + "status": { + "type": "string", + "enum": [ + "expired", + "in_progress", + "completed" + ], + "description": "The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use." + }, + "expires_after": { + "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter" + }, + "expires_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "last_active_at": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "type": "integer", + "format": "unixTimestamp" + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.Metadata" + }, + { + "type": "null" + } + ] + } + }, + "description": "A vector store is a collection of processed files can be used by the `file_search` tool.", + "title": "Vector store", + "x-oaiMeta": { + "name": "The vector store object", + "example": "{\n \"id\": \"vs_123\",\n \"object\": \"vector_store\",\n \"created_at\": 1698107661,\n \"usage_bytes\": 123456,\n \"last_active_at\": 1698107661,\n \"name\": \"my_vector_store\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"cancelled\": 0,\n \"failed\": 0,\n \"total\": 100\n },\n \"last_used_at\": 1698107661\n}\n" + } + }, + "OpenAI.VectorStoreObjectFileCounts": { + "type": "object", + "required": [ + "in_progress", + "completed", + "failed", + "cancelled", + "total" + ], + "properties": { + "in_progress": { + "type": "integer" + }, + "completed": { + "type": "integer" + }, + "failed": { + "type": "integer" + }, + "cancelled": { + "type": "integer" + }, + "total": { + "type": "integer" + } + } + }, + "OpenAI.VectorStoreSearchRequest": { + "type": "object", + "required": [ + "query" + ], + "properties": { + "query": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "A query string for a search" + }, + "rewrite_query": { + "type": "boolean", + "description": "Whether to rewrite the natural language query for vector search." + }, + "max_num_results": { + "type": "integer", + "minimum": 1, + "maximum": 50, + "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive.", + "default": 10 + }, + "filters": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComparisonFilter" + }, + { + "$ref": "#/components/schemas/OpenAI.CompoundFilter" + } + ], + "description": "A filter to apply based on file attributes." + }, + "ranking_options": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions" + } + ], + "description": "Ranking options for search." + } + }, + "x-oaiMeta": { + "name": "Vector store search request" + } + }, + "OpenAI.VectorStoreSearchRequestRankingOptions": { + "type": "object", + "properties": { + "ranker": { + "type": "string", + "enum": [ + "none", + "auto", + "default-2024-11-15" + ], + "default": "auto" + }, + "score_threshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + }, + "OpenAI.VectorStoreSearchResultContentObject": { + "type": "object", + "required": [ + "type", + "text" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "text" + ], + "description": "The type of content." + }, + "text": { + "type": "string", + "description": "The text content returned from search." + } + }, + "x-oaiMeta": { + "name": "Vector store search result content object" + } + }, + "OpenAI.VectorStoreSearchResultItem": { + "type": "object", + "required": [ + "file_id", + "filename", + "score", + "attributes", + "content" + ], + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the vector store file." + }, + "filename": { + "type": "string", + "description": "The name of the vector store file." + }, + "score": { + "type": "number", + "minimum": 0, + "maximum": 1, + "description": "The similarity score for the result." + }, + "attributes": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" + }, + { + "type": "null" + } + ] + }, + "content": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultContentObject" + }, + "description": "Content chunks from the file." + } + }, + "x-oaiMeta": { + "name": "Vector store search result item" + } + }, + "OpenAI.VectorStoreSearchResultsPage": { + "type": "object", + "required": [ + "object", + "search_query", + "data", + "has_more", + "next_page" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "vector_store.search_results.page" + ], + "description": "The object type, which is always `vector_store.search_results.page`", + "x-stainless-const": true + }, + "search_query": { + "type": "array", + "items": { + "type": "string" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultItem" + }, + "description": "The list of search result items." + }, + "has_more": { + "type": "boolean", + "description": "Indicates if there are more results to fetch." + }, + "next_page": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "x-oaiMeta": { + "name": "Vector store search results page" + } + }, + "OpenAI.Verbosity": { + "anyOf": [ + { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ] + }, + { + "type": "null" + } + ], + "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`." + }, + "OpenAI.VoiceIdsShared": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "alloy", + "ash", + "ballad", + "coral", + "echo", + "sage", + "shimmer", + "verse", + "marin", + "cedar" + ] + } + ] + }, + "OpenAI.Wait": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "wait" + ], + "description": "Specifies the event type. For a wait action, this property is\n always set to `wait`.", + "x-stainless-const": true, + "default": "wait" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.ComputerAction" + } + ], + "description": "A wait action.", + "title": "Wait" + }, + "OpenAI.WebSearchActionFind": { + "type": "object", + "required": [ + "type", + "url", + "pattern" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "find_in_page" + ], + "description": "The action type.", + "x-stainless-const": true + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL of the page searched for the pattern." + }, + "pattern": { + "type": "string", + "description": "The pattern or text to search for within the page." + } + }, + "description": "Action type \"find\": Searches for a pattern within a loaded page.", + "title": "Find action" + }, + "OpenAI.WebSearchActionOpenPage": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "open_page" + ], + "description": "The action type.", + "x-stainless-const": true + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL opened by the model." + } + }, + "description": "Action type \"open_page\" - Opens a specific URL from search results.", + "title": "Open page action" + }, + "OpenAI.WebSearchActionSearch": { + "type": "object", + "required": [ + "type", + "query" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "search" + ], + "description": "The action type.", + "x-stainless-const": true + }, + "query": { + "type": "string", + "description": "[DEPRECATED] The search query.", + "deprecated": true + }, + "queries": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The search queries.", + "title": "Search queries" + }, + "sources": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.WebSearchActionSearchSources" + }, + "description": "The sources used in the search.", + "title": "Web search sources" + } + }, + "description": "Action type \"search\" - Performs a web search query.", + "title": "Search action" + }, + "OpenAI.WebSearchActionSearchSources": { + "type": "object", + "required": [ + "type", + "url" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "url" + ], + "x-stainless-const": true + }, + "url": { + "type": "string" + } + } + }, + "OpenAI.WebSearchApproximateLocation": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "approximate" + ], + "description": "The type of location approximation. Always `approximate`.", + "x-stainless-const": true, + "default": "approximate" + }, + "country": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "region": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "city": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "timezone": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + } + }, + "description": "The approximate location of the user.", + "title": "Web search approximate location" + }, + "OpenAI.WebSearchPreviewTool": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "web_search_preview" + ], + "description": "The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.", + "x-stainless-const": true, + "default": "web_search_preview" + }, + "user_location": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.ApproximateLocation" + }, + { + "type": "null" + } + ] + }, + "search_context_size": { + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.SearchContextSize" + } + ], + "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default." + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "Note: web_search is not yet available via Azure OpenAI.", + "title": "Web search preview" + }, + "OpenAI.WebSearchTool": { + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "web_search" + ], + "description": "The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.", + "default": "web_search" + }, + "filters": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.WebSearchToolFilters" + }, + { + "type": "null" + } + ] + }, + "user_location": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.WebSearchApproximateLocation" + }, + { + "type": "null" + } + ] + }, + "search_context_size": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.", + "default": "medium" + } + }, + "allOf": [ + { + "$ref": "#/components/schemas/OpenAI.Tool" + } + ], + "description": "Note: web_search is not yet available via Azure OpenAI.", + "title": "Web search" + }, + "OpenAI.WebSearchToolFilters": { + "type": "object", + "properties": { + "allowed_domains": { + "anyOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "null" + } + ] + } + } + }, + "Order": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + }, + "ResponseFormatJSONSchemaRequest": { + "type": "object", + "required": [ + "type", + "json_schema" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "json_schema" + ], + "description": "Type of response format" + }, + "json_schema": { + "type": "object", + "unevaluatedProperties": {}, + "description": "JSON Schema for the response format" + } + } + }, + "SpeechGenerationResponse": { + "type": "object", + "required": [ + "audio" + ], + "properties": { + "audio": { + "type": "string", + "contentEncoding": "base64", + "description": "The generated audio, generated in the requested audio output format." + } + }, + "description": "A representation of a response for a text-to-speech operation." + }, + "SpeechGenerationResponseFormat": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "mp3", + "opus", + "aac", + "flac", + "wav", + "pcm" + ] + } + ], + "description": "The supported audio output formats for text-to-speech." + }, + "SpeechVoice": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "alloy", + "echo", + "fable", + "onyx", + "nova", + "shimmer" + ] + } + ], + "description": "The available voices for text-to-speech." + }, + "VideoContent": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "content": { + "type": "string", + "contentEncoding": "base64" + } + } + }, + "VideoContentVariant": { + "anyOf": [ + { + "type": "string", + "enum": [ + "video", + "thumbnail", + "spritesheet" + ] + }, + { + "type": "string" + } + ], + "description": "Selectable asset variants for downloaded content." + }, + "VideoIdParameter": { + "type": "object", + "required": [ + "video-id" + ], + "properties": { + "video-id": { + "type": "string", + "description": "The ID of the video to use for the Azure OpenAI request." + } + } + }, + "VideoList": { + "type": "object", + "required": [ + "object", + "data", + "has_more" + ], + "properties": { + "object": { + "type": "string", + "enum": [ + "list" + ] + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VideoResource" + }, + "description": "The list of video generation jobs." + }, + "has_more": { + "type": "boolean", + "description": "A flag indicating whether there are more jobs available after the list." + }, + "first_id": { + "type": "string", + "description": "The ID of the first video in the current page, if available." + }, + "last_id": { + "type": "string", + "description": "The ID of the last video in the current page, if available." + } + }, + "description": "A list of video generation jobs." + }, + "VideoResource": { + "type": "object", + "required": [ + "id", + "object", + "model", + "status", + "progress", + "created_at", + "size", + "seconds" + ], + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the video job." + }, + "object": { + "type": "string", + "description": "The object type, which is always `video`." + }, + "model": { + "type": "string", + "description": "The video generation model deployment that produced the job." + }, + "status": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoStatus" + } + ], + "description": "Current lifecycle status of the video job." + }, + "progress": { + "type": "integer", + "format": "int32", + "description": "Approximate completion percentage for the generation task." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (seconds) for when the job was created." + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (seconds) for when the job completed, if finished." + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "Unix timestamp (seconds) for when the video generation expires (and will be deleted)." + }, + "size": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoSize" + } + ], + "description": "The resolution of the generated video." + }, + "seconds": { + "allOf": [ + { + "$ref": "#/components/schemas/VideoSeconds" + } + ], + "description": "Duration of the generated clip in seconds." + }, + "remixed_from_video_id": { + "type": "string", + "description": "Identifier of the source video if this video is a remix." + }, + "error": { + "allOf": [ + { + "$ref": "#/components/schemas/Error" + } + ], + "description": "Error payload that explains why generation failed, if applicable." + } + }, + "description": "Structured information describing a generated video job." + }, + "VideoSeconds": { + "anyOf": [ + { + "type": "string", + "enum": [ + "4", + "8", + "12" + ] + }, + { + "type": "string" + } + ], + "description": "Supported clip durations, measured in seconds." + }, + "VideoSize": { + "anyOf": [ + { + "type": "string", + "enum": [ + "720x1280", + "1280x720", + "1024x1792", + "1792x1024" + ] + }, + { + "type": "string" + } + ], + "description": "Output dimensions formatted as `{width}x{height}`." + }, + "VideoStatus": { + "anyOf": [ + { + "type": "string", + "enum": [ + "queued", + "in_progress", + "completed", + "failed" + ] + }, + { + "type": "string" + } + ], + "description": "Lifecycle state of a generated video." + } + }, + "securitySchemes": { + "ApiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "api-key" + }, + "ApiKeyAuth_": { + "type": "apiKey", + "in": "header", + "name": "authorization" + }, + "OAuth2Auth": { + "type": "oauth2", + "flows": { + "implicit": { + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + "scopes": { + "https://cognitiveservices.azure.com/.default": "" + } + } + } + } + } + }, + "servers": [ + { + "url": "{endpoint}/openai/v1", + "description": "Azure AI Foundry Models APIs", + "variables": { + "endpoint": { + "default": "", + "description": "A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.\nFor example:\nhttps://westus.api.cognitive.microsoft.com)." + } + } + } + ] +} \ No newline at end of file diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml new file mode 100644 index 000000000..8a39439a3 --- /dev/null +++ b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml @@ -0,0 +1,27510 @@ +openapi: 3.2.0 +info: + title: Azure AI Foundry Models Service + license: + name: MIT + url: https://github.com/openai/openai-openapi/blob/master/LICENSE + version: v1 +tags: + - name: Batch + - name: Chat + - name: Completions + - name: Containers + - name: Conversations + - name: Evals + - name: Files + - name: Embeddings + - name: Fine-tuning + - name: Models + - name: Realtime + - name: Responses + - name: Threads + - name: Vector Stores +paths: + /batches: + post: + operationId: createBatch + summary: Creates and executes a batch from an uploaded file of requests + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: accept + in: header + required: true + schema: + type: string + enum: + - application/json + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - endpoint + - completion_window + - status + - created_at + properties: + id: + type: string + object: + type: string + enum: + - batch + description: The object type, which is always `batch`. + x-stainless-const: true + endpoint: + type: string + description: The OpenAI API endpoint used by the batch. + model: + type: string + description: |- + Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model + guide](https://platform.openai.com/docs/models) to browse and compare available models. + errors: + $ref: '#/components/schemas/OpenAI.BatchErrors' + completion_window: + type: string + description: The time frame within which the batch should be processed. + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + description: The current status of the batch. + output_file_id: + type: string + description: The ID of the file containing the outputs of successfully executed requests. + error_file_id: + type: string + description: The ID of the file containing the outputs of requests with errors. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was created. + in_progress_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started processing. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch will expire. + finalizing_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started finalizing. + completed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was completed. + failed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch failed. + expired_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch expired. + cancelling_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started cancelling. + cancelled_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was cancelled. + request_counts: + $ref: '#/components/schemas/OpenAI.BatchRequestCounts' + usage: + allOf: + - $ref: '#/components/schemas/OpenAI.BatchUsage' + description: |- + Represents token usage details including input tokens, output tokens, a + breakdown of output tokens, and the total tokens used. Only populated on + batches created after September 7, 2025. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + input_file_id: + anyOf: + - type: string + - type: 'null' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Batch + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + input_file_id: + type: string + description: |- + The ID of an uploaded file that contains requests for the new batch. + + See [upload file](/docs/api-reference/files/create) for how to upload a file. + + Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/requestInput), + and must be uploaded with the purpose `batch`. + endpoint: + type: string + enum: + - /v1/chat/completions + - /v1/embeddings + description: The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions` is supported. + completion_window: + type: string + enum: + - 24h + description: The time frame within which the batch should be processed. Currently only `24h` is supported. + required: + - endpoint + - completion_window + unevaluatedProperties: + type: string + get: + operationId: listBatches + summary: List your organization's batches. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: accept + in: header + required: true + schema: + type: string + enum: + - application/json + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListBatchesResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Batch + /batches/{batch_id}: + get: + operationId: retrieveBatch + summary: Retrieves a batch. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: accept + in: header + required: true + schema: + type: string + enum: + - application/json + - name: batch_id + in: path + required: true + description: The ID of the batch to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - endpoint + - completion_window + - status + - created_at + properties: + id: + type: string + object: + type: string + enum: + - batch + description: The object type, which is always `batch`. + x-stainless-const: true + endpoint: + type: string + description: The OpenAI API endpoint used by the batch. + model: + type: string + description: |- + Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model + guide](https://platform.openai.com/docs/models) to browse and compare available models. + errors: + $ref: '#/components/schemas/OpenAI.BatchErrors' + completion_window: + type: string + description: The time frame within which the batch should be processed. + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + description: The current status of the batch. + output_file_id: + type: string + description: The ID of the file containing the outputs of successfully executed requests. + error_file_id: + type: string + description: The ID of the file containing the outputs of requests with errors. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was created. + in_progress_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started processing. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch will expire. + finalizing_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started finalizing. + completed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was completed. + failed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch failed. + expired_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch expired. + cancelling_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started cancelling. + cancelled_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was cancelled. + request_counts: + $ref: '#/components/schemas/OpenAI.BatchRequestCounts' + usage: + allOf: + - $ref: '#/components/schemas/OpenAI.BatchUsage' + description: |- + Represents token usage details including input tokens, output tokens, a + breakdown of output tokens, and the total tokens used. Only populated on + batches created after September 7, 2025. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + input_file_id: + anyOf: + - type: string + - type: 'null' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Batch + /batches/{batch_id}/cancel: + post: + operationId: cancelBatch + summary: Cancels an in-progress batch. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: accept + in: header + required: true + schema: + type: string + enum: + - application/json + - name: batch_id + in: path + required: true + description: The ID of the batch to cancel. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - endpoint + - completion_window + - status + - created_at + properties: + id: + type: string + object: + type: string + enum: + - batch + description: The object type, which is always `batch`. + x-stainless-const: true + endpoint: + type: string + description: The OpenAI API endpoint used by the batch. + model: + type: string + description: |- + Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model + guide](https://platform.openai.com/docs/models) to browse and compare available models. + errors: + $ref: '#/components/schemas/OpenAI.BatchErrors' + completion_window: + type: string + description: The time frame within which the batch should be processed. + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + description: The current status of the batch. + output_file_id: + type: string + description: The ID of the file containing the outputs of successfully executed requests. + error_file_id: + type: string + description: The ID of the file containing the outputs of requests with errors. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was created. + in_progress_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started processing. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch will expire. + finalizing_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started finalizing. + completed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was completed. + failed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch failed. + expired_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch expired. + cancelling_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started cancelling. + cancelled_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was cancelled. + request_counts: + $ref: '#/components/schemas/OpenAI.BatchRequestCounts' + usage: + allOf: + - $ref: '#/components/schemas/OpenAI.BatchUsage' + description: |- + Represents token usage details including input tokens, output tokens, a + breakdown of output tokens, and the total tokens used. Only populated on + batches created after September 7, 2025. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + input_file_id: + anyOf: + - type: string + - type: 'null' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Batch + /chat/completions: + post: + operationId: createChatCompletion + description: Creates a chat completion. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + anyOf: + - type: object + required: + - id + - choices + - created + - model + - object + properties: + id: + type: string + description: A unique identifier for the chat completion. + choices: + type: array + items: + $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoices' + description: A list of chat completion choices. Can be more than one if `n` is greater than 1. + created: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) of when the chat completion was created. + model: + type: string + description: The model used for the chat completion. + system_fingerprint: + type: string + description: |- + This fingerprint represents the backend configuration that the model runs with. + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + deprecated: true + object: + type: string + enum: + - chat.completion + description: The object type, which is always `chat.completion`. + x-stainless-const: true + usage: + $ref: '#/components/schemas/OpenAI.CompletionUsage' + prompt_filter_results: + type: array + items: + type: object + properties: + prompt_index: + type: integer + format: int32 + description: The index of the input prompt that this content filter result corresponds to. + content_filter_results: + allOf: + - $ref: '#/components/schemas/AzureContentFilterResultForPrompt' + description: The content filter results associated with the indexed input prompt. + required: + - prompt_index + - content_filter_results + - type: object + required: + - id + - choices + - created + - model + - object + properties: + id: + type: string + description: A unique identifier for the chat completion. Each chunk has the same ID. + choices: + type: array + items: + $ref: '#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoices' + description: |- + A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the + last chunk if you set `stream_options: {"include_usage": true}`. + created: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. + model: + type: string + description: The model to generate the completion. + system_fingerprint: + type: string + description: |- + This fingerprint represents the backend configuration that the model runs with. + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + deprecated: true + object: + type: string + enum: + - chat.completion.chunk + description: The object type, which is always `chat.completion.chunk`. + x-stainless-const: true + usage: + allOf: + - $ref: '#/components/schemas/OpenAI.CompletionUsage' + description: |- + An optional field that will only be present when you set + `stream_options: {"include_usage": true}` in your request. When present, it + contains a null value **except for the last chunk** which contains the + token usage statistics for the entire request. + *NOTE:** If the stream is interrupted or cancelled, you may not + receive the final usage chunk which contains the total token usage for + the request. + delta: + $ref: '#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta' + content_filter_results: + $ref: '#/components/schemas/AzureContentFilterResultForChoice' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Chat + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + A unique identifier representing your end-user, which can help to + monitor and detect abuse. + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + messages: + type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + minItems: 1 + description: |- + A list of messages comprising the conversation so far. Depending on the + model you use, different message types (modalities) are supported, + like text, images, and audio. + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + modalities: + $ref: '#/components/schemas/OpenAI.ResponseModalities' + verbosity: + $ref: '#/components/schemas/OpenAI.Verbosity' + reasoning_effort: + $ref: '#/components/schemas/OpenAI.ReasoningEffort' + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + description: |- + An upper bound for the number of tokens that can be generated for a + completion, including visible output tokens and reasoning tokens. + frequency_penalty: + anyOf: + - type: number + - type: 'null' + minimum: -2 + maximum: 2 + description: |- + Number between -2.0 and 2.0. Positive values penalize new tokens based on + their existing frequency in the text so far, decreasing the model's + likelihood to repeat the same line verbatim. + presence_penalty: + anyOf: + - type: number + - type: 'null' + minimum: -2 + maximum: 2 + 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. + response_format: + allOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' + description: |- + An object specifying the format that the model must output. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables + Structured Outputs which ensures the model will match your supplied JSON + schema. + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures + the message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model + to produce JSON yourself via a system or user message. Without this, the + model may generate an unending stream of whitespace until the generation + reaches the token limit, resulting in a long-running and seemingly "stuck" + request. Also note that the message content may be partially cut off if + `finish_reason="length"`, which indicates the generation exceeded + `max_tokens` or the conversation exceeded the max context length. + audio: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestAudio' + - type: 'null' + description: |- + Parameters for audio output. Required when audio output is requested with + `modalities: ["audio"]`. + store: + anyOf: + - type: boolean + - type: 'null' + description: |- + Whether or not to store the output of this chat completion request for + use in model distillation or evals products. + stream: + anyOf: + - type: boolean + - type: 'null' + description: |- + If set to true, the model response data will be streamed to the client + as it is generated using server-sent events. + stop: + $ref: '#/components/schemas/OpenAI.StopConfiguration' + logit_bias: + anyOf: + - type: object + unevaluatedProperties: + type: integer + - type: 'null' + description: |- + Modify the likelihood of specified tokens appearing in the completion. + Accepts a JSON object that maps tokens (specified by their token ID in the + tokenizer) to an associated bias value from -100 to 100. Mathematically, + the bias is added to the logits generated by the model prior to sampling. + The exact effect will vary per model, but values between -1 and 1 should + decrease or increase likelihood of selection; values like -100 or 100 + should result in a ban or exclusive selection of the relevant token. + x-oaiTypeLabel: map + logprobs: + anyOf: + - type: boolean + - type: 'null' + description: |- + Whether to return log probabilities of the output tokens or not. If true, + returns the log probabilities of each output token returned in the + `content` of `message`. + max_tokens: + anyOf: + - type: integer + - type: 'null' + description: |- + The maximum number of tokens that can be generated in the chat completion. + This value can be used to control costs for text generated via API. + + This value is now deprecated in favor of `max_completion_tokens`, and is + not compatible with o1 series models. + deprecated: true + 'n': + anyOf: + - type: integer + - type: 'null' + minimum: 1 + maximum: 128 + description: How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + default: 1 + prediction: + allOf: + - $ref: '#/components/schemas/OpenAI.PredictionContent' + description: |- + Configuration for a predicted output, which can greatly improve + response times when large parts of the model response are known + ahead of time. This is most common when you are regenerating a + file with only minor changes to most of the content. + seed: + anyOf: + - type: integer + format: int64 + - type: 'null' + description: |- + This feature is in Beta. + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + deprecated: true + x-oaiMeta: + beta: true + stream_options: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions' + - type: 'null' + tools: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionTool' + - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletions' + description: |- + A list of tools the model may call. You can provide either + [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or + [function tools](https://platform.openai.com/docs/guides/function-calling). + tool_choice: + $ref: '#/components/schemas/OpenAI.ChatCompletionToolChoiceOption' + parallel_tool_calls: + $ref: '#/components/schemas/OpenAI.ParallelToolCalls' + function_call: + anyOf: + - type: string + enum: + - none + - auto + - $ref: '#/components/schemas/OpenAI.ChatCompletionFunctionCallOption' + description: |- + Deprecated in favor of `tool_choice`. + Controls which (if any) function is called by the model. + `none` means the model will not call a function and instead generates a + message. + `auto` means the model can pick between generating a message or calling a + function. + Specifying a particular function via `{"name": "my_function"}` forces the + model to call that function. + `none` is the default when no functions are present. `auto` is the default + if functions are present. + deprecated: true + functions: + type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionFunctions' + minItems: 1 + maxItems: 128 + description: |- + Deprecated in favor of `tools`. + A list of functions the model may generate JSON inputs for. + deprecated: true + user_security_context: + $ref: '#/components/schemas/AzureUserSecurityContext' + required: + - messages + - model + x-ms-examples: + Create a chat completion: + $ref: ./examples/chat_completions.yaml + /completions: + post: + operationId: createCompletion + description: Creates a completion. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - choices + - created + - model + - object + properties: + id: + type: string + description: A unique identifier for the completion. + choices: + type: array + items: + $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoices' + description: The list of completion choices the model generated for the input prompt. + created: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) of when the completion was created. + model: + type: string + description: The model used for completion. + system_fingerprint: + type: string + description: |- + This fingerprint represents the backend configuration that the model runs with. + Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + object: + type: string + enum: + - text_completion + description: The object type, which is always "text_completion" + x-stainless-const: true + usage: + $ref: '#/components/schemas/OpenAI.CompletionUsage' + prompt_filter_results: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterResultForPrompt' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Completions + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + model: + type: string + description: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + x-oaiTypeLabel: string + best_of: + anyOf: + - type: integer + - type: 'null' + minimum: 0 + maximum: 20 + description: |- + Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. + When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. + *Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + default: 1 + echo: + anyOf: + - type: boolean + - type: 'null' + description: Echo back the prompt in addition to the completion + frequency_penalty: + anyOf: + - type: number + - type: 'null' + minimum: -2 + maximum: 2 + description: |- + Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) + logit_bias: + anyOf: + - type: object + unevaluatedProperties: + type: integer + - type: 'null' + description: |- + Modify the likelihood of specified tokens appearing in the completion. + Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + x-oaiTypeLabel: map + logprobs: + anyOf: + - type: integer + - type: 'null' + minimum: 0 + maximum: 5 + description: |- + Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + The maximum value for `logprobs` is 5. + max_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 0 + description: |- + The maximum number of [tokens](/tokenizer) that can be generated in the completion. + The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + default: 16 + 'n': + anyOf: + - type: integer + - type: 'null' + minimum: 1 + maximum: 128 + description: |- + How many completions to generate for each prompt. + *Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + default: 1 + presence_penalty: + anyOf: + - type: number + - type: 'null' + minimum: -2 + maximum: 2 + 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. + [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) + seed: + anyOf: + - type: integer + format: int64 + - type: 'null' + description: |- + If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + stop: + $ref: '#/components/schemas/OpenAI.StopConfiguration' + stream: + anyOf: + - type: boolean + - type: 'null' + description: 'Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).' + stream_options: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions' + - type: 'null' + suffix: + anyOf: + - type: string + - type: 'null' + description: |- + The suffix that comes after a completion of inserted text. + This parameter is only supported for `gpt-3.5-turbo-instruct`. + temperature: + anyOf: + - type: number + - type: 'null' + minimum: 0 + maximum: 2 + description: |- + What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + We generally recommend altering this or `top_p` but not both. + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + minimum: 0 + maximum: 1 + description: |- + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + We generally recommend altering this or `temperature` but not both. + default: 1 + user: + type: string + description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + prompt: + anyOf: + - type: string + - type: array + items: + type: string + - type: 'null' + default: <|endoftext|> + required: + - model + x-ms-examples: + Create a chat completion: + $ref: ./examples/completions.yaml + /containers: + get: + operationId: listContainers + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ContainerListResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + post: + operationId: createContainer + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ContainerResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateContainerBody' + /containers/{container_id}: + get: + operationId: retrieveContainer + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ContainerResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + delete: + operationId: deleteContainer + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + /containers/{container_id}/files: + get: + operationId: listContainerFiles + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container to list files from. + schema: + type: string + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ContainerFileListResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + post: + operationId: createContainerFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container to create a file in. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ContainerFileResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/OpenAI.CreateContainerFileBody' + /containers/{container_id}/files/{file_id}: + get: + operationId: retrieveContainerFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container. + schema: + type: string + - name: file_id + in: path + required: true + description: The ID of the file to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ContainerFileResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + delete: + operationId: deleteContainerFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container. + schema: + type: string + - name: file_id + in: path + required: true + description: The ID of the file to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + /containers/{container_id}/files/{file_id}/content: + get: + operationId: retrieveContainerFileContent + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: container_id + in: path + required: true + description: The ID of the container. + schema: + type: string + - name: file_id + in: path + required: true + description: The ID of the file to retrieve content from. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/octet-stream: + schema: + contentMediaType: application/octet-stream + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Containers + /conversations: + post: + operationId: createConversation + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateConversationBody' + /conversations/{conversation_id}: + get: + operationId: retrieveConversation + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + post: + operationId: updateConversation + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation to update. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.UpdateConversationBody' + delete: + operationId: deleteConversation + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeletedConversationResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + /conversations/{conversation_id}/items: + get: + operationId: listConversationItems + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation to list items for. + schema: + type: string + - name: limit + in: query + required: false + description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: The order to return the input items in. Default is `desc`. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: An item ID to list items after, used in pagination. + schema: + type: string + explode: false + - name: include + in: query + required: false + description: Specify additional output data to include in the model response. + schema: + type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationItemList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + post: + operationId: createConversationItems + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation to add the item to. + schema: + type: string + - name: include + in: query + required: false + description: Additional fields to include in the response. + schema: + type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationItemList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateConversationItemsParametersBody' + /conversations/{conversation_id}/items/{item_id}: + get: + operationId: retrieveConversationItem + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation that contains the item. + schema: + type: string + - name: item_id + in: path + required: true + description: The ID of the item to retrieve. + schema: + type: string + - name: include + in: query + required: false + description: Additional fields to include in the response. + schema: + type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationItem' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + delete: + operationId: deleteConversationItem + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: conversation_id + in: path + required: true + description: The ID of the conversation that contains the item. + schema: + type: string + - name: item_id + in: path + required: true + description: The ID of the item to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ConversationResource' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Conversations + /embeddings: + post: + operationId: createEmbedding + summary: Creates an embedding vector representing the input text. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Embeddings + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateEmbeddingRequest' + x-ms-examples: + Create an embedding request: + $ref: ./examples/embeddings.yaml + /evals: + get: + operationId: listEvals + summary: List evaluations for a project. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: after + in: query + required: false + description: Identifier for the last eval from the previous pagination request. + schema: + type: string + explode: false + - name: limit + in: query + required: false + description: A limit on the number of evals to be returned in a single pagination response. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order for evals by timestamp. Use `asc` for ascending order or + `desc` for descending order. + schema: + type: string + enum: + - asc + - desc + default: asc + explode: false + - name: order_by + in: query + required: false + description: |- + Evals can be ordered by creation time or last updated time. Use + `created_at` for creation time or `updated_at` for last updated + time. + schema: + type: string + enum: + - created_at + - updated_at + default: created_at + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + post: + operationId: createEval + description: |- + Create the structure of an evaluation that can be used to test a model's + performance. + + An evaluation is a set of testing criteria and a datasource. After + creating an evaluation, you can run it on different models and model + parameters. We support several types of graders and datasources. + + For more information, see the [Evals guide](/docs/guides/evals). + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.Eval' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + statusCode: + type: number + enum: + - 201 + name: + type: string + description: The name of the evaluation. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + data_source_config: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig' + - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig' + - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig' + description: The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation. + testing_criteria: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalLabelModelGrader' + - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck' + - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.EvalGraderPython' + - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel' + - $ref: '#/components/schemas/EvalGraderEndpoint' + description: A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`). + required: + - statusCode + - data_source_config + - testing_criteria + /evals/{eval_id}: + get: + operationId: getEval + summary: Retrieve an evaluation by its ID. + description: Retrieves an evaluation by its ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.Eval' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + post: + operationId: updateEval + description: Update select, mutable properties of a specified evaluation. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.Eval' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + metadata: + $ref: '#/components/schemas/OpenAI.Metadata' + delete: + operationId: deleteEval + description: Delete a specified evaluation. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - object + - deleted + - eval_id + properties: + object: + type: string + enum: + - eval.deleted + deleted: + type: boolean + eval_id: + type: string + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + /evals/{eval_id}/runs: + get: + operationId: getEvalRuns + summary: '' + description: Retrieve a list of runs for a specified evaluation. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + - name: after + in: query + required: false + schema: + type: string + explode: false + - name: limit + in: query + required: false + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + schema: + type: string + enum: + - asc + - desc + default: asc + explode: false + - name: status + in: query + required: false + schema: + type: string + enum: + - queued + - in_progress + - completed + - canceled + - failed + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalRunList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + post: + operationId: createEvalRun + description: Create a new evaluation run, beginning the grading process. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalRun' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateEvalRunRequest' + /evals/{eval_id}/runs/{run_id}: + get: + operationId: getEvalRun + description: Retrieve a specific evaluation run by its ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalRun' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + post: + operationId: cancelEvalRun + description: Cancel a specific evaluation run by its ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalRun' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + delete: + operationId: deleteEvalRun + description: Delete a specific evaluation run by its ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - object + - deleted + - eval_run_id + properties: + object: + type: string + enum: + - eval_run.deleted + deleted: + type: boolean + eval_run_id: + type: string + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + /evals/{eval_id}/runs/{run_id}/output_items: + get: + operationId: getEvalRunOutputItems + description: Get a list of output items for a specified evaluation run. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + - name: after + in: query + required: false + schema: + type: string + explode: false + - name: limit + in: query + required: false + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: status + in: query + required: false + schema: + type: string + enum: + - fail + - pass + explode: false + - name: order + in: query + required: false + schema: + type: string + enum: + - asc + - desc + default: asc + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItemList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}: + get: + operationId: getEvalRunOutputItem + description: Retrieve a specific output item from an evaluation run by its ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: eval_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + - name: output_item_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItem' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Evals + /files: + post: + operationId: createFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - bytes + - created_at + - filename + - object + - purpose + - status + properties: + id: + type: string + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + description: The size of the file, in bytes. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the file will expire. + filename: + type: string + description: The name of the file. + object: + type: string + enum: + - file + description: The object type, which is always `file`. + x-stainless-const: true + status_details: + type: string + description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + deprecated: true + purpose: + type: string + enum: + - assistants + - assistants_output + - batch + - batch_output + - fine-tune + - fine-tune-results + - evals + description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`. + status: + type: string + enum: + - uploaded + - pending + - running + - processed + - error + - deleting + - deleted + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Files + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/OpenAI.CreateFileRequest' + x-ms-examples: + Create a file request: + $ref: ./examples/files.yaml + get: + operationId: listFiles + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: purpose + in: query + required: false + schema: + type: string + explode: false + - name: limit + in: query + required: false + schema: + type: integer + explode: false + - name: order + in: query + required: false + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListFilesResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Files + /files/{file_id}: + get: + operationId: retrieveFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: file_id + in: path + required: true + description: The ID of the file to use for this request. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - bytes + - created_at + - filename + - object + - purpose + - status + properties: + id: + type: string + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + description: The size of the file, in bytes. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the file will expire. + filename: + type: string + description: The name of the file. + object: + type: string + enum: + - file + description: The object type, which is always `file`. + x-stainless-const: true + status_details: + type: string + description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + deprecated: true + purpose: + type: string + enum: + - assistants + - assistants_output + - batch + - batch_output + - fine-tune + - fine-tune-results + - evals + description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`. + status: + type: string + enum: + - uploaded + - pending + - running + - processed + - error + - deleting + - deleted + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Files + delete: + operationId: deleteFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: file_id + in: path + required: true + description: The ID of the file to use for this request. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteFileResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Files + /files/{file_id}/content: + get: + operationId: downloadFile + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: file_id + in: path + required: true + description: The ID of the file to use for this request. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/octet-stream: + schema: + contentMediaType: application/octet-stream + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Files + /fine_tuning/alpha/graders/run: + post: + operationId: runGrader + summary: Run a grader. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunGraderResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunGraderRequest' + /fine_tuning/alpha/graders/validate: + post: + operationId: validateGrader + summary: Validate a grader. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ValidateGraderResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + grader: + anyOf: + - $ref: '#/components/schemas/OpenAI.GraderStringCheck' + - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.GraderPython' + - $ref: '#/components/schemas/OpenAI.GraderScoreModel' + - $ref: '#/components/schemas/OpenAI.GraderMulti' + - $ref: '#/components/schemas/GraderEndpoint' + /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions: + get: + operationId: listFineTuningCheckpointPermissions + summary: List checkpoint permissions + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuned_model_checkpoint + in: path + required: true + description: The ID of the fine-tuned model checkpoint to get permissions for. + schema: + type: string + - name: project_id + in: query + required: false + description: The ID of the project to get permissions for. + schema: + type: string + explode: false + - name: after + in: query + required: false + description: Identifier for the last permission ID from the previous pagination request. + schema: + type: string + explode: false + - name: limit + in: query + required: false + description: Number of permissions to retrieve. + schema: + type: integer + format: int32 + default: 10 + explode: false + - name: order + in: query + required: false + description: The order in which to retrieve permissions. + schema: + type: string + enum: + - ascending + - descending + default: descending + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + post: + operationId: createFineTuningCheckpointPermission + summary: Create checkpoint permissions + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuned_model_checkpoint + in: path + required: true + description: The ID of the fine-tuned model checkpoint to create a permission for. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest' + /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}: + delete: + operationId: deleteFineTuningCheckpointPermission + summary: Delete checkpoint permission + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuned_model_checkpoint + in: path + required: true + description: The ID of the fine-tuned model checkpoint to delete a permission for. + schema: + type: string + - name: permission_id + in: path + required: true + description: The ID of the fine-tuned model checkpoint permission to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs: + post: + operationId: createFineTuningJob + summary: |- + Creates a fine-tuning job which begins the process of creating a new model from a given dataset. + + Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. + + [Learn more about fine-tuning](/docs/guides/fine-tuning) + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.FineTuningJob' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequest' + get: + operationId: listPaginatedFineTuningJobs + summary: List your organization's fine-tuning jobs + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: after + in: query + required: false + description: Identifier for the last job from the previous pagination request. + schema: + type: string + explode: false + - name: limit + in: query + required: false + description: Number of fine-tuning jobs to retrieve. + schema: + type: integer + format: int32 + default: 20 + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}: + get: + operationId: retrieveFineTuningJob + summary: |- + Get info about a fine-tuning job. + + [Learn more about fine-tuning](/docs/guides/fine-tuning) + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuning_job_id + in: path + required: true + description: The ID of the fine-tuning job. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.FineTuningJob' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}/cancel: + post: + operationId: cancelFineTuningJob + summary: Immediately cancel a fine-tune job. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuning_job_id + in: path + required: true + description: The ID of the fine-tuning job to cancel. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.FineTuningJob' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints: + get: + operationId: listFineTuningJobCheckpoints + summary: List the checkpoints for a fine-tuning job. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuning_job_id + in: path + required: true + description: The ID of the fine-tuning job to get checkpoints for. + schema: + type: string + - name: after + in: query + required: false + description: Identifier for the last checkpoint ID from the previous pagination request. + schema: + type: string + explode: false + - name: limit + in: query + required: false + description: Number of checkpoints to retrieve. + schema: + type: integer + format: int32 + default: 10 + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy: + post: + operationId: FineTuning_CopyCheckpoint + description: |- + Creates a copy of a fine-tuning checkpoint at the given destination account and region. + + NOTE: This Azure OpenAI API is in preview and subject to change. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: aoai-copy-ft-checkpoints + in: header + required: true + description: |- + Enables access to checkpoint copy operations for models, an AOAI preview feature. + This feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'. + schema: + type: string + enum: + - preview + - name: accept + in: header + required: true + schema: + type: string + enum: + - application/json + - name: fine_tuning_job_id + in: path + required: true + schema: + type: string + - name: fine_tuning_checkpoint_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CopyModelResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CopyModelRequest' + get: + operationId: FineTuning_GetCheckpoint + description: |- + Gets the status of a fine-tuning checkpoint copy. + + NOTE: This Azure OpenAI API is in preview and subject to change. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: aoai-copy-ft-checkpoints + in: header + required: true + description: |- + Enables access to checkpoint copy operations for models, an AOAI preview feature. + This feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'. + schema: + type: string + enum: + - preview + - name: accept + in: header + required: true + schema: + type: string + enum: + - application/json + - name: fine_tuning_job_id + in: path + required: true + schema: + type: string + - name: fine_tuning_checkpoint_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CopyModelResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}/events: + get: + operationId: listFineTuningEvents + summary: Get status updates for a fine-tuning job. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuning_job_id + in: path + required: true + description: The ID of the fine-tuning job to get events for. + schema: + type: string + - name: after + in: query + required: false + description: Identifier for the last event from the previous pagination request. + schema: + type: string + explode: false + - name: limit + in: query + required: false + description: Number of events to retrieve. + schema: + type: integer + format: int32 + default: 20 + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListFineTuningJobEventsResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}/pause: + post: + operationId: pauseFineTuningJob + summary: Pause a fine-tune job. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuning_job_id + in: path + required: true + description: The ID of the fine-tuning job to pause. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.FineTuningJob' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /fine_tuning/jobs/{fine_tuning_job_id}/resume: + post: + operationId: resumeFineTuningJob + summary: Resume a paused fine-tune job. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: fine_tuning_job_id + in: path + required: true + description: The ID of the fine-tuning job to resume. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.FineTuningJob' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Fine-tuning + /models: + get: + operationId: listModels + summary: |- + Lists the currently available models, and provides basic information about each one such as the + owner and availability. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListModelsResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Models + /models/{model}: + get: + operationId: retrieveModel + summary: |- + Retrieves a model instance, providing basic information about the model such as the owner and + permissioning. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: model + in: path + required: true + description: The ID of the model to use for this request. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.Model' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Models + delete: + operationId: deleteModel + summary: Deletes a model instance. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: model + in: path + required: true + description: The ID of the model to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteModelResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Models + /realtime/calls: + post: + operationId: createRealtimeCall + summary: Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '201': + description: The request has succeeded and a new resource has been created as a result. + headers: + location: + required: false + description: Relative URL containing the call ID for subsequent control requests. + schema: + type: string + content: + application/sdp: + schema: + type: string + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeCallCreateRequest' + encoding: + session: + contentType: application/json + /realtime/calls/{call_id}/accept: + post: + operationId: acceptRealtimeCall + summary: Accept an incoming SIP call and configure the realtime session that will handle it. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: call_id + in: path + required: true + description: The identifier for the call provided in the realtime.call.incoming webhook. + schema: + type: string + responses: + '200': + description: The request has succeeded. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA' + description: Session configuration to apply before the caller is bridged to the model. + /realtime/calls/{call_id}/hangup: + post: + operationId: hangupRealtimeCall + summary: End an active Realtime API call, whether it was initiated over SIP or WebRTC. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: call_id + in: path + required: true + description: The identifier for the call. + schema: + type: string + responses: + '200': + description: The request has succeeded. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + /realtime/calls/{call_id}/refer: + post: + operationId: referRealtimeCall + summary: Transfer an active SIP call to a new destination using the SIP REFER verb. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: call_id + in: path + required: true + description: The identifier for the call provided in the realtime.call.incoming webhook. + schema: + type: string + responses: + '200': + description: The request has succeeded. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeCallReferRequest' + description: Destination URI for the REFER request. + /realtime/calls/{call_id}/reject: + post: + operationId: rejectRealtimeCall + summary: Decline an incoming SIP call by returning a SIP status code to the caller. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: call_id + in: path + required: true + description: The identifier for the call provided in the realtime.call.incoming webhook. + schema: + type: string + responses: + '200': + description: The request has succeeded. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeCallRejectRequest' + description: Provide an optional SIP status code. When omitted the API responds with 603 Decline. + /realtime/client_secrets: + post: + operationId: createRealtimeClientSecret + summary: Create a Realtime client secret with an associated session configuration. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretRequest' + description: Create a client secret with the given session configuration. + /realtime/sessions: + post: + operationId: createRealtimeSession + summary: Create an ephemeral API token for use in client-side applications with the Realtime API. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequest' + description: Create an ephemeral API key with the given session configuration. + /realtime/transcription_sessions: + post: + operationId: createRealtimeTranscriptionSession + summary: Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Realtime + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest' + description: Create an ephemeral API key with the given session configuration. + /responses: + post: + operationId: createResponse + description: Creates a model response. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + text/event-stream: + itemSchema: + type: object + properties: + event: + type: string + data: + type: string + required: + - event + oneOf: + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent' + event: + const: response.audio.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent' + event: + const: response.audio.transcript.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent' + event: + const: response.code_interpreter_call_code.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent' + event: + const: response.code_interpreter_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent' + event: + const: response.code_interpreter_call.interpreting + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent' + event: + const: response.content_part.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent' + event: + const: response.created + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseErrorEvent' + event: + const: error + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent' + event: + const: response.file_search_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent' + event: + const: response.file_search_call.searching + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent' + event: + const: response.function_call_arguments.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent' + event: + const: response.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFailedEvent' + event: + const: response.failed + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent' + event: + const: response.incomplete + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent' + event: + const: response.output_item.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent' + event: + const: response.reasoning_summary_part.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent' + event: + const: response.reasoning_summary_text.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent' + event: + const: response.reasoning_text.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent' + event: + const: response.refusal.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent' + event: + const: response.output_text.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent' + event: + const: response.web_search_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent' + event: + const: response.web_search_call.searching + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent' + event: + const: response.image_generation_call.generating + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent' + event: + const: response.image_generation_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent' + event: + const: response.image_generation_call.partial_image + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent' + event: + const: response.mcp_call_arguments.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent' + event: + const: response.mcp_call.failed + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent' + event: + const: response.mcp_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent' + event: + const: response.mcp_list_tools.failed + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent' + event: + const: response.mcp_list_tools.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent' + event: + const: response.output_text.annotation.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent' + event: + const: response.queued + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent' + event: + const: response.custom_tool_call_input.delta + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Responses + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateResponse' + x-ms-examples: + Create a response request: + $ref: ./examples/responses.yaml + /responses/{response_id}: + get: + operationId: getResponse + description: Retrieves a model response with the given ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + - name: include[] + in: query + required: false + description: Additional fields to include in the response. See the include parameter for Response creation above for more information. + schema: + type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + default: [] + - name: stream + in: query + required: false + description: If set to true, the model response data will be streamed to the client as it is generated using server-sent events. + schema: + type: boolean + explode: false + - name: starting_after + in: query + required: false + description: The sequence number of the event after which to start streaming. + schema: + type: integer + format: int32 + explode: false + - name: include_obfuscation + in: query + required: false + description: When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. + schema: + type: boolean + default: true + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Responses + delete: + operationId: deleteResponse + description: Deletes a response by ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - object + - id + - deleted + properties: + object: + type: string + enum: + - response.deleted + id: + type: string + deleted: + type: boolean + enum: + - true + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Responses + /responses/{response_id}/cancel: + post: + operationId: cancelResponse + description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Responses + /responses/{response_id}/input_items: + get: + operationId: listInputItems + description: Returns a list of input items for a given response. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ResponseItemList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Responses + /threads: + post: + operationId: createThread + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ThreadObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateThreadRequest' + /threads/runs: + post: + operationId: createThreadAndRun + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequest' + /threads/{thread_id}: + delete: + operationId: deleteThread + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteThreadResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + get: + operationId: retrieveThread + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ThreadObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + post: + operationId: modifyThread + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ThreadObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ModifyThreadRequest' + /threads/{thread_id}/messages: + get: + operationId: listMessages + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + explode: false + - name: order + in: query + required: false + schema: + type: string + enum: + - asc + - desc + default: desc + explode: false + - name: after + in: query + required: false + schema: + type: string + explode: false + - name: before + in: query + required: false + schema: + type: string + explode: false + - name: run_id + in: query + required: false + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListMessagesResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + post: + operationId: createMessage + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.MessageObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateMessageRequest' + /threads/{thread_id}/messages/{message_id}: + delete: + operationId: deleteMessage + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: message_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteMessageResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + get: + operationId: retrieveMessage + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: message_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.MessageObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + post: + operationId: modifyMessage + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: message_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.MessageObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ModifyMessageRequest' + /threads/{thread_id}/runs: + post: + operationId: createRun + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateRunRequest' + get: + operationId: listRuns + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + explode: false + - name: order + in: query + required: false + schema: + type: string + enum: + - asc + - desc + default: desc + explode: false + - name: after + in: query + required: false + schema: + type: string + explode: false + - name: before + in: query + required: false + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListRunsResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + /threads/{thread_id}/runs/{run_id}: + get: + operationId: retrieveRun + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + post: + operationId: modifyRun + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ModifyRunRequest' + /threads/{thread_id}/runs/{run_id}/cancel: + post: + operationId: cancelRun + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + /threads/{thread_id}/runs/{run_id}/steps: + get: + operationId: listRunSteps + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + - name: limit + in: query + required: false + schema: + type: integer + default: 20 + explode: false + - name: order + in: query + required: false + schema: + type: string + enum: + - asc + - desc + default: desc + explode: false + - name: after + in: query + required: false + schema: + type: string + explode: false + - name: before + in: query + required: false + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListRunStepsResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + /threads/{thread_id}/runs/{run_id}/steps/{step_id}: + get: + operationId: getRunStep + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + - name: step_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunStepObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + /threads/{thread_id}/runs/{run_id}/submit_tool_outputs: + post: + operationId: submitToolOutputsToRun + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: thread_id + in: path + required: true + schema: + type: string + - name: run_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.RunObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Threads + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequest' + /vector_stores: + get: + operationId: listVectorStores + summary: Returns a list of vector stores. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListVectorStoresResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + post: + operationId: createVectorStore + summary: Creates a vector store. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateVectorStoreRequest' + x-ms-examples: + Create a vector store request: + $ref: ./examples/vector_stores.yaml + /vector_stores/{vector_store_id}: + get: + operationId: getVectorStore + summary: Retrieves a vector store. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + post: + operationId: modifyVectorStore + summary: Modifies a vector store. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store to modify. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.UpdateVectorStoreRequest' + delete: + operationId: deleteVectorStore + summary: Delete a vector store. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteVectorStoreResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + /vector_stores/{vector_store_id}/file_batches: + post: + operationId: createVectorStoreFileBatch + summary: Create a vector store file batch. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store for which to create a file batch. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest' + /vector_stores/{vector_store_id}/file_batches/{batch_id}: + get: + operationId: getVectorStoreFileBatch + summary: Retrieves a vector store file batch. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store that the file batch belongs to. + schema: + type: string + - name: batch_id + in: path + required: true + description: The ID of the file batch being retrieved. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: + post: + operationId: cancelVectorStoreFileBatch + summary: Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store that the file batch belongs to. + schema: + type: string + - name: batch_id + in: path + required: true + description: The ID of the file batch to cancel. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + /vector_stores/{vector_store_id}/file_batches/{batch_id}/files: + get: + operationId: listFilesInVectorStoreBatch + summary: Returns a list of vector store files in a batch. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store that the file batch belongs to. + schema: + type: string + - name: batch_id + in: path + required: true + description: The ID of the file batch that the files belong to. + schema: + type: string + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + - name: filter + in: query + required: false + description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + schema: + type: string + enum: + - in_progress + - completed + - failed + - cancelled + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + /vector_stores/{vector_store_id}/files: + get: + operationId: listVectorStoreFiles + summary: Returns a list of vector store files. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store that the files belong to. + schema: + type: string + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + - name: filter + in: query + required: false + description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + schema: + type: string + enum: + - in_progress + - completed + - failed + - cancelled + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + post: + operationId: createVectorStoreFile + summary: Create a vector store file by attaching a [File](/docs/api-reference/files) to a [vector store](/docs/api-reference/vector-stores/object). + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store for which to create a File. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest' + /vector_stores/{vector_store_id}/files/{file_id}: + get: + operationId: getVectorStoreFile + summary: Retrieves a vector store file. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store that the file belongs to. + schema: + type: string + - name: file_id + in: path + required: true + description: The ID of the file being retrieved. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + post: + operationId: updateVectorStoreFileAttributes + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + schema: + type: string + - name: file_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest' + delete: + operationId: deleteVectorStoreFile + summary: Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store that the file belongs to. + schema: + type: string + - name: file_id + in: path + required: true + description: The ID of the file to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.DeleteVectorStoreFileResponse' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + /vector_stores/{vector_store_id}/files/{file_id}/content: + get: + operationId: retrieveVectorStoreFileContent + summary: Retrieve vector store file content + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store to search. + schema: + type: string + - name: file_id + in: path + required: true + description: The ID of the file to retrieve content for. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultsPage' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + /vector_stores/{vector_store_id}/search: + post: + operationId: searchVectorStore + summary: Search vector store + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: vector_store_id + in: path + required: true + description: The ID of the vector store to search. + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultsPage' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + inner_error: {} + required: + - code + - message + - param + - type + tags: + - Vector Stores + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequest' +security: + - ApiKeyAuth: [] + - ApiKeyAuth_: [] + - OAuth2Auth: + - https://cognitiveservices.azure.com/.default +components: + schemas: + AudioSegment: + type: object + required: + - id + - start + - end + - text + - temperature + - avg_logprob + - compression_ratio + - no_speech_prob + - tokens + - seek + properties: + id: + type: integer + format: int32 + description: The 0-based index of this segment within a translation. + start: + type: number + format: float + description: The time at which this segment started relative to the beginning of the translated audio. + end: + type: number + format: float + description: The time at which this segment ended relative to the beginning of the translated audio. + text: + type: string + description: The translated text that was part of this audio segment. + temperature: + type: number + format: float + description: The temperature score associated with this audio segment. + avg_logprob: + type: number + format: float + description: The average log probability associated with this audio segment. + compression_ratio: + type: number + format: float + description: The compression ratio of this audio segment. + no_speech_prob: + type: number + format: float + description: The probability of no speech detection within this audio segment. + tokens: + type: array + items: + type: integer + format: int32 + description: The token IDs matching the translated text in this audio segment. + seek: + type: integer + format: int32 + description: |- + The seek position associated with the processing of this audio segment. + Seek positions are expressed as hundredths of seconds. + The model may process several segments from a single seek position, so while the seek position will never represent + a later time than the segment's start, the segment's start may represent a significantly later time than the + segment's associated seek position. + AudioTaskLabel: + anyOf: + - type: string + - type: string + enum: + - transcribe + - translate + description: Defines the possible descriptors for available audio operation responses. + AudioTranslationSegment: + type: object + required: + - id + - start + - end + - text + - temperature + - avg_logprob + - compression_ratio + - no_speech_prob + - tokens + - seek + properties: + id: + type: integer + format: int32 + description: The 0-based index of this segment within a translation. + start: + type: number + format: float + description: The time at which this segment started relative to the beginning of the translated audio. + end: + type: number + format: float + description: The time at which this segment ended relative to the beginning of the translated audio. + text: + type: string + description: The translated text that was part of this audio segment. + temperature: + type: number + format: float + description: The temperature score associated with this audio segment. + avg_logprob: + type: number + format: float + description: The average log probability associated with this audio segment. + compression_ratio: + type: number + format: float + description: The compression ratio of this audio segment. + no_speech_prob: + type: number + format: float + description: The probability of no speech detection within this audio segment. + tokens: + type: array + items: + type: integer + format: int32 + description: The token IDs matching the translated text in this audio segment. + seek: + type: integer + format: int32 + description: |- + The seek position associated with the processing of this audio segment. + Seek positions are expressed as hundredths of seconds. + The model may process several segments from a single seek position, so while the seek position will never represent + a later time than the segment's start, the segment's start may represent a significantly later time than the + segment's associated seek position. + description: |- + Extended information about a single segment of translated audio data. + Segments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not + necessarily sentences. + AzureAIFoundryModelsApiVersion: + type: string + enum: + - v1 + - preview + AzureAudioTranscriptionResponse: + type: object + required: + - text + properties: + text: + type: string + description: The transcribed text for the provided audio data. + task: + allOf: + - $ref: '#/components/schemas/AudioTaskLabel' + description: The label that describes which operation type generated the accompanying response data. + language: + type: string + description: |- + The spoken language that was detected in the transcribed audio data. + This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. + duration: + type: number + format: float + description: The total duration of the audio processed to produce accompanying transcription information. + segments: + type: array + items: + $ref: '#/components/schemas/OpenAI.TranscriptionSegment' + description: A collection of information about the timing, probabilities, and other detail of each processed audio segment. + words: + type: array + items: + $ref: '#/components/schemas/OpenAI.TranscriptionWord' + description: A collection of information about the timing of each processed word. + description: Result information for an operation that transcribed spoken audio into written text. + AzureAudioTranslationResponse: + type: object + required: + - text + properties: + text: + type: string + description: The translated text for the provided audio data. + task: + allOf: + - $ref: '#/components/schemas/AudioTaskLabel' + description: The label that describes which operation type generated the accompanying response data. + language: + type: string + description: |- + The spoken language that was detected in the translated audio data. + This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. + duration: + type: number + format: float + description: The total duration of the audio processed to produce accompanying translation information. + segments: + type: array + items: + $ref: '#/components/schemas/AudioTranslationSegment' + description: A collection of information about the timing, probabilities, and other detail of each processed audio segment. + description: Result information for an operation that translated spoken audio into written text. + AzureCompletionsSamplingParams: + type: object + properties: + max_tokens: + type: integer + format: int32 + description: The maximum number of tokens in the generated output. + allOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams' + description: Sampling parameters for controlling the behavior of completions. + AzureContentFilterBlocklistIdResult: + type: object + required: + - id + - filtered + properties: + id: + type: string + description: The ID of the custom blocklist associated with the filtered status. + filtered: + type: boolean + description: Whether the associated blocklist resulted in the content being filtered. + description: |- + A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not + the corresponding blocklist resulted in content being filtered. + AzureContentFilterBlocklistResult: + type: object + required: + - filtered + properties: + filtered: + type: boolean + description: A value indicating whether any of the detailed blocklists resulted in a filtering action. + details: + type: array + items: + type: object + properties: + filtered: + type: boolean + description: A value indicating whether the blocklist produced a filtering action. + id: + type: string + description: The ID of the custom blocklist evaluated. + required: + - filtered + - id + description: The pairs of individual blocklist IDs and whether they resulted in a filtering action. + description: A collection of true/false filtering results for configured custom blocklists. + AzureContentFilterCompletionTextSpan: + type: object + required: + - completion_start_offset + - completion_end_offset + properties: + completion_start_offset: + type: integer + format: int32 + description: Offset of the UTF32 code point which begins the span. + completion_end_offset: + type: integer + format: int32 + description: Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. + description: A representation of a span of completion text as used by Azure OpenAI content filter results. + AzureContentFilterCompletionTextSpanDetectionResult: + type: object + required: + - filtered + - detected + - details + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + details: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan' + description: Detailed information about the detected completion text spans. + AzureContentFilterCustomTopicIdResult: + type: object + required: + - id + - detected + properties: + id: + type: string + description: The ID of the custom topic associated with the detected status. + detected: + type: boolean + description: Whether the associated custom topic resulted in the content being detected. + description: |- + A content filter result item that associates an existing custom topic ID with a value indicating whether or not + the corresponding topic resulted in content being detected. + AzureContentFilterCustomTopicResult: + type: object + required: + - filtered + properties: + filtered: + type: boolean + description: A value indicating whether any of the detailed topics resulted in a filtering action. + details: + type: array + items: + type: object + properties: + detected: + type: boolean + description: A value indicating whether the topic is detected. + id: + type: string + description: The ID of the custom topic evaluated. + required: + - detected + - id + description: The pairs of individual topic IDs and whether they are detected. + description: A collection of true/false filtering results for configured custom topics. + AzureContentFilterDetectionResult: + type: object + required: + - filtered + - detected + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + description: |- + A labeled content filter result item that indicates whether the content was detected and whether the content was + filtered. + AzureContentFilterForResponsesAPI: + type: object + required: + - blocked + - source_type + - content_filter_results + - content_filter_offsets + properties: + blocked: + type: boolean + description: Indicate if the response is blocked. + source_type: + type: string + description: The name of the source type of the message. + content_filter_results: + allOf: + - $ref: '#/components/schemas/AzureContentFilterResultsForResponsesAPI' + description: A content filter result for a single response item produced by a generative AI system. + content_filter_offsets: + $ref: '#/components/schemas/AzureContentFilterResultOffsets' + AzureContentFilterHarmExtensions: + type: object + properties: + pii_sub_categories: + type: array + items: + $ref: '#/components/schemas/AzurePiiSubCategory' + description: Configuration for PIIHarmSubCategory(s). + description: Extensions for harm categories, providing additional configuration options. + AzureContentFilterImagePromptResults: + type: object + required: + - jailbreak + properties: + profanity: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the + content. + custom_blocklists: + allOf: + - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' + description: A collection of binary filtering outcomes for configured custom blocklists. + custom_topics: + allOf: + - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' + description: A collection of binary filtering outcomes for configured custom topics. + jailbreak: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes user prompt injection attacks, where malicious users deliberately exploit + system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content + generation or violations of system-imposed restrictions. + allOf: + - $ref: '#/components/schemas/AzureContentFilterImageResponseResults' + description: A content filter result for an image generation operation's input request content. + AzureContentFilterImageResponseResults: + type: object + properties: + sexual: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to anatomical organs and genitals, romantic relationships, acts + portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an + assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. + violence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to physical actions intended to hurt, injure, damage, or kill + someone or something; describes weapons, guns and related entities, such as manufactures, associations, + legislation, and so on. + hate: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that can refer to any content that attacks or uses pejorative or discriminatory + language with reference to a person or identity group based on certain differentiating attributes of these groups + including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, + religion, immigration status, ability status, personal appearance, and body size. + self_harm: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that describes language related to physical actions intended to purposely hurt, injure, + damage one's body or kill oneself. + description: A content filter result for an image generation operation's output response content. + AzureContentFilterPersonallyIdentifiableInformationResult: + type: object + properties: + redacted_text: + type: string + description: The redacted text with PII information removed or masked. + sub_categories: + type: array + items: + $ref: '#/components/schemas/AzurePiiSubCategoryResult' + description: Detailed results for individual PIIHarmSubCategory(s). + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A content filter detection result for Personally Identifiable Information that includes harm extensions. + AzureContentFilterResultForChoice: + type: object + properties: + sexual: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to anatomical organs and genitals, romantic relationships, acts + portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an + assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. + hate: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that can refer to any content that attacks or uses pejorative or discriminatory + language with reference to a person or identity group based on certain differentiating attributes of these groups + including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, + religion, immigration status, ability status, personal appearance, and body size. + violence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to physical actions intended to hurt, injure, damage, or kill + someone or something; describes weapons, guns and related entities, such as manufactures, associations, + legislation, and so on. + self_harm: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that describes language related to physical actions intended to purposely hurt, injure, + damage one's body or kill oneself. + profanity: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the + content. + custom_blocklists: + allOf: + - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' + description: A collection of binary filtering outcomes for configured custom blocklists. + custom_topics: + allOf: + - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' + description: A collection of binary filtering outcomes for configured custom topics. + error: + type: object + properties: + code: + type: integer + format: int32 + description: A distinct, machine-readable code associated with the error. + message: + type: string + description: A human-readable message associated with the error. + required: + - code + - message + description: If present, details about an error that prevented content filtering from completing its evaluation. + protected_material_text: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A detection result that describes a match against text protected under copyright or other status. + protected_material_code: + type: object + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + citation: + type: object + properties: + license: + type: string + description: The name or identifier of the license associated with the detection. + URL: + type: string + format: uri + description: The URL associated with the license. + description: If available, the citation details describing the associated license and its location. + required: + - filtered + - detected + description: A detection result that describes a match against licensed code or other protected source material. + ungrounded_material: + $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult' + personally_identifiable_information: + allOf: + - $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult' + description: A detection result that describes matches against Personal Identifiable Information with configurable subcategories. + description: A content filter result for a single response item produced by a generative AI system. + AzureContentFilterResultForPrompt: + type: object + properties: + prompt_index: + type: integer + format: int32 + description: The index of the input prompt associated with the accompanying content filter result categories. + content_filter_results: + type: object + properties: + sexual: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to anatomical organs and genitals, romantic relationships, acts + portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an + assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. + hate: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that can refer to any content that attacks or uses pejorative or discriminatory + language with reference to a person or identity group based on certain differentiating attributes of these groups + including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, + religion, immigration status, ability status, personal appearance, and body size. + violence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to physical actions intended to hurt, injure, damage, or kill + someone or something; describes weapons, guns and related entities, such as manufactures, associations, + legislation, and so on. + self_harm: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that describes language related to physical actions intended to purposely hurt, injure, + damage one's body or kill oneself. + profanity: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the + content. + custom_blocklists: + allOf: + - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' + description: A collection of binary filtering outcomes for configured custom blocklists. + custom_topics: + allOf: + - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' + description: A collection of binary filtering outcomes for configured custom topics. + error: + type: object + properties: + code: + type: integer + format: int32 + description: A distinct, machine-readable code associated with the error. + message: + type: string + description: A human-readable message associated with the error. + required: + - code + - message + description: If present, details about an error that prevented content filtering from completing its evaluation. + jailbreak: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes user prompt injection attacks, where malicious users deliberately exploit + system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content + generation or violations of system-imposed restrictions. + indirect_attack: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes attacks on systems powered by Generative AI models that can happen every time + an application processes information that wasn’t directly authored by either the developer of the application or + the user. + required: + - jailbreak + - indirect_attack + description: The content filter category details for the result. + description: A content filter result associated with a single input prompt item into a generative AI system. + AzureContentFilterResultOffsets: + type: object + required: + - start_offset + - end_offset + - check_offset + properties: + start_offset: + type: integer + format: int32 + end_offset: + type: integer + format: int32 + check_offset: + type: integer + format: int32 + AzureContentFilterResultsForResponsesAPI: + type: object + required: + - jailbreak + - task_adherence + properties: + sexual: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to anatomical organs and genitals, romantic relationships, acts + portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an + assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. + hate: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that can refer to any content that attacks or uses pejorative or discriminatory + language with reference to a person or identity group based on certain differentiating attributes of these groups + including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, + religion, immigration status, ability status, personal appearance, and body size. + violence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to physical actions intended to hurt, injure, damage, or kill + someone or something; describes weapons, guns and related entities, such as manufactures, associations, + legislation, and so on. + self_harm: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that describes language related to physical actions intended to purposely hurt, injure, + damage one's body or kill oneself. + profanity: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the + content. + custom_blocklists: + allOf: + - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' + description: A collection of binary filtering outcomes for configured custom blocklists. + custom_topics: + allOf: + - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' + description: A collection of binary filtering outcomes for configured custom topics. + error: + type: object + properties: + code: + type: integer + format: int32 + description: A distinct, machine-readable code associated with the error. + message: + type: string + description: A human-readable message associated with the error. + required: + - code + - message + description: If present, details about an error that prevented content filtering from completing its evaluation. + jailbreak: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes user prompt injection attacks, where malicious users deliberately exploit + system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content + generation or violations of system-imposed restrictions. + task_adherence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A detection result that indicates if the execution flow still sticks the plan. + protected_material_text: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A detection result that describes a match against text protected under copyright or other status. + protected_material_code: + type: object + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + citation: + type: object + properties: + license: + type: string + description: The name or identifier of the license associated with the detection. + URL: + type: string + format: uri + description: The URL associated with the license. + description: If available, the citation details describing the associated license and its location. + required: + - filtered + - detected + description: A detection result that describes a match against licensed code or other protected source material. + ungrounded_material: + $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult' + personally_identifiable_information: + allOf: + - $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult' + description: A detection result that describes matches against Personal Identifiable Information with configurable subcategories. + indirect_attack: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes attacks on systems powered by Generative AI models that can happen every time + an application processes information that wasn’t directly authored by either the developer of the application or + the user. + AzureContentFilterSeverityResult: + type: object + required: + - filtered + - severity + properties: + filtered: + type: boolean + description: Whether the content severity resulted in a content filtering action. + severity: + type: string + enum: + - safe + - low + - medium + - high + description: The labeled severity of the content. + description: |- + A labeled content filter result item that indicates whether the content was filtered and what the qualitative + severity level of the content was, as evaluated against content filter configuration for the category. + AzureFileExpiryAnchor: + type: string + enum: + - created_at + AzureFineTuneReinforcementMethod: + type: object + required: + - grader + properties: + grader: + anyOf: + - $ref: '#/components/schemas/OpenAI.GraderStringCheck' + - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.GraderScoreModel' + - $ref: '#/components/schemas/OpenAI.GraderMulti' + - $ref: '#/components/schemas/GraderEndpoint' + response_format: + allOf: + - $ref: '#/components/schemas/ResponseFormatJSONSchemaRequest' + description: Response format to be used while sampling during RFT training + hyperparameters: + $ref: '#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters' + AzurePiiSubCategory: + type: object + required: + - sub_category + - detect + - redact + - filter + properties: + sub_category: + type: string + description: The PIIHarmSubCategory being configured. + detect: + type: boolean + description: Whether detection is enabled for this subcategory. + redact: + type: boolean + description: Whether content containing this subcategory should be redacted. + filter: + type: boolean + description: Whether content containing this subcategory should be blocked. + description: Configuration for individual PIIHarmSubCategory(s) within the harm extensions framework. + AzurePiiSubCategoryResult: + type: object + required: + - sub_category + - filtered + - detected + - redacted + properties: + sub_category: + type: string + description: The PIIHarmSubCategory that was evaluated. + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action for this subcategory. + detected: + type: boolean + description: Whether the labeled content subcategory was detected in the content. + redacted: + type: boolean + description: Whether the content was redacted for this subcategory. + description: Result details for individual PIIHarmSubCategory(s). + AzureResponsesSamplingParams: + type: object + properties: + max_tokens: + type: integer + format: int32 + description: The maximum number of tokens in the generated output. + allOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams' + description: Sampling parameters for controlling the behavior of responses. + AzureUserSecurityContext: + type: object + properties: + application_name: + type: string + description: The name of the application. Sensitive personal information should not be included in this field. + end_user_id: + type: string + description: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field. + end_user_tenant_id: + type: string + description: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant. + source_ip: + type: string + description: Captures the original client's IP address. + description: User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud. + CopiedAccountDetails: + type: object + required: + - destinationResourceId + - region + - status + properties: + destinationResourceId: + type: string + description: The ID of the destination resource where the model was copied to. + region: + type: string + description: The region where the model was copied to. + status: + type: string + enum: + - Completed + - Failed + - InProgress + description: The status of the copy operation. + CopyModelRequest: + type: object + required: + - destinationResourceId + - region + properties: + destinationResourceId: + type: string + description: The ID of the destination Resource to copy. + region: + type: string + description: The region to copy the model to. + CopyModelResponse: + type: object + required: + - checkpointedModelName + - fineTuningJobId + - copiedAccountDetails + properties: + checkpointedModelName: + type: string + description: The ID of the copied model. + fineTuningJobId: + type: string + description: The ID of the fine-tuning job that the checkpoint was copied from. + copiedAccountDetails: + type: array + items: + $ref: '#/components/schemas/CopiedAccountDetails' + description: The ID of the destination resource id where it was copied + CreateVideoBody: + type: object + required: + - model + - prompt + properties: + model: + type: string + description: The name of the deployment to use for this request. + prompt: + type: string + minLength: 1 + description: Text prompt that describes the video to generate. + seconds: + allOf: + - $ref: '#/components/schemas/VideoSeconds' + description: Clip duration in seconds. Defaults to 4 seconds. + default: '4' + size: + allOf: + - $ref: '#/components/schemas/VideoSize' + description: Output resolution formatted as width x height. Defaults to 720x1280. + default: 720x1280 + CreateVideoBodyWithInputReference: + type: object + required: + - model + - prompt + - input_reference + properties: + model: + type: object + description: The name of the deployment to use for this request. + prompt: + type: object + description: Text prompt that describes the video to generate. + seconds: + type: object + description: Clip duration in seconds. Defaults to 4 seconds. + size: + type: object + description: Output resolution formatted as width x height. Defaults to 720x1280. + input_reference: + type: object + description: Optional image reference that guides generation. + x-oaiTypeLabel: file + description: The properties of a video generation job request with media files. + CreateVideoRemixBody: + type: object + required: + - prompt + properties: + prompt: + type: string + minLength: 1 + description: Updated text prompt that directs the remix generation. + description: Parameters for remixing an existing generated video. + DeletedVideoResource: + type: object + required: + - object + - deleted + - id + properties: + object: + type: string + description: The object type that signals the deletion response. + default: video.deleted + deleted: + type: boolean + description: Indicates that the video resource was deleted. + default: true + id: + type: string + description: Identifier of the deleted video. + description: Confirmation payload returned after deleting a video. + Error: + type: object + required: + - code + - message + properties: + code: + type: string + message: + type: string + EvalGraderEndpoint: + type: object + required: + - type + - name + - url + properties: + type: + type: string + enum: + - endpoint + default: endpoint + name: + type: string + description: The name of the grader + url: + type: string + pattern: ^https:// + description: The HTTPS URL of the endpoint to call for grading + headers: + anyOf: + - type: object + unevaluatedProperties: + type: string + - type: 'null' + description: Optional HTTP headers to include in requests to the endpoint + rate_limit: + anyOf: + - type: integer + format: int32 + - type: 'null' + description: |- + Optional rate limit for requests per second to the endpoint + Must be a positive integer + pass_threshold: + anyOf: + - type: number + format: decimal + - type: 'null' + description: |- + Optional threshold score above which the grade is considered passing + If not specified, all scores are considered valid + GraderEndpoint: + type: object + required: + - type + - name + - url + properties: + type: + type: string + enum: + - endpoint + default: endpoint + name: + type: string + description: The name of the grader + url: + type: string + pattern: ^https:// + description: The HTTPS URL of the endpoint to call for grading + headers: + anyOf: + - type: object + unevaluatedProperties: + type: string + - type: 'null' + description: Optional HTTP headers to include in requests to the endpoint + rate_limit: + anyOf: + - type: integer + format: int32 + - type: 'null' + description: |- + Optional rate limit for requests per second to the endpoint + Must be a positive integer + pass_threshold: + anyOf: + - type: number + format: decimal + - type: 'null' + description: |- + Optional threshold score above which the grade is considered passing + If not specified, all scores are considered valid + description: Endpoint grader configuration for external HTTP endpoint evaluation + OpenAI.Annotation: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.AnnotationType' + discriminator: + propertyName: type + mapping: + file_citation: '#/components/schemas/OpenAI.FileCitationBody' + url_citation: '#/components/schemas/OpenAI.UrlCitationBody' + container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody' + file_path: '#/components/schemas/OpenAI.FilePath' + description: An annotation that applies to a span of output text. + OpenAI.AnnotationType: + anyOf: + - type: string + - type: string + enum: + - file_citation + - url_citation + - container_file_citation + - file_path + OpenAI.ApplyPatchCallOutputStatus: + type: string + enum: + - completed + - failed + OpenAI.ApplyPatchCallStatus: + type: string + enum: + - in_progress + - completed + OpenAI.ApplyPatchCreateFileOperation: + type: object + required: + - type + - path + - diff + properties: + type: + type: string + enum: + - create_file + description: Create a new file with the provided diff. + x-stainless-const: true + default: create_file + path: + type: string + description: Path of the file to create. + diff: + type: string + description: Diff to apply. + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' + description: Instruction describing how to create a file via the apply_patch tool. + title: Apply patch create file operation + OpenAI.ApplyPatchDeleteFileOperation: + type: object + required: + - type + - path + properties: + type: + type: string + enum: + - delete_file + description: Delete the specified file. + x-stainless-const: true + default: delete_file + path: + type: string + description: Path of the file to delete. + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' + description: Instruction describing how to delete a file via the apply_patch tool. + title: Apply patch delete file operation + OpenAI.ApplyPatchFileOperation: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperationType' + discriminator: + propertyName: type + mapping: + create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperation' + delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation' + update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation' + description: One of the create_file, delete_file, or update_file operations applied via apply_patch. + title: Apply patch operation + OpenAI.ApplyPatchFileOperationType: + anyOf: + - type: string + - type: string + enum: + - create_file + - delete_file + - update_file + OpenAI.ApplyPatchToolParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - apply_patch + description: The type of the tool. Always `apply_patch`. + x-stainless-const: true + default: apply_patch + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: Allows the assistant to create, delete, or update files using unified diffs. + title: Apply patch tool + OpenAI.ApplyPatchUpdateFileOperation: + type: object + required: + - type + - path + - diff + properties: + type: + type: string + enum: + - update_file + description: Update an existing file with the provided diff. + x-stainless-const: true + default: update_file + path: + type: string + description: Path of the file to update. + diff: + type: string + description: Diff to apply. + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' + description: Instruction describing how to update a file via the apply_patch tool. + title: Apply patch update file operation + OpenAI.ApproximateLocation: + type: object + required: + - type + properties: + type: + type: string + enum: + - approximate + description: The type of location approximation. Always `approximate`. + x-stainless-const: true + default: approximate + country: + anyOf: + - type: string + - type: 'null' + region: + anyOf: + - type: string + - type: 'null' + city: + anyOf: + - type: string + - type: 'null' + timezone: + anyOf: + - type: string + - type: 'null' + OpenAI.AssistantTool: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.AssistantToolType' + discriminator: + propertyName: type + mapping: + code_interpreter: '#/components/schemas/OpenAI.AssistantToolsCode' + file_search: '#/components/schemas/OpenAI.AssistantToolsFileSearch' + function: '#/components/schemas/OpenAI.AssistantToolsFunction' + OpenAI.AssistantToolType: + anyOf: + - type: string + - type: string + enum: + - code_interpreter + - file_search + - function + OpenAI.AssistantToolsCode: + type: object + required: + - type + properties: + type: + type: string + enum: + - code_interpreter + description: 'The type of tool being defined: `code_interpreter`' + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.AssistantTool' + title: Code interpreter tool + OpenAI.AssistantToolsFileSearch: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_search + description: 'The type of tool being defined: `file_search`' + x-stainless-const: true + file_search: + allOf: + - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch' + description: Overrides for the file search tool. + allOf: + - $ref: '#/components/schemas/OpenAI.AssistantTool' + title: FileSearch tool + OpenAI.AssistantToolsFileSearchFileSearch: + type: object + properties: + max_num_results: + type: integer + minimum: 1 + maximum: 50 + ranking_options: + $ref: '#/components/schemas/OpenAI.FileSearchRankingOptions' + OpenAI.AssistantToolsFileSearchTypeOnly: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_search + description: 'The type of tool being defined: `file_search`' + x-stainless-const: true + title: AssistantToolsFileSearchTypeOnly + OpenAI.AssistantToolsFunction: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + description: 'The type of tool being defined: `function`' + x-stainless-const: true + function: + $ref: '#/components/schemas/OpenAI.FunctionObject' + allOf: + - $ref: '#/components/schemas/OpenAI.AssistantTool' + title: Function tool + OpenAI.AssistantsApiResponseFormatOption: + anyOf: + - type: string + enum: + - auto + - $ref: '#/components/schemas/OpenAI.ResponseFormatText' + - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject' + - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema' + description: |- + Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. + *Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. + OpenAI.AssistantsApiToolChoiceOption: + anyOf: + - type: string + enum: + - none + - auto + - required + - $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoice' + description: |- + Controls which (if any) tool is called by the model. + `none` means the model will not call any tools and instead generates a message. + `auto` is the default value and means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools before responding to the user. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + OpenAI.AssistantsNamedToolChoice: + type: object + required: + - type + properties: + type: + type: string + enum: + - function + - code_interpreter + - file_search + description: The type of the tool. If type is `function`, the function name must be set + function: + $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction' + description: Specifies a tool the model should use. Use to force the model to call a specific tool. + OpenAI.AssistantsNamedToolChoiceFunction: + type: object + required: + - name + properties: + name: + type: string + OpenAI.AudioTranscription: + type: object + properties: + model: + type: string + description: The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels. + language: + type: string + description: |- + The language of the input audio. Supplying the input language in + [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format + will improve accuracy and latency. + prompt: + type: string + description: |- + An optional text to guide the model's style or continue a previous audio + segment. + For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). + For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example "expect words related to technology". + OpenAI.AutoChunkingStrategyRequestParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - auto + description: Always `auto`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' + description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. + title: Auto Chunking Strategy + OpenAI.Batch: + type: object + required: + - id + - object + - endpoint + - completion_window + - status + - created_at + properties: + id: + type: string + object: + type: string + enum: + - batch + description: The object type, which is always `batch`. + x-stainless-const: true + endpoint: + type: string + description: The OpenAI API endpoint used by the batch. + model: + type: string + description: |- + Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model + guide](https://platform.openai.com/docs/models) to browse and compare available models. + errors: + $ref: '#/components/schemas/OpenAI.BatchErrors' + completion_window: + type: string + description: The time frame within which the batch should be processed. + status: + type: string + enum: + - validating + - failed + - in_progress + - finalizing + - completed + - expired + - cancelling + - cancelled + description: The current status of the batch. + output_file_id: + type: string + description: The ID of the file containing the outputs of successfully executed requests. + error_file_id: + type: string + description: The ID of the file containing the outputs of requests with errors. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was created. + in_progress_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started processing. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch will expire. + finalizing_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started finalizing. + completed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was completed. + failed_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch failed. + expired_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch expired. + cancelling_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch started cancelling. + cancelled_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the batch was cancelled. + request_counts: + $ref: '#/components/schemas/OpenAI.BatchRequestCounts' + usage: + allOf: + - $ref: '#/components/schemas/OpenAI.BatchUsage' + description: |- + Represents token usage details including input tokens, output tokens, a + breakdown of output tokens, and the total tokens used. Only populated on + batches created after September 7, 2025. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + input_file_id: + anyOf: + - type: string + - type: 'null' + x-oaiMeta: + name: The batch object + example: | + { + "id": "batch_abc123", + "object": "batch", + "endpoint": "/v1/completions", + "model": "gpt-5-2025-08-07", + "errors": null, + "input_file_id": "file-abc123", + "completion_window": "24h", + "status": "completed", + "output_file_id": "file-cvaTdG", + "error_file_id": "file-HOWS94", + "created_at": 1711471533, + "in_progress_at": 1711471538, + "expires_at": 1711557933, + "finalizing_at": 1711493133, + "completed_at": 1711493163, + "failed_at": null, + "expired_at": null, + "cancelling_at": null, + "cancelled_at": null, + "request_counts": { + "total": 100, + "completed": 95, + "failed": 5 + }, + "usage": { + "input_tokens": 1500, + "input_tokens_details": { + "cached_tokens": 1024 + }, + "output_tokens": 500, + "output_tokens_details": { + "reasoning_tokens": 300 + }, + "total_tokens": 2000 + }, + "metadata": { + "customer_id": "user_123456789", + "batch_description": "Nightly eval job", + } + } + OpenAI.BatchError: + type: object + properties: + code: + type: string + description: An error code identifying the error type. + message: + type: string + description: A human-readable message providing more details about the error. + param: + anyOf: + - type: string + - type: 'null' + line: + anyOf: + - type: integer + - type: 'null' + OpenAI.BatchErrors: + type: object + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.BatchError' + OpenAI.BatchRequestCounts: + type: object + required: + - total + - completed + - failed + properties: + total: + type: integer + description: Total number of requests in the batch. + completed: + type: integer + description: Number of requests that have been completed successfully. + failed: + type: integer + description: Number of requests that have failed. + description: The request counts for different statuses within the batch. + OpenAI.BatchUsage: + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + properties: + input_tokens: + type: integer + input_tokens_details: + $ref: '#/components/schemas/OpenAI.BatchUsageInputTokensDetails' + output_tokens: + type: integer + output_tokens_details: + $ref: '#/components/schemas/OpenAI.BatchUsageOutputTokensDetails' + total_tokens: + type: integer + OpenAI.BatchUsageInputTokensDetails: + type: object + required: + - cached_tokens + properties: + cached_tokens: + type: integer + OpenAI.BatchUsageOutputTokensDetails: + type: object + required: + - reasoning_tokens + properties: + reasoning_tokens: + type: integer + OpenAI.ChatCompletionAllowedTools: + type: object + required: + - mode + - tools + properties: + mode: + type: string + enum: + - auto + - required + description: |- + Constrains the tools available to the model to a pre-defined set. + `auto` allows the model to pick from among the allowed tools and generate a + message. + `required` requires the model to call one or more of the allowed tools. + tools: + type: array + items: + type: object + unevaluatedProperties: {} + description: |- + A list of tool definitions that the model should be allowed to call. + For the Chat Completions API, the list of tool definitions might look like: + ```json + [ + { "type": "function", "function": { "name": "get_weather" } }, + { "type": "function", "function": { "name": "get_time" } } + ] + ``` + description: Constrains the tools available to the model to a pre-defined set. + title: Allowed tools + OpenAI.ChatCompletionAllowedToolsChoice: + type: object + required: + - type + - allowed_tools + properties: + type: + type: string + enum: + - allowed_tools + description: Allowed tool configuration type. Always `allowed_tools`. + x-stainless-const: true + allowed_tools: + $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedTools' + description: Constrains the tools available to the model to a pre-defined set. + title: Allowed tools + OpenAI.ChatCompletionFunctionCallOption: + type: object + required: + - name + properties: + name: + type: string + description: The name of the function to call. + description: 'Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.' + x-stainless-variantName: function_call_option + OpenAI.ChatCompletionFunctions: + type: object + required: + - name + properties: + description: + type: string + description: A description of what the function does, used by the model to choose when and how to call the function. + name: + type: string + description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + parameters: + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionParameters' + description: |- + The parameters the functions accepts, described as a JSON Schema object. + See the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) + for documentation about the format. + + Omitting `parameters` defines a function with an empty parameter list. + deprecated: true + OpenAI.ChatCompletionMessageCustomToolCall: + type: object + required: + - id + - type + - custom + properties: + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - custom + description: The type of the tool. Always `custom`. + x-stainless-const: true + custom: + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom' + description: The custom tool that the model called. + description: A call to a custom tool created by the model. + title: Custom tool call + OpenAI.ChatCompletionMessageCustomToolCallCustom: + type: object + required: + - name + - input + properties: + name: + type: string + input: + type: string + OpenAI.ChatCompletionMessageToolCall: + type: object + required: + - id + - type + - function + properties: + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + x-stainless-const: true + function: + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction' + description: The function that the model called. + description: A call to a function tool created by the model. + title: Function tool call + OpenAI.ChatCompletionMessageToolCallChunk: + type: object + required: + - index + properties: + index: + type: integer + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + x-stainless-const: true + function: + $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunkFunction' + OpenAI.ChatCompletionMessageToolCallChunkFunction: + type: object + properties: + name: + type: string + arguments: + type: string + OpenAI.ChatCompletionMessageToolCallFunction: + type: object + required: + - name + - arguments + properties: + name: + type: string + arguments: + type: string + OpenAI.ChatCompletionMessageToolCalls: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall' + - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall' + description: The tool calls generated by the model, such as function calls. + OpenAI.ChatCompletionMessageToolCallsItem: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall' + - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall' + description: The tool calls generated by the model, such as function calls. + OpenAI.ChatCompletionNamedToolChoice: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + description: For function calling, the type is always `function`. + x-stainless-const: true + function: + $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction' + description: Specifies a tool the model should use. Use to force the model to call a specific function. + title: Function tool choice + OpenAI.ChatCompletionNamedToolChoiceCustom: + type: object + required: + - type + - custom + properties: + type: + type: string + enum: + - custom + description: For custom tool calling, the type is always `custom`. + x-stainless-const: true + custom: + $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom' + description: Specifies a tool the model should use. Use to force the model to call a specific custom tool. + title: Custom tool choice + OpenAI.ChatCompletionNamedToolChoiceCustomCustom: + type: object + required: + - name + properties: + name: + type: string + OpenAI.ChatCompletionNamedToolChoiceFunction: + type: object + required: + - name + properties: + name: + type: string + OpenAI.ChatCompletionRequestAssistantMessage: + type: object + required: + - role + properties: + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart' + - type: 'null' + refusal: + anyOf: + - type: string + - type: 'null' + role: + type: string + enum: + - assistant + description: The role of the messages author, in this case `assistant`. + x-stainless-const: true + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + audio: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio' + - type: 'null' + description: Data about a previous audio response from the model. + tool_calls: + $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCalls' + function_call: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + description: Messages sent by the model in response to user messages. + title: Assistant message + x-stainless-soft-required: + - content + OpenAI.ChatCompletionRequestAssistantMessageAudio: + type: object + required: + - id + properties: + id: + type: string + OpenAI.ChatCompletionRequestAssistantMessageContentPart: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType' + discriminator: + propertyName: type + mapping: + refusal: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal' + text: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText' + OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: The type of the content part. + x-stainless-const: true + text: + type: string + description: The text content. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart' + description: Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation). + title: Text content part + x-stainless-naming: + go: + variant_constructor: TextContentPart + OpenAI.ChatCompletionRequestAssistantMessageContentPartType: + anyOf: + - type: string + - type: string + enum: + - text + - refusal + OpenAI.ChatCompletionRequestAssistantMessageFunctionCall: + type: object + required: + - arguments + - name + properties: + arguments: + type: string + name: + type: string + OpenAI.ChatCompletionRequestDeveloperMessage: + type: object + required: + - content + - role + properties: + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' + description: The contents of the developer message. + role: + type: string + enum: + - developer + description: The role of the messages author, in this case `developer`. + x-stainless-const: true + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + description: |- + Developer-provided instructions that the model should follow, regardless of + messages sent by the user. With o1 models and newer, `developer` messages + replace the previous `system` messages. + title: Developer message + x-stainless-naming: + go: + variant_constructor: DeveloperMessage + OpenAI.ChatCompletionRequestFunctionMessage: + type: object + required: + - role + - content + - name + properties: + role: + type: string + enum: + - function + description: The role of the messages author, in this case `function`. + x-stainless-const: true + content: + anyOf: + - type: string + - type: 'null' + name: + type: string + description: The name of the function to call. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + title: Function message + deprecated: true + OpenAI.ChatCompletionRequestMessage: + type: object + required: + - role + properties: + role: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageType' + discriminator: + propertyName: role + mapping: + assistant: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage' + developer: '#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage' + function: '#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage' + system: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage' + user: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessage' + tool: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessage' + OpenAI.ChatCompletionRequestMessageContentPartAudio: + type: object + required: + - type + - input_audio + properties: + type: + type: string + enum: + - input_audio + description: The type of the content part. Always `input_audio`. + x-stainless-const: true + input_audio: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio' + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' + description: '' + title: Audio content part + x-stainless-naming: + go: + variant_constructor: InputAudioContentPart + OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio: + type: object + required: + - data + - format + properties: + data: + type: string + format: + type: string + enum: + - wav + - mp3 + OpenAI.ChatCompletionRequestMessageContentPartFile: + type: object + required: + - type + - file + properties: + type: + type: string + enum: + - file + description: The type of the content part. Always `file`. + x-stainless-const: true + file: + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile' + x-stainless-naming: + java: + type_name: FileObject + kotlin: + type_name: FileObject + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' + description: Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text generation. + title: File content part + x-stainless-naming: + go: + variant_constructor: FileContentPart + OpenAI.ChatCompletionRequestMessageContentPartFileFile: + type: object + properties: + filename: + type: string + file_data: + type: string + file_id: + type: string + OpenAI.ChatCompletionRequestMessageContentPartImage: + type: object + required: + - type + - image_url + properties: + type: + type: string + enum: + - image_url + description: The type of the content part. + x-stainless-const: true + image_url: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl' + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' + description: '' + title: Image content part + x-stainless-naming: + go: + variant_constructor: ImageContentPart + OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl: + type: object + required: + - url + properties: + url: + type: string + format: uri + detail: + type: string + enum: + - auto + - low + - high + default: auto + OpenAI.ChatCompletionRequestMessageContentPartRefusal: + type: object + required: + - type + - refusal + properties: + type: + type: string + enum: + - refusal + description: The type of the content part. + x-stainless-const: true + refusal: + type: string + description: The refusal message generated by the model. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart' + title: Refusal content part + OpenAI.ChatCompletionRequestMessageContentPartText: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: The type of the content part. + x-stainless-const: true + text: + type: string + description: The text content. + description: '' + title: Text content part + x-stainless-naming: + go: + variant_constructor: TextContentPart + OpenAI.ChatCompletionRequestMessageType: + anyOf: + - type: string + - type: string + enum: + - developer + - system + - user + - assistant + - tool + - function + OpenAI.ChatCompletionRequestSystemMessage: + type: object + required: + - content + - role + properties: + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart' + description: The contents of the system message. + role: + type: string + enum: + - system + description: The role of the messages author, in this case `system`. + x-stainless-const: true + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + description: |- + Developer-provided instructions that the model should follow, regardless of + messages sent by the user. With o1 models and newer, use `developer` messages + for this purpose instead. + title: System message + x-stainless-naming: + go: + variant_constructor: SystemMessage + OpenAI.ChatCompletionRequestSystemMessageContentPart: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' + OpenAI.ChatCompletionRequestToolMessage: + type: object + required: + - role + - content + - tool_call_id + properties: + role: + type: string + enum: + - tool + description: The role of the messages author, in this case `tool`. + x-stainless-const: true + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart' + description: The contents of the tool message. + tool_call_id: + type: string + description: Tool call that this message is responding to. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + title: Tool message + x-stainless-naming: + go: + variant_constructor: ToolMessage + OpenAI.ChatCompletionRequestToolMessageContentPart: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' + OpenAI.ChatCompletionRequestUserMessage: + type: object + required: + - content + - role + properties: + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' + description: The contents of the user message. + role: + type: string + enum: + - user + description: The role of the messages author, in this case `user`. + x-stainless-const: true + name: + type: string + description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' + description: |- + Messages sent by an end user, containing prompts or additional context + information. + title: User message + x-stainless-naming: + go: + variant_constructor: UserMessage + OpenAI.ChatCompletionRequestUserMessageContentPart: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType' + discriminator: + propertyName: type + mapping: + image_url: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage' + input_audio: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio' + file: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile' + text: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText' + OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: The type of the content part. + x-stainless-const: true + text: + type: string + description: The text content. + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' + description: Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation). + title: Text content part + x-stainless-naming: + go: + variant_constructor: TextContentPart + OpenAI.ChatCompletionRequestUserMessageContentPartType: + anyOf: + - type: string + - type: string + enum: + - text + - image_url + - input_audio + - file + OpenAI.ChatCompletionResponseMessage: + type: object + required: + - content + - refusal + - role + properties: + content: + anyOf: + - type: string + - type: 'null' + refusal: + anyOf: + - type: string + - type: 'null' + tool_calls: + $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem' + annotations: + type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations' + description: |- + Annotations for the message, when applicable, as when using the + [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). + role: + type: string + enum: + - assistant + description: The role of the author of this message. + x-stainless-const: true + function_call: + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall' + description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + deprecated: true + audio: + anyOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio' + - type: 'null' + reasoning_content: + type: string + description: An Azure-specific extension property containing generated reasoning content from supported models. + description: |- + If the audio output modality is requested, this object contains data + about the audio response from the model. + OpenAI.ChatCompletionResponseMessageAnnotations: + type: object + required: + - type + - url_citation + properties: + type: + type: string + enum: + - url_citation + x-stainless-const: true + url_citation: + $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation' + OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation: + type: object + required: + - end_index + - start_index + - url + - title + properties: + end_index: + type: integer + start_index: + type: integer + url: + type: string + title: + type: string + OpenAI.ChatCompletionResponseMessageAudio: + type: object + required: + - id + - expires_at + - data + - transcript + properties: + id: + type: string + expires_at: + type: integer + format: unixtime + data: + type: string + transcript: + type: string + OpenAI.ChatCompletionResponseMessageFunctionCall: + type: object + required: + - arguments + - name + properties: + arguments: + type: string + name: + type: string + OpenAI.ChatCompletionStreamOptions: + type: object + properties: + include_usage: + type: boolean + description: |- + If set, an additional chunk will be streamed before the `data: [DONE]` + message. The `usage` field on this chunk shows the token usage statistics + for the entire request, and the `choices` field will always be an empty + array. + All other chunks will also include a `usage` field, but with a null + value. **NOTE:** If the stream is interrupted, you may not receive the + final usage chunk which contains the total token usage for the request. + include_obfuscation: + type: boolean + description: |- + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. + description: 'Options for streaming response. Only set this when you set `stream: true`.' + OpenAI.ChatCompletionStreamResponseDelta: + type: object + properties: + content: + anyOf: + - type: string + - type: 'null' + function_call: + allOf: + - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamResponseDeltaFunctionCall' + description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + deprecated: true + tool_calls: + type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunk' + role: + type: string + enum: + - developer + - system + - user + - assistant + - tool + description: The role of the author of this message. + refusal: + anyOf: + - type: string + - type: 'null' + reasoning_content: + type: string + description: An Azure-specific extension property containing generated reasoning content from supported models. + description: A chat completion delta generated by streamed model responses. + OpenAI.ChatCompletionStreamResponseDeltaFunctionCall: + type: object + properties: + arguments: + type: string + name: + type: string + OpenAI.ChatCompletionTokenLogprob: + type: object + required: + - token + - logprob + - bytes + - top_logprobs + properties: + token: + type: string + description: The token. + logprob: + type: number + description: The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely. + bytes: + anyOf: + - type: array + items: + type: integer + - type: 'null' + top_logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs' + description: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. + OpenAI.ChatCompletionTokenLogprobTopLogprobs: + type: object + required: + - token + - logprob + - bytes + properties: + token: + type: string + logprob: + type: number + bytes: + anyOf: + - type: array + items: + type: integer + - type: 'null' + OpenAI.ChatCompletionTool: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + description: The type of the tool. Currently, only `function` is supported. + x-stainless-const: true + function: + $ref: '#/components/schemas/OpenAI.FunctionObject' + description: A function tool that can be used to generate a response. + title: Function tool + OpenAI.ChatCompletionToolChoiceOption: + anyOf: + - type: string + enum: + - none + - auto + - required + - $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice' + - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoice' + - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom' + description: |- + Controls which (if any) tool is called by the model. + `none` means the model will not call any tool and instead generates a message. + `auto` means the model can pick between generating a message or calling one or more tools. + `required` means the model must call one or more tools. + Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. + `none` is the default when no tools are present. `auto` is the default if tools are present. + x-stainless-go-variant-constructor: + naming: tool_choice_option_{variant} + OpenAI.ChunkingStrategyRequestParam: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParamType' + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam' + static: '#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam' + description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty. + OpenAI.ChunkingStrategyRequestParamType: + anyOf: + - type: string + - type: string + enum: + - auto + - static + OpenAI.ChunkingStrategyResponse: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponseType' + discriminator: + propertyName: type + mapping: + static: '#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam' + other: '#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam' + description: The strategy used to chunk the file. + OpenAI.ChunkingStrategyResponseType: + anyOf: + - type: string + - type: string + enum: + - static + - other + OpenAI.ClickButtonType: + type: string + enum: + - left + - right + - wheel + - back + - forward + OpenAI.ClickParam: + type: object + required: + - type + - button + - x + - 'y' + properties: + type: + type: string + enum: + - click + description: Specifies the event type. For a click action, this property is always `click`. + x-stainless-const: true + default: click + button: + allOf: + - $ref: '#/components/schemas/OpenAI.ClickButtonType' + description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + x: + type: integer + description: The x-coordinate where the click occurred. + 'y': + type: integer + description: The y-coordinate where the click occurred. + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A click action. + title: Click + OpenAI.CodeInterpreterContainerAuto: + type: object + required: + - type + properties: + type: + type: string + enum: + - auto + description: Always `auto`. + x-stainless-const: true + default: auto + file_ids: + type: array + items: + type: string + maxItems: 50 + description: An optional list of uploaded files to make available to your code. + memory_limit: + anyOf: + - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit' + - type: 'null' + description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. + title: CodeInterpreterToolAuto + x-stainless-naming: + go: + type_name: ToolCodeInterpreterContainerCodeInterpreterContainerAuto + OpenAI.CodeInterpreterOutputImage: + type: object + required: + - type + - url + properties: + type: + type: string + enum: + - image + description: The type of the output. Always `image`. + x-stainless-const: true + default: image + url: + type: string + format: uri + description: The URL of the image output from the code interpreter. + description: The image output from the code interpreter. + title: Code interpreter output image + OpenAI.CodeInterpreterOutputLogs: + type: object + required: + - type + - logs + properties: + type: + type: string + enum: + - logs + description: The type of the output. Always `logs`. + x-stainless-const: true + default: logs + logs: + type: string + description: The logs output from the code interpreter. + description: The logs output from the code interpreter. + title: Code interpreter output logs + OpenAI.CodeInterpreterTool: + type: object + required: + - type + - container + properties: + type: + type: string + enum: + - code_interpreter + description: The type of the code interpreter tool. Always `code_interpreter`. + x-stainless-const: true + container: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAI.CodeInterpreterContainerAuto' + description: |- + The code interpreter container. Can be a container ID or an object that + specifies uploaded file IDs to make available to your code, along with an + optional `memory_limit` setting. + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A tool that runs Python code to help generate a response to a prompt. + title: Code interpreter + OpenAI.ComparisonFilter: + type: object + required: + - type + - key + - value + properties: + type: + type: string + enum: + - eq + - ne + - gt + - gte + - lt + - lte + description: |- + Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + - `eq`: equals + - `ne`: not equal + - `gt`: greater than + - `gte`: greater than or equal + - `lt`: less than + - `lte`: less than or equal + - `in`: in + - `nin`: not in + default: eq + key: + type: string + description: The key to compare against the value. + value: + anyOf: + - type: string + - type: number + - type: boolean + - type: array + items: + $ref: '#/components/schemas/OpenAI.ComparisonFilterValueItems' + description: The value to compare against the attribute key; supports string, number, or boolean types. + description: A filter used to compare a specified attribute key to a given value using a defined comparison operation. + title: Comparison Filter + x-oaiMeta: + name: ComparisonFilter + OpenAI.ComparisonFilterValueItems: + anyOf: + - type: string + - type: number + OpenAI.CompletionUsage: + type: object + required: + - completion_tokens + - prompt_tokens + - total_tokens + properties: + completion_tokens: + type: integer + description: Number of tokens in the generated completion. + prompt_tokens: + type: integer + description: Number of tokens in the prompt. + total_tokens: + type: integer + description: Total number of tokens used in the request (prompt + completion). + completion_tokens_details: + allOf: + - $ref: '#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails' + description: Breakdown of tokens used in a completion. + prompt_tokens_details: + allOf: + - $ref: '#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails' + description: Breakdown of tokens used in the prompt. + description: Usage statistics for the completion request. + OpenAI.CompletionUsageCompletionTokensDetails: + type: object + properties: + accepted_prediction_tokens: + type: integer + audio_tokens: + type: integer + reasoning_tokens: + type: integer + rejected_prediction_tokens: + type: integer + OpenAI.CompletionUsagePromptTokensDetails: + type: object + properties: + audio_tokens: + type: integer + cached_tokens: + type: integer + OpenAI.CompoundFilter: + type: object + required: + - type + - filters + properties: + type: + type: string + enum: + - and + - or + description: 'Type of operation: `and` or `or`.' + filters: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.ComparisonFilter' + - {} + description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + description: Combine multiple filters using `and` or `or`. + title: Compound Filter + x-oaiMeta: + name: CompoundFilter + OpenAI.ComputerAction: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ComputerActionType' + discriminator: + propertyName: type + mapping: + click: '#/components/schemas/OpenAI.ClickParam' + double_click: '#/components/schemas/OpenAI.DoubleClickAction' + drag: '#/components/schemas/OpenAI.Drag' + keypress: '#/components/schemas/OpenAI.KeyPressAction' + move: '#/components/schemas/OpenAI.Move' + screenshot: '#/components/schemas/OpenAI.Screenshot' + scroll: '#/components/schemas/OpenAI.Scroll' + type: '#/components/schemas/OpenAI.Type' + wait: '#/components/schemas/OpenAI.Wait' + OpenAI.ComputerActionType: + anyOf: + - type: string + - type: string + enum: + - click + - double_click + - drag + - keypress + - move + - screenshot + - scroll + - type + - wait + OpenAI.ComputerCallSafetyCheckParam: + type: object + required: + - id + properties: + id: + type: string + description: The ID of the pending safety check. + code: + anyOf: + - type: string + - type: 'null' + message: + anyOf: + - type: string + - type: 'null' + description: A pending safety check for the computer call. + OpenAI.ComputerEnvironment: + type: string + enum: + - windows + - mac + - linux + - ubuntu + - browser + OpenAI.ComputerScreenshotContent: + type: object + required: + - type + - image_url + - file_id + properties: + type: + type: string + enum: + - computer_screenshot + description: Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. + x-stainless-const: true + default: computer_screenshot + image_url: + anyOf: + - type: string + format: uri + - type: 'null' + file_id: + anyOf: + - type: string + - type: 'null' + description: A screenshot of a computer. + title: Computer screenshot + OpenAI.ComputerScreenshotImage: + type: object + required: + - type + properties: + type: + type: string + enum: + - computer_screenshot + description: |- + Specifies the event type. For a computer screenshot, this property is + always set to `computer_screenshot`. + x-stainless-const: true + default: computer_screenshot + image_url: + type: string + format: uri + description: The URL of the screenshot image. + file_id: + type: string + description: The identifier of an uploaded file that contains the screenshot. + description: A computer screenshot image used with the computer use tool. + OpenAI.ComputerUsePreviewTool: + type: object + required: + - type + - environment + - display_width + - display_height + properties: + type: + type: string + enum: + - computer_use_preview + description: The type of the computer use tool. Always `computer_use_preview`. + x-stainless-const: true + default: computer_use_preview + environment: + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerEnvironment' + description: The type of computer environment to control. + display_width: + type: integer + description: The width of the computer display. + display_height: + type: integer + description: The height of the computer display. + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + title: Computer use preview + OpenAI.ContainerFileCitationBody: + type: object + required: + - type + - container_id + - file_id + - start_index + - end_index + - filename + properties: + type: + type: string + enum: + - container_file_citation + description: The type of the container file citation. Always `container_file_citation`. + x-stainless-const: true + default: container_file_citation + container_id: + type: string + description: The ID of the container file. + file_id: + type: string + description: The ID of the file. + start_index: + type: integer + description: The index of the first character of the container file citation in the message. + end_index: + type: integer + description: The index of the last character of the container file citation in the message. + filename: + type: string + description: The filename of the container file cited. + allOf: + - $ref: '#/components/schemas/OpenAI.Annotation' + description: A citation for a container file used to generate a model response. + title: Container file citation + OpenAI.ContainerFileListResource: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The type of object returned, must be 'list'. + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.ContainerFileResource' + description: A list of container files. + first_id: + type: string + description: The ID of the first file in the list. + last_id: + type: string + description: The ID of the last file in the list. + has_more: + type: boolean + description: Whether there are more files available. + OpenAI.ContainerFileResource: + type: object + required: + - id + - object + - container_id + - created_at + - bytes + - path + - source + properties: + id: + type: string + description: Unique identifier for the file. + object: + type: string + enum: + - container.file + description: The type of this object (`container.file`). + container_id: + type: string + description: The container this file belongs to. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) when the file was created. + bytes: + type: integer + description: Size of the file in bytes. + path: + type: string + description: Path of the file in the container. + source: + type: string + description: Source of the file (e.g., `user`, `assistant`). + title: The container file object + x-oaiMeta: + name: The container file object + example: | + { + "id": "cfile_682e0e8a43c88191a7978f477a09bdf5", + "object": "container.file", + "created_at": 1747848842, + "bytes": 880, + "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04", + "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json", + "source": "user" + } + OpenAI.ContainerListResource: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The type of object returned, must be 'list'. + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.ContainerResource' + description: A list of containers. + first_id: + type: string + description: The ID of the first container in the list. + last_id: + type: string + description: The ID of the last container in the list. + has_more: + type: boolean + description: Whether there are more containers available. + OpenAI.ContainerMemoryLimit: + type: string + enum: + - 1g + - 4g + - 16g + - 64g + OpenAI.ContainerResource: + type: object + required: + - id + - object + - name + - created_at + - status + properties: + id: + type: string + description: Unique identifier for the container. + object: + type: string + description: The type of this object. + name: + type: string + description: Name of the container. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) when the container was created. + status: + type: string + description: Status of the container (e.g., active, deleted). + last_active_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) when the container was last active. + expires_after: + allOf: + - $ref: '#/components/schemas/OpenAI.ContainerResourceExpiresAfter' + description: |- + The container will expire after this time period. + The anchor is the reference point for the expiration. + The minutes is the number of minutes after the anchor before the container expires. + memory_limit: + type: string + enum: + - 1g + - 4g + - 16g + - 64g + description: The memory limit configured for the container. + title: The container object + x-oaiMeta: + name: The container object + example: | + { + "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863", + "object": "container", + "created_at": 1747844794, + "status": "running", + "expires_after": { + "anchor": "last_active_at", + "minutes": 20 + }, + "last_active_at": 1747844794, + "memory_limit": "1g", + "name": "My Container" + } + OpenAI.ContainerResourceExpiresAfter: + type: object + properties: + anchor: + type: string + enum: + - last_active_at + minutes: + type: integer + OpenAI.ConversationItem: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ConversationItemType' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAI.ConversationItemMessage' + function_call: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallResource' + function_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutputResource' + file_search_call: '#/components/schemas/OpenAI.ConversationItemFileSearchToolCall' + web_search_call: '#/components/schemas/OpenAI.ConversationItemWebSearchToolCall' + image_generation_call: '#/components/schemas/OpenAI.ConversationItemImageGenToolCall' + computer_call: '#/components/schemas/OpenAI.ConversationItemComputerToolCall' + computer_call_output: '#/components/schemas/OpenAI.ConversationItemComputerToolCallOutputResource' + reasoning: '#/components/schemas/OpenAI.ConversationItemReasoningItem' + code_interpreter_call: '#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall' + local_shell_call: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCall' + local_shell_call_output: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput' + shell_call: '#/components/schemas/OpenAI.ConversationItemFunctionShellCall' + shell_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput' + apply_patch_call: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall' + apply_patch_call_output: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput' + mcp_list_tools: '#/components/schemas/OpenAI.ConversationItemMcpListTools' + mcp_approval_request: '#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource' + mcp_call: '#/components/schemas/OpenAI.ConversationItemMcpToolCall' + custom_tool_call: '#/components/schemas/OpenAI.ConversationItemCustomToolCall' + custom_tool_call_output: '#/components/schemas/OpenAI.ConversationItemCustomToolCallOutput' + description: A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output). + title: Conversation item + OpenAI.ConversationItemApplyPatchToolCall: + type: object + required: + - type + - id + - call_id + - status + - operation + properties: + type: + type: string + enum: + - apply_patch_call + description: The type of the item. Always `apply_patch_call`. + x-stainless-const: true + default: apply_patch_call + id: + type: string + description: The unique ID of the apply patch tool call. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the apply patch tool call generated by the model. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus' + description: The status of the apply patch tool call. One of `in_progress` or `completed`. + operation: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' + description: One of the create_file, delete_file, or update_file operations applied via apply_patch. + created_by: + type: string + description: The ID of the entity that created this tool call. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A tool call that applies file diffs by creating, deleting, or updating files. + title: Apply patch tool call + OpenAI.ConversationItemApplyPatchToolCallOutput: + type: object + required: + - type + - id + - call_id + - status + properties: + type: + type: string + enum: + - apply_patch_call_output + description: The type of the item. Always `apply_patch_call_output`. + x-stainless-const: true + default: apply_patch_call_output + id: + type: string + description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the apply patch tool call generated by the model. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus' + description: The status of the apply patch tool call output. One of `completed` or `failed`. + output: + anyOf: + - type: string + - type: 'null' + created_by: + type: string + description: The ID of the entity that created this tool call output. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: The output emitted by an apply patch tool call. + title: Apply patch tool call output + OpenAI.ConversationItemCodeInterpreterToolCall: + type: object + required: + - type + - id + - status + - container_id + - code + - outputs + properties: + type: + type: string + enum: + - code_interpreter_call + description: The type of the code interpreter tool call. Always `code_interpreter_call`. + x-stainless-const: true + default: code_interpreter_call + id: + type: string + description: The unique ID of the code interpreter tool call. + status: + type: string + enum: + - in_progress + - completed + - incomplete + - interpreting + - failed + description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + container_id: + type: string + description: The ID of the container used to run the code. + code: + anyOf: + - type: string + - type: 'null' + outputs: + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs' + - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A tool call to run code. + title: Code interpreter tool call + OpenAI.ConversationItemComputerToolCall: + type: object + required: + - type + - id + - call_id + - action + - pending_safety_checks + - status + properties: + type: + type: string + enum: + - computer_call + description: The type of the computer call. Always `computer_call`. + default: computer_call + id: + type: string + description: The unique ID of the computer call. + call_id: + type: string + description: An identifier used when responding to the tool call with output. + action: + $ref: '#/components/schemas/OpenAI.ComputerAction' + pending_safety_checks: + type: array + items: + $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' + description: The pending safety checks for the computer call. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: |- + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + title: Computer tool call + OpenAI.ConversationItemComputerToolCallOutputResource: + type: object + required: + - type + - call_id + - output + properties: + type: + type: string + enum: + - computer_call_output + description: The type of the computer tool call output. Always `computer_call_output`. + x-stainless-const: true + default: computer_call_output + id: + type: string + description: The ID of the computer tool call output. + call_id: + type: string + description: The ID of the computer tool call that produced the output. + acknowledged_safety_checks: + type: array + items: + $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' + description: |- + The safety checks reported by the API that have been acknowledged by the + developer. + output: + $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage' + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + OpenAI.ConversationItemCustomToolCall: + type: object + required: + - type + - call_id + - name + - input + properties: + type: + type: string + enum: + - custom_tool_call + description: The type of the custom tool call. Always `custom_tool_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the custom tool call in the OpenAI platform. + call_id: + type: string + description: An identifier used to map this custom tool call to a tool call output. + name: + type: string + description: The name of the custom tool being called. + input: + type: string + description: The input for the custom tool call generated by the model. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A call to a custom tool created by the model. + title: Custom tool call + OpenAI.ConversationItemCustomToolCallOutput: + type: object + required: + - type + - call_id + - output + properties: + type: + type: string + enum: + - custom_tool_call_output + description: The type of the custom tool call output. Always `custom_tool_call_output`. + x-stainless-const: true + id: + type: string + description: The unique ID of the custom tool call output in the OpenAI platform. + call_id: + type: string + description: The call ID, used to map this custom tool call output to a custom tool call. + output: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' + description: |- + The output from the custom tool call generated by your code. + Can be a string or an list of output content. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: The output of a custom tool call from your code, being sent back to the model. + title: Custom tool call output + OpenAI.ConversationItemFileSearchToolCall: + type: object + required: + - id + - type + - status + - queries + properties: + id: + type: string + description: The unique ID of the file search tool call. + type: + type: string + enum: + - file_search_call + description: The type of the file search tool call. Always `file_search_call`. + x-stainless-const: true + status: + type: string + enum: + - in_progress + - searching + - completed + - incomplete + - failed + description: |- + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + queries: + type: array + items: + type: string + description: The queries used to search for files. + results: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: |- + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + title: File search tool call + OpenAI.ConversationItemFunctionShellCall: + type: object + required: + - type + - id + - call_id + - action + - status + properties: + type: + type: string + enum: + - shell_call + description: The type of the item. Always `shell_call`. + x-stainless-const: true + default: shell_call + id: + type: string + description: The unique ID of the shell tool call. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the shell tool call generated by the model. + action: + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionShellAction' + description: The shell commands and limits that describe how to run the tool call. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.LocalShellCallStatus' + description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + created_by: + type: string + description: The ID of the entity that created this tool call. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A tool call that executes one or more shell commands in a managed environment. + title: Shell tool call + OpenAI.ConversationItemFunctionShellCallOutput: + type: object + required: + - type + - id + - call_id + - output + - max_output_length + properties: + type: + type: string + enum: + - shell_call_output + description: The type of the shell call output. Always `shell_call_output`. + x-stainless-const: true + default: shell_call_output + id: + type: string + description: The unique ID of the shell call output. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the shell tool call generated by the model. + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent' + description: An array of shell call output contents + max_output_length: + anyOf: + - type: integer + - type: 'null' + created_by: + type: string + description: The identifier of the actor that created the item. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: The output of a shell tool call that was emitted. + title: Shell call output + OpenAI.ConversationItemFunctionToolCallOutputResource: + type: object + required: + - type + - call_id + - output + properties: + id: + type: string + description: |- + The unique ID of the function tool call output. Populated when this item + is returned via API. + type: + type: string + enum: + - function_call_output + description: The type of the function tool call output. Always `function_call_output`. + x-stainless-const: true + call_id: + type: string + description: The unique ID of the function tool call generated by the model. + output: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' + description: |- + The output from the function call generated by your code. + Can be a string or an list of output content. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + OpenAI.ConversationItemFunctionToolCallResource: + type: object + required: + - type + - call_id + - name + - arguments + properties: + id: + type: string + description: The unique ID of the function tool call. + type: + type: string + enum: + - function_call + description: The type of the function tool call. Always `function_call`. + x-stainless-const: true + call_id: + type: string + description: The unique ID of the function tool call generated by the model. + name: + type: string + description: The name of the function to run. + arguments: + type: string + description: A JSON string of the arguments to pass to the function. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + OpenAI.ConversationItemImageGenToolCall: + type: object + required: + - type + - id + - status + - result + properties: + type: + type: string + enum: + - image_generation_call + description: The type of the image generation call. Always `image_generation_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the image generation call. + status: + type: string + enum: + - in_progress + - completed + - generating + - failed + description: The status of the image generation call. + result: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: An image generation request made by the model. + title: Image generation call + OpenAI.ConversationItemList: + type: object + required: + - object + - data + - has_more + - first_id + - last_id + properties: + object: + type: string + enum: + - list + description: The type of object returned, must be `list`. + x-stainless-const: true + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A list of conversation items. + has_more: + type: boolean + description: Whether there are more items available. + first_id: + type: string + description: The ID of the first item in the list. + last_id: + type: string + description: The ID of the last item in the list. + description: A list of Conversation items. + title: The conversation item list + x-oaiMeta: + name: The item list + group: conversations + OpenAI.ConversationItemLocalShellToolCall: + type: object + required: + - type + - id + - call_id + - action + - status + properties: + type: + type: string + enum: + - local_shell_call + description: The type of the local shell call. Always `local_shell_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the local shell call. + call_id: + type: string + description: The unique ID of the local shell tool call generated by the model. + action: + $ref: '#/components/schemas/OpenAI.LocalShellExecAction' + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: The status of the local shell call. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A tool call to run a command on the local shell. + title: Local shell call + OpenAI.ConversationItemLocalShellToolCallOutput: + type: object + required: + - type + - id + - output + properties: + type: + type: string + enum: + - local_shell_call_output + description: The type of the local shell tool call output. Always `local_shell_call_output`. + x-stainless-const: true + id: + type: string + description: The unique ID of the local shell tool call generated by the model. + output: + type: string + description: A JSON string of the output of the local shell tool call. + status: + anyOf: + - type: string + enum: + - in_progress + - completed + - incomplete + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: The output of a local shell tool call. + title: Local shell call output + OpenAI.ConversationItemMcpApprovalRequest: + type: object + required: + - type + - id + - server_label + - name + - arguments + properties: + type: + type: string + enum: + - mcp_approval_request + description: The type of the item. Always `mcp_approval_request`. + x-stainless-const: true + id: + type: string + description: The unique ID of the approval request. + server_label: + type: string + description: The label of the MCP server making the request. + name: + type: string + description: The name of the tool to run. + arguments: + type: string + description: A JSON string of arguments for the tool. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A request for human approval of a tool invocation. + title: MCP approval request + OpenAI.ConversationItemMcpApprovalResponseResource: + type: object + required: + - type + - id + - approval_request_id + - approve + properties: + type: + type: string + enum: + - mcp_approval_response + description: The type of the item. Always `mcp_approval_response`. + x-stainless-const: true + id: + type: string + description: The unique ID of the approval response + approval_request_id: + type: string + description: The ID of the approval request being answered. + approve: + type: boolean + description: Whether the request was approved. + reason: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A response to an MCP approval request. + title: MCP approval response + OpenAI.ConversationItemMcpListTools: + type: object + required: + - type + - id + - server_label + - tools + properties: + type: + type: string + enum: + - mcp_list_tools + description: The type of the item. Always `mcp_list_tools`. + x-stainless-const: true + id: + type: string + description: The unique ID of the list. + server_label: + type: string + description: The label of the MCP server. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.MCPListToolsTool' + description: The tools available on the server. + error: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A list of tools available on an MCP server. + title: MCP list tools + OpenAI.ConversationItemMcpToolCall: + type: object + required: + - type + - id + - server_label + - name + - arguments + properties: + type: + type: string + enum: + - mcp_call + description: The type of the item. Always `mcp_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the tool call. + server_label: + type: string + description: The label of the MCP server running the tool. + name: + type: string + description: The name of the tool that was run. + arguments: + type: string + description: A JSON string of the arguments passed to the tool. + output: + anyOf: + - type: string + - type: 'null' + error: + anyOf: + - type: string + - type: 'null' + status: + allOf: + - $ref: '#/components/schemas/OpenAI.MCPToolCallStatus' + description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + approval_request_id: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: An invocation of a tool on an MCP server. + title: MCP tool call + OpenAI.ConversationItemMessage: + type: object + required: + - type + - id + - status + - role + - content + properties: + type: + type: string + enum: + - message + description: The type of the message. Always set to `message`. + x-stainless-const: true + default: message + id: + type: string + description: The unique ID of the message. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.MessageStatus' + description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. + role: + allOf: + - $ref: '#/components/schemas/OpenAI.MessageRole' + description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`. + content: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.InputTextContent' + - $ref: '#/components/schemas/OpenAI.OutputTextContent' + - $ref: '#/components/schemas/OpenAI.TextContent' + - $ref: '#/components/schemas/OpenAI.SummaryTextContent' + - $ref: '#/components/schemas/OpenAI.ReasoningTextContent' + - $ref: '#/components/schemas/OpenAI.RefusalContent' + - $ref: '#/components/schemas/OpenAI.InputImageContent' + - $ref: '#/components/schemas/OpenAI.ComputerScreenshotContent' + - $ref: '#/components/schemas/OpenAI.InputFileContent' + description: The content of the message + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: A message to or from the model. + title: Message + OpenAI.ConversationItemReasoningItem: + type: object + required: + - type + - id + - summary + properties: + type: + type: string + enum: + - reasoning + description: The type of the object. Always `reasoning`. + x-stainless-const: true + id: + type: string + description: The unique identifier of the reasoning content. + encrypted_content: + anyOf: + - type: string + - type: 'null' + summary: + type: array + items: + $ref: '#/components/schemas/OpenAI.Summary' + description: Reasoning summary content. + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.ReasoningTextContent' + description: Reasoning text content. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: |- + A description of the chain of thought used by a reasoning model while generating + a response. Be sure to include these items in your `input` to the Responses API + for subsequent turns of a conversation if you are manually + [managing context](https://platform.openai.com/docs/guides/conversation-state). + title: Reasoning + OpenAI.ConversationItemType: + anyOf: + - type: string + - type: string + enum: + - message + - function_call + - function_call_output + - file_search_call + - web_search_call + - image_generation_call + - computer_call + - computer_call_output + - reasoning + - code_interpreter_call + - local_shell_call + - local_shell_call_output + - shell_call + - shell_call_output + - apply_patch_call + - apply_patch_call_output + - mcp_list_tools + - mcp_approval_request + - mcp_approval_response + - mcp_call + - custom_tool_call + - custom_tool_call_output + OpenAI.ConversationItemWebSearchToolCall: + type: object + required: + - id + - type + - status + - action + properties: + id: + type: string + description: The unique ID of the web search tool call. + type: + type: string + enum: + - web_search_call + description: The type of the web search tool call. Always `web_search_call`. + x-stainless-const: true + status: + type: string + enum: + - in_progress + - searching + - completed + - failed + description: The status of the web search tool call. + action: + anyOf: + - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch' + - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage' + - $ref: '#/components/schemas/OpenAI.WebSearchActionFind' + description: |- + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find). + allOf: + - $ref: '#/components/schemas/OpenAI.ConversationItem' + description: |- + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + title: Web search tool call + OpenAI.ConversationParam: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAI.ConversationParam-2' + description: |- + The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. + Input items and output items from this response are automatically added to this conversation after this response completes. + OpenAI.ConversationParam-2: + type: object + required: + - id + properties: + id: + type: string + description: The unique ID of the conversation. + description: The conversation that this response belongs to. + title: Conversation object + OpenAI.ConversationReference: + type: object + required: + - id + properties: + id: + type: string + description: The unique ID of the conversation that this response was associated with. + description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + title: Conversation + OpenAI.ConversationResource: + type: object + required: + - id + - object + - metadata + - created_at + properties: + id: + type: string + description: The unique ID of the conversation. + object: + type: string + enum: + - conversation + description: The object type, which is always `conversation`. + x-stainless-const: true + default: conversation + metadata: + description: |- + Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. + created_at: + type: integer + format: unixtime + description: The time at which the conversation was created, measured in seconds since the Unix epoch. + OpenAI.CreateChatCompletionRequestAudio: + type: object + required: + - voice + - format + properties: + voice: + $ref: '#/components/schemas/OpenAI.VoiceIdsShared' + format: + type: string + enum: + - wav + - aac + - mp3 + - flac + - opus + - pcm16 + OpenAI.CreateChatCompletionRequestResponseFormat: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType' + discriminator: + propertyName: type + mapping: + json_schema: '#/components/schemas/OpenAI.ResponseFormatJsonSchema' + text: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText' + json_object: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject' + description: |- + An object specifying the format that the model must output. + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables + Structured Outputs which ensures the model will match your supplied JSON + schema. Learn more in the [Structured Outputs + guide](https://platform.openai.com/docs/guides/structured-outputs). + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: The type of response format being defined. Always `json_object`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' + description: |- + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + title: JSON object + OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: The type of response format being defined. Always `text`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' + description: Default response format. Used to generate text responses. + title: Text + OpenAI.CreateChatCompletionRequestResponseFormatType: + anyOf: + - type: string + - type: string + enum: + - text + - json_schema + - json_object + OpenAI.CreateChatCompletionResponseChoices: + type: object + required: + - finish_reason + - index + - message + - logprobs + properties: + finish_reason: + type: string + enum: + - stop + - length + - tool_calls + - content_filter + - function_call + index: + type: integer + message: + $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessage' + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs' + - type: 'null' + content_filter_results: + $ref: '#/components/schemas/AzureContentFilterResultForChoice' + OpenAI.CreateChatCompletionResponseChoicesLogprobs: + type: object + required: + - content + - refusal + properties: + content: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' + - type: 'null' + refusal: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' + - type: 'null' + OpenAI.CreateChatCompletionStreamResponseChoices: + type: object + required: + - delta + - finish_reason + - index + properties: + delta: + $ref: '#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta' + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs' + - type: 'null' + finish_reason: + anyOf: + - type: string + enum: + - stop + - length + - tool_calls + - content_filter + - function_call + - type: 'null' + index: + type: integer + OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs: + type: object + required: + - content + - refusal + properties: + content: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' + - type: 'null' + refusal: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' + - type: 'null' + OpenAI.CreateCompletionResponseChoices: + type: object + required: + - finish_reason + - index + - logprobs + - text + properties: + finish_reason: + type: string + enum: + - stop + - length + - content_filter + index: + type: integer + format: int32 + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs' + - type: 'null' + text: + type: string + content_filter_results: + $ref: '#/components/schemas/AzureContentFilterResultForChoice' + OpenAI.CreateCompletionResponseChoicesLogprobs: + type: object + properties: + text_offset: + type: array + items: + type: integer + format: int32 + token_logprobs: + type: array + items: + type: number + format: float + tokens: + type: array + items: + type: string + top_logprobs: + type: array + items: + type: object + unevaluatedProperties: + type: number + format: float + OpenAI.CreateContainerBody: + type: object + required: + - name + properties: + name: + type: string + description: Name of the container to create. + file_ids: + type: array + items: + type: string + description: IDs of files to copy to the container. + expires_after: + allOf: + - $ref: '#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter' + description: Container expiration time in seconds relative to the 'anchor' time. + memory_limit: + type: string + enum: + - 1g + - 4g + - 16g + - 64g + description: Optional memory limit for the container. Defaults to "1g". + OpenAI.CreateContainerBodyExpiresAfter: + type: object + required: + - anchor + - minutes + properties: + anchor: + type: string + enum: + - last_active_at + minutes: + type: integer + OpenAI.CreateContainerFileBody: + type: object + properties: + file_id: + type: string + description: Name of the file to create. + file: + description: The File object (not file name) to be uploaded. + required: [] + OpenAI.CreateConversationBody: + type: object + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + items: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + OpenAI.CreateConversationItemsParametersBody: + type: object + required: + - items + properties: + items: + type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + maxItems: 20 + OpenAI.CreateEmbeddingRequest: + type: object + required: + - input + - model + properties: + input: + anyOf: + - type: string + - type: array + items: + type: string + - type: array + items: + type: integer + - type: array + items: + type: array + items: + type: integer + description: Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request. + model: + type: string + description: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + x-oaiTypeLabel: string + encoding_format: + type: string + enum: + - float + - base64 + description: The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). + default: float + dimensions: + type: integer + minimum: 1 + description: The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + user: + type: string + description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + OpenAI.CreateEmbeddingResponse: + type: object + required: + - data + - model + - object + - usage + properties: + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.Embedding' + description: The list of embeddings generated by the model. + model: + type: string + description: The name of the model used to generate the embedding. + object: + type: string + enum: + - list + description: The object type, which is always "list". + x-stainless-const: true + usage: + allOf: + - $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponseUsage' + description: The usage information for the request. + OpenAI.CreateEmbeddingResponseUsage: + type: object + required: + - prompt_tokens + - total_tokens + properties: + prompt_tokens: + type: integer + total_tokens: + type: integer + OpenAI.CreateEvalCompletionsRunDataSource: + type: object + required: + - type + - source + properties: + type: + type: string + enum: + - completions + description: The type of run data source. Always `completions`. + default: completions + input_messages: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate' + - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference' + description: Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. + sampling_params: + $ref: '#/components/schemas/AzureCompletionsSamplingParams' + model: + type: string + description: The name of the model to use for generating completions (e.g. "o3-mini"). + source: + anyOf: + - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource' + - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource' + - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsSource' + description: Determines what populates the `item` namespace in this run's data source. + description: A CompletionsRunDataSource object describing a model sampling configuration. + title: CompletionsRunDataSource + x-oaiMeta: + name: The completions data source object used to configure an individual run + group: eval runs + example: | + { + "name": "gpt-4o-mini-2024-07-18", + "data_source": { + "type": "completions", + "input_messages": { + "type": "item_reference", + "item_reference": "item.input" + }, + "model": "gpt-4o-mini-2024-07-18", + "source": { + "type": "stored_completions", + "model": "gpt-4o-mini-2024-07-18" + } + } + } + OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference: + type: object + required: + - type + - item_reference + properties: + type: + type: string + enum: + - item_reference + item_reference: + type: string + OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate: + type: object + required: + - type + - template + properties: + type: + type: string + enum: + - template + template: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.EasyInputMessage' + - $ref: '#/components/schemas/OpenAI.EvalItem' + OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams: + type: object + properties: + reasoning_effort: + allOf: + - $ref: '#/components/schemas/OpenAI.ReasoningEffort' + description: Controls the level of reasoning effort applied during generation. + temperature: + type: number + description: A higher temperature increases randomness in the outputs. + default: 1 + max_completion_tokens: + type: integer + top_p: + type: number + description: An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + default: 1 + seed: + type: integer + description: A seed value initializes the randomness during sampling. + default: 42 + response_format: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseFormatText' + - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema' + - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject' + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionTool' + OpenAI.CreateEvalCustomDataSourceConfig: + type: object + required: + - type + - item_schema + properties: + type: + type: string + enum: + - custom + description: The type of data source. Always `custom`. + x-stainless-const: true + default: custom + item_schema: + type: object + unevaluatedProperties: {} + description: The json schema for each row in the data source. + include_sample_schema: + type: boolean + description: Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) + description: |- + A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs. + This schema is used to define the shape of the data that will be: + - Used to define your testing criteria and + - What data is required when creating a run + title: CustomDataSourceConfig + x-oaiMeta: + name: The eval file data source config object + group: evals + example: | + { + "type": "custom", + "item_schema": { + "type": "object", + "properties": { + "name": {"type": "string"}, + "age": {"type": "integer"} + }, + "required": ["name", "age"] + }, + "include_sample_schema": true + } + OpenAI.CreateEvalItem: + type: object + required: + - role + - content + properties: + role: + type: string + description: The role of the message (e.g. "system", "assistant", "user"). + content: + type: string + description: The content of the message. + description: A chat message that makes up the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + title: SimpleInputMessage + x-oaiMeta: + name: The chat message object used to configure an individual run + OpenAI.CreateEvalJsonlRunDataSource: + type: object + required: + - type + - source + properties: + type: + type: string + enum: + - jsonl + description: The type of data source. Always `jsonl`. + x-stainless-const: true + default: jsonl + source: + anyOf: + - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource' + - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource' + description: Determines what populates the `item` namespace in the data source. + description: A JsonlRunDataSource object with that specifies a JSONL file that matches the eval + title: JsonlRunDataSource + x-oaiMeta: + name: The file data source object for the eval run configuration + group: evals + example: | + { + "type": "jsonl", + "source": { + "type": "file_id", + "id": "file-9GYS6xbkWgWhmE7VoLUWFg" + } + } + OpenAI.CreateEvalLabelModelGrader: + type: object + required: + - type + - name + - model + - input + - labels + - passing_labels + properties: + type: + type: string + enum: + - label_model + description: The object type, which is always `label_model`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + model: + type: string + description: The model to use for the evaluation. Must support structured outputs. + input: + type: array + items: + $ref: '#/components/schemas/OpenAI.CreateEvalItem' + description: A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + labels: + type: array + items: + type: string + description: The labels to classify to each item in the evaluation. + passing_labels: + type: array + items: + type: string + description: The labels that indicate a passing result. Must be a subset of labels. + description: |- + A LabelModelGrader object which uses a model to assign labels to each item + in the evaluation. + title: LabelModelGrader + x-oaiMeta: + name: The eval label model grader object + group: evals + example: | + { + "type": "label_model", + "model": "gpt-4o-2024-08-06", + "input": [ + { + "role": "system", + "content": "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'" + }, + { + "role": "user", + "content": "Statement: {{item.response}}" + } + ], + "passing_labels": ["positive"], + "labels": ["positive", "neutral", "negative"], + "name": "Sentiment label grader" + } + OpenAI.CreateEvalLogsDataSourceConfig: + type: object + required: + - type + properties: + type: + type: string + enum: + - logs + description: The type of data source. Always `logs`. + x-stainless-const: true + default: logs + metadata: + type: object + unevaluatedProperties: {} + description: Metadata filters for the logs data source. + description: |- + A data source config which specifies the metadata property of your logs query. + This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. + title: LogsDataSourceConfig + x-oaiMeta: + name: The logs data source object for evals + group: evals + example: | + { + "type": "logs", + "metadata": { + "use_case": "customer_support_agent" + } + } + OpenAI.CreateEvalResponsesRunDataSource: + type: object + required: + - type + - source + properties: + type: + type: string + enum: + - responses + description: The type of run data source. Always `responses`. + default: responses + input_messages: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate' + - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference' + description: Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. + sampling_params: + $ref: '#/components/schemas/AzureResponsesSamplingParams' + model: + type: string + description: The name of the model to use for generating completions (e.g. "o3-mini"). + source: + anyOf: + - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource' + - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource' + - $ref: '#/components/schemas/OpenAI.EvalResponsesSource' + description: Determines what populates the `item` namespace in this run's data source. + description: A ResponsesRunDataSource object describing a model sampling configuration. + title: CreateEvalResponsesRunDataSource + x-oaiMeta: + name: The completions data source object used to configure an individual run + group: eval runs + example: | + { + "name": "gpt-4o-mini-2024-07-18", + "data_source": { + "type": "responses", + "input_messages": { + "type": "item_reference", + "item_reference": "item.input" + }, + "model": "gpt-4o-mini-2024-07-18", + "source": { + "type": "responses", + "model": "gpt-4o-mini-2024-07-18" + } + } + } + OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference: + type: object + required: + - type + - item_reference + properties: + type: + type: string + enum: + - item_reference + item_reference: + type: string + OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate: + type: object + required: + - type + - template + properties: + type: + type: string + enum: + - template + template: + type: array + items: + anyOf: + - type: object + properties: + role: + type: string + content: + type: string + required: + - role + - content + - $ref: '#/components/schemas/OpenAI.EvalItem' + OpenAI.CreateEvalResponsesRunDataSourceSamplingParams: + type: object + properties: + reasoning_effort: + allOf: + - $ref: '#/components/schemas/OpenAI.ReasoningEffort' + description: Controls the level of reasoning effort applied during generation. + temperature: + type: number + description: A higher temperature increases randomness in the outputs. + default: 1 + top_p: + type: number + description: An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + default: 1 + seed: + type: integer + description: A seed value initializes the randomness during sampling. + default: 42 + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.Tool' + text: + $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText' + OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' + OpenAI.CreateEvalRunRequest: + type: object + required: + - data_source + properties: + name: + type: string + description: The name of the run. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + data_source: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource' + - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource' + - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource' + description: Details about the run's data source. + title: CreateEvalRunRequest + OpenAI.CreateEvalStoredCompletionsDataSourceConfig: + type: object + required: + - type + properties: + type: + type: string + enum: + - stored_completions + description: The type of data source. Always `stored_completions`. + x-stainless-const: true + default: stored_completions + metadata: + type: object + unevaluatedProperties: {} + description: Metadata filters for the stored completions data source. + description: Deprecated in favor of LogsDataSourceConfig. + title: StoredCompletionsDataSourceConfig + deprecated: true + x-oaiMeta: + name: The stored completions data source object for evals + group: evals + example: | + { + "type": "stored_completions", + "metadata": { + "use_case": "customer_support_agent" + } + } + OpenAI.CreateFileRequest: + type: object + properties: + file: + description: The File object (not file name) to be uploaded. + x-oaiMeta: + exampleFilePath: fine-tune.jsonl + expires_after: + type: object + properties: + seconds: + type: integer + format: int32 + anchor: + $ref: '#/components/schemas/AzureFileExpiryAnchor' + required: + - seconds + - anchor + purpose: + type: string + enum: + - assistants + - batch + - fine-tune + - evals + description: 'The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `evals`: Used for eval data sets' + required: + - file + - expires_after + - purpose + OpenAI.CreateFineTuningCheckpointPermissionRequest: + type: object + required: + - project_ids + properties: + project_ids: + type: array + items: + type: string + description: The project identifiers to grant access to. + OpenAI.CreateFineTuningJobRequest: + type: object + required: + - model + - training_file + properties: + model: + anyOf: + - type: string + - type: string + enum: + - babbage-002 + - davinci-002 + - gpt-3.5-turbo + - gpt-4o-mini + description: |- + The name of the model to fine-tune. You can select one of the + [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). + x-oaiTypeLabel: string + training_file: + type: string + description: |- + The ID of an uploaded file that contains training data. + See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. + Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. + The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format. + See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. + hyperparameters: + allOf: + - $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters' + description: |- + The hyperparameters used for the fine-tuning job. + This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter. + deprecated: true + suffix: + anyOf: + - type: string + - type: 'null' + minLength: 1 + maxLength: 64 + description: |- + A string of up to 64 characters that will be added to your fine-tuned model name. + For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. + validation_file: + anyOf: + - type: string + - type: 'null' + description: |- + The ID of an uploaded file that contains validation data. + If you provide this file, the data is used to generate validation + metrics periodically during fine-tuning. These metrics can be viewed in + the fine-tuning results file. + The same data should not be present in both train and validation files. + Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. + See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. + integrations: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations' + - type: 'null' + description: A list of integrations to enable for your fine-tuning job. + seed: + anyOf: + - type: integer + - type: 'null' + minimum: 0 + maximum: 2147483647 + description: |- + The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. + If a seed is not specified, one will be generated for you. + method: + $ref: '#/components/schemas/OpenAI.FineTuneMethod' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.CreateFineTuningJobRequestHyperparameters: + type: object + properties: + batch_size: + anyOf: + - type: string + enum: + - auto + - type: integer + default: auto + learning_rate_multiplier: + anyOf: + - type: string + enum: + - auto + - type: number + n_epochs: + anyOf: + - type: string + enum: + - auto + - type: integer + default: auto + OpenAI.CreateFineTuningJobRequestIntegrations: + type: object + required: + - type + - wandb + properties: + type: + type: string + enum: + - wandb + x-stainless-const: true + wandb: + $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb' + OpenAI.CreateFineTuningJobRequestIntegrationsWandb: + type: object + required: + - project + properties: + project: + type: string + name: + anyOf: + - type: string + - type: 'null' + entity: + anyOf: + - type: string + - type: 'null' + tags: + type: array + items: + type: string + OpenAI.CreateMessageRequest: + type: object + required: + - role + - content + properties: + role: + type: string + enum: + - user + - assistant + description: |- + The role of the entity that is creating the message. Allowed values include: + - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. + content: + anyOf: + - type: string + - type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.MessageContentImageFileObject' + - $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObject' + - $ref: '#/components/schemas/OpenAI.MessageRequestContentTextObject' + attachments: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.CreateMessageRequestAttachments' + - type: 'null' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.CreateMessageRequestAttachments: + type: object + properties: + file_id: + type: string + tools: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.AssistantToolsCode' + - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly' + OpenAI.CreateResponse: + type: object + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + description: |- + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + The two categories of tools you can provide the model are: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like file search. + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code. + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + input: + $ref: '#/components/schemas/OpenAI.InputParam' + include: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + - type: 'null' + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + default: true + store: + anyOf: + - type: boolean + - type: 'null' + default: true + instructions: + anyOf: + - type: string + - type: 'null' + stream: + anyOf: + - type: boolean + - type: 'null' + stream_options: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseStreamOptions' + - type: 'null' + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationParam' + - type: 'null' + OpenAI.CreateRunRequest: + type: object + required: + - assistant_id + properties: + assistant_id: + type: string + description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + model: + type: string + description: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + x-oaiTypeLabel: string + reasoning_effort: + $ref: '#/components/schemas/OpenAI.ReasoningEffort' + instructions: + anyOf: + - type: string + - type: 'null' + description: Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. + additional_instructions: + anyOf: + - type: string + - type: 'null' + description: Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. + additional_messages: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.CreateMessageRequest' + - type: 'null' + description: Adds additional messages to the thread before creating the run. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.AssistantTool' + maxItems: 20 + description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + minimum: 0 + maximum: 2 + description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + minimum: 0 + maximum: 1 + description: |- + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + We generally recommend altering this or temperature but not both. + default: 1 + stream: + anyOf: + - type: boolean + - type: 'null' + description: 'If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.' + max_prompt_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 256 + description: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 256 + description: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + truncation_strategy: + $ref: '#/components/schemas/OpenAI.TruncationObject' + tool_choice: + $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption' + parallel_tool_calls: + $ref: '#/components/schemas/OpenAI.ParallelToolCalls' + response_format: + $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption' + OpenAI.CreateThreadAndRunRequest: + type: object + required: + - assistant_id + properties: + assistant_id: + type: string + description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + thread: + $ref: '#/components/schemas/OpenAI.CreateThreadRequest' + model: + type: string + description: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + x-oaiTypeLabel: string + instructions: + anyOf: + - type: string + - type: 'null' + description: Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.AssistantTool' + maxItems: 20 + description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + tool_resources: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources' + - type: 'null' + description: A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + minimum: 0 + maximum: 2 + description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + minimum: 0 + maximum: 1 + description: |- + An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + We generally recommend altering this or temperature but not both. + default: 1 + stream: + anyOf: + - type: boolean + - type: 'null' + description: 'If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.' + max_prompt_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 256 + description: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 256 + description: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + truncation_strategy: + $ref: '#/components/schemas/OpenAI.TruncationObject' + tool_choice: + $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption' + parallel_tool_calls: + $ref: '#/components/schemas/OpenAI.ParallelToolCalls' + response_format: + $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption' + OpenAI.CreateThreadAndRunRequestToolResources: + type: object + properties: + code_interpreter: + $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter' + file_search: + $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch' + OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + default: [] + OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch: + type: object + properties: + vector_store_ids: + type: array + items: + type: string + maxItems: 1 + OpenAI.CreateThreadRequest: + type: object + properties: + messages: + type: array + items: + $ref: '#/components/schemas/OpenAI.CreateMessageRequest' + description: A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. + tool_resources: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResources' + - type: 'null' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: |- + Options to create a new thread. If no thread is provided when running a + request, an empty thread will be created. + OpenAI.CreateThreadRequestToolResources: + type: object + properties: + code_interpreter: + $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter' + file_search: + anyOf: + - {} + - {} + OpenAI.CreateThreadRequestToolResourcesCodeInterpreter: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + OpenAI.CreateVectorStoreFileBatchRequest: + type: object + properties: + file_ids: + type: array + items: + type: string + minItems: 1 + maxItems: 500 + description: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. Mutually exclusive with `files`. + files: + type: array + items: + $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest' + minItems: 1 + maxItems: 500 + description: A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. Mutually exclusive with `file_ids`. + chunking_strategy: + $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' + attributes: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' + - type: 'null' + OpenAI.CreateVectorStoreFileRequest: + type: object + required: + - file_id + properties: + file_id: + type: string + description: A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. + chunking_strategy: + $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' + attributes: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' + - type: 'null' + OpenAI.CreateVectorStoreRequest: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 500 + description: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. + name: + type: string + description: The name of the vector store. + description: + type: string + description: A description for the vector store. Can be used to describe the vector store's purpose. + expires_after: + $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter' + chunking_strategy: + $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.CustomGrammarFormatParam: + type: object + required: + - type + - syntax + - definition + properties: + type: + type: string + enum: + - grammar + description: Grammar format. Always `grammar`. + x-stainless-const: true + default: grammar + syntax: + allOf: + - $ref: '#/components/schemas/OpenAI.GrammarSyntax1' + description: The syntax of the grammar definition. One of `lark` or `regex`. + definition: + type: string + description: The grammar definition. + allOf: + - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat' + description: A grammar defined by the user. + title: Grammar format + OpenAI.CustomTextFormatParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: Unconstrained text format. Always `text`. + x-stainless-const: true + default: text + allOf: + - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat' + description: Unconstrained free-form text. + title: Text format + OpenAI.CustomToolChatCompletions: + type: object + required: + - type + - custom + properties: + type: + type: string + enum: + - custom + description: The type of the custom tool. Always `custom`. + x-stainless-const: true + custom: + allOf: + - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustom' + description: Properties of the custom tool. + title: Custom tool properties + description: A custom tool that processes input using a specified format. + title: Custom tool + OpenAI.CustomToolChatCompletionsCustom: + type: object + required: + - name + properties: + name: + type: string + description: + type: string + format: + anyOf: + - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText' + - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar' + OpenAI.CustomToolChatCompletionsCustomFormatGrammar: + type: object + required: + - type + - grammar + properties: + type: + type: string + enum: + - grammar + x-stainless-const: true + grammar: + allOf: + - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar' + title: Grammar format + OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar: + type: object + required: + - definition + - syntax + properties: + definition: + type: string + syntax: + type: string + enum: + - lark + - regex + OpenAI.CustomToolChatCompletionsCustomFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + x-stainless-const: true + OpenAI.CustomToolParam: + type: object + required: + - type + - name + properties: + type: + type: string + enum: + - custom + description: The type of the custom tool. Always `custom`. + x-stainless-const: true + default: custom + name: + type: string + description: The name of the custom tool, used to identify it in tool calls. + description: + type: string + description: Optional description of the custom tool, used to provide more context. + format: + allOf: + - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat' + description: The input format for the custom tool. Default is unconstrained text. + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) + title: Custom tool + OpenAI.CustomToolParamFormat: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.CustomToolParamFormatType' + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/OpenAI.CustomTextFormatParam' + grammar: '#/components/schemas/OpenAI.CustomGrammarFormatParam' + description: The input format for the custom tool. Default is unconstrained text. + OpenAI.CustomToolParamFormatType: + anyOf: + - type: string + - type: string + enum: + - text + - grammar + OpenAI.DeleteFileResponse: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + object: + type: string + enum: + - file + x-stainless-const: true + deleted: + type: boolean + OpenAI.DeleteFineTuningCheckpointPermissionResponse: + type: object + required: + - id + - object + - deleted + properties: + id: + type: string + description: The ID of the fine-tuned model checkpoint permission that was deleted. + object: + type: string + enum: + - checkpoint.permission + description: The object type, which is always "checkpoint.permission". + x-stainless-const: true + deleted: + type: boolean + description: Whether the fine-tuned model checkpoint permission was successfully deleted. + OpenAI.DeleteMessageResponse: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: + - thread.message.deleted + x-stainless-const: true + OpenAI.DeleteModelResponse: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + OpenAI.DeleteThreadResponse: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: + - thread.deleted + x-stainless-const: true + OpenAI.DeleteVectorStoreFileResponse: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: + - vector_store.file.deleted + x-stainless-const: true + OpenAI.DeleteVectorStoreResponse: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + deleted: + type: boolean + object: + type: string + enum: + - vector_store.deleted + x-stainless-const: true + OpenAI.DeletedConversationResource: + type: object + required: + - object + - deleted + - id + properties: + object: + type: string + enum: + - conversation.deleted + x-stainless-const: true + default: conversation.deleted + deleted: + type: boolean + id: + type: string + OpenAI.DoubleClickAction: + type: object + required: + - type + - x + - 'y' + properties: + type: + type: string + enum: + - double_click + description: Specifies the event type. For a double click action, this property is always set to `double_click`. + x-stainless-const: true + default: double_click + x: + type: integer + description: The x-coordinate where the double click occurred. + 'y': + type: integer + description: The y-coordinate where the double click occurred. + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A double click action. + title: DoubleClick + OpenAI.Drag: + type: object + required: + - type + - path + properties: + type: + type: string + enum: + - drag + description: |- + Specifies the event type. For a drag action, this property is + always set to `drag`. + x-stainless-const: true + default: drag + path: + type: array + items: + $ref: '#/components/schemas/OpenAI.DragPoint' + description: |- + An array of coordinates representing the path of the drag action. Coordinates will appear as an array + of objects, eg + ``` + [ + { x: 100, y: 200 }, + { x: 200, y: 300 } + ] + ``` + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A drag action. + title: Drag + OpenAI.DragPoint: + type: object + required: + - x + - 'y' + properties: + x: + type: integer + description: The x-coordinate. + 'y': + type: integer + description: The y-coordinate. + description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.' + title: Coordinate + OpenAI.EasyInputMessage: + type: object + required: + - role + - content + - type + properties: + role: + type: string + enum: + - user + - assistant + - system + - developer + description: |- + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + content: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAI.InputMessageContentList' + description: |- + Text, image, or audio input to the model, used to generate a response. + Can also contain previous assistant responses. + type: + type: string + enum: + - message + description: The type of the message input. Always `message`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.InputItem' + description: |- + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + title: Input message + OpenAI.Embedding: + type: object + required: + - index + - embedding + - object + properties: + index: + type: integer + description: The index of the embedding in the list of embeddings. + embedding: + type: array + items: + type: number + format: float + description: The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings). + object: + type: string + enum: + - embedding + description: The object type, which is always "embedding". + x-stainless-const: true + description: Represents an embedding vector returned by embedding endpoint. + x-oaiMeta: + name: The embedding object + example: | + { + "object": "embedding", + "embedding": [ + 0.0023064255, + -0.009327292, + .... (1536 floats total for ada-002) + -0.0028842222, + ], + "index": 0 + } + OpenAI.Eval: + type: object + required: + - object + - id + - name + - data_source_config + - testing_criteria + - created_at + - metadata + properties: + object: + type: string + enum: + - eval + description: The object type. + x-stainless-const: true + default: eval + id: + type: string + description: Unique identifier for the evaluation. + name: + type: string + description: The name of the evaluation. + data_source_config: + anyOf: + - $ref: '#/components/schemas/OpenAI.EvalCustomDataSourceConfig' + - $ref: '#/components/schemas/OpenAI.EvalLogsDataSourceConfig' + - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsDataSourceConfig' + description: Configuration of data sources used in runs of the evaluation. + testing_criteria: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalLabelModelGrader' + - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck' + - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.EvalGraderPython' + - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel' + - $ref: '#/components/schemas/EvalGraderEndpoint' + description: A list of testing criteria. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the eval was created. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: |- + An Eval object with a data source config and testing criteria. + An Eval represents a task to be done for your LLM integration. + Like: + - Improve the quality of my chatbot + - See how well my chatbot handles customer support + - Check if o4-mini is better at my usecase than gpt-4o + title: Eval + x-oaiMeta: + name: The eval object + group: evals + example: | + { + "object": "eval", + "id": "eval_67abd54d9b0081909a86353f6fb9317a", + "data_source_config": { + "type": "custom", + "item_schema": { + "type": "object", + "properties": { + "label": {"type": "string"}, + }, + "required": ["label"] + }, + "include_sample_schema": true + }, + "testing_criteria": [ + { + "name": "My string check grader", + "type": "string_check", + "input": "{{sample.output_text}}", + "reference": "{{item.label}}", + "operation": "eq", + } + ], + "name": "External Data Eval", + "created_at": 1739314509, + "metadata": { + "test": "synthetics", + } + } + OpenAI.EvalApiError: + type: object + required: + - code + - message + properties: + code: + type: string + description: The error code. + message: + type: string + description: The error message. + description: An object representing an error response from the Eval API. + title: EvalApiError + x-oaiMeta: + name: The API error object + group: evals + example: | + { + "code": "internal_error", + "message": "The eval run failed due to an internal error." + } + OpenAI.EvalCustomDataSourceConfig: + type: object + required: + - type + - schema + properties: + type: + type: string + enum: + - custom + description: The type of data source. Always `custom`. + x-stainless-const: true + default: custom + schema: + type: object + unevaluatedProperties: {} + description: |- + The json schema for the run data source items. + Learn how to build JSON schemas [here](https://json-schema.org/). + description: |- + A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces. + The response schema defines the shape of the data that will be: + - Used to define your testing criteria and + - What data is required when creating a run + title: CustomDataSourceConfig + x-oaiMeta: + name: The eval custom data source config object + group: evals + example: | + { + "type": "custom", + "schema": { + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "label": {"type": "string"}, + }, + "required": ["label"] + } + }, + "required": ["item"] + } + } + OpenAI.EvalGraderPython: + type: object + required: + - type + - name + - source + properties: + type: + type: string + enum: + - python + description: The object type, which is always `python`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + source: + type: string + description: The source code of the python script. + image_tag: + type: string + description: The image tag to use for the python script. + pass_threshold: + type: number + description: The threshold for the score. + title: EvalGraderPython + OpenAI.EvalGraderScoreModel: + type: object + required: + - type + - name + - model + - input + properties: + type: + type: string + enum: + - score_model + description: The object type, which is always `score_model`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + model: + type: string + description: The model to use for the evaluation. + sampling_params: + allOf: + - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams' + description: The sampling parameters for the model. + input: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalItem' + description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings. + range: + type: array + items: + type: number + description: The range of the score. Defaults to `[0, 1]`. + pass_threshold: + type: number + description: The threshold for the score. + title: EvalGraderScoreModel + OpenAI.EvalGraderScoreModelSamplingParams: + type: object + properties: + seed: + anyOf: + - type: integer + - type: 'null' + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + temperature: + anyOf: + - type: number + - type: 'null' + max_completions_tokens: + anyOf: + - type: integer + - type: 'null' + reasoning_effort: + $ref: '#/components/schemas/OpenAI.ReasoningEffort' + OpenAI.EvalGraderStringCheck: + type: object + required: + - type + - name + - input + - reference + - operation + properties: + type: + type: string + enum: + - string_check + description: The object type, which is always `string_check`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + input: + type: string + description: The input text. This may include template strings. + reference: + type: string + description: The reference text. This may include template strings. + operation: + type: string + enum: + - eq + - ne + - like + - ilike + description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + title: StringCheckGrader + OpenAI.EvalGraderTextSimilarity: + type: object + required: + - type + - name + - input + - reference + - evaluation_metric + - pass_threshold + properties: + type: + type: string + enum: + - text_similarity + description: The type of grader. + x-stainless-const: true + default: text_similarity + name: + type: string + description: The name of the grader. + input: + type: string + description: The text being graded. + reference: + type: string + description: The text being graded against. + evaluation_metric: + type: string + enum: + - cosine + - fuzzy_match + - bleu + - gleu + - meteor + - rouge_1 + - rouge_2 + - rouge_3 + - rouge_4 + - rouge_5 + - rouge_l + description: |- + The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, + `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, + or `rouge_l`. + pass_threshold: + type: number + description: The threshold for the score. + title: EvalGraderTextSimilarity + OpenAI.EvalItem: + type: object + required: + - role + - content + properties: + role: + type: string + enum: + - user + - assistant + - system + - developer + description: |- + The role of the message input. One of `user`, `assistant`, `system`, or + `developer`. + content: + $ref: '#/components/schemas/OpenAI.EvalItemContent' + type: + type: string + enum: + - message + description: The type of the message input. Always `message`. + x-stainless-const: true + description: |- + A message input to the model with a role indicating instruction following + hierarchy. Instructions given with the `developer` or `system` role take + precedence over instructions given with the `user` role. Messages with the + `assistant` role are presumed to have been generated by the model in previous + interactions. + title: EvalItem + OpenAI.EvalItemContent: + anyOf: + - $ref: '#/components/schemas/OpenAI.EvalItemContentItem' + - $ref: '#/components/schemas/OpenAI.EvalItemContentArray' + description: Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items. + title: Eval content + OpenAI.EvalItemContentArray: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalItemContentItem' + description: |- + A list of inputs, each of which may be either an input text, output text, input + image, or input audio object. + title: An array of Input text, Output text, Input image, and Input audio + OpenAI.EvalItemContentItem: + anyOf: + - $ref: '#/components/schemas/OpenAI.EvalItemContentText' + - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' + description: 'A single content item: input text, output text, input image, or input audio.' + title: Eval content item + x-stainless-naming: + ruby: + model_name: GraderInputItem + OpenAI.EvalItemContentItemObject: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.EvalItemContentItemObjectType' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAI.EvalItemContentOutputText' + input_image: '#/components/schemas/OpenAI.EvalItemInputImage' + input_audio: '#/components/schemas/OpenAI.InputAudio' + input_text: '#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent' + description: 'A single content item: input text, output text, input image, or input audio.' + title: Eval content item + x-stainless-naming: + ruby: + model_name: GraderInputItem + OpenAI.EvalItemContentItemObjectInputTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - input_text + description: The type of the input item. Always `input_text`. + x-stainless-const: true + default: input_text + text: + type: string + description: The text input to the model. + allOf: + - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' + description: A text input to the model. + title: Input text + OpenAI.EvalItemContentItemObjectType: + anyOf: + - type: string + - type: string + enum: + - input_text + - output_text + - input_image + - input_audio + OpenAI.EvalItemContentOutputText: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - output_text + description: The type of the output text. Always `output_text`. + x-stainless-const: true + text: + type: string + description: The text output from the model. + allOf: + - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' + description: A text output from the model. + title: Output text + OpenAI.EvalItemContentText: + type: string + description: A text input to the model. + title: Text input + OpenAI.EvalItemInputImage: + type: object + required: + - type + - image_url + properties: + type: + type: string + enum: + - input_image + description: The type of the image input. Always `input_image`. + x-stainless-const: true + image_url: + type: string + format: uri + description: The URL of the image input. + detail: + type: string + description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + allOf: + - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' + description: An image input block used within EvalItem content arrays. + title: Input image + OpenAI.EvalJsonlFileContentSource: + type: object + required: + - type + - content + properties: + type: + type: string + enum: + - file_content + description: The type of jsonl source. Always `file_content`. + x-stainless-const: true + default: file_content + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent' + description: The content of the jsonl file. + title: EvalJsonlFileContentSource + OpenAI.EvalJsonlFileContentSourceContent: + type: object + required: + - item + properties: + item: + type: object + unevaluatedProperties: {} + sample: + type: object + unevaluatedProperties: {} + OpenAI.EvalJsonlFileIdSource: + type: object + required: + - type + - id + properties: + type: + type: string + enum: + - file_id + description: The type of jsonl source. Always `file_id`. + x-stainless-const: true + default: file_id + id: + type: string + description: The identifier of the file. + title: EvalJsonlFileIdSource + OpenAI.EvalList: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The type of this object. It is always set to "list". + x-stainless-const: true + default: list + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.Eval' + description: An array of eval objects. + first_id: + type: string + description: The identifier of the first eval in the data array. + last_id: + type: string + description: The identifier of the last eval in the data array. + has_more: + type: boolean + description: Indicates whether there are more evals available. + description: An object representing a list of evals. + title: EvalList + x-oaiMeta: + name: The eval list object + group: evals + example: | + { + "object": "list", + "data": [ + { + "object": "eval", + "id": "eval_67abd54d9b0081909a86353f6fb9317a", + "data_source_config": { + "type": "custom", + "schema": { + "type": "object", + "properties": { + "item": { + "type": "object", + "properties": { + "input": { + "type": "string" + }, + "ground_truth": { + "type": "string" + } + }, + "required": [ + "input", + "ground_truth" + ] + } + }, + "required": [ + "item" + ] + } + }, + "testing_criteria": [ + { + "name": "String check", + "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2", + "type": "string_check", + "input": "{{item.input}}", + "reference": "{{item.ground_truth}}", + "operation": "eq" + } + ], + "name": "External Data Eval", + "created_at": 1739314509, + "metadata": {}, + } + ], + "first_id": "eval_67abd54d9b0081909a86353f6fb9317a", + "last_id": "eval_67abd54d9b0081909a86353f6fb9317a", + "has_more": true + } + OpenAI.EvalLogsDataSourceConfig: + type: object + required: + - type + - schema + properties: + type: + type: string + enum: + - logs + description: The type of data source. Always `logs`. + x-stainless-const: true + default: logs + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + schema: + type: object + unevaluatedProperties: {} + description: |- + The json schema for the run data source items. + Learn how to build JSON schemas [here](https://json-schema.org/). + description: |- + A LogsDataSourceConfig which specifies the metadata property of your logs query. + This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. + The schema returned by this data source config is used to defined what variables are available in your evals. + `item` and `sample` are both defined when using this data source config. + title: LogsDataSourceConfig + x-oaiMeta: + name: The logs data source object for evals + group: evals + example: | + { + "type": "logs", + "metadata": { + "language": "english" + }, + "schema": { + "type": "object", + "properties": { + "item": { + "type": "object" + }, + "sample": { + "type": "object" + } + }, + "required": [ + "item", + "sample" + } + } + OpenAI.EvalResponsesSource: + type: object + required: + - type + properties: + type: + type: string + enum: + - responses + description: The type of run data source. Always `responses`. + metadata: + anyOf: + - type: object + unevaluatedProperties: {} + - type: 'null' + model: + anyOf: + - type: string + - type: 'null' + instructions_search: + anyOf: + - type: string + - type: 'null' + created_after: + anyOf: + - type: integer + - type: 'null' + created_before: + anyOf: + - type: integer + - type: 'null' + reasoning_effort: + anyOf: + - $ref: '#/components/schemas/OpenAI.ReasoningEffort' + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + top_p: + anyOf: + - type: number + - type: 'null' + users: + anyOf: + - type: array + items: + type: string + - type: 'null' + tools: + anyOf: + - type: array + items: + type: string + - type: 'null' + description: A EvalResponsesSource object describing a run data source configuration. + title: EvalResponsesSource + x-oaiMeta: + name: The run data source object used to configure an individual run + group: eval runs + example: | + { + "type": "responses", + "model": "gpt-4o-mini-2024-07-18", + "temperature": 0.7, + "top_p": 1.0, + "users": ["user1", "user2"], + "tools": ["tool1", "tool2"], + "instructions_search": "You are a coding assistant" + } + OpenAI.EvalRun: + type: object + required: + - object + - id + - eval_id + - status + - model + - name + - created_at + - report_url + - result_counts + - per_model_usage + - per_testing_criteria_results + - data_source + - metadata + - error + properties: + object: + type: string + enum: + - eval.run + description: The type of the object. Always "eval.run". + x-stainless-const: true + default: eval.run + id: + type: string + description: Unique identifier for the evaluation run. + eval_id: + type: string + description: The identifier of the associated evaluation. + status: + type: string + description: The status of the evaluation run. + model: + type: string + description: The model that is evaluated, if applicable. + name: + type: string + description: The name of the evaluation run. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) when the evaluation run was created. + report_url: + type: string + format: uri + description: The URL to the rendered evaluation run report on the UI dashboard. + result_counts: + allOf: + - $ref: '#/components/schemas/OpenAI.EvalRunResultCounts' + description: Counters summarizing the outcomes of the evaluation run. + per_model_usage: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRunPerModelUsage' + description: Usage statistics for each model during the evaluation run. + per_testing_criteria_results: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults' + description: Results per testing criteria applied during the evaluation run. + data_source: + anyOf: + - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource' + - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource' + - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource' + description: Information about the run's data source. + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + error: + $ref: '#/components/schemas/OpenAI.EvalApiError' + description: A schema representing an evaluation run. + title: EvalRun + x-oaiMeta: + name: The eval run object + group: evals + example: | + { + "object": "eval.run", + "id": "evalrun_67e57965b480819094274e3a32235e4c", + "eval_id": "eval_67e579652b548190aaa83ada4b125f47", + "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c", + "status": "queued", + "model": "gpt-4o-mini", + "name": "gpt-4o-mini", + "created_at": 1743092069, + "result_counts": { + "total": 0, + "errored": 0, + "failed": 0, + "passed": 0 + }, + "per_model_usage": null, + "per_testing_criteria_results": null, + "data_source": { + "type": "completions", + "source": { + "type": "file_content", + "content": [ + { + "item": { + "input": "Tech Company Launches Advanced Artificial Intelligence Platform", + "ground_truth": "Technology" + } + }, + { + "item": { + "input": "Central Bank Increases Interest Rates Amid Inflation Concerns", + "ground_truth": "Markets" + } + }, + { + "item": { + "input": "International Summit Addresses Climate Change Strategies", + "ground_truth": "World" + } + }, + { + "item": { + "input": "Major Retailer Reports Record-Breaking Holiday Sales", + "ground_truth": "Business" + } + }, + { + "item": { + "input": "National Team Qualifies for World Championship Finals", + "ground_truth": "Sports" + } + }, + { + "item": { + "input": "Stock Markets Rally After Positive Economic Data Released", + "ground_truth": "Markets" + } + }, + { + "item": { + "input": "Global Manufacturer Announces Merger with Competitor", + "ground_truth": "Business" + } + }, + { + "item": { + "input": "Breakthrough in Renewable Energy Technology Unveiled", + "ground_truth": "Technology" + } + }, + { + "item": { + "input": "World Leaders Sign Historic Climate Agreement", + "ground_truth": "World" + } + }, + { + "item": { + "input": "Professional Athlete Sets New Record in Championship Event", + "ground_truth": "Sports" + } + }, + { + "item": { + "input": "Financial Institutions Adapt to New Regulatory Requirements", + "ground_truth": "Business" + } + }, + { + "item": { + "input": "Tech Conference Showcases Advances in Artificial Intelligence", + "ground_truth": "Technology" + } + }, + { + "item": { + "input": "Global Markets Respond to Oil Price Fluctuations", + "ground_truth": "Markets" + } + }, + { + "item": { + "input": "International Cooperation Strengthened Through New Treaty", + "ground_truth": "World" + } + }, + { + "item": { + "input": "Sports League Announces Revised Schedule for Upcoming Season", + "ground_truth": "Sports" + } + } + ] + }, + "input_messages": { + "type": "template", + "template": [ + { + "type": "message", + "role": "developer", + "content": { + "type": "input_text", + "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports. + + # Steps + + 1. Analyze the content of the news headline to understand its primary focus. + 2. Extract the subject matter, identifying any key indicators or keywords. + 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports. + 4. Ensure only one category is selected per headline. + + # Output Format + + Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports". + + # Examples + + **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features" + **Output**: "Technology" + + **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions" + **Output**: "Markets" + + **Input**: "War in Ukraine: Latest Updates on Negotiation Status" + **Output**: "World" + + **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion" + **Output**: "Business" + + **Input**: "Manchester United Secures Win in Premier League Football Match" + **Output**: "Sports" + + # Notes + + - If the headline appears to fit into more than one category, choose the most dominant theme. + - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification. + " + } + }, + { + "type": "message", + "role": "user", + "content": { + "type": "input_text", + "text": "{{item.input}}" + } + } + ] + }, + "model": "gpt-4o-mini", + "sampling_params": { + "seed": 42, + "temperature": 1.0, + "top_p": 1.0, + "max_completions_tokens": 2048 + } + }, + "error": null, + "metadata": {} + } + OpenAI.EvalRunList: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The type of this object. It is always set to "list". + x-stainless-const: true + default: list + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRun' + description: An array of eval run objects. + first_id: + type: string + description: The identifier of the first eval run in the data array. + last_id: + type: string + description: The identifier of the last eval run in the data array. + has_more: + type: boolean + description: Indicates whether there are more evals available. + description: An object representing a list of runs for an evaluation. + title: EvalRunList + x-oaiMeta: + name: The eval run list object + group: evals + example: | + { + "object": "list", + "data": [ + { + "object": "eval.run", + "id": "evalrun_67b7fbdad46c819092f6fe7a14189620", + "eval_id": "eval_67b7fa9a81a88190ab4aa417e397ea21", + "report_url": "https://platform.openai.com/evaluations/eval_67b7fa9a81a88190ab4aa417e397ea21?run_id=evalrun_67b7fbdad46c819092f6fe7a14189620", + "status": "completed", + "model": "o3-mini", + "name": "Academic Assistant", + "created_at": 1740110812, + "result_counts": { + "total": 171, + "errored": 0, + "failed": 80, + "passed": 91 + }, + "per_model_usage": null, + "per_testing_criteria_results": [ + { + "testing_criteria": "String check grader", + "passed": 91, + "failed": 80 + } + ], + "run_data_source": { + "type": "completions", + "template_messages": [ + { + "type": "message", + "role": "system", + "content": { + "type": "input_text", + "text": "You are a helpful assistant." + } + }, + { + "type": "message", + "role": "user", + "content": { + "type": "input_text", + "text": "Hello, can you help me with my homework?" + } + } + ], + "datasource_reference": null, + "model": "o3-mini", + "max_completion_tokens": null, + "seed": null, + "temperature": null, + "top_p": null + }, + "error": null, + "metadata": {"test": "synthetics"} + } + ], + "first_id": "evalrun_67abd54d60ec8190832b46859da808f7", + "last_id": "evalrun_67abd54d60ec8190832b46859da808f7", + "has_more": false + } + OpenAI.EvalRunOutputItem: + type: object + required: + - object + - id + - run_id + - eval_id + - created_at + - status + - datasource_item_id + - datasource_item + - results + - sample + properties: + object: + type: string + enum: + - eval.run.output_item + description: The type of the object. Always "eval.run.output_item". + x-stainless-const: true + default: eval.run.output_item + id: + type: string + description: Unique identifier for the evaluation run output item. + run_id: + type: string + description: The identifier of the evaluation run associated with this output item. + eval_id: + type: string + description: The identifier of the evaluation group. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) when the evaluation run was created. + status: + type: string + description: The status of the evaluation run. + datasource_item_id: + type: integer + description: The identifier for the data source item. + datasource_item: + type: object + unevaluatedProperties: {} + description: Details of the input data source item. + results: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItemResult' + description: A list of grader results for this output item. + sample: + allOf: + - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSample' + description: A sample containing the input and output of the evaluation run. + description: A schema representing an evaluation run output item. + title: EvalRunOutputItem + x-oaiMeta: + name: The eval run output item object + group: evals + example: | + { + "object": "eval.run.output_item", + "id": "outputitem_67abd55eb6548190bb580745d5644a33", + "run_id": "evalrun_67abd54d60ec8190832b46859da808f7", + "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a", + "created_at": 1739314509, + "status": "pass", + "datasource_item_id": 137, + "datasource_item": { + "teacher": "To grade essays, I only check for style, content, and grammar.", + "student": "I am a student who is trying to write the best essay." + }, + "results": [ + { + "name": "String Check Grader", + "type": "string-check-grader", + "score": 1.0, + "passed": true, + } + ], + "sample": { + "input": [ + { + "role": "system", + "content": "You are an evaluator bot..." + }, + { + "role": "user", + "content": "You are assessing..." + } + ], + "output": [ + { + "role": "assistant", + "content": "The rubric is not clear nor concise." + } + ], + "finish_reason": "stop", + "model": "gpt-4o-2024-08-06", + "usage": { + "total_tokens": 521, + "completion_tokens": 2, + "prompt_tokens": 519, + "cached_tokens": 0 + }, + "error": null, + "temperature": 1.0, + "max_completion_tokens": 2048, + "top_p": 1.0, + "seed": 42 + } + } + OpenAI.EvalRunOutputItemList: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The type of this object. It is always set to "list". + x-stainless-const: true + default: list + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItem' + description: An array of eval run output item objects. + first_id: + type: string + description: The identifier of the first eval run output item in the data array. + last_id: + type: string + description: The identifier of the last eval run output item in the data array. + has_more: + type: boolean + description: Indicates whether there are more eval run output items available. + description: An object representing a list of output items for an evaluation run. + title: EvalRunOutputItemList + x-oaiMeta: + name: The eval run output item list object + group: evals + example: | + { + "object": "list", + "data": [ + { + "object": "eval.run.output_item", + "id": "outputitem_67abd55eb6548190bb580745d5644a33", + "run_id": "evalrun_67abd54d60ec8190832b46859da808f7", + "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a", + "created_at": 1739314509, + "status": "pass", + "datasource_item_id": 137, + "datasource_item": { + "teacher": "To grade essays, I only check for style, content, and grammar.", + "student": "I am a student who is trying to write the best essay." + }, + "results": [ + { + "name": "String Check Grader", + "type": "string-check-grader", + "score": 1.0, + "passed": true, + } + ], + "sample": { + "input": [ + { + "role": "system", + "content": "You are an evaluator bot..." + }, + { + "role": "user", + "content": "You are assessing..." + } + ], + "output": [ + { + "role": "assistant", + "content": "The rubric is not clear nor concise." + } + ], + "finish_reason": "stop", + "model": "gpt-4o-2024-08-06", + "usage": { + "total_tokens": 521, + "completion_tokens": 2, + "prompt_tokens": 519, + "cached_tokens": 0 + }, + "error": null, + "temperature": 1.0, + "max_completion_tokens": 2048, + "top_p": 1.0, + "seed": 42 + } + }, + ], + "first_id": "outputitem_67abd55eb6548190bb580745d5644a33", + "last_id": "outputitem_67abd55eb6548190bb580745d5644a33", + "has_more": false + } + OpenAI.EvalRunOutputItemResult: + type: object + required: + - name + - score + - passed + properties: + name: + type: string + description: The name of the grader. + type: + type: string + description: The grader type (for example, "string-check-grader"). + score: + type: number + description: The numeric score produced by the grader. + passed: + type: boolean + description: Whether the grader considered the output a pass. + sample: + anyOf: + - type: object + unevaluatedProperties: {} + - type: 'null' + description: Optional sample or intermediate data produced by the grader. + unevaluatedProperties: {} + description: A single grader result for an evaluation run output item. + title: EvalRunOutputItemResult + OpenAI.EvalRunOutputItemSample: + type: object + required: + - input + - output + - finish_reason + - model + - usage + - error + - temperature + - max_completion_tokens + - top_p + - seed + properties: + input: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleInput' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleOutput' + finish_reason: + type: string + model: + type: string + usage: + $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage' + error: + $ref: '#/components/schemas/OpenAI.EvalApiError' + temperature: + type: number + max_completion_tokens: + type: integer + top_p: + type: number + seed: + type: integer + OpenAI.EvalRunOutputItemSampleInput: + type: object + required: + - role + - content + properties: + role: + type: string + content: + type: string + OpenAI.EvalRunOutputItemSampleOutput: + type: object + properties: + role: + type: string + content: + type: string + OpenAI.EvalRunOutputItemSampleUsage: + type: object + required: + - total_tokens + - completion_tokens + - prompt_tokens + - cached_tokens + properties: + total_tokens: + type: integer + completion_tokens: + type: integer + prompt_tokens: + type: integer + cached_tokens: + type: integer + OpenAI.EvalRunPerModelUsage: + type: object + required: + - model_name + - invocation_count + - prompt_tokens + - completion_tokens + - total_tokens + - cached_tokens + properties: + model_name: + type: string + x-stainless-naming: + python: + property_name: run_model_name + invocation_count: + type: integer + prompt_tokens: + type: integer + completion_tokens: + type: integer + total_tokens: + type: integer + cached_tokens: + type: integer + OpenAI.EvalRunPerTestingCriteriaResults: + type: object + required: + - testing_criteria + - passed + - failed + properties: + testing_criteria: + type: string + passed: + type: integer + failed: + type: integer + OpenAI.EvalRunResultCounts: + type: object + required: + - total + - errored + - failed + - passed + properties: + total: + type: integer + errored: + type: integer + failed: + type: integer + passed: + type: integer + OpenAI.EvalStoredCompletionsDataSourceConfig: + type: object + required: + - type + - schema + properties: + type: + type: string + enum: + - stored_completions + description: The type of data source. Always `stored_completions`. + x-stainless-const: true + default: stored_completions + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + schema: + type: object + unevaluatedProperties: {} + description: |- + The json schema for the run data source items. + Learn how to build JSON schemas [here](https://json-schema.org/). + description: Deprecated in favor of LogsDataSourceConfig. + title: StoredCompletionsDataSourceConfig + deprecated: true + x-oaiMeta: + name: The stored completions data source object for evals + group: evals + example: | + { + "type": "stored_completions", + "metadata": { + "language": "english" + }, + "schema": { + "type": "object", + "properties": { + "item": { + "type": "object" + }, + "sample": { + "type": "object" + } + }, + "required": [ + "item", + "sample" + } + } + OpenAI.EvalStoredCompletionsSource: + type: object + required: + - type + properties: + type: + type: string + enum: + - stored_completions + description: The type of source. Always `stored_completions`. + x-stainless-const: true + default: stored_completions + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + model: + anyOf: + - type: string + - type: 'null' + created_after: + anyOf: + - type: integer + - type: 'null' + created_before: + anyOf: + - type: integer + - type: 'null' + limit: + anyOf: + - type: integer + - type: 'null' + description: A StoredCompletionsRunDataSource configuration describing a set of filters + title: StoredCompletionsRunDataSource + x-oaiMeta: + name: The stored completions data source object used to configure an individual run + group: eval runs + example: | + { + "type": "stored_completions", + "model": "gpt-4o", + "created_after": 1668124800, + "created_before": 1668124900, + "limit": 100, + "metadata": {} + } + OpenAI.FileCitationBody: + type: object + required: + - type + - file_id + - index + - filename + properties: + type: + type: string + enum: + - file_citation + description: The type of the file citation. Always `file_citation`. + x-stainless-const: true + default: file_citation + file_id: + type: string + description: The ID of the file. + index: + type: integer + description: The index of the file in the list of files. + filename: + type: string + description: The filename of the file cited. + allOf: + - $ref: '#/components/schemas/OpenAI.Annotation' + description: A citation to a file. + title: File citation + OpenAI.FilePath: + type: object + required: + - type + - file_id + - index + properties: + type: + type: string + enum: + - file_path + description: The type of the file path. Always `file_path`. + x-stainless-const: true + file_id: + type: string + description: The ID of the file. + index: + type: integer + description: The index of the file in the list of files. + allOf: + - $ref: '#/components/schemas/OpenAI.Annotation' + description: A path to a file. + title: File path + OpenAI.FileSearchRanker: + type: string + enum: + - auto + - default_2024_08_21 + description: The ranker to use for the file search. If not specified will use the `auto` ranker. + OpenAI.FileSearchRankingOptions: + type: object + required: + - score_threshold + properties: + ranker: + $ref: '#/components/schemas/OpenAI.FileSearchRanker' + score_threshold: + type: number + minimum: 0 + maximum: 1 + description: The score threshold for the file search. All values must be a floating point number between 0 and 1. + description: |- + The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. + See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + title: File search tool call ranking options + OpenAI.FileSearchTool: + type: object + required: + - type + - vector_store_ids + properties: + type: + type: string + enum: + - file_search + description: The type of the file search tool. Always `file_search`. + x-stainless-const: true + default: file_search + vector_store_ids: + type: array + items: + type: string + description: The IDs of the vector stores to search. + max_num_results: + type: integer + description: The maximum number of results to return. This number should be between 1 and 50 inclusive. + ranking_options: + allOf: + - $ref: '#/components/schemas/OpenAI.RankingOptions' + description: Ranking options for search. + filters: + anyOf: + - $ref: '#/components/schemas/OpenAI.Filters' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). + title: File search + OpenAI.FileSearchToolCallResults: + type: object + properties: + file_id: + type: string + text: + type: string + filename: + type: string + attributes: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' + - type: 'null' + score: + type: number + format: float + OpenAI.Filters: + anyOf: + - $ref: '#/components/schemas/OpenAI.ComparisonFilter' + - $ref: '#/components/schemas/OpenAI.CompoundFilter' + OpenAI.FineTuneDPOHyperparameters: + type: object + properties: + beta: + anyOf: + - type: string + enum: + - auto + - type: number + description: The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. + batch_size: + anyOf: + - type: string + enum: + - auto + - type: integer + description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + default: auto + learning_rate_multiplier: + anyOf: + - type: string + enum: + - auto + - type: number + description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + n_epochs: + anyOf: + - type: string + enum: + - auto + - type: integer + description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + default: auto + description: The hyperparameters used for the DPO fine-tuning job. + OpenAI.FineTuneDPOMethod: + type: object + properties: + hyperparameters: + $ref: '#/components/schemas/OpenAI.FineTuneDPOHyperparameters' + description: Configuration for the DPO fine-tuning method. + OpenAI.FineTuneMethod: + type: object + required: + - type + properties: + type: + type: string + enum: + - supervised + - dpo + - reinforcement + description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`. + supervised: + $ref: '#/components/schemas/OpenAI.FineTuneSupervisedMethod' + dpo: + $ref: '#/components/schemas/OpenAI.FineTuneDPOMethod' + reinforcement: + $ref: '#/components/schemas/AzureFineTuneReinforcementMethod' + description: The method used for fine-tuning. + OpenAI.FineTuneReinforcementHyperparameters: + type: object + properties: + batch_size: + anyOf: + - type: string + enum: + - auto + - type: integer + description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + default: auto + learning_rate_multiplier: + anyOf: + - type: string + enum: + - auto + - type: number + description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + n_epochs: + anyOf: + - type: string + enum: + - auto + - type: integer + description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + default: auto + reasoning_effort: + type: string + enum: + - default + - low + - medium + - high + description: Level of reasoning effort. + default: default + compute_multiplier: + anyOf: + - type: string + enum: + - auto + - type: number + description: Multiplier on amount of compute used for exploring search space during training. + eval_interval: + anyOf: + - type: string + enum: + - auto + - type: integer + description: The number of training steps between evaluation runs. + default: auto + eval_samples: + anyOf: + - type: string + enum: + - auto + - type: integer + description: Number of evaluation samples to generate per training step. + default: auto + description: The hyperparameters used for the reinforcement fine-tuning job. + OpenAI.FineTuneSupervisedHyperparameters: + type: object + properties: + batch_size: + anyOf: + - type: string + enum: + - auto + - type: integer + description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + default: auto + learning_rate_multiplier: + anyOf: + - type: string + enum: + - auto + - type: number + description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + n_epochs: + anyOf: + - type: string + enum: + - auto + - type: integer + description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + default: auto + description: The hyperparameters used for the fine-tuning job. + OpenAI.FineTuneSupervisedMethod: + type: object + properties: + hyperparameters: + $ref: '#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters' + description: Configuration for the supervised fine-tuning method. + OpenAI.FineTuningCheckpointPermission: + type: object + required: + - id + - created_at + - project_id + - object + properties: + id: + type: string + description: The permission identifier, which can be referenced in the API endpoints. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the permission was created. + project_id: + type: string + description: The project identifier that the permission is for. + object: + type: string + enum: + - checkpoint.permission + description: The object type, which is always "checkpoint.permission". + x-stainless-const: true + description: The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint. + title: FineTuningCheckpointPermission + x-oaiMeta: + name: The fine-tuned model checkpoint permission object + example: | + { + "object": "checkpoint.permission", + "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", + "created_at": 1712211699, + "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH" + } + OpenAI.FineTuningIntegration: + type: object + required: + - type + - wandb + properties: + type: + type: string + enum: + - wandb + description: The type of the integration being enabled for the fine-tuning job + x-stainless-const: true + wandb: + allOf: + - $ref: '#/components/schemas/OpenAI.FineTuningIntegrationWandb' + description: |- + The settings for your integration with Weights and Biases. This payload specifies the project that + metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags + to your run, and set a default entity (team, username, etc) to be associated with your run. + title: Fine-Tuning Job Integration + OpenAI.FineTuningIntegrationWandb: + type: object + required: + - project + properties: + project: + type: string + name: + anyOf: + - type: string + - type: 'null' + entity: + anyOf: + - type: string + - type: 'null' + tags: + type: array + items: + type: string + OpenAI.FineTuningJob: + type: object + required: + - id + - created_at + - error + - fine_tuned_model + - finished_at + - hyperparameters + - model + - object + - organization_id + - result_files + - status + - trained_tokens + - training_file + - validation_file + - seed + properties: + id: + type: string + description: The object identifier, which can be referenced in the API endpoints. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the fine-tuning job was created. + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.FineTuningJobError' + - type: 'null' + fine_tuned_model: + anyOf: + - type: string + - type: 'null' + finished_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + hyperparameters: + allOf: + - $ref: '#/components/schemas/OpenAI.FineTuningJobHyperparameters' + description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs. + model: + type: string + description: The base model that is being fine-tuned. + object: + type: string + enum: + - fine_tuning.job + description: The object type, which is always "fine_tuning.job". + x-stainless-const: true + organization_id: + type: string + description: The organization that owns the fine-tuning job. + result_files: + type: array + items: + type: string + description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + status: + type: string + enum: + - validating_files + - queued + - running + - succeeded + - failed + - cancelled + description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + trained_tokens: + anyOf: + - type: integer + - type: 'null' + training_file: + type: string + description: The file ID used for training. You can retrieve the training data with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + validation_file: + anyOf: + - type: string + - type: 'null' + integrations: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.FineTuningIntegration' + - type: 'null' + seed: + type: integer + description: The seed used for the fine-tuning job. + estimated_finish: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + method: + $ref: '#/components/schemas/OpenAI.FineTuneMethod' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. + title: FineTuningJob + x-oaiMeta: + name: The fine-tuning job object + example: | + { + "object": "fine_tuning.job", + "id": "ftjob-abc123", + "model": "davinci-002", + "created_at": 1692661014, + "finished_at": 1692661190, + "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy", + "organization_id": "org-123", + "result_files": [ + "file-abc123" + ], + "status": "succeeded", + "validation_file": null, + "training_file": "file-abc123", + "hyperparameters": { + "n_epochs": 4, + "batch_size": 1, + "learning_rate_multiplier": 1.0 + }, + "trained_tokens": 5768, + "integrations": [], + "seed": 0, + "estimated_finish": 0, + "method": { + "type": "supervised", + "supervised": { + "hyperparameters": { + "n_epochs": 4, + "batch_size": 1, + "learning_rate_multiplier": 1.0 + } + } + }, + "metadata": { + "key": "value" + } + } + OpenAI.FineTuningJobCheckpoint: + type: object + required: + - id + - created_at + - fine_tuned_model_checkpoint + - step_number + - metrics + - fine_tuning_job_id + - object + properties: + id: + type: string + description: The checkpoint identifier, which can be referenced in the API endpoints. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the checkpoint was created. + fine_tuned_model_checkpoint: + type: string + description: The name of the fine-tuned checkpoint model that is created. + step_number: + type: integer + description: The step number that the checkpoint was created at. + metrics: + allOf: + - $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics' + description: Metrics at the step number during the fine-tuning job. + fine_tuning_job_id: + type: string + description: The name of the fine-tuning job that this checkpoint was created from. + object: + type: string + enum: + - fine_tuning.job.checkpoint + description: The object type, which is always "fine_tuning.job.checkpoint". + x-stainless-const: true + description: The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use. + title: FineTuningJobCheckpoint + x-oaiMeta: + name: The fine-tuning job checkpoint object + example: | + { + "object": "fine_tuning.job.checkpoint", + "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P", + "created_at": 1712211699, + "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88", + "fine_tuning_job_id": "ftjob-fpbNQ3H1GrMehXRf8cO97xTN", + "metrics": { + "step": 88, + "train_loss": 0.478, + "train_mean_token_accuracy": 0.924, + "valid_loss": 10.112, + "valid_mean_token_accuracy": 0.145, + "full_valid_loss": 0.567, + "full_valid_mean_token_accuracy": 0.944 + }, + "step_number": 88 + } + OpenAI.FineTuningJobCheckpointMetrics: + type: object + properties: + step: + type: number + train_loss: + type: number + train_mean_token_accuracy: + type: number + valid_loss: + type: number + valid_mean_token_accuracy: + type: number + full_valid_loss: + type: number + full_valid_mean_token_accuracy: + type: number + OpenAI.FineTuningJobError: + type: object + required: + - code + - message + - param + properties: + code: + type: string + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + OpenAI.FineTuningJobEvent: + type: object + required: + - object + - id + - created_at + - level + - message + properties: + object: + type: string + enum: + - fine_tuning.job.event + description: The object type, which is always "fine_tuning.job.event". + x-stainless-const: true + id: + type: string + description: The object identifier. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the fine-tuning job was created. + level: + type: string + enum: + - info + - warn + - error + description: The log level of the event. + message: + type: string + description: The message of the event. + type: + type: string + enum: + - message + - metrics + description: The type of event. + data: + allOf: + - $ref: '#/components/schemas/OpenAI.FineTuningJobEventData' + description: The data associated with the event. + description: Fine-tuning job event object + x-oaiMeta: + name: The fine-tuning job event object + example: | + { + "object": "fine_tuning.job.event", + "id": "ftevent-abc123" + "created_at": 1677610602, + "level": "info", + "message": "Created fine-tuning job", + "data": {}, + "type": "message" + } + OpenAI.FineTuningJobEventData: + type: object + OpenAI.FineTuningJobHyperparameters: + type: object + properties: + batch_size: + anyOf: + - type: string + enum: + - auto + - type: integer + - type: 'null' + default: auto + learning_rate_multiplier: + anyOf: + - type: string + enum: + - auto + - type: number + n_epochs: + anyOf: + - type: string + enum: + - auto + - type: integer + default: auto + OpenAI.FunctionAndCustomToolCallOutput: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType' + discriminator: + propertyName: type + mapping: + input_text: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent' + input_image: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent' + input_file: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent' + OpenAI.FunctionAndCustomToolCallOutputInputFileContent: + type: object + required: + - type + properties: + type: + type: string + enum: + - input_file + description: The type of the input item. Always `input_file`. + x-stainless-const: true + default: input_file + file_id: + anyOf: + - type: string + - type: 'null' + filename: + type: string + description: The name of the file to be sent to the model. + file_url: + type: string + format: uri + description: The URL of the file to be sent to the model. + file_data: + type: string + description: The content of the file to be sent to the model. + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' + description: A file input to the model. + title: Input file + OpenAI.FunctionAndCustomToolCallOutputInputImageContent: + type: object + required: + - type + - detail + properties: + type: + type: string + enum: + - input_image + description: The type of the input item. Always `input_image`. + x-stainless-const: true + default: input_image + image_url: + anyOf: + - type: string + format: uri + - type: 'null' + file_id: + anyOf: + - type: string + - type: 'null' + detail: + allOf: + - $ref: '#/components/schemas/OpenAI.ImageDetail' + description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' + description: An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + title: Input image + OpenAI.FunctionAndCustomToolCallOutputInputTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - input_text + description: The type of the input item. Always `input_text`. + x-stainless-const: true + default: input_text + text: + type: string + description: The text input to the model. + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' + description: A text input to the model. + title: Input text + OpenAI.FunctionAndCustomToolCallOutputType: + anyOf: + - type: string + - type: string + enum: + - input_text + - input_image + - input_file + OpenAI.FunctionObject: + type: object + required: + - name + properties: + description: + type: string + description: A description of what the function does, used by the model to choose when and how to call the function. + name: + type: string + description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + parameters: + $ref: '#/components/schemas/OpenAI.FunctionParameters' + strict: + anyOf: + - type: boolean + - type: 'null' + OpenAI.FunctionParameters: + type: object + unevaluatedProperties: {} + description: |- + The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. + Omitting `parameters` defines a function with an empty parameter list. + OpenAI.FunctionShellAction: + type: object + required: + - commands + - timeout_ms + - max_output_length + properties: + commands: + type: array + items: + type: string + timeout_ms: + anyOf: + - type: integer + - type: 'null' + max_output_length: + anyOf: + - type: integer + - type: 'null' + description: Execute a shell command. + title: Shell exec action + OpenAI.FunctionShellCallOutputContent: + type: object + required: + - stdout + - stderr + - outcome + properties: + stdout: + type: string + description: The standard output that was captured. + stderr: + type: string + description: The standard error output that was captured. + outcome: + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome' + description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + created_by: + type: string + description: The identifier of the actor that created the item. + description: The content of a shell tool call output that was emitted. + title: Shell call output content + OpenAI.FunctionShellCallOutputExitOutcome: + type: object + required: + - type + - exit_code + properties: + type: + type: string + enum: + - exit + description: The outcome type. Always `exit`. + x-stainless-const: true + default: exit + exit_code: + type: integer + description: Exit code from the shell process. + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome' + description: Indicates that the shell commands finished and returned an exit code. + title: Shell call exit outcome + OpenAI.FunctionShellCallOutputOutcome: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType' + discriminator: + propertyName: type + mapping: + timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome' + exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome' + description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. + title: Shell call outcome + OpenAI.FunctionShellCallOutputOutcomeType: + anyOf: + - type: string + - type: string + enum: + - timeout + - exit + OpenAI.FunctionShellCallOutputTimeoutOutcome: + type: object + required: + - type + properties: + type: + type: string + enum: + - timeout + description: The outcome type. Always `timeout`. + x-stainless-const: true + default: timeout + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome' + description: Indicates that the shell call exceeded its configured time limit. + title: Shell call timeout outcome + OpenAI.FunctionShellToolParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - shell + description: The type of the shell tool. Always `shell`. + x-stainless-const: true + default: shell + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A tool that allows the model to execute shell commands. + title: Shell tool + OpenAI.FunctionTool: + type: object + required: + - type + - name + - parameters + - strict + properties: + type: + type: string + enum: + - function + description: The type of the function tool. Always `function`. + x-stainless-const: true + default: function + name: + type: string + description: The name of the function to call. + description: + anyOf: + - type: string + - type: 'null' + parameters: + anyOf: + - type: object + unevaluatedProperties: {} + - type: 'null' + strict: + anyOf: + - type: boolean + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). + title: Function + OpenAI.GraderMulti: + type: object + required: + - type + - name + - graders + - calculate_output + properties: + type: + type: string + enum: + - multi + description: The object type, which is always `multi`. + x-stainless-const: true + default: multi + name: + type: string + description: The name of the grader. + graders: + anyOf: + - $ref: '#/components/schemas/OpenAI.GraderStringCheck' + - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.GraderScoreModel' + - $ref: '#/components/schemas/GraderEndpoint' + calculate_output: + type: string + description: A formula to calculate the output based on grader results. + description: A MultiGrader object combines the output of multiple graders to produce a single score. + title: MultiGrader + x-oaiMeta: + name: Multi Grader + group: graders + example: | + { + "type": "multi", + "name": "example multi grader", + "graders": [ + { + "type": "text_similarity", + "name": "example text similarity grader", + "input": "The graded text", + "reference": "The reference text", + "evaluation_metric": "fuzzy_match" + }, + { + "type": "string_check", + "name": "Example string check grader", + "input": "{{sample.output_text}}", + "reference": "{{item.label}}", + "operation": "eq" + } + ], + "calculate_output": "0.5 * text_similarity_score + 0.5 * string_check_score)" + } + OpenAI.GraderPython: + type: object + required: + - type + - name + - source + properties: + type: + type: string + enum: + - python + description: The object type, which is always `python`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + source: + type: string + description: The source code of the python script. + image_tag: + type: string + description: The image tag to use for the python script. + description: A PythonGrader object that runs a python script on the input. + title: PythonGrader + x-oaiMeta: + name: Python Grader + group: graders + example: | + { + "type": "python", + "name": "Example python grader", + "image_tag": "2025-05-08", + "source": """ + def grade(sample: dict, item: dict) -> float: + """ + Returns 1.0 if `output_text` equals `label`, otherwise 0.0. + """ + output = sample.get("output_text") + label = item.get("label") + return 1.0 if output == label else 0.0 + """, + } + OpenAI.GraderScoreModel: + type: object + required: + - type + - name + - model + - input + properties: + type: + type: string + enum: + - score_model + description: The object type, which is always `score_model`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + model: + type: string + description: The model to use for the evaluation. + sampling_params: + allOf: + - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams' + description: The sampling parameters for the model. + input: + type: array + items: + $ref: '#/components/schemas/OpenAI.EvalItem' + description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings. + range: + type: array + items: + type: number + description: The range of the score. Defaults to `[0, 1]`. + description: A ScoreModelGrader object that uses a model to assign a score to the input. + title: ScoreModelGrader + x-oaiMeta: + name: Score Model Grader + group: graders + example: | + { + "type": "score_model", + "name": "Example score model grader", + "input": [ + { + "role": "user", + "content": [ + { + "type": "input_text", + "text": ( + "Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different." + " Return just a floating point score + + " + " Reference answer: {{item.label}} + + " + " Model answer: {{sample.output_text}}" + ) + }, + { + "type": "input_image", + "image_url": "https://example.com/reference.png", + "file_id": null, + "detail": "auto" + } + ], + } + ], + "model": "gpt-5-mini", + "sampling_params": { + "temperature": 1, + "top_p": 1, + "seed": 42, + "max_completions_tokens": 32768, + "reasoning_effort": "medium" + }, + } + OpenAI.GraderStringCheck: + type: object + required: + - type + - name + - input + - reference + - operation + properties: + type: + type: string + enum: + - string_check + description: The object type, which is always `string_check`. + x-stainless-const: true + name: + type: string + description: The name of the grader. + input: + type: string + description: The input text. This may include template strings. + reference: + type: string + description: The reference text. This may include template strings. + operation: + type: string + enum: + - eq + - ne + - like + - ilike + description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + description: A StringCheckGrader object that performs a string comparison between input and reference using a specified operation. + title: StringCheckGrader + x-oaiMeta: + name: String Check Grader + group: graders + example: | + { + "type": "string_check", + "name": "Example string check grader", + "input": "{{sample.output_text}}", + "reference": "{{item.label}}", + "operation": "eq" + } + OpenAI.GraderTextSimilarity: + type: object + required: + - type + - name + - input + - reference + - evaluation_metric + properties: + type: + type: string + enum: + - text_similarity + description: The type of grader. + x-stainless-const: true + default: text_similarity + name: + type: string + description: The name of the grader. + input: + type: string + description: The text being graded. + reference: + type: string + description: The text being graded against. + evaluation_metric: + type: string + enum: + - cosine + - fuzzy_match + - bleu + - gleu + - meteor + - rouge_1 + - rouge_2 + - rouge_3 + - rouge_4 + - rouge_5 + - rouge_l + description: |- + The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, + `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, + or `rouge_l`. + description: A TextSimilarityGrader object which grades text based on similarity metrics. + title: TextSimilarityGrader + x-oaiMeta: + name: Text Similarity Grader + group: graders + example: | + { + "type": "text_similarity", + "name": "Example text similarity grader", + "input": "{{sample.output_text}}", + "reference": "{{item.label}}", + "evaluation_metric": "fuzzy_match" + } + OpenAI.GrammarSyntax1: + type: string + enum: + - lark + - regex + OpenAI.HybridSearchOptions: + type: object + required: + - embedding_weight + - text_weight + properties: + embedding_weight: + type: number + description: The weight of the embedding in the reciprocal ranking fusion. + text_weight: + type: number + description: The weight of the text in the reciprocal ranking fusion. + OpenAI.ImageDetail: + type: string + enum: + - low + - high + - auto + OpenAI.ImageGenTool: + type: object + required: + - type + properties: + type: + type: string + enum: + - image_generation + description: The type of the image generation tool. Always `image_generation`. + x-stainless-const: true + default: image_generation + model: + anyOf: + - type: string + - type: string + enum: + - gpt-image-1 + - gpt-image-1-mini + default: gpt-image-1 + quality: + type: string + enum: + - low + - medium + - high + - auto + description: |- + The quality of the generated image. One of `low`, `medium`, `high`, + or `auto`. Default: `auto`. + default: auto + size: + type: string + enum: + - 1024x1024 + - 1024x1536 + - 1536x1024 + - auto + description: |- + The size of the generated image. One of `1024x1024`, `1024x1536`, + `1536x1024`, or `auto`. Default: `auto`. + default: auto + output_format: + type: string + enum: + - png + - webp + - jpeg + description: |- + The output format of the generated image. One of `png`, `webp`, or + `jpeg`. Default: `png`. + default: png + output_compression: + type: integer + minimum: 0 + maximum: 100 + description: 'Compression level for the output image. Default: 100.' + default: 100 + moderation: + type: string + enum: + - auto + - low + description: 'Moderation level for the generated image. Default: `auto`.' + default: auto + background: + type: string + enum: + - transparent + - opaque + - auto + description: |- + Background type for the generated image. One of `transparent`, + `opaque`, or `auto`. Default: `auto`. + default: auto + input_fidelity: + anyOf: + - $ref: '#/components/schemas/OpenAI.InputFidelity' + - type: 'null' + input_image_mask: + allOf: + - $ref: '#/components/schemas/OpenAI.ImageGenToolInputImageMask' + description: |- + Optional mask for inpainting. Contains `image_url` + (string, optional) and `file_id` (string, optional). + partial_images: + type: integer + minimum: 0 + maximum: 3 + description: Number of partial images to generate in streaming mode, from 0 (default value) to 3. + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A tool that generates images using the GPT image models. + title: Image generation tool + OpenAI.ImageGenToolInputImageMask: + type: object + properties: + image_url: + type: string + file_id: + type: string + OpenAI.IncludeEnum: + anyOf: + - type: string + - type: string + enum: + - file_search_call.results + - web_search_call.results + - web_search_call.action.sources + - message.input_image.image_url + - computer_call_output.output.image_url + - code_interpreter_call.outputs + - reasoning.encrypted_content + - message.output_text.logprobs + description: |- + Specify additional output data to include in the model response. Currently supported values are: + - `web_search_call.action.sources`: Include the sources of the web search tool call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer call output. + - `file_search_call.results`: Include the search results of the file search tool call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + OpenAI.InputAudio: + type: object + required: + - type + - input_audio + properties: + type: + type: string + enum: + - input_audio + description: The type of the input item. Always `input_audio`. + x-stainless-const: true + input_audio: + $ref: '#/components/schemas/OpenAI.InputAudioInputAudio' + allOf: + - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' + description: An audio input to the model. + title: Input audio + OpenAI.InputAudioInputAudio: + type: object + required: + - data + - format + properties: + data: + type: string + format: + type: string + enum: + - mp3 + - wav + OpenAI.InputContent: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.InputContentType' + discriminator: + propertyName: type + mapping: + input_text: '#/components/schemas/OpenAI.InputContentInputTextContent' + input_image: '#/components/schemas/OpenAI.InputContentInputImageContent' + input_file: '#/components/schemas/OpenAI.InputContentInputFileContent' + OpenAI.InputContentInputFileContent: + type: object + required: + - type + properties: + type: + type: string + enum: + - input_file + description: The type of the input item. Always `input_file`. + x-stainless-const: true + default: input_file + file_id: + anyOf: + - type: string + - type: 'null' + filename: + type: string + description: The name of the file to be sent to the model. + file_url: + type: string + format: uri + description: The URL of the file to be sent to the model. + file_data: + type: string + description: The content of the file to be sent to the model. + allOf: + - $ref: '#/components/schemas/OpenAI.InputContent' + description: A file input to the model. + title: Input file + OpenAI.InputContentInputImageContent: + type: object + required: + - type + - detail + properties: + type: + type: string + enum: + - input_image + description: The type of the input item. Always `input_image`. + x-stainless-const: true + default: input_image + image_url: + anyOf: + - type: string + format: uri + - type: 'null' + file_id: + anyOf: + - type: string + - type: 'null' + detail: + allOf: + - $ref: '#/components/schemas/OpenAI.ImageDetail' + description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + allOf: + - $ref: '#/components/schemas/OpenAI.InputContent' + description: An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + title: Input image + OpenAI.InputContentInputTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - input_text + description: The type of the input item. Always `input_text`. + x-stainless-const: true + default: input_text + text: + type: string + description: The text input to the model. + allOf: + - $ref: '#/components/schemas/OpenAI.InputContent' + description: A text input to the model. + title: Input text + OpenAI.InputContentType: + anyOf: + - type: string + - type: string + enum: + - input_text + - input_image + - input_file + OpenAI.InputFidelity: + type: string + enum: + - high + - low + description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. + OpenAI.InputFileContent: + type: object + required: + - type + properties: + type: + type: string + enum: + - input_file + description: The type of the input item. Always `input_file`. + x-stainless-const: true + default: input_file + file_id: + anyOf: + - type: string + - type: 'null' + filename: + type: string + description: The name of the file to be sent to the model. + file_url: + type: string + format: uri + description: The URL of the file to be sent to the model. + file_data: + type: string + description: The content of the file to be sent to the model. + description: A file input to the model. + title: Input file + OpenAI.InputImageContent: + type: object + required: + - type + - detail + properties: + type: + type: string + enum: + - input_image + description: The type of the input item. Always `input_image`. + x-stainless-const: true + default: input_image + image_url: + anyOf: + - type: string + format: uri + - type: 'null' + file_id: + anyOf: + - type: string + - type: 'null' + detail: + allOf: + - $ref: '#/components/schemas/OpenAI.ImageDetail' + description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + description: An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). + title: Input image + OpenAI.InputItem: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.InputItemType' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAI.EasyInputMessage' + item_reference: '#/components/schemas/OpenAI.ItemReferenceParam' + OpenAI.InputItemType: + anyOf: + - type: string + - type: string + enum: + - message + - item_reference + OpenAI.InputMessageContentList: + type: array + items: + $ref: '#/components/schemas/OpenAI.InputContent' + description: |- + A list of one or many input items to the model, containing different content + types. + title: Input item content list + OpenAI.InputMessageResource: + type: object + required: + - type + - role + - content + - id + properties: + type: + type: string + enum: + - message + description: The type of the message input. Always set to `message`. + x-stainless-const: true + role: + type: string + enum: + - user + - system + - developer + description: The role of the message input. One of `user`, `system`, or `developer`. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + content: + $ref: '#/components/schemas/OpenAI.InputMessageContentList' + id: + type: string + description: The unique ID of the message input. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + OpenAI.InputParam: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + description: |- + Text, image, or file inputs to the model, used to generate a response. + Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Image inputs](https://platform.openai.com/docs/guides/images) + - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + - [Function calling](https://platform.openai.com/docs/guides/function-calling) + OpenAI.InputTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - input_text + description: The type of the input item. Always `input_text`. + x-stainless-const: true + default: input_text + text: + type: string + description: The text input to the model. + description: A text input to the model. + title: Input text + OpenAI.ItemReferenceParam: + type: object + required: + - type + - id + properties: + type: + type: string + enum: + - item_reference + description: The type of item to reference. Always `item_reference`. + x-stainless-const: true + default: item_reference + id: + type: string + description: The ID of the item to reference. + allOf: + - $ref: '#/components/schemas/OpenAI.InputItem' + description: An internal identifier for an item to reference. + title: Item reference + OpenAI.ItemResource: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ItemResourceType' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAI.InputMessageResource' + output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage' + file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall' + computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall' + computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutputResource' + web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall' + function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallResource' + function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutputResource' + image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall' + code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall' + local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall' + local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput' + shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall' + shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput' + apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall' + apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput' + mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools' + mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource' + mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall' + description: Content item used to generate a response. + OpenAI.ItemResourceApplyPatchToolCall: + type: object + required: + - type + - id + - call_id + - status + - operation + properties: + type: + type: string + enum: + - apply_patch_call + description: The type of the item. Always `apply_patch_call`. + x-stainless-const: true + default: apply_patch_call + id: + type: string + description: The unique ID of the apply patch tool call. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the apply patch tool call generated by the model. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus' + description: The status of the apply patch tool call. One of `in_progress` or `completed`. + operation: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' + description: One of the create_file, delete_file, or update_file operations applied via apply_patch. + created_by: + type: string + description: The ID of the entity that created this tool call. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A tool call that applies file diffs by creating, deleting, or updating files. + title: Apply patch tool call + OpenAI.ItemResourceApplyPatchToolCallOutput: + type: object + required: + - type + - id + - call_id + - status + properties: + type: + type: string + enum: + - apply_patch_call_output + description: The type of the item. Always `apply_patch_call_output`. + x-stainless-const: true + default: apply_patch_call_output + id: + type: string + description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the apply patch tool call generated by the model. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus' + description: The status of the apply patch tool call output. One of `completed` or `failed`. + output: + anyOf: + - type: string + - type: 'null' + created_by: + type: string + description: The ID of the entity that created this tool call output. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: The output emitted by an apply patch tool call. + title: Apply patch tool call output + OpenAI.ItemResourceCodeInterpreterToolCall: + type: object + required: + - type + - id + - status + - container_id + - code + - outputs + properties: + type: + type: string + enum: + - code_interpreter_call + description: The type of the code interpreter tool call. Always `code_interpreter_call`. + x-stainless-const: true + default: code_interpreter_call + id: + type: string + description: The unique ID of the code interpreter tool call. + status: + type: string + enum: + - in_progress + - completed + - incomplete + - interpreting + - failed + description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + container_id: + type: string + description: The ID of the container used to run the code. + code: + anyOf: + - type: string + - type: 'null' + outputs: + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs' + - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A tool call to run code. + title: Code interpreter tool call + OpenAI.ItemResourceComputerToolCall: + type: object + required: + - type + - id + - call_id + - action + - pending_safety_checks + - status + properties: + type: + type: string + enum: + - computer_call + description: The type of the computer call. Always `computer_call`. + default: computer_call + id: + type: string + description: The unique ID of the computer call. + call_id: + type: string + description: An identifier used when responding to the tool call with output. + action: + $ref: '#/components/schemas/OpenAI.ComputerAction' + pending_safety_checks: + type: array + items: + $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' + description: The pending safety checks for the computer call. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: |- + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + title: Computer tool call + OpenAI.ItemResourceComputerToolCallOutputResource: + type: object + required: + - type + - call_id + - output + properties: + type: + type: string + enum: + - computer_call_output + description: The type of the computer tool call output. Always `computer_call_output`. + x-stainless-const: true + default: computer_call_output + id: + type: string + description: The ID of the computer tool call output. + call_id: + type: string + description: The ID of the computer tool call that produced the output. + acknowledged_safety_checks: + type: array + items: + $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' + description: |- + The safety checks reported by the API that have been acknowledged by the + developer. + output: + $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage' + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + OpenAI.ItemResourceFileSearchToolCall: + type: object + required: + - id + - type + - status + - queries + properties: + id: + type: string + description: The unique ID of the file search tool call. + type: + type: string + enum: + - file_search_call + description: The type of the file search tool call. Always `file_search_call`. + x-stainless-const: true + status: + type: string + enum: + - in_progress + - searching + - completed + - incomplete + - failed + description: |- + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + queries: + type: array + items: + type: string + description: The queries used to search for files. + results: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: |- + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + title: File search tool call + OpenAI.ItemResourceFunctionShellCall: + type: object + required: + - type + - id + - call_id + - action + - status + properties: + type: + type: string + enum: + - shell_call + description: The type of the item. Always `shell_call`. + x-stainless-const: true + default: shell_call + id: + type: string + description: The unique ID of the shell tool call. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the shell tool call generated by the model. + action: + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionShellAction' + description: The shell commands and limits that describe how to run the tool call. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.LocalShellCallStatus' + description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + created_by: + type: string + description: The ID of the entity that created this tool call. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A tool call that executes one or more shell commands in a managed environment. + title: Shell tool call + OpenAI.ItemResourceFunctionShellCallOutput: + type: object + required: + - type + - id + - call_id + - output + - max_output_length + properties: + type: + type: string + enum: + - shell_call_output + description: The type of the shell call output. Always `shell_call_output`. + x-stainless-const: true + default: shell_call_output + id: + type: string + description: The unique ID of the shell call output. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the shell tool call generated by the model. + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent' + description: An array of shell call output contents + max_output_length: + anyOf: + - type: integer + - type: 'null' + created_by: + type: string + description: The identifier of the actor that created the item. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: The output of a shell tool call that was emitted. + title: Shell call output + OpenAI.ItemResourceFunctionToolCallOutputResource: + type: object + required: + - type + - call_id + - output + properties: + id: + type: string + description: |- + The unique ID of the function tool call output. Populated when this item + is returned via API. + type: + type: string + enum: + - function_call_output + description: The type of the function tool call output. Always `function_call_output`. + x-stainless-const: true + call_id: + type: string + description: The unique ID of the function tool call generated by the model. + output: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' + description: |- + The output from the function call generated by your code. + Can be a string or an list of output content. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + OpenAI.ItemResourceFunctionToolCallResource: + type: object + required: + - type + - call_id + - name + - arguments + properties: + id: + type: string + description: The unique ID of the function tool call. + type: + type: string + enum: + - function_call + description: The type of the function tool call. Always `function_call`. + x-stainless-const: true + call_id: + type: string + description: The unique ID of the function tool call generated by the model. + name: + type: string + description: The name of the function to run. + arguments: + type: string + description: A JSON string of the arguments to pass to the function. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + OpenAI.ItemResourceImageGenToolCall: + type: object + required: + - type + - id + - status + - result + properties: + type: + type: string + enum: + - image_generation_call + description: The type of the image generation call. Always `image_generation_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the image generation call. + status: + type: string + enum: + - in_progress + - completed + - generating + - failed + description: The status of the image generation call. + result: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: An image generation request made by the model. + title: Image generation call + OpenAI.ItemResourceLocalShellToolCall: + type: object + required: + - type + - id + - call_id + - action + - status + properties: + type: + type: string + enum: + - local_shell_call + description: The type of the local shell call. Always `local_shell_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the local shell call. + call_id: + type: string + description: The unique ID of the local shell tool call generated by the model. + action: + $ref: '#/components/schemas/OpenAI.LocalShellExecAction' + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: The status of the local shell call. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A tool call to run a command on the local shell. + title: Local shell call + OpenAI.ItemResourceLocalShellToolCallOutput: + type: object + required: + - type + - id + - output + properties: + type: + type: string + enum: + - local_shell_call_output + description: The type of the local shell tool call output. Always `local_shell_call_output`. + x-stainless-const: true + id: + type: string + description: The unique ID of the local shell tool call generated by the model. + output: + type: string + description: A JSON string of the output of the local shell tool call. + status: + anyOf: + - type: string + enum: + - in_progress + - completed + - incomplete + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: The output of a local shell tool call. + title: Local shell call output + OpenAI.ItemResourceMcpApprovalRequest: + type: object + required: + - type + - id + - server_label + - name + - arguments + properties: + type: + type: string + enum: + - mcp_approval_request + description: The type of the item. Always `mcp_approval_request`. + x-stainless-const: true + id: + type: string + description: The unique ID of the approval request. + server_label: + type: string + description: The label of the MCP server making the request. + name: + type: string + description: The name of the tool to run. + arguments: + type: string + description: A JSON string of arguments for the tool. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A request for human approval of a tool invocation. + title: MCP approval request + OpenAI.ItemResourceMcpApprovalResponseResource: + type: object + required: + - type + - id + - approval_request_id + - approve + properties: + type: + type: string + enum: + - mcp_approval_response + description: The type of the item. Always `mcp_approval_response`. + x-stainless-const: true + id: + type: string + description: The unique ID of the approval response + approval_request_id: + type: string + description: The ID of the approval request being answered. + approve: + type: boolean + description: Whether the request was approved. + reason: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A response to an MCP approval request. + title: MCP approval response + OpenAI.ItemResourceMcpListTools: + type: object + required: + - type + - id + - server_label + - tools + properties: + type: + type: string + enum: + - mcp_list_tools + description: The type of the item. Always `mcp_list_tools`. + x-stainless-const: true + id: + type: string + description: The unique ID of the list. + server_label: + type: string + description: The label of the MCP server. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.MCPListToolsTool' + description: The tools available on the server. + error: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: A list of tools available on an MCP server. + title: MCP list tools + OpenAI.ItemResourceMcpToolCall: + type: object + required: + - type + - id + - server_label + - name + - arguments + properties: + type: + type: string + enum: + - mcp_call + description: The type of the item. Always `mcp_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the tool call. + server_label: + type: string + description: The label of the MCP server running the tool. + name: + type: string + description: The name of the tool that was run. + arguments: + type: string + description: A JSON string of the arguments passed to the tool. + output: + anyOf: + - type: string + - type: 'null' + error: + anyOf: + - type: string + - type: 'null' + status: + allOf: + - $ref: '#/components/schemas/OpenAI.MCPToolCallStatus' + description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + approval_request_id: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: An invocation of a tool on an MCP server. + title: MCP tool call + OpenAI.ItemResourceOutputMessage: + type: object + required: + - id + - type + - role + - content + - status + properties: + id: + type: string + description: The unique ID of the output message. + x-stainless-go-json: omitzero + type: + type: string + enum: + - output_message + description: The type of the output message. Always `message`. + x-stainless-const: true + role: + type: string + enum: + - assistant + description: The role of the output message. Always `assistant`. + x-stainless-const: true + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputMessageContent' + description: The content of the output message. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: An output message from the model. + title: Output message + OpenAI.ItemResourceType: + anyOf: + - type: string + - type: string + enum: + - message + - output_message + - file_search_call + - computer_call + - computer_call_output + - web_search_call + - function_call + - function_call_output + - image_generation_call + - code_interpreter_call + - local_shell_call + - local_shell_call_output + - shell_call + - shell_call_output + - apply_patch_call + - apply_patch_call_output + - mcp_list_tools + - mcp_approval_request + - mcp_approval_response + - mcp_call + OpenAI.ItemResourceWebSearchToolCall: + type: object + required: + - id + - type + - status + - action + properties: + id: + type: string + description: The unique ID of the web search tool call. + type: + type: string + enum: + - web_search_call + description: The type of the web search tool call. Always `web_search_call`. + x-stainless-const: true + status: + type: string + enum: + - in_progress + - searching + - completed + - failed + description: The status of the web search tool call. + action: + anyOf: + - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch' + - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage' + - $ref: '#/components/schemas/OpenAI.WebSearchActionFind' + description: |- + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find). + allOf: + - $ref: '#/components/schemas/OpenAI.ItemResource' + description: |- + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + title: Web search tool call + OpenAI.KeyPressAction: + type: object + required: + - type + - keys + properties: + type: + type: string + enum: + - keypress + description: Specifies the event type. For a keypress action, this property is always set to `keypress`. + x-stainless-const: true + default: keypress + keys: + type: array + items: + type: string + description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A collection of keypresses the model would like to perform. + title: KeyPress + OpenAI.ListBatchesResponse: + type: object + required: + - data + - has_more + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.Batch' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + object: + type: string + enum: + - list + x-stainless-const: true + OpenAI.ListFilesResponse: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.OpenAIFile' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + OpenAI.ListFineTuningCheckpointPermissionResponse: + type: object + required: + - data + - object + - has_more + properties: + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.FineTuningCheckpointPermission' + object: + type: string + enum: + - list + x-stainless-const: true + first_id: + anyOf: + - type: string + - type: 'null' + last_id: + anyOf: + - type: string + - type: 'null' + has_more: + type: boolean + OpenAI.ListFineTuningJobCheckpointsResponse: + type: object + required: + - data + - object + - has_more + properties: + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpoint' + object: + type: string + enum: + - list + x-stainless-const: true + first_id: + anyOf: + - type: string + - type: 'null' + last_id: + anyOf: + - type: string + - type: 'null' + has_more: + type: boolean + OpenAI.ListFineTuningJobEventsResponse: + type: object + required: + - data + - object + - has_more + properties: + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.FineTuningJobEvent' + object: + type: string + enum: + - list + x-stainless-const: true + has_more: + type: boolean + OpenAI.ListMessagesResponse: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.MessageObject' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + OpenAI.ListModelsResponse: + type: object + required: + - object + - data + properties: + object: + type: string + enum: + - list + x-stainless-const: true + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.Model' + OpenAI.ListPaginatedFineTuningJobsResponse: + type: object + required: + - data + - has_more + - object + properties: + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.FineTuningJob' + has_more: + type: boolean + object: + type: string + enum: + - list + x-stainless-const: true + OpenAI.ListRunStepsResponse: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.RunStepObject' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + OpenAI.ListRunsResponse: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.RunObject' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + OpenAI.ListVectorStoreFilesResponse: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + OpenAI.ListVectorStoresResponse: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.VectorStoreObject' + first_id: + type: string + last_id: + type: string + has_more: + type: boolean + OpenAI.LocalShellCallStatus: + type: string + enum: + - in_progress + - completed + - incomplete + OpenAI.LocalShellExecAction: + type: object + required: + - type + - command + - env + properties: + type: + type: string + enum: + - exec + description: The type of the local shell action. Always `exec`. + x-stainless-const: true + default: exec + command: + type: array + items: + type: string + description: The command to run. + timeout_ms: + anyOf: + - type: integer + - type: 'null' + working_directory: + anyOf: + - type: string + - type: 'null' + env: + type: object + unevaluatedProperties: + type: string + description: Environment variables to set for the command. + x-oaiTypeLabel: map + user: + anyOf: + - type: string + - type: 'null' + description: Execute a shell command on the server. + title: Local shell exec action + OpenAI.LocalShellToolParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - local_shell + description: The type of the local shell tool. Always `local_shell`. + x-stainless-const: true + default: local_shell + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: A tool that allows the model to execute shell commands in a local environment. + title: Local shell tool + OpenAI.LogProb: + type: object + required: + - token + - logprob + - bytes + - top_logprobs + properties: + token: + type: string + logprob: + type: number + bytes: + type: array + items: + type: integer + top_logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.TopLogProb' + description: The log probability of a token. + title: Log probability + OpenAI.MCPListToolsTool: + type: object + required: + - name + - input_schema + properties: + name: + type: string + description: The name of the tool. + description: + anyOf: + - type: string + - type: 'null' + input_schema: + allOf: + - $ref: '#/components/schemas/OpenAI.MCPListToolsToolInputSchema' + description: The JSON schema describing the tool's input. + annotations: + anyOf: + - $ref: '#/components/schemas/OpenAI.MCPListToolsToolAnnotations' + - type: 'null' + description: A tool available on an MCP server. + title: MCP list tools tool + OpenAI.MCPListToolsToolAnnotations: + type: object + OpenAI.MCPListToolsToolInputSchema: + type: object + OpenAI.MCPTool: + type: object + required: + - type + - server_label + properties: + type: + type: string + enum: + - mcp + description: The type of the MCP tool. Always `mcp`. + x-stainless-const: true + server_label: + type: string + description: A label for this MCP server, used to identify it in tool calls. + server_url: + type: string + format: uri + description: |- + The URL for the MCP server. One of `server_url` or `connector_id` must be + provided. + connector_id: + type: string + enum: + - connector_dropbox + - connector_gmail + - connector_googlecalendar + - connector_googledrive + - connector_microsoftteams + - connector_outlookcalendar + - connector_outlookemail + - connector_sharepoint + description: |- + Identifier for service connectors, like those available in ChatGPT. One of + `server_url` or `connector_id` must be provided. Learn more about service + connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + Currently supported `connector_id` values are: + - Dropbox: `connector_dropbox` + - Gmail: `connector_gmail` + - Google Calendar: `connector_googlecalendar` + - Google Drive: `connector_googledrive` + - Microsoft Teams: `connector_microsoftteams` + - Outlook Calendar: `connector_outlookcalendar` + - Outlook Email: `connector_outlookemail` + - SharePoint: `connector_sharepoint` + authorization: + type: string + description: |- + An OAuth access token that can be used with a remote MCP server, either + with a custom MCP server URL or a service connector. Your application + must handle the OAuth authorization flow and provide the token here. + server_description: + type: string + description: Optional description of the MCP server, used to provide more context. + headers: + anyOf: + - type: object + unevaluatedProperties: + type: string + - type: 'null' + allowed_tools: + anyOf: + - type: array + items: + type: string + - $ref: '#/components/schemas/OpenAI.MCPToolFilter' + - type: 'null' + require_approval: + anyOf: + - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval' + - type: string + enum: + - always + - never + - type: 'null' + default: always + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: |- + Give the model access to additional tools via remote Model Context Protocol + (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). + title: MCP tool + OpenAI.MCPToolCallStatus: + type: string + enum: + - in_progress + - completed + - incomplete + - calling + - failed + OpenAI.MCPToolFilter: + type: object + properties: + tool_names: + type: array + items: + type: string + description: List of allowed tool names. + title: MCP allowed tools + read_only: + type: boolean + description: |- + Indicates whether or not a tool modifies data or is read-only. If an + MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + it will match this filter. + description: A filter object to specify which tools are allowed. + title: MCP tool filter + OpenAI.MCPToolRequireApproval: + type: object + properties: + always: + $ref: '#/components/schemas/OpenAI.MCPToolFilter' + never: + $ref: '#/components/schemas/OpenAI.MCPToolFilter' + OpenAI.MessageContent: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.MessageContentType' + discriminator: + propertyName: type + mapping: + image_url: '#/components/schemas/OpenAI.MessageContentImageUrlObject' + text: '#/components/schemas/OpenAI.MessageContentTextObject' + refusal: '#/components/schemas/OpenAI.MessageContentRefusalObject' + OpenAI.MessageContentImageFileObject: + type: object + required: + - type + - image_file + properties: + type: + type: string + enum: + - image_file + description: Always `image_file`. + x-stainless-const: true + image_file: + $ref: '#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile' + allOf: + - $ref: '#/components/schemas/OpenAI.MessageContent' + description: References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. + title: Image file + OpenAI.MessageContentImageFileObjectImageFile: + type: object + required: + - file_id + properties: + file_id: + type: string + detail: + type: string + enum: + - auto + - low + - high + default: auto + OpenAI.MessageContentImageUrlObject: + type: object + required: + - type + - image_url + properties: + type: + type: string + enum: + - image_url + description: The type of the content part. + x-stainless-const: true + image_url: + $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl' + allOf: + - $ref: '#/components/schemas/OpenAI.MessageContent' + description: References an image URL in the content of a message. + title: Image URL + OpenAI.MessageContentImageUrlObjectImageUrl: + type: object + required: + - url + properties: + url: + type: string + format: uri + detail: + type: string + enum: + - auto + - low + - high + default: auto + OpenAI.MessageContentRefusalObject: + type: object + required: + - type + - refusal + properties: + type: + type: string + enum: + - refusal + description: Always `refusal`. + x-stainless-const: true + refusal: + type: string + allOf: + - $ref: '#/components/schemas/OpenAI.MessageContent' + description: The refusal content generated by the assistant. + title: Refusal + OpenAI.MessageContentTextAnnotationsFileCitationObject: + type: object + required: + - type + - text + - file_citation + - start_index + - end_index + properties: + type: + type: string + enum: + - file_citation + description: Always `file_citation`. + x-stainless-const: true + text: + type: string + description: The text in the message content that needs to be replaced. + file_citation: + $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation' + start_index: + type: integer + minimum: 0 + end_index: + type: integer + minimum: 0 + allOf: + - $ref: '#/components/schemas/OpenAI.TextAnnotation' + description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. + title: File citation + OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation: + type: object + required: + - file_id + properties: + file_id: + type: string + OpenAI.MessageContentTextAnnotationsFilePathObject: + type: object + required: + - type + - text + - file_path + - start_index + - end_index + properties: + type: + type: string + enum: + - file_path + description: Always `file_path`. + x-stainless-const: true + text: + type: string + description: The text in the message content that needs to be replaced. + file_path: + $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath' + start_index: + type: integer + minimum: 0 + end_index: + type: integer + minimum: 0 + allOf: + - $ref: '#/components/schemas/OpenAI.TextAnnotation' + description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + title: File path + OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath: + type: object + required: + - file_id + properties: + file_id: + type: string + OpenAI.MessageContentTextObject: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: Always `text`. + x-stainless-const: true + text: + $ref: '#/components/schemas/OpenAI.MessageContentTextObjectText' + allOf: + - $ref: '#/components/schemas/OpenAI.MessageContent' + description: The text content that is part of a message. + title: Text + OpenAI.MessageContentTextObjectText: + type: object + required: + - value + - annotations + properties: + value: + type: string + annotations: + type: array + items: + $ref: '#/components/schemas/OpenAI.TextAnnotation' + OpenAI.MessageContentType: + anyOf: + - type: string + - type: string + enum: + - image_file + - image_url + - text + - refusal + OpenAI.MessageObject: + type: object + required: + - id + - object + - created_at + - thread_id + - status + - incomplete_details + - completed_at + - incomplete_at + - role + - content + - assistant_id + - run_id + - attachments + - metadata + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - thread.message + description: The object type, which is always `thread.message`. + x-stainless-const: true + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the message was created. + thread_id: + type: string + description: The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + status: + type: string + enum: + - in_progress + - incomplete + - completed + description: The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.MessageObjectIncompleteDetails' + - type: 'null' + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + incomplete_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + role: + type: string + enum: + - user + - assistant + description: The entity that produced the message. One of `user` or `assistant`. + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.MessageContent' + description: The content of the message in array of text and/or images. + assistant_id: + anyOf: + - type: string + - type: 'null' + run_id: + anyOf: + - type: string + - type: 'null' + attachments: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.MessageObjectAttachments' + - type: 'null' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). + title: The message object + x-oaiMeta: + name: The message object + beta: true + example: | + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1698983503, + "thread_id": "thread_abc123", + "role": "assistant", + "content": [ + { + "type": "text", + "text": { + "value": "Hi! How can I help you today?", + "annotations": [] + } + } + ], + "assistant_id": "asst_abc123", + "run_id": "run_abc123", + "attachments": [], + "metadata": {} + } + OpenAI.MessageObjectAttachments: + type: object + properties: + file_id: + type: string + tools: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.AssistantToolsCode' + - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly' + OpenAI.MessageObjectIncompleteDetails: + type: object + required: + - reason + properties: + reason: + type: string + enum: + - content_filter + - max_tokens + - run_cancelled + - run_expired + - run_failed + OpenAI.MessageRequestContentTextObject: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: Always `text`. + x-stainless-const: true + text: + type: string + description: Text content to be sent to the model + description: The text content that is part of a message. + title: Text + OpenAI.MessageRole: + type: string + enum: + - unknown + - user + - assistant + - system + - critic + - discriminator + - developer + - tool + OpenAI.MessageStatus: + type: string + enum: + - in_progress + - completed + - incomplete + OpenAI.Metadata: + type: object + unevaluatedProperties: + type: string + description: |- + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + x-oaiTypeLabel: map + OpenAI.Model: + type: object + required: + - id + - created + - object + - owned_by + properties: + id: + type: string + description: The model identifier, which can be referenced in the API endpoints. + created: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) when the model was created. + object: + type: string + enum: + - model + description: The object type, which is always "model". + x-stainless-const: true + owned_by: + type: string + description: The organization that owns the model. + description: Describes an OpenAI model offering that can be used with the API. + title: Model + x-oaiMeta: + name: The model object + example: | + { + "id": "VAR_chat_model_id", + "object": "model", + "created": 1686935002, + "owned_by": "openai" + } + OpenAI.ModifyMessageRequest: + type: object + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.ModifyRunRequest: + type: object + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.ModifyThreadRequest: + type: object + properties: + tool_resources: + anyOf: + - $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResources' + - type: 'null' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.ModifyThreadRequestToolResources: + type: object + properties: + code_interpreter: + $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter' + file_search: + $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch' + OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + OpenAI.ModifyThreadRequestToolResourcesFileSearch: + type: object + properties: + vector_store_ids: + type: array + items: + type: string + maxItems: 1 + OpenAI.Move: + type: object + required: + - type + - x + - 'y' + properties: + type: + type: string + enum: + - move + description: |- + Specifies the event type. For a move action, this property is + always set to `move`. + x-stainless-const: true + default: move + x: + type: integer + description: The x-coordinate to move to. + 'y': + type: integer + description: The y-coordinate to move to. + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A mouse move action. + title: Move + OpenAI.NoiseReductionType: + type: string + enum: + - near_field + - far_field + description: Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. + OpenAI.OpenAIFile: + type: object + required: + - id + - bytes + - created_at + - filename + - object + - purpose + - status + properties: + id: + type: string + description: The file identifier, which can be referenced in the API endpoints. + bytes: + type: integer + description: The size of the file, in bytes. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the file was created. + expires_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the file will expire. + filename: + type: string + description: The name of the file. + object: + type: string + enum: + - file + description: The object type, which is always `file`. + x-stainless-const: true + status_details: + type: string + description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + deprecated: true + purpose: + type: string + enum: + - assistants + - assistants_output + - batch + - batch_output + - fine-tune + - fine-tune-results + - evals + description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`. + status: + type: string + enum: + - uploaded + - pending + - running + - processed + - error + - deleting + - deleted + description: The `File` object represents a document that has been uploaded to OpenAI. + title: OpenAIFile + x-oaiMeta: + name: The file object + example: | + { + "id": "file-abc123", + "object": "file", + "bytes": 120000, + "created_at": 1677610602, + "expires_at": 1680202602, + "filename": "salesOverview.pdf", + "purpose": "assistants", + } + OpenAI.OtherChunkingStrategyResponseParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - other + description: Always `other`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse' + description: This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API. + title: Other Chunking Strategy + OpenAI.OutputContent: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.OutputContentType' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent' + refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent' + OpenAI.OutputContentOutputTextContent: + type: object + required: + - type + - text + - annotations + properties: + type: + type: string + enum: + - output_text + description: The type of the output text. Always `output_text`. + x-stainless-const: true + default: output_text + text: + type: string + description: The text output from the model. + annotations: + type: array + items: + $ref: '#/components/schemas/OpenAI.Annotation' + description: The annotations of the text output. + logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.LogProb' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputContent' + description: A text output from the model. + title: Output text + OpenAI.OutputContentRefusalContent: + type: object + required: + - type + - refusal + properties: + type: + type: string + enum: + - refusal + description: The type of the refusal. Always `refusal`. + x-stainless-const: true + default: refusal + refusal: + type: string + description: The refusal explanation from the model. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputContent' + description: A refusal from the model. + title: Refusal + OpenAI.OutputContentType: + anyOf: + - type: string + - type: string + enum: + - output_text + - refusal + - reasoning_text + OpenAI.OutputItem: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.OutputItemType' + discriminator: + propertyName: type + mapping: + output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage' + file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall' + function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall' + web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall' + computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall' + reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem' + compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody' + image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall' + code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall' + local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall' + shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall' + shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput' + apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall' + apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput' + mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall' + mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools' + mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest' + custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCall' + OpenAI.OutputItemApplyPatchToolCall: + type: object + required: + - type + - id + - call_id + - status + - operation + properties: + type: + type: string + enum: + - apply_patch_call + description: The type of the item. Always `apply_patch_call`. + x-stainless-const: true + default: apply_patch_call + id: + type: string + description: The unique ID of the apply patch tool call. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the apply patch tool call generated by the model. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus' + description: The status of the apply patch tool call. One of `in_progress` or `completed`. + operation: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' + description: One of the create_file, delete_file, or update_file operations applied via apply_patch. + created_by: + type: string + description: The ID of the entity that created this tool call. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A tool call that applies file diffs by creating, deleting, or updating files. + title: Apply patch tool call + OpenAI.OutputItemApplyPatchToolCallOutput: + type: object + required: + - type + - id + - call_id + - status + properties: + type: + type: string + enum: + - apply_patch_call_output + description: The type of the item. Always `apply_patch_call_output`. + x-stainless-const: true + default: apply_patch_call_output + id: + type: string + description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the apply patch tool call generated by the model. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus' + description: The status of the apply patch tool call output. One of `completed` or `failed`. + output: + anyOf: + - type: string + - type: 'null' + created_by: + type: string + description: The ID of the entity that created this tool call output. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: The output emitted by an apply patch tool call. + title: Apply patch tool call output + OpenAI.OutputItemCodeInterpreterToolCall: + type: object + required: + - type + - id + - status + - container_id + - code + - outputs + properties: + type: + type: string + enum: + - code_interpreter_call + description: The type of the code interpreter tool call. Always `code_interpreter_call`. + x-stainless-const: true + default: code_interpreter_call + id: + type: string + description: The unique ID of the code interpreter tool call. + status: + type: string + enum: + - in_progress + - completed + - incomplete + - interpreting + - failed + description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + container_id: + type: string + description: The ID of the container used to run the code. + code: + anyOf: + - type: string + - type: 'null' + outputs: + anyOf: + - type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs' + - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A tool call to run code. + title: Code interpreter tool call + OpenAI.OutputItemCompactionBody: + type: object + required: + - type + - id + - encrypted_content + properties: + type: + type: string + enum: + - compaction + description: The type of the item. Always `compaction`. + x-stainless-const: true + default: compaction + id: + type: string + description: The unique ID of the compaction item. + encrypted_content: + type: string + description: The encrypted content that was produced by compaction. + created_by: + type: string + description: The identifier of the actor that created the item. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). + title: Compaction item + OpenAI.OutputItemComputerToolCall: + type: object + required: + - type + - id + - call_id + - action + - pending_safety_checks + - status + properties: + type: + type: string + enum: + - computer_call + description: The type of the computer call. Always `computer_call`. + default: computer_call + id: + type: string + description: The unique ID of the computer call. + call_id: + type: string + description: An identifier used when responding to the tool call with output. + action: + $ref: '#/components/schemas/OpenAI.ComputerAction' + pending_safety_checks: + type: array + items: + $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' + description: The pending safety checks for the computer call. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + A tool call to a computer use tool. See the + [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. + title: Computer tool call + OpenAI.OutputItemCustomToolCall: + type: object + required: + - type + - call_id + - name + - input + properties: + type: + type: string + enum: + - custom_tool_call + description: The type of the custom tool call. Always `custom_tool_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the custom tool call in the OpenAI platform. + call_id: + type: string + description: An identifier used to map this custom tool call to a tool call output. + name: + type: string + description: The name of the custom tool being called. + input: + type: string + description: The input for the custom tool call generated by the model. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A call to a custom tool created by the model. + title: Custom tool call + OpenAI.OutputItemFileSearchToolCall: + type: object + required: + - id + - type + - status + - queries + properties: + id: + type: string + description: The unique ID of the file search tool call. + type: + type: string + enum: + - file_search_call + description: The type of the file search tool call. Always `file_search_call`. + x-stainless-const: true + status: + type: string + enum: + - in_progress + - searching + - completed + - incomplete + - failed + description: |- + The status of the file search tool call. One of `in_progress`, + `searching`, `incomplete` or `failed`, + queries: + type: array + items: + type: string + description: The queries used to search for files. + results: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults' + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + The results of a file search tool call. See the + [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + title: File search tool call + OpenAI.OutputItemFunctionShellCall: + type: object + required: + - type + - id + - call_id + - action + - status + properties: + type: + type: string + enum: + - shell_call + description: The type of the item. Always `shell_call`. + x-stainless-const: true + default: shell_call + id: + type: string + description: The unique ID of the shell tool call. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the shell tool call generated by the model. + action: + allOf: + - $ref: '#/components/schemas/OpenAI.FunctionShellAction' + description: The shell commands and limits that describe how to run the tool call. + status: + allOf: + - $ref: '#/components/schemas/OpenAI.LocalShellCallStatus' + description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. + created_by: + type: string + description: The ID of the entity that created this tool call. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A tool call that executes one or more shell commands in a managed environment. + title: Shell tool call + OpenAI.OutputItemFunctionShellCallOutput: + type: object + required: + - type + - id + - call_id + - output + - max_output_length + properties: + type: + type: string + enum: + - shell_call_output + description: The type of the shell call output. Always `shell_call_output`. + x-stainless-const: true + default: shell_call_output + id: + type: string + description: The unique ID of the shell call output. Populated when this item is returned via API. + call_id: + type: string + description: The unique ID of the shell tool call generated by the model. + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent' + description: An array of shell call output contents + max_output_length: + anyOf: + - type: integer + - type: 'null' + created_by: + type: string + description: The identifier of the actor that created the item. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: The output of a shell tool call that was emitted. + title: Shell call output + OpenAI.OutputItemFunctionToolCall: + type: object + required: + - type + - call_id + - name + - arguments + properties: + id: + type: string + description: The unique ID of the function tool call. + type: + type: string + enum: + - function_call + description: The type of the function tool call. Always `function_call`. + x-stainless-const: true + call_id: + type: string + description: The unique ID of the function tool call generated by the model. + name: + type: string + description: The name of the function to run. + arguments: + type: string + description: A JSON string of the arguments to pass to the function. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + A tool call to run a function. See the + [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. + title: Function tool call + OpenAI.OutputItemImageGenToolCall: + type: object + required: + - type + - id + - status + - result + properties: + type: + type: string + enum: + - image_generation_call + description: The type of the image generation call. Always `image_generation_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the image generation call. + status: + type: string + enum: + - in_progress + - completed + - generating + - failed + description: The status of the image generation call. + result: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: An image generation request made by the model. + title: Image generation call + OpenAI.OutputItemLocalShellToolCall: + type: object + required: + - type + - id + - call_id + - action + - status + properties: + type: + type: string + enum: + - local_shell_call + description: The type of the local shell call. Always `local_shell_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the local shell call. + call_id: + type: string + description: The unique ID of the local shell tool call generated by the model. + action: + $ref: '#/components/schemas/OpenAI.LocalShellExecAction' + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: The status of the local shell call. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A tool call to run a command on the local shell. + title: Local shell call + OpenAI.OutputItemMcpApprovalRequest: + type: object + required: + - type + - id + - server_label + - name + - arguments + properties: + type: + type: string + enum: + - mcp_approval_request + description: The type of the item. Always `mcp_approval_request`. + x-stainless-const: true + id: + type: string + description: The unique ID of the approval request. + server_label: + type: string + description: The label of the MCP server making the request. + name: + type: string + description: The name of the tool to run. + arguments: + type: string + description: A JSON string of arguments for the tool. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A request for human approval of a tool invocation. + title: MCP approval request + OpenAI.OutputItemMcpListTools: + type: object + required: + - type + - id + - server_label + - tools + properties: + type: + type: string + enum: + - mcp_list_tools + description: The type of the item. Always `mcp_list_tools`. + x-stainless-const: true + id: + type: string + description: The unique ID of the list. + server_label: + type: string + description: The label of the MCP server. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.MCPListToolsTool' + description: The tools available on the server. + error: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: A list of tools available on an MCP server. + title: MCP list tools + OpenAI.OutputItemMcpToolCall: + type: object + required: + - type + - id + - server_label + - name + - arguments + properties: + type: + type: string + enum: + - mcp_call + description: The type of the item. Always `mcp_call`. + x-stainless-const: true + id: + type: string + description: The unique ID of the tool call. + server_label: + type: string + description: The label of the MCP server running the tool. + name: + type: string + description: The name of the tool that was run. + arguments: + type: string + description: A JSON string of the arguments passed to the tool. + output: + anyOf: + - type: string + - type: 'null' + error: + anyOf: + - type: string + - type: 'null' + status: + allOf: + - $ref: '#/components/schemas/OpenAI.MCPToolCallStatus' + description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. + approval_request_id: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: An invocation of a tool on an MCP server. + title: MCP tool call + OpenAI.OutputItemOutputMessage: + type: object + required: + - id + - type + - role + - content + - status + properties: + id: + type: string + description: The unique ID of the output message. + x-stainless-go-json: omitzero + type: + type: string + enum: + - output_message + description: The type of the output message. Always `message`. + x-stainless-const: true + role: + type: string + enum: + - assistant + description: The role of the output message. Always `assistant`. + x-stainless-const: true + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputMessageContent' + description: The content of the output message. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the message input. One of `in_progress`, `completed`, or + `incomplete`. Populated when input items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: An output message from the model. + title: Output message + OpenAI.OutputItemReasoningItem: + type: object + required: + - type + - id + - summary + properties: + type: + type: string + enum: + - reasoning + description: The type of the object. Always `reasoning`. + x-stainless-const: true + id: + type: string + description: The unique identifier of the reasoning content. + encrypted_content: + anyOf: + - type: string + - type: 'null' + summary: + type: array + items: + $ref: '#/components/schemas/OpenAI.Summary' + description: Reasoning summary content. + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.ReasoningTextContent' + description: Reasoning text content. + status: + type: string + enum: + - in_progress + - completed + - incomplete + description: |- + The status of the item. One of `in_progress`, `completed`, or + `incomplete`. Populated when items are returned via API. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + A description of the chain of thought used by a reasoning model while generating + a response. Be sure to include these items in your `input` to the Responses API + for subsequent turns of a conversation if you are manually + [managing context](https://platform.openai.com/docs/guides/conversation-state). + title: Reasoning + OpenAI.OutputItemType: + anyOf: + - type: string + - type: string + enum: + - output_message + - file_search_call + - function_call + - web_search_call + - computer_call + - reasoning + - compaction + - image_generation_call + - code_interpreter_call + - local_shell_call + - shell_call + - shell_call_output + - apply_patch_call + - apply_patch_call_output + - mcp_call + - mcp_list_tools + - mcp_approval_request + - custom_tool_call + OpenAI.OutputItemWebSearchToolCall: + type: object + required: + - id + - type + - status + - action + properties: + id: + type: string + description: The unique ID of the web search tool call. + type: + type: string + enum: + - web_search_call + description: The type of the web search tool call. Always `web_search_call`. + x-stainless-const: true + status: + type: string + enum: + - in_progress + - searching + - completed + - failed + description: The status of the web search tool call. + action: + anyOf: + - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch' + - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage' + - $ref: '#/components/schemas/OpenAI.WebSearchActionFind' + description: |- + An object describing the specific action taken in this web search call. + Includes details on how the model used the web (search, open_page, find). + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + The results of a web search tool call. See the + [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. + title: Web search tool call + OpenAI.OutputMessageContent: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.OutputMessageContentType' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAI.OutputMessageContentOutputTextContent' + refusal: '#/components/schemas/OpenAI.OutputMessageContentRefusalContent' + OpenAI.OutputMessageContentOutputTextContent: + type: object + required: + - type + - text + - annotations + properties: + type: + type: string + enum: + - output_text + description: The type of the output text. Always `output_text`. + x-stainless-const: true + default: output_text + text: + type: string + description: The text output from the model. + annotations: + type: array + items: + $ref: '#/components/schemas/OpenAI.Annotation' + description: The annotations of the text output. + logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.LogProb' + allOf: + - $ref: '#/components/schemas/OpenAI.OutputMessageContent' + description: A text output from the model. + title: Output text + OpenAI.OutputMessageContentRefusalContent: + type: object + required: + - type + - refusal + properties: + type: + type: string + enum: + - refusal + description: The type of the refusal. Always `refusal`. + x-stainless-const: true + default: refusal + refusal: + type: string + description: The refusal explanation from the model. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputMessageContent' + description: A refusal from the model. + title: Refusal + OpenAI.OutputMessageContentType: + anyOf: + - type: string + - type: string + enum: + - output_text + - refusal + OpenAI.OutputTextContent: + type: object + required: + - type + - text + - annotations + properties: + type: + type: string + enum: + - output_text + description: The type of the output text. Always `output_text`. + x-stainless-const: true + default: output_text + text: + type: string + description: The text output from the model. + annotations: + type: array + items: + $ref: '#/components/schemas/OpenAI.Annotation' + description: The annotations of the text output. + logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.LogProb' + description: A text output from the model. + title: Output text + OpenAI.ParallelToolCalls: + type: boolean + description: Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. + OpenAI.PredictionContent: + type: object + required: + - type + - content + properties: + type: + type: string + enum: + - content + description: |- + The type of the predicted content you want to provide. This type is + currently always `content`. + x-stainless-const: true + content: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' + description: |- + The content that should be matched when generating a model response. + If generated tokens would match this content, the entire model response + can be returned much more quickly. + description: |- + Static predicted output content, such as the content of a text file that is + being regenerated. + title: Static Content + OpenAI.Prompt: + type: object + required: + - id + properties: + id: + type: string + description: The unique identifier of the prompt template to use. + version: + anyOf: + - type: string + - type: 'null' + variables: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables' + - type: 'null' + description: |- + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + OpenAI.RankerVersionType: + type: string + enum: + - auto + - default-2024-11-15 + OpenAI.RankingOptions: + type: object + properties: + ranker: + allOf: + - $ref: '#/components/schemas/OpenAI.RankerVersionType' + description: The ranker to use for the file search. + score_threshold: + type: number + description: The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. + hybrid_search: + allOf: + - $ref: '#/components/schemas/OpenAI.HybridSearchOptions' + description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. + OpenAI.RealtimeAudioFormats: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.RealtimeAudioFormatsType' + discriminator: + propertyName: type + mapping: + audio/pcm: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm' + audio/pcmu: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu' + audio/pcma: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma' + OpenAI.RealtimeAudioFormatsAudioPcm: + type: object + required: + - type + properties: + type: + type: string + enum: + - audio/pcm + rate: + type: number + enum: + - 24000 + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + OpenAI.RealtimeAudioFormatsAudioPcma: + type: object + required: + - type + properties: + type: + type: string + enum: + - audio/pcma + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + OpenAI.RealtimeAudioFormatsAudioPcmu: + type: object + required: + - type + properties: + type: + type: string + enum: + - audio/pcmu + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + OpenAI.RealtimeAudioFormatsType: + anyOf: + - type: string + - type: string + enum: + - audio/pcm + - audio/pcmu + - audio/pcma + OpenAI.RealtimeCallCreateRequest: + type: object + properties: + sdp: + type: string + description: WebRTC Session Description Protocol (SDP) offer generated by the caller. + session: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA' + description: |- + Optional session configuration to apply before the realtime session is + created. Use the same parameters you would send in a [`create client secret`](https://platform.openai.com/docs/api-reference/realtime-sessions/create-realtime-client-secret) + request. + required: + - sdp + OpenAI.RealtimeCallReferRequest: + type: object + required: + - target_uri + properties: + target_uri: + type: string + description: |- + URI that should appear in the SIP Refer-To header. Supports values like + `tel:+14155550123` or `sip:agent\@example.com`. + description: |- + Parameters required to transfer a SIP call to a new destination using the + Realtime API. + title: Realtime call refer request + OpenAI.RealtimeCallRejectRequest: + type: object + properties: + status_code: + type: integer + description: |- + SIP response code to send back to the caller. Defaults to `603` (Decline) + when omitted. + description: Parameters used to decline an incoming SIP call handled by the Realtime API. + title: Realtime call reject request + OpenAI.RealtimeCreateClientSecretRequest: + type: object + properties: + expires_after: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter' + description: |- + Configuration for the client secret expiration. Expiration refers to the time after which + a client secret will no longer be valid for creating sessions. The session itself may + continue after that time once started. A secret can be used to create multiple sessions + until it expires. + title: Client secret expiration + session: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion' + description: |- + Session configuration to use for the client secret. Choose either a realtime + session or a transcription session. + description: |- + Create a session and client secret for the Realtime API. The request can specify + either a realtime or a transcription session configuration. + [Learn more about the Realtime API](https://platform.openai.com/docs/guides/realtime). + title: Realtime client secret creation request + OpenAI.RealtimeCreateClientSecretRequestExpiresAfter: + type: object + properties: + anchor: + type: string + enum: + - created_at + x-stainless-const: true + default: created_at + seconds: + type: integer + minimum: 10 + maximum: 7200 + default: 600 + OpenAI.RealtimeCreateClientSecretResponse: + type: object + required: + - value + - expires_at + - session + properties: + value: + type: string + description: The generated client secret value. + expires_at: + type: integer + format: unixtime + description: Expiration timestamp for the client secret, in seconds since epoch. + session: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion' + description: The session configuration for either a realtime or transcription session. + description: Response from creating a session and client secret for the Realtime API. + title: Realtime session and client secret + x-oaiMeta: + name: Session response object + group: realtime + example: | + { + "value": "ek_68af296e8e408191a1120ab6383263c2", + "expires_at": 1756310470, + "session": { + "type": "realtime", + "object": "realtime.session", + "id": "sess_C9CiUVUzUzYIssh3ELY1d", + "model": "gpt-realtime-2025-08-25", + "output_modalities": [ + "audio" + ], + "instructions": "You are a friendly assistant.", + "tools": [], + "tool_choice": "auto", + "max_output_tokens": "inf", + "tracing": null, + "truncation": "auto", + "prompt": null, + "expires_at": 0, + "audio": { + "input": { + "format": { + "type": "audio/pcm", + "rate": 24000 + }, + "transcription": null, + "noise_reduction": null, + "turn_detection": { + "type": "server_vad", + "threshold": 0.5, + "prefix_padding_ms": 300, + "silence_duration_ms": 200, + "idle_timeout_ms": null, + "create_response": true, + "interrupt_response": true + } + }, + "output": { + "format": { + "type": "audio/pcm", + "rate": 24000 + }, + "voice": "alloy", + "speed": 1.0 + } + }, + "include": null + } + } + OpenAI.RealtimeFunctionTool: + type: object + properties: + type: + type: string + enum: + - function + description: The type of the tool, i.e. `function`. + x-stainless-const: true + name: + type: string + description: The name of the function. + description: + type: string + description: |- + The description of the function, including guidance on when and how + to call it, and guidance about what to tell the user when calling + (if anything). + parameters: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeFunctionToolParameters' + description: Parameters of the function in JSON Schema. + title: Function tool + OpenAI.RealtimeFunctionToolParameters: + type: object + OpenAI.RealtimeSessionCreateRequest: + type: object + required: + - client_secret + - type + properties: + client_secret: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret' + description: Ephemeral key returned by the API. + modalities: + type: array + items: + type: string + enum: + - text + - audio + description: |- + The set of modalities the model can respond with. To disable audio, + set this to ["text"]. + default: + - text + - audio + instructions: + type: string + description: |- + The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. + Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session. + voice: + allOf: + - $ref: '#/components/schemas/OpenAI.VoiceIdsShared' + description: The voice the model uses to respond. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the session once the model has responded with audio at least once. + input_audio_format: + type: string + description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + output_audio_format: + type: string + description: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + input_audio_transcription: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription' + description: |- + Configuration for input audio transcription, defaults to off and can be + set to `null` to turn off once on. Input audio transcription is not native + to the model, since the model consumes audio directly. Transcription runs + asynchronously and should be treated as rough guidance + rather than the representation understood by the model. + speed: + type: number + minimum: 0.25 + maximum: 1.5 + description: |- + The speed of the model's spoken response. 1.0 is the default speed. 0.25 is + the minimum speed. 1.5 is the maximum speed. This value can only be changed + in between model turns, not while a response is in progress. + default: 1 + tracing: + anyOf: + - type: string + enum: + - auto + - type: object + properties: + workflow_name: + type: string + group_id: + type: string + metadata: + type: object + unevaluatedProperties: {} + description: |- + Configuration options for tracing. Set to null to disable tracing. Once + tracing is enabled for a session, the configuration cannot be modified. + `auto` will create a trace for the session with default values for the + workflow name, group id, and metadata. + title: Tracing Configuration + default: auto + turn_detection: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection' + description: |- + Configuration for turn detection. Can be set to `null` to turn off. Server + VAD means that the model will detect the start and end of speech based on + audio volume and respond at the end of user speech. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools' + description: Tools (functions) available to the model. + tool_choice: + type: string + description: |- + How the model chooses tools. Options are `auto`, `none`, `required`, or + specify a function. + temperature: + type: number + description: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + max_response_output_tokens: + anyOf: + - type: integer + - type: string + enum: + - inf + description: |- + Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to + limit output tokens, or `inf` for the maximum available tokens for a + given model. Defaults to `inf`. + truncation: + $ref: '#/components/schemas/OpenAI.RealtimeTruncation' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + type: + type: string + enum: + - realtime + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion' + description: |- + A new Realtime session configuration, with an ephemeral key. Default TTL + for keys is one minute. + x-oaiMeta: + name: The session object + group: realtime + example: | + { + "id": "sess_001", + "object": "realtime.session", + "model": "gpt-realtime-2025-08-25", + "modalities": ["audio", "text"], + "instructions": "You are a friendly assistant.", + "voice": "alloy", + "input_audio_format": "pcm16", + "output_audio_format": "pcm16", + "input_audio_transcription": { + "model": "whisper-1" + }, + "turn_detection": null, + "tools": [], + "tool_choice": "none", + "temperature": 0.7, + "speed": 1.1, + "tracing": "auto", + "max_response_output_tokens": 200, + "truncation": "auto", + "prompt": null, + "client_secret": { + "value": "ek_abc123", + "expires_at": 1234567890 + } + } + OpenAI.RealtimeSessionCreateRequestClientSecret: + type: object + required: + - value + - expires_at + properties: + value: + type: string + expires_at: + type: integer + format: unixtime + OpenAI.RealtimeSessionCreateRequestGA: + type: object + required: + - type + properties: + type: + type: string + enum: + - realtime + description: The type of session to create. Always `realtime` for the Realtime API. + x-stainless-const: true + output_modalities: + type: array + items: + type: string + enum: + - text + - audio + description: |- + The set of modalities the model can respond with. It defaults to `["audio"]`, indicating + that the model will respond with audio plus a transcript. `["text"]` can be used to make + the model respond with text only. It is not possible to request both `text` and `audio` at the same time. + default: + - audio + model: + type: string + description: The Realtime model used for this session. + instructions: + type: string + description: |- + The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. + Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session. + audio: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio' + description: Configuration for input and output audio. + include: + type: array + items: + type: string + enum: + - item.input_audio_transcription.logprobs + description: |- + Additional fields to include in server outputs. + `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription. + tracing: + anyOf: + - type: string + enum: + - auto + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing' + - type: 'null' + description: |- + Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once + tracing is enabled for a session, the configuration cannot be modified. + `auto` will create a trace for the session with default values for the + workflow name, group id, and metadata. + title: Tracing Configuration + default: auto + tools: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool' + - $ref: '#/components/schemas/OpenAI.MCPTool' + description: Tools available to the model. + tool_choice: + anyOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions' + - $ref: '#/components/schemas/OpenAI.ToolChoiceFunction' + - $ref: '#/components/schemas/OpenAI.ToolChoiceMCP' + description: |- + How the model chooses tools. Provide one of the string modes or force a specific + function/MCP tool. + default: auto + max_output_tokens: + anyOf: + - type: integer + - type: string + enum: + - inf + description: |- + Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to + limit output tokens, or `inf` for the maximum available tokens for a + given model. Defaults to `inf`. + truncation: + $ref: '#/components/schemas/OpenAI.RealtimeTruncation' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + description: Realtime session object configuration. + title: Realtime session configuration + OpenAI.RealtimeSessionCreateRequestGAAudio: + type: object + properties: + input: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput' + output: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput' + OpenAI.RealtimeSessionCreateRequestGAAudioInput: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + transcription: + $ref: '#/components/schemas/OpenAI.AudioTranscription' + noise_reduction: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction' + turn_detection: + $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection' + OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction: + type: object + properties: + type: + $ref: '#/components/schemas/OpenAI.NoiseReductionType' + OpenAI.RealtimeSessionCreateRequestGAAudioOutput: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + voice: + $ref: '#/components/schemas/OpenAI.VoiceIdsShared' + speed: + type: number + minimum: 0.25 + maximum: 1.5 + default: 1 + OpenAI.RealtimeSessionCreateRequestGATracing: + type: object + properties: + workflow_name: + type: string + group_id: + type: string + metadata: + type: object + unevaluatedProperties: {} + OpenAI.RealtimeSessionCreateRequestInputAudioTranscription: + type: object + properties: + model: + type: string + OpenAI.RealtimeSessionCreateRequestTools: + type: object + properties: + type: + type: string + enum: + - function + x-stainless-const: true + name: + type: string + description: + type: string + parameters: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters' + OpenAI.RealtimeSessionCreateRequestToolsParameters: + type: object + OpenAI.RealtimeSessionCreateRequestTurnDetection: + type: object + properties: + type: + type: string + threshold: + type: number + prefix_padding_ms: + type: integer + silence_duration_ms: + type: integer + OpenAI.RealtimeSessionCreateRequestUnion: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType' + discriminator: + propertyName: type + mapping: + realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateRequest' + transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest' + OpenAI.RealtimeSessionCreateRequestUnionType: + anyOf: + - type: string + - type: string + enum: + - realtime + - transcription + OpenAI.RealtimeSessionCreateResponse: + type: object + required: + - type + properties: + id: + type: string + description: Unique identifier for the session that looks like `sess_1234567890abcdef`. + object: + type: string + description: The object type. Always `realtime.session`. + expires_at: + type: integer + format: unixtime + description: Expiration timestamp for the session, in seconds since epoch. + include: + type: array + items: + type: string + enum: + - item.input_audio_transcription.logprobs + description: |- + Additional fields to include in server outputs. + - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription. + model: + type: string + description: The Realtime model used for this session. + output_modalities: + type: array + items: + type: string + enum: + - text + - audio + description: |- + The set of modalities the model can respond with. To disable audio, + set this to ["text"]. + instructions: + type: string + description: |- + The default system instructions (i.e. system message) prepended to model + calls. This field allows the client to guide the model on desired + responses. The model can be instructed on response content and format, + (e.g. "be extremely succinct", "act friendly", "here are examples of good + responses") and on audio behavior (e.g. "talk quickly", "inject emotion + into your voice", "laugh frequently"). The instructions are not guaranteed + to be followed by the model, but they provide guidance to the model on the + desired behavior. + Note that the server sets default instructions which will be used if this + field is not set and are visible in the `session.created` event at the + start of the session. + audio: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio' + description: Configuration for input and output audio for the session. + tracing: + anyOf: + - type: string + enum: + - auto + - type: object + properties: + workflow_name: + type: string + group_id: + type: string + metadata: + type: object + unevaluatedProperties: {} + description: |- + Configuration options for tracing. Set to null to disable tracing. Once + tracing is enabled for a session, the configuration cannot be modified. + `auto` will create a trace for the session with default values for the + workflow name, group id, and metadata. + title: Tracing Configuration + default: auto + turn_detection: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection' + description: |- + Configuration for turn detection. Can be set to `null` to turn off. Server + VAD means that the model will detect the start and end of speech based on + audio volume and respond at the end of user speech. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool' + description: Tools (functions) available to the model. + tool_choice: + type: string + description: |- + How the model chooses tools. Options are `auto`, `none`, `required`, or + specify a function. + max_output_tokens: + anyOf: + - type: integer + - type: string + enum: + - inf + description: |- + Maximum number of output tokens for a single assistant response, + inclusive of tool calls. Provide an integer between 1 and 4096 to + limit output tokens, or `inf` for the maximum available tokens for a + given model. Defaults to `inf`. + type: + type: string + enum: + - realtime + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion' + description: A Realtime session configuration object. + title: Realtime session configuration object + x-oaiMeta: + name: The session object + group: realtime + example: | + { + "id": "sess_001", + "object": "realtime.session", + "expires_at": 1742188264, + "model": "gpt-realtime", + "output_modalities": ["audio"], + "instructions": "You are a friendly assistant.", + "tools": [], + "tool_choice": "none", + "max_output_tokens": "inf", + "tracing": "auto", + "truncation": "auto", + "prompt": null, + "audio": { + "input": { + "format": { + "type": "audio/pcm", + "rate": 24000 + }, + "transcription": { "model": "whisper-1" }, + "noise_reduction": null, + "turn_detection": null + }, + "output": { + "format": { + "type": "audio/pcm", + "rate": 24000 + }, + "voice": "alloy", + "speed": 1.0 + } + } + } + OpenAI.RealtimeSessionCreateResponseAudio: + type: object + properties: + input: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput' + output: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput' + OpenAI.RealtimeSessionCreateResponseAudioInput: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + transcription: + $ref: '#/components/schemas/OpenAI.AudioTranscription' + noise_reduction: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction' + turn_detection: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection' + OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction: + type: object + properties: + type: + $ref: '#/components/schemas/OpenAI.NoiseReductionType' + OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection: + type: object + properties: + type: + type: string + threshold: + type: number + prefix_padding_ms: + type: integer + silence_duration_ms: + type: integer + OpenAI.RealtimeSessionCreateResponseAudioOutput: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' + voice: + $ref: '#/components/schemas/OpenAI.VoiceIdsShared' + speed: + type: number + OpenAI.RealtimeSessionCreateResponseTurnDetection: + type: object + properties: + type: + type: string + threshold: + type: number + prefix_padding_ms: + type: integer + silence_duration_ms: + type: integer + OpenAI.RealtimeSessionCreateResponseUnion: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType' + discriminator: + propertyName: type + mapping: + realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateResponse' + transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse' + OpenAI.RealtimeSessionCreateResponseUnionType: + anyOf: + - type: string + - type: string + enum: + - realtime + - transcription + OpenAI.RealtimeTranscriptionSessionCreateRequest: + type: object + required: + - type + properties: + turn_detection: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection' + description: Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. + input_audio_noise_reduction: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction' + description: |- + Configuration for input audio noise reduction. This can be set to `null` to turn off. + Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. + Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + input_audio_format: + type: string + enum: + - pcm16 + - g711_ulaw + - g711_alaw + description: |- + The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, + single channel (mono), and little-endian byte order. + default: pcm16 + input_audio_transcription: + allOf: + - $ref: '#/components/schemas/OpenAI.AudioTranscription' + description: Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + include: + type: array + items: + type: string + enum: + - item.input_audio_transcription.logprobs + description: |- + The set of items to include in the transcription. Current available items are: + `item.input_audio_transcription.logprobs` + type: + type: string + enum: + - transcription + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion' + description: Realtime transcription session object configuration. + title: Realtime transcription session configuration + OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction: + type: object + properties: + type: + $ref: '#/components/schemas/OpenAI.NoiseReductionType' + OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection: + type: object + properties: + type: + type: string + enum: + - server_vad + threshold: + type: number + prefix_padding_ms: + type: integer + silence_duration_ms: + type: integer + OpenAI.RealtimeTranscriptionSessionCreateResponse: + type: object + required: + - client_secret + - type + properties: + client_secret: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret' + description: |- + Ephemeral key returned by the API. Only present when the session is + created on the server via REST API. + modalities: + type: array + items: + type: string + enum: + - text + - audio + description: |- + The set of modalities the model can respond with. To disable audio, + set this to ["text"]. + input_audio_format: + type: string + description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + input_audio_transcription: + allOf: + - $ref: '#/components/schemas/OpenAI.AudioTranscription' + description: Configuration of the transcription model. + turn_detection: + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection' + description: |- + Configuration for turn detection. Can be set to `null` to turn off. Server + VAD means that the model will detect the start and end of speech based on + audio volume and respond at the end of user speech. + type: + type: string + enum: + - transcription + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion' + description: |- + A new Realtime transcription session configuration. + When a session is created on the server via REST API, the session object + also contains an ephemeral key. Default TTL for keys is 10 minutes. This + property is not present when a session is updated via the WebSocket API. + x-oaiMeta: + name: The transcription session object + group: realtime + example: | + { + "id": "sess_BBwZc7cFV3XizEyKGDCGL", + "object": "realtime.transcription_session", + "expires_at": 1742188264, + "modalities": ["audio", "text"], + "turn_detection": { + "type": "server_vad", + "threshold": 0.5, + "prefix_padding_ms": 300, + "silence_duration_ms": 200 + }, + "input_audio_format": "pcm16", + "input_audio_transcription": { + "model": "gpt-4o-transcribe", + "language": null, + "prompt": "" + }, + "client_secret": null + } + OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret: + type: object + required: + - value + - expires_at + properties: + value: + type: string + expires_at: + type: integer + format: unixtime + OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection: + type: object + properties: + type: + type: string + threshold: + type: number + prefix_padding_ms: + type: integer + silence_duration_ms: + type: integer + OpenAI.RealtimeTruncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: object + properties: + type: + type: string + enum: + - retention_ratio + x-stainless-const: true + retention_ratio: + type: number + minimum: 0 + maximum: 1 + token_limits: + $ref: '#/components/schemas/OpenAI.TokenLimits' + required: + - type + - retention_ratio + description: |- + When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs. + Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost. + Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate. + Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit. + title: Realtime Truncation Controls + OpenAI.RealtimeTurnDetection: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.RealtimeTurnDetectionType' + discriminator: + propertyName: type + OpenAI.RealtimeTurnDetectionType: + type: string + OpenAI.Reasoning: + type: object + properties: + effort: + $ref: '#/components/schemas/OpenAI.ReasoningEffort' + summary: + anyOf: + - type: string + enum: + - auto + - concise + - detailed + - type: 'null' + generate_summary: + anyOf: + - type: string + enum: + - auto + - concise + - detailed + - type: 'null' + description: |- + **gpt-5 and o-series models only** + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + title: Reasoning + OpenAI.ReasoningEffort: + anyOf: + - type: string + enum: + - none + - minimal + - low + - medium + - high + - xhigh + - type: 'null' + description: |- + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing + reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + OpenAI.ReasoningTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - reasoning_text + description: The type of the reasoning text. Always `reasoning_text`. + x-stainless-const: true + default: reasoning_text + text: + type: string + description: The reasoning text from the model. + allOf: + - $ref: '#/components/schemas/OpenAI.OutputContent' + description: Reasoning text from the model. + title: ReasoningTextContent + OpenAI.RefusalContent: + type: object + required: + - type + - refusal + properties: + type: + type: string + enum: + - refusal + description: The type of the refusal. Always `refusal`. + x-stainless-const: true + default: refusal + refusal: + type: string + description: The refusal explanation from the model. + description: A refusal from the model. + title: Refusal + OpenAI.Response: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + title: The response object + OpenAI.ResponseAudioDeltaEvent: + type: object + required: + - type + - sequence_number + - delta + properties: + type: + type: string + enum: + - response.audio.delta + description: The type of the event. Always `response.audio.delta`. + x-stainless-const: true + sequence_number: + type: integer + description: A sequence number for this chunk of the stream response. + delta: + type: string + contentEncoding: base64 + description: A chunk of Base64 encoded response audio bytes. + description: Emitted when there is a partial audio response. + x-oaiMeta: + name: response.audio.delta + group: responses + example: | + { + "type": "response.audio.delta", + "response_id": "resp_123", + "delta": "base64encoded...", + "sequence_number": 1 + } + OpenAI.ResponseAudioTranscriptDeltaEvent: + type: object + required: + - type + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.audio.transcript.delta + description: The type of the event. Always `response.audio.transcript.delta`. + x-stainless-const: true + delta: + type: string + description: The partial transcript of the audio response. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when there is a partial transcript of audio. + x-oaiMeta: + name: response.audio.transcript.delta + group: responses + example: | + { + "type": "response.audio.transcript.delta", + "response_id": "resp_123", + "delta": " ... partial transcript ... ", + "sequence_number": 1 + } + OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent: + type: object + required: + - type + - output_index + - item_id + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.code_interpreter_call_code.delta + description: The type of the event. Always `response.code_interpreter_call_code.delta`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response for which the code is being streamed. + item_id: + type: string + description: The unique identifier of the code interpreter tool call item. + delta: + type: string + description: The partial code snippet being streamed by the code interpreter. + sequence_number: + type: integer + description: The sequence number of this event, used to order streaming events. + description: Emitted when a partial code snippet is streamed by the code interpreter. + x-oaiMeta: + name: response.code_interpreter_call_code.delta + group: responses + example: | + { + "type": "response.code_interpreter_call_code.delta", + "output_index": 0, + "item_id": "ci_12345", + "delta": "print('Hello, world')", + "sequence_number": 1 + } + OpenAI.ResponseCodeInterpreterCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.code_interpreter_call.in_progress + description: The type of the event. Always `response.code_interpreter_call.in_progress`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response for which the code interpreter call is in progress. + item_id: + type: string + description: The unique identifier of the code interpreter tool call item. + sequence_number: + type: integer + description: The sequence number of this event, used to order streaming events. + description: Emitted when a code interpreter call is in progress. + x-oaiMeta: + name: response.code_interpreter_call.in_progress + group: responses + example: | + { + "type": "response.code_interpreter_call.in_progress", + "output_index": 0, + "item_id": "ci_12345", + "sequence_number": 1 + } + OpenAI.ResponseCodeInterpreterCallInterpretingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.code_interpreter_call.interpreting + description: The type of the event. Always `response.code_interpreter_call.interpreting`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response for which the code interpreter is interpreting code. + item_id: + type: string + description: The unique identifier of the code interpreter tool call item. + sequence_number: + type: integer + description: The sequence number of this event, used to order streaming events. + description: Emitted when the code interpreter is actively interpreting the code snippet. + x-oaiMeta: + name: response.code_interpreter_call.interpreting + group: responses + example: | + { + "type": "response.code_interpreter_call.interpreting", + "output_index": 4, + "item_id": "ci_12345", + "sequence_number": 1 + } + OpenAI.ResponseContentPartAddedEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - part + - sequence_number + properties: + type: + type: string + enum: + - response.content_part.added + description: The type of the event. Always `response.content_part.added`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the content part was added to. + output_index: + type: integer + description: The index of the output item that the content part was added to. + content_index: + type: integer + description: The index of the content part that was added. + part: + allOf: + - $ref: '#/components/schemas/OpenAI.OutputContent' + description: The content part that was added. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a new content part is added. + x-oaiMeta: + name: response.content_part.added + group: responses + example: | + { + "type": "response.content_part.added", + "item_id": "msg_123", + "output_index": 0, + "content_index": 0, + "part": { + "type": "output_text", + "text": "", + "annotations": [] + }, + "sequence_number": 1 + } + OpenAI.ResponseCreatedEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.created + description: The type of the event. Always `response.created`. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that was created. + sequence_number: + type: integer + description: The sequence number for this event. + description: An event that is emitted when a response is created. + x-oaiMeta: + name: response.created + group: responses + example: | + { + "type": "response.created", + "response": { + "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", + "object": "response", + "created_at": 1741487325, + "status": "in_progress", + "completed_at": null, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-2024-08-06", + "output": [], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + }, + "sequence_number": 1 + } + OpenAI.ResponseCustomToolCallInputDeltaEvent: + type: object + required: + - type + - sequence_number + - output_index + - item_id + - delta + properties: + type: + type: string + enum: + - response.custom_tool_call_input.delta + description: The event type identifier. + x-stainless-const: true + sequence_number: + type: integer + description: The sequence number of this event. + output_index: + type: integer + description: The index of the output this delta applies to. + item_id: + type: string + description: Unique identifier for the API item associated with this event. + delta: + type: string + description: The incremental input data (delta) for the custom tool call. + description: Event representing a delta (partial update) to the input of a custom tool call. + title: ResponseCustomToolCallInputDelta + x-oaiMeta: + name: response.custom_tool_call_input.delta + group: responses + example: | + { + "type": "response.custom_tool_call_input.delta", + "output_index": 0, + "item_id": "ctc_1234567890abcdef", + "delta": "partial input text" + } + OpenAI.ResponseError: + type: object + required: + - code + - message + properties: + code: + $ref: '#/components/schemas/OpenAI.ResponseErrorCode' + message: + type: string + description: A human-readable description of the error. + description: An error object returned when the model fails to generate a Response. + OpenAI.ResponseErrorCode: + type: string + enum: + - server_error + - rate_limit_exceeded + - invalid_prompt + - vector_store_timeout + - invalid_image + - invalid_image_format + - invalid_base64_image + - invalid_image_url + - image_too_large + - image_too_small + - image_parse_error + - image_content_policy_violation + - invalid_image_mode + - image_file_too_large + - unsupported_image_media_type + - empty_image_file + - failed_to_download_image + - image_file_not_found + description: The error code for the response. + OpenAI.ResponseErrorEvent: + type: object + required: + - type + - code + - message + - param + - sequence_number + properties: + type: + type: string + enum: + - error + description: The type of the event. Always `error`. + x-stainless-const: true + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + description: The error message. + param: + anyOf: + - type: string + - type: 'null' + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when an error occurs. + x-oaiMeta: + name: error + group: responses + example: | + { + "type": "error", + "code": "ERR_SOMETHING", + "message": "Something went wrong", + "param": null, + "sequence_number": 1 + } + OpenAI.ResponseFailedEvent: + type: object + required: + - type + - sequence_number + - response + properties: + type: + type: string + enum: + - response.failed + description: The type of the event. Always `response.failed`. + x-stainless-const: true + sequence_number: + type: integer + description: The sequence number of this event. + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that failed. + description: An event that is emitted when a response fails. + x-oaiMeta: + name: response.failed + group: responses + example: | + { + "type": "response.failed", + "response": { + "id": "resp_123", + "object": "response", + "created_at": 1740855869, + "status": "failed", + "completed_at": null, + "error": { + "code": "server_error", + "message": "The model failed to generate a response." + }, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [], + "previous_response_id": null, + "reasoning_effort": null, + "store": false, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + } + } + OpenAI.ResponseFileSearchCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.file_search_call.in_progress + description: The type of the event. Always `response.file_search_call.in_progress`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the file search call is initiated. + item_id: + type: string + description: The ID of the output item that the file search call is initiated. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a file search call is initiated. + x-oaiMeta: + name: response.file_search_call.in_progress + group: responses + example: | + { + "type": "response.file_search_call.in_progress", + "output_index": 0, + "item_id": "fs_123", + "sequence_number": 1 + } + OpenAI.ResponseFileSearchCallSearchingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.file_search_call.searching + description: The type of the event. Always `response.file_search_call.searching`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the file search call is searching. + item_id: + type: string + description: The ID of the output item that the file search call is initiated. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a file search is currently searching. + x-oaiMeta: + name: response.file_search_call.searching + group: responses + example: | + { + "type": "response.file_search_call.searching", + "output_index": 0, + "item_id": "fs_123", + "sequence_number": 1 + } + OpenAI.ResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: The type of response format being defined. Always `json_object`. + x-stainless-const: true + description: |- + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + title: JSON object + OpenAI.ResponseFormatJsonSchema: + type: object + required: + - type + - json_schema + properties: + type: + type: string + enum: + - json_schema + description: The type of response format being defined. Always `json_schema`. + x-stainless-const: true + json_schema: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema' + description: Structured Outputs configuration options, including a JSON Schema. + title: JSON schema + allOf: + - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' + description: |- + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + title: JSON schema + OpenAI.ResponseFormatJsonSchemaJsonSchema: + type: object + required: + - name + properties: + description: + type: string + name: + type: string + schema: + $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema' + strict: + anyOf: + - type: boolean + - type: 'null' + OpenAI.ResponseFormatJsonSchemaSchema: + type: object + unevaluatedProperties: {} + description: |- + The schema for the response format, described as a JSON Schema object. + Learn how to build JSON schemas [here](https://json-schema.org/). + title: JSON schema + OpenAI.ResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: The type of response format being defined. Always `text`. + x-stainless-const: true + description: Default response format. Used to generate text responses. + title: Text + OpenAI.ResponseFunctionCallArgumentsDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + - delta + properties: + type: + type: string + enum: + - response.function_call_arguments.delta + description: The type of the event. Always `response.function_call_arguments.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the function-call arguments delta is added to. + output_index: + type: integer + description: The index of the output item that the function-call arguments delta is added to. + sequence_number: + type: integer + description: The sequence number of this event. + delta: + type: string + description: The function-call arguments delta that is added. + description: Emitted when there is a partial function-call arguments delta. + x-oaiMeta: + name: response.function_call_arguments.delta + group: responses + example: | + { + "type": "response.function_call_arguments.delta", + "item_id": "item-abc", + "output_index": 0, + "delta": "{ "arg":" + "sequence_number": 1 + } + OpenAI.ResponseImageGenCallGeneratingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.image_generation_call.generating + description: The type of the event. Always 'response.image_generation_call.generating'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the image generation item being processed. + sequence_number: + type: integer + description: The sequence number of the image generation item being processed. + description: Emitted when an image generation tool call is actively generating an image (intermediate state). + title: ResponseImageGenCallGeneratingEvent + x-oaiMeta: + name: response.image_generation_call.generating + group: responses + example: | + { + "type": "response.image_generation_call.generating", + "output_index": 0, + "item_id": "item-123", + "sequence_number": 0 + } + OpenAI.ResponseImageGenCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.image_generation_call.in_progress + description: The type of the event. Always 'response.image_generation_call.in_progress'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the image generation item being processed. + sequence_number: + type: integer + description: The sequence number of the image generation item being processed. + description: Emitted when an image generation tool call is in progress. + title: ResponseImageGenCallInProgressEvent + x-oaiMeta: + name: response.image_generation_call.in_progress + group: responses + example: | + { + "type": "response.image_generation_call.in_progress", + "output_index": 0, + "item_id": "item-123", + "sequence_number": 0 + } + OpenAI.ResponseImageGenCallPartialImageEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + - partial_image_index + - partial_image_b64 + properties: + type: + type: string + enum: + - response.image_generation_call.partial_image + description: The type of the event. Always 'response.image_generation_call.partial_image'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the image generation item being processed. + sequence_number: + type: integer + description: The sequence number of the image generation item being processed. + partial_image_index: + type: integer + description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + partial_image_b64: + type: string + description: Base64-encoded partial image data, suitable for rendering as an image. + description: Emitted when a partial image is available during image generation streaming. + title: ResponseImageGenCallPartialImageEvent + x-oaiMeta: + name: response.image_generation_call.partial_image + group: responses + example: | + { + "type": "response.image_generation_call.partial_image", + "output_index": 0, + "item_id": "item-123", + "sequence_number": 0, + "partial_image_index": 0, + "partial_image_b64": "..." + } + OpenAI.ResponseInProgressEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.in_progress + description: The type of the event. Always `response.in_progress`. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that is in progress. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when the response is in progress. + x-oaiMeta: + name: response.in_progress + group: responses + example: | + { + "type": "response.in_progress", + "response": { + "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", + "object": "response", + "created_at": 1741487325, + "status": "in_progress", + "completed_at": null, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-2024-08-06", + "output": [], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + }, + "sequence_number": 1 + } + OpenAI.ResponseIncompleteDetails: + type: object + properties: + reason: + type: string + enum: + - max_output_tokens + - content_filter + OpenAI.ResponseIncompleteEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.incomplete + description: The type of the event. Always `response.incomplete`. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that was incomplete. + sequence_number: + type: integer + description: The sequence number of this event. + description: An event that is emitted when a response finishes as incomplete. + x-oaiMeta: + name: response.incomplete + group: responses + example: | + { + "type": "response.incomplete", + "response": { + "id": "resp_123", + "object": "response", + "created_at": 1740855869, + "status": "incomplete", + "completed_at": null, + "error": null, + "incomplete_details": { + "reason": "max_tokens" + }, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [], + "previous_response_id": null, + "reasoning_effort": null, + "store": false, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + }, + "sequence_number": 1 + } + OpenAI.ResponseItemList: + type: object + required: + - object + - data + - has_more + - first_id + - last_id + properties: + object: + type: string + enum: + - list + description: The type of object returned, must be `list`. + x-stainless-const: true + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.ItemResource' + description: A list of items used to generate this response. + has_more: + type: boolean + description: Whether there are more items available. + first_id: + type: string + description: The ID of the first item in the list. + last_id: + type: string + description: The ID of the last item in the list. + description: A list of Response items. + x-oaiMeta: + name: The input item list + group: responses + example: | + { + "object": "list", + "data": [ + { + "id": "msg_abc123", + "type": "message", + "role": "user", + "content": [ + { + "type": "input_text", + "text": "Tell me a three sentence bedtime story about a unicorn." + } + ] + } + ], + "first_id": "msg_abc123", + "last_id": "msg_abc123", + "has_more": false + } + OpenAI.ResponseLogProb: + type: object + required: + - token + - logprob + properties: + token: + type: string + description: A possible text token. + logprob: + type: number + description: The log probability of this token. + top_logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs' + description: The log probability of the top 20 most likely tokens. + description: |- + A logprob is the logarithmic probability that the model assigns to producing + a particular token at a given position in the sequence. Less-negative (higher) + logprob values indicate greater model confidence in that token choice. + OpenAI.ResponseLogProbTopLogprobs: + type: object + properties: + token: + type: string + logprob: + type: number + OpenAI.ResponseMCPCallArgumentsDeltaEvent: + type: object + required: + - type + - output_index + - item_id + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_call_arguments.delta + description: The type of the event. Always 'response.mcp_call_arguments.delta'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the MCP tool call item being processed. + delta: + type: string + description: A JSON string containing the partial update to the arguments for the MCP tool call. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call. + title: ResponseMCPCallArgumentsDeltaEvent + x-oaiMeta: + name: response.mcp_call_arguments.delta + group: responses + example: | + { + "type": "response.mcp_call_arguments.delta", + "output_index": 0, + "item_id": "item-abc", + "delta": "{", + "sequence_number": 1 + } + OpenAI.ResponseMCPCallFailedEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_call.failed + description: The type of the event. Always 'response.mcp_call.failed'. + x-stainless-const: true + item_id: + type: string + description: The ID of the MCP tool call item that failed. + output_index: + type: integer + description: The index of the output item that failed. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when an MCP tool call has failed. + title: ResponseMCPCallFailedEvent + x-oaiMeta: + name: response.mcp_call.failed + group: responses + example: | + { + "type": "response.mcp_call.failed", + "sequence_number": 1, + "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90", + "output_index": 0 + } + OpenAI.ResponseMCPCallInProgressEvent: + type: object + required: + - type + - sequence_number + - output_index + - item_id + properties: + type: + type: string + enum: + - response.mcp_call.in_progress + description: The type of the event. Always 'response.mcp_call.in_progress'. + x-stainless-const: true + sequence_number: + type: integer + description: The sequence number of this event. + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the MCP tool call item being processed. + description: Emitted when an MCP tool call is in progress. + title: ResponseMCPCallInProgressEvent + x-oaiMeta: + name: response.mcp_call.in_progress + group: responses + example: | + { + "type": "response.mcp_call.in_progress", + "sequence_number": 1, + "output_index": 0, + "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90" + } + OpenAI.ResponseMCPListToolsFailedEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_list_tools.failed + description: The type of the event. Always 'response.mcp_list_tools.failed'. + x-stainless-const: true + item_id: + type: string + description: The ID of the MCP tool call item that failed. + output_index: + type: integer + description: The index of the output item that failed. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when the attempt to list available MCP tools has failed. + title: ResponseMCPListToolsFailedEvent + x-oaiMeta: + name: response.mcp_list_tools.failed + group: responses + example: | + { + "type": "response.mcp_list_tools.failed", + "sequence_number": 1, + "output_index": 0, + "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" + } + OpenAI.ResponseMCPListToolsInProgressEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_list_tools.in_progress + description: The type of the event. Always 'response.mcp_list_tools.in_progress'. + x-stainless-const: true + item_id: + type: string + description: The ID of the MCP tool call item that is being processed. + output_index: + type: integer + description: The index of the output item that is being processed. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when the system is in the process of retrieving the list of available MCP tools. + title: ResponseMCPListToolsInProgressEvent + x-oaiMeta: + name: response.mcp_list_tools.in_progress + group: responses + example: | + { + "type": "response.mcp_list_tools.in_progress", + "sequence_number": 1, + "output_index": 0, + "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" + } + OpenAI.ResponseModalities: + anyOf: + - type: array + items: + type: string + enum: + - text + - audio + - type: 'null' + description: |- + Output types that you would like the model to generate. + Most models are capable of generating text, which is the default: + `["text"]` + The `gpt-4o-audio-preview` model can also be used to + [generate audio](https://platform.openai.com/docs/guides/audio). To request that this model generate + both text and audio responses, you can use: + `["text", "audio"]` + OpenAI.ResponseOutputItemAddedEvent: + type: object + required: + - type + - output_index + - sequence_number + - item + properties: + type: + type: string + enum: + - response.output_item.added + description: The type of the event. Always `response.output_item.added`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that was added. + sequence_number: + type: integer + description: The sequence number of this event. + item: + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: The output item that was added. + description: Emitted when a new output item is added. + x-oaiMeta: + name: response.output_item.added + group: responses + example: | + { + "type": "response.output_item.added", + "output_index": 0, + "item": { + "id": "msg_123", + "status": "in_progress", + "type": "message", + "role": "assistant", + "content": [] + }, + "sequence_number": 1 + } + OpenAI.ResponseOutputTextAnnotationAddedEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - annotation_index + - sequence_number + - annotation + properties: + type: + type: string + enum: + - response.output_text.annotation.added + description: The type of the event. Always 'response.output_text.annotation.added'. + x-stainless-const: true + item_id: + type: string + description: The unique identifier of the item to which the annotation is being added. + output_index: + type: integer + description: The index of the output item in the response's output array. + content_index: + type: integer + description: The index of the content part within the output item. + annotation_index: + type: integer + description: The index of the annotation within the content part. + sequence_number: + type: integer + description: The sequence number of this event. + annotation: + allOf: + - $ref: '#/components/schemas/OpenAI.Annotation' + description: The annotation object being added. (See annotation schema for details.) + description: Emitted when an annotation is added to output text content. + title: ResponseOutputTextAnnotationAddedEvent + x-oaiMeta: + name: response.output_text.annotation.added + group: responses + example: | + { + "type": "response.output_text.annotation.added", + "item_id": "item-abc", + "output_index": 0, + "content_index": 0, + "annotation_index": 0, + "annotation": { + "type": "text_annotation", + "text": "This is a test annotation", + "start": 0, + "end": 10 + }, + "sequence_number": 1 + } + OpenAI.ResponsePromptVariables: + type: object + unevaluatedProperties: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAI.InputTextContent' + - $ref: '#/components/schemas/OpenAI.InputImageContent' + - $ref: '#/components/schemas/OpenAI.InputFileContent' + description: |- + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + title: Prompt Variables + x-oaiExpandable: true + x-oaiTypeLabel: map + OpenAI.ResponseQueuedEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.queued + description: The type of the event. Always 'response.queued'. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The full response object that is queued. + sequence_number: + type: integer + description: The sequence number for this event. + description: Emitted when a response is queued and waiting to be processed. + title: ResponseQueuedEvent + x-oaiMeta: + name: response.queued + group: responses + example: | + { + "type": "response.queued", + "response": { + "id": "res_123", + "status": "queued", + "created_at": "2021-01-01T00:00:00Z", + "updated_at": "2021-01-01T00:00:00Z" + }, + "sequence_number": 1 + } + OpenAI.ResponseReasoningSummaryPartAddedEvent: + type: object + required: + - type + - item_id + - output_index + - summary_index + - sequence_number + - part + properties: + type: + type: string + enum: + - response.reasoning_summary_part.added + description: The type of the event. Always `response.reasoning_summary_part.added`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item this summary part is associated with. + output_index: + type: integer + description: The index of the output item this summary part is associated with. + summary_index: + type: integer + description: The index of the summary part within the reasoning summary. + sequence_number: + type: integer + description: The sequence number of this event. + part: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart' + description: The summary part that was added. + description: Emitted when a new reasoning summary part is added. + x-oaiMeta: + name: response.reasoning_summary_part.added + group: responses + example: | + { + "type": "response.reasoning_summary_part.added", + "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", + "output_index": 0, + "summary_index": 0, + "part": { + "type": "summary_text", + "text": "" + }, + "sequence_number": 1 + } + OpenAI.ResponseReasoningSummaryPartAddedEventPart: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - summary_text + x-stainless-const: true + text: + type: string + OpenAI.ResponseReasoningSummaryTextDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - summary_index + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.reasoning_summary_text.delta + description: The type of the event. Always `response.reasoning_summary_text.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item this summary text delta is associated with. + output_index: + type: integer + description: The index of the output item this summary text delta is associated with. + summary_index: + type: integer + description: The index of the summary part within the reasoning summary. + delta: + type: string + description: The text delta that was added to the summary. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a delta is added to a reasoning summary text. + x-oaiMeta: + name: response.reasoning_summary_text.delta + group: responses + example: | + { + "type": "response.reasoning_summary_text.delta", + "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", + "output_index": 0, + "summary_index": 0, + "delta": "**Responding to a greeting** + + The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!", + "sequence_number": 1 + } + OpenAI.ResponseReasoningTextDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.reasoning_text.delta + description: The type of the event. Always `response.reasoning_text.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item this reasoning text delta is associated with. + output_index: + type: integer + description: The index of the output item this reasoning text delta is associated with. + content_index: + type: integer + description: The index of the reasoning content part this delta is associated with. + delta: + type: string + description: The text delta that was added to the reasoning content. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a delta is added to a reasoning text. + x-oaiMeta: + name: response.reasoning_text.delta + group: responses + example: | + { + "type": "response.reasoning_text.delta", + "item_id": "rs_123", + "output_index": 0, + "content_index": 0, + "delta": "The", + "sequence_number": 1 + } + OpenAI.ResponseRefusalDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.refusal.delta + description: The type of the event. Always `response.refusal.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the refusal text is added to. + output_index: + type: integer + description: The index of the output item that the refusal text is added to. + content_index: + type: integer + description: The index of the content part that the refusal text is added to. + delta: + type: string + description: The refusal text that is added. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when there is a partial refusal text. + x-oaiMeta: + name: response.refusal.delta + group: responses + example: | + { + "type": "response.refusal.delta", + "item_id": "msg_123", + "output_index": 0, + "content_index": 0, + "delta": "refusal text so far", + "sequence_number": 1 + } + OpenAI.ResponseStreamOptions: + type: object + properties: + include_obfuscation: + type: boolean + description: |- + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. + description: 'Options for streaming responses. Only set this when you set `stream: true`.' + OpenAI.ResponseTextDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - delta + - sequence_number + - logprobs + properties: + type: + type: string + enum: + - response.output_text.delta + description: The type of the event. Always `response.output_text.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the text delta was added to. + output_index: + type: integer + description: The index of the output item that the text delta was added to. + content_index: + type: integer + description: The index of the content part that the text delta was added to. + delta: + type: string + description: The text delta that was added. + sequence_number: + type: integer + description: The sequence number for this event. + logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.ResponseLogProb' + description: The log probabilities of the tokens in the delta. + description: Emitted when there is an additional text delta. + x-oaiMeta: + name: response.output_text.delta + group: responses + example: | + { + "type": "response.output_text.delta", + "item_id": "msg_123", + "output_index": 0, + "content_index": 0, + "delta": "In", + "sequence_number": 1 + } + OpenAI.ResponseTextParam: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' + verbosity: + $ref: '#/components/schemas/OpenAI.Verbosity' + description: |- + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + OpenAI.ResponseUsage: + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + properties: + input_tokens: + type: integer + description: The number of input tokens. + input_tokens_details: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails' + description: A detailed breakdown of the input tokens. + output_tokens: + type: integer + description: The number of output tokens. + output_tokens_details: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails' + description: A detailed breakdown of the output tokens. + total_tokens: + type: integer + description: The total number of tokens used. + description: |- + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + OpenAI.ResponseUsageInputTokensDetails: + type: object + required: + - cached_tokens + properties: + cached_tokens: + type: integer + OpenAI.ResponseUsageOutputTokensDetails: + type: object + required: + - reasoning_tokens + properties: + reasoning_tokens: + type: integer + OpenAI.ResponseWebSearchCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.web_search_call.in_progress + description: The type of the event. Always `response.web_search_call.in_progress`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the web search call is associated with. + item_id: + type: string + description: Unique ID for the output item associated with the web search call. + sequence_number: + type: integer + description: The sequence number of the web search call being processed. + description: 'Note: web_search is not yet available via Azure OpenAI.' + x-oaiMeta: + name: response.web_search_call.in_progress + group: responses + example: | + { + "type": "response.web_search_call.in_progress", + "output_index": 0, + "item_id": "ws_123", + "sequence_number": 0 + } + OpenAI.ResponseWebSearchCallSearchingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.web_search_call.searching + description: The type of the event. Always `response.web_search_call.searching`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the web search call is associated with. + item_id: + type: string + description: Unique ID for the output item associated with the web search call. + sequence_number: + type: integer + description: The sequence number of the web search call being processed. + description: 'Note: web_search is not yet available via Azure OpenAI.' + x-oaiMeta: + name: response.web_search_call.searching + group: responses + example: | + { + "type": "response.web_search_call.searching", + "output_index": 0, + "item_id": "ws_123", + "sequence_number": 0 + } + OpenAI.RunCompletionUsage: + type: object + required: + - completion_tokens + - prompt_tokens + - total_tokens + properties: + completion_tokens: + type: integer + description: Number of completion tokens used over the course of the run. + prompt_tokens: + type: integer + description: Number of prompt tokens used over the course of the run. + total_tokens: + type: integer + description: Total number of tokens used (prompt + completion). + description: Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). + OpenAI.RunGraderRequest: + type: object + required: + - grader + - model_sample + properties: + grader: + anyOf: + - $ref: '#/components/schemas/OpenAI.GraderStringCheck' + - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.GraderPython' + - $ref: '#/components/schemas/OpenAI.GraderScoreModel' + - $ref: '#/components/schemas/OpenAI.GraderMulti' + - $ref: '#/components/schemas/GraderEndpoint' + description: The grader used for the fine-tuning job. + item: + allOf: + - $ref: '#/components/schemas/OpenAI.RunGraderRequestItem' + description: |- + The dataset item provided to the grader. This will be used to populate + the `item` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. + model_sample: + type: string + description: |- + The model sample to be evaluated. This value will be used to populate + the `sample` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. + The `output_json` variable will be populated if the model sample is a + valid JSON string. + title: RunGraderRequest + OpenAI.RunGraderRequestItem: + type: object + OpenAI.RunGraderResponse: + type: object + required: + - reward + - metadata + - sub_rewards + - model_grader_token_usage_per_model + properties: + reward: + type: number + metadata: + $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadata' + sub_rewards: + type: object + unevaluatedProperties: {} + model_grader_token_usage_per_model: + type: object + unevaluatedProperties: {} + OpenAI.RunGraderResponseMetadata: + type: object + required: + - name + - type + - errors + - execution_time + - scores + - token_usage + - sampled_model_name + properties: + name: + type: string + type: + type: string + errors: + $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadataErrors' + execution_time: + type: number + scores: + type: object + unevaluatedProperties: {} + token_usage: + anyOf: + - type: integer + - type: 'null' + sampled_model_name: + anyOf: + - type: string + - type: 'null' + OpenAI.RunGraderResponseMetadataErrors: + type: object + required: + - formula_parse_error + - sample_parse_error + - truncated_observation_error + - unresponsive_reward_error + - invalid_variable_error + - other_error + - python_grader_server_error + - python_grader_server_error_type + - python_grader_runtime_error + - python_grader_runtime_error_details + - model_grader_server_error + - model_grader_refusal_error + - model_grader_parse_error + - model_grader_server_error_details + properties: + formula_parse_error: + type: boolean + sample_parse_error: + type: boolean + truncated_observation_error: + type: boolean + unresponsive_reward_error: + type: boolean + invalid_variable_error: + type: boolean + other_error: + type: boolean + python_grader_server_error: + type: boolean + python_grader_server_error_type: + anyOf: + - type: string + - type: 'null' + python_grader_runtime_error: + type: boolean + python_grader_runtime_error_details: + anyOf: + - type: string + - type: 'null' + model_grader_server_error: + type: boolean + model_grader_refusal_error: + type: boolean + model_grader_parse_error: + type: boolean + model_grader_server_error_details: + anyOf: + - type: string + - type: 'null' + OpenAI.RunObject: + type: object + required: + - id + - object + - created_at + - thread_id + - assistant_id + - status + - required_action + - last_error + - expires_at + - started_at + - cancelled_at + - failed_at + - completed_at + - incomplete_details + - model + - instructions + - tools + - metadata + - usage + - max_prompt_tokens + - max_completion_tokens + - truncation_strategy + - tool_choice + - parallel_tool_calls + - response_format + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - thread.run + description: The object type, which is always `thread.run`. + x-stainless-const: true + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the run was created. + thread_id: + type: string + description: The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + assistant_id: + type: string + description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + status: + $ref: '#/components/schemas/OpenAI.RunStatus' + required_action: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunObjectRequiredAction' + - type: 'null' + description: Details on the action required to continue the run. Will be `null` if no action is required. + last_error: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunObjectLastError' + - type: 'null' + description: The last error associated with this run. Will be `null` if there are no errors. + expires_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + description: The Unix timestamp (in seconds) for when the run will expire. + started_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + description: The Unix timestamp (in seconds) for when the run was started. + cancelled_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + description: The Unix timestamp (in seconds) for when the run was cancelled. + failed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + description: The Unix timestamp (in seconds) for when the run failed. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + description: The Unix timestamp (in seconds) for when the run was completed. + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunObjectIncompleteDetails' + - type: 'null' + description: Details on why the run is incomplete. Will be `null` if the run is not incomplete. + model: + type: string + description: The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + instructions: + type: string + description: The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + tools: + type: array + items: + $ref: '#/components/schemas/OpenAI.AssistantTool' + maxItems: 20 + description: The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + default: [] + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + usage: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunCompletionUsage' + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + description: The sampling temperature used for this run. If not set, defaults to 1. + top_p: + anyOf: + - type: number + - type: 'null' + description: The nucleus sampling value used for this run. If not set, defaults to 1. + max_prompt_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 256 + description: The maximum number of prompt tokens specified to have been used over the course of the run. + max_completion_tokens: + anyOf: + - type: integer + - type: 'null' + minimum: 256 + description: The maximum number of completion tokens specified to have been used over the course of the run. + truncation_strategy: + $ref: '#/components/schemas/OpenAI.TruncationObject' + tool_choice: + $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption' + parallel_tool_calls: + $ref: '#/components/schemas/OpenAI.ParallelToolCalls' + response_format: + $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption' + description: Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). + title: A run on a thread + x-oaiMeta: + name: The run object + beta: true + example: | + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1698107661, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699073476, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699073498, + "last_error": null, + "model": "gpt-4o", + "instructions": null, + "tools": [{"type": "file_search"}, {"type": "code_interpreter"}], + "metadata": {}, + "incomplete_details": null, + "usage": { + "prompt_tokens": 123, + "completion_tokens": 456, + "total_tokens": 579 + }, + "temperature": 1.0, + "top_p": 1.0, + "max_prompt_tokens": 1000, + "max_completion_tokens": 1000, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "response_format": "auto", + "tool_choice": "auto", + "parallel_tool_calls": true + } + OpenAI.RunObjectIncompleteDetails: + type: object + properties: + reason: + type: string + enum: + - max_completion_tokens + - max_prompt_tokens + OpenAI.RunObjectLastError: + type: object + required: + - code + - message + properties: + code: + type: string + enum: + - server_error + - rate_limit_exceeded + - invalid_prompt + message: + type: string + OpenAI.RunObjectRequiredAction: + type: object + required: + - type + - submit_tool_outputs + properties: + type: + type: string + enum: + - submit_tool_outputs + x-stainless-const: true + submit_tool_outputs: + $ref: '#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs' + OpenAI.RunObjectRequiredActionSubmitToolOutputs: + type: object + required: + - tool_calls + properties: + tool_calls: + type: array + items: + $ref: '#/components/schemas/OpenAI.RunToolCallObject' + OpenAI.RunStatus: + type: string + enum: + - queued + - in_progress + - requires_action + - cancelling + - cancelled + - failed + - completed + - incomplete + - expired + description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. + OpenAI.RunStepCompletionUsage: + type: object + required: + - completion_tokens + - prompt_tokens + - total_tokens + properties: + completion_tokens: + type: integer + description: Number of completion tokens used over the course of the run step. + prompt_tokens: + type: integer + description: Number of prompt tokens used over the course of the run step. + total_tokens: + type: integer + description: Total number of tokens used (prompt + completion). + description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + OpenAI.RunStepDetailsMessageCreationObject: + type: object + required: + - type + - message_creation + properties: + type: + type: string + enum: + - message_creation + description: Always `message_creation`. + x-stainless-const: true + message_creation: + $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation' + description: Details of the message creation by the run step. + title: Message creation + OpenAI.RunStepDetailsMessageCreationObjectMessageCreation: + type: object + required: + - message_id + properties: + message_id: + type: string + OpenAI.RunStepDetailsToolCall: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallType' + discriminator: + propertyName: type + mapping: + code_interpreter: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject' + file_search: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject' + function: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject' + OpenAI.RunStepDetailsToolCallType: + anyOf: + - type: string + - type: string + enum: + - code_interpreter + - file_search + - function + OpenAI.RunStepDetailsToolCallsCodeObject: + type: object + required: + - id + - type + - code_interpreter + properties: + id: + type: string + description: The ID of the tool call. + type: + type: string + enum: + - code_interpreter + description: The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + x-stainless-const: true + code_interpreter: + allOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter' + description: The Code Interpreter tool call definition. + allOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' + description: Details of the Code Interpreter tool call the run step was involved in. + title: Code Interpreter tool call + OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter: + type: object + required: + - input + - outputs + properties: + input: + type: string + outputs: + type: array + items: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject' + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject' + OpenAI.RunStepDetailsToolCallsCodeOutputImageObject: + type: object + required: + - type + - image + properties: + type: + type: string + enum: + - image + description: Always `image`. + x-stainless-const: true + image: + $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage' + title: Code Interpreter image output + x-stainless-naming: + java: + type_name: ImageOutput + kotlin: + type_name: ImageOutput + OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage: + type: object + required: + - file_id + properties: + file_id: + type: string + OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject: + type: object + required: + - type + - logs + properties: + type: + type: string + enum: + - logs + description: Always `logs`. + x-stainless-const: true + logs: + type: string + description: The text output from the Code Interpreter tool call. + description: Text output from the Code Interpreter tool call as part of a run step. + title: Code Interpreter log output + x-stainless-naming: + java: + type_name: LogsOutput + kotlin: + type_name: LogsOutput + OpenAI.RunStepDetailsToolCallsFileSearchObject: + type: object + required: + - id + - type + - file_search + properties: + id: + type: string + description: The ID of the tool call object. + type: + type: string + enum: + - file_search + description: The type of tool call. This is always going to be `file_search` for this type of tool call. + x-stainless-const: true + file_search: + allOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch' + description: For now, this is always going to be an empty object. + x-oaiTypeLabel: map + allOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' + title: File search tool call + OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch: + type: object + properties: + ranking_options: + $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject' + results: + type: array + items: + $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject' + OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject: + type: object + required: + - ranker + - score_threshold + properties: + ranker: + $ref: '#/components/schemas/OpenAI.FileSearchRanker' + score_threshold: + type: number + minimum: 0 + maximum: 1 + description: The score threshold for the file search. All values must be a floating point number between 0 and 1. + description: The ranking options for the file search. + title: File search tool call ranking options + OpenAI.RunStepDetailsToolCallsFileSearchResultObject: + type: object + required: + - file_id + - file_name + - score + properties: + file_id: + type: string + description: The ID of the file that result was found in. + file_name: + type: string + description: The name of the file that result was found in. + score: + type: number + minimum: 0 + maximum: 1 + description: The score of the result. All values must be a floating point number between 0 and 1. + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent' + description: The content of the result that was found. The content is only included if requested via the include query parameter. + description: A result instance of the file search. + title: File search tool call result + x-oaiTypeLabel: map + OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent: + type: object + properties: + type: + type: string + enum: + - text + x-stainless-const: true + text: + type: string + OpenAI.RunStepDetailsToolCallsFunctionObject: + type: object + required: + - id + - type + - function + properties: + id: + type: string + description: The ID of the tool call object. + type: + type: string + enum: + - function + description: The type of tool call. This is always going to be `function` for this type of tool call. + x-stainless-const: true + function: + allOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction' + description: The definition of the function that was called. + allOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' + title: Function tool call + OpenAI.RunStepDetailsToolCallsFunctionObjectFunction: + type: object + required: + - name + - arguments + - output + properties: + name: + type: string + arguments: + type: string + output: + anyOf: + - type: string + - type: 'null' + OpenAI.RunStepDetailsToolCallsObject: + type: object + required: + - type + - tool_calls + properties: + type: + type: string + enum: + - tool_calls + description: Always `tool_calls`. + x-stainless-const: true + tool_calls: + type: array + items: + $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' + description: 'An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.' + description: Details of the tool call. + title: Tool calls + OpenAI.RunStepObject: + type: object + required: + - id + - object + - created_at + - assistant_id + - thread_id + - run_id + - type + - status + - step_details + - last_error + - expired_at + - cancelled_at + - failed_at + - completed_at + - metadata + - usage + properties: + id: + type: string + description: The identifier of the run step, which can be referenced in API endpoints. + object: + type: string + enum: + - thread.run.step + description: The object type, which is always `thread.run.step`. + x-stainless-const: true + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the run step was created. + assistant_id: + type: string + description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + thread_id: + type: string + description: The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + run_id: + type: string + description: The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + type: + type: string + enum: + - message_creation + - tool_calls + description: The type of run step, which can be either `message_creation` or `tool_calls`. + status: + type: string + enum: + - in_progress + - cancelled + - failed + - completed + - expired + description: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + step_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject' + - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsObject' + description: The details of the run step. + last_error: + anyOf: + - $ref: '#/components/schemas/OpenAI.RunStepObjectLastError' + - type: 'null' + expired_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + cancelled_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + failed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + usage: + $ref: '#/components/schemas/OpenAI.RunStepCompletionUsage' + description: Represents a step in execution of a run. + title: Run steps + x-oaiMeta: + name: The run step object + beta: true + example: | + { + "id": "step_abc123", + "object": "thread.run.step", + "created_at": 1699063291, + "run_id": "run_abc123", + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "type": "message_creation", + "status": "completed", + "cancelled_at": null, + "completed_at": 1699063291, + "expired_at": null, + "failed_at": null, + "last_error": null, + "step_details": { + "type": "message_creation", + "message_creation": { + "message_id": "msg_abc123" + } + }, + "usage": { + "prompt_tokens": 123, + "completion_tokens": 456, + "total_tokens": 579 + } + } + OpenAI.RunStepObjectLastError: + type: object + required: + - code + - message + properties: + code: + type: string + enum: + - server_error + - rate_limit_exceeded + message: + type: string + OpenAI.RunToolCallObject: + type: object + required: + - id + - type + - function + properties: + id: + type: string + description: The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + type: + type: string + enum: + - function + description: The type of tool call the output is required for. For now, this is always `function`. + x-stainless-const: true + function: + allOf: + - $ref: '#/components/schemas/OpenAI.RunToolCallObjectFunction' + description: The function definition. + description: Tool call objects + OpenAI.RunToolCallObjectFunction: + type: object + required: + - name + - arguments + properties: + name: + type: string + arguments: + type: string + OpenAI.Screenshot: + type: object + required: + - type + properties: + type: + type: string + enum: + - screenshot + description: |- + Specifies the event type. For a screenshot action, this property is + always set to `screenshot`. + x-stainless-const: true + default: screenshot + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A screenshot action. + title: Screenshot + OpenAI.Scroll: + type: object + required: + - type + - x + - 'y' + - scroll_x + - scroll_y + properties: + type: + type: string + enum: + - scroll + description: |- + Specifies the event type. For a scroll action, this property is + always set to `scroll`. + x-stainless-const: true + default: scroll + x: + type: integer + description: The x-coordinate where the scroll occurred. + 'y': + type: integer + description: The y-coordinate where the scroll occurred. + scroll_x: + type: integer + description: The horizontal scroll distance. + scroll_y: + type: integer + description: The vertical scroll distance. + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A scroll action. + title: Scroll + OpenAI.SearchContextSize: + type: string + enum: + - low + - medium + - high + OpenAI.SpecificApplyPatchParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - apply_patch + description: The tool to call. Always `apply_patch`. + x-stainless-const: true + default: apply_patch + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: Forces the model to call the apply_patch tool when executing a tool call. + title: Specific apply patch tool choice + OpenAI.SpecificFunctionShellParam: + type: object + required: + - type + properties: + type: + type: string + enum: + - shell + description: The tool to call. Always `shell`. + x-stainless-const: true + default: shell + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: Forces the model to call the shell tool when a tool call is required. + title: Specific shell tool choice + OpenAI.StaticChunkingStrategy: + type: object + required: + - max_chunk_size_tokens + - chunk_overlap_tokens + properties: + max_chunk_size_tokens: + type: integer + minimum: 100 + maximum: 4096 + description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + chunk_overlap_tokens: + type: integer + description: |- + The number of tokens that overlap between chunks. The default value is `400`. + Note that the overlap must not exceed half of `max_chunk_size_tokens`. + OpenAI.StaticChunkingStrategyRequestParam: + type: object + required: + - type + - static + properties: + type: + type: string + enum: + - static + description: Always `static`. + x-stainless-const: true + static: + $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy' + allOf: + - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' + description: Customize your own chunking strategy by setting chunk size and chunk overlap. + title: Static Chunking Strategy + OpenAI.StaticChunkingStrategyResponseParam: + type: object + required: + - type + - static + properties: + type: + type: string + enum: + - static + description: Always `static`. + x-stainless-const: true + static: + $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy' + allOf: + - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse' + title: Static Chunking Strategy + OpenAI.StopConfiguration: + anyOf: + - anyOf: + - type: string + - type: 'null' + - type: array + items: + type: string + - type: 'null' + description: |- + Not supported with latest reasoning models `o3` and `o4-mini`. + Up to 4 sequences where the API will stop generating further tokens. The + returned text will not contain the stop sequence. + OpenAI.SubmitToolOutputsRunRequest: + type: object + required: + - tool_outputs + properties: + tool_outputs: + type: array + items: + $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs' + description: A list of tools for which the outputs are being submitted. + stream: + anyOf: + - type: boolean + - type: 'null' + OpenAI.SubmitToolOutputsRunRequestToolOutputs: + type: object + properties: + tool_call_id: + type: string + output: + type: string + OpenAI.Summary: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - summary_text + description: The type of the object. Always `summary_text`. + x-stainless-const: true + default: summary_text + text: + type: string + description: A summary of the reasoning output from the model so far. + description: A summary text from the model. + title: Summary text + OpenAI.SummaryTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - summary_text + description: The type of the object. Always `summary_text`. + x-stainless-const: true + default: summary_text + text: + type: string + description: A summary of the reasoning output from the model so far. + description: A summary text from the model. + title: Summary text + OpenAI.TextAnnotation: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.TextAnnotationType' + discriminator: + propertyName: type + mapping: + file_citation: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject' + file_path: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject' + OpenAI.TextAnnotationType: + anyOf: + - type: string + - type: string + enum: + - file_citation + - file_path + OpenAI.TextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + x-stainless-const: true + default: text + text: + type: string + description: A text content. + title: Text Content + OpenAI.TextResponseFormatConfiguration: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType' + discriminator: + propertyName: type + mapping: + json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema' + text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText' + json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject' + description: |- + An object specifying the format that the model must output. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The default format is `{ "type": "text" }` with no additional options. + *Not recommended for gpt-4o and newer models:** + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: The type of response format being defined. Always `json_object`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' + description: |- + JSON object response format. An older method of generating JSON responses. + Using `json_schema` is recommended for models that support it. Note that the + model will not generate JSON without a system or user message instructing it + to do so. + title: JSON object + OpenAI.TextResponseFormatConfigurationResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: The type of response format being defined. Always `text`. + x-stainless-const: true + allOf: + - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' + description: Default response format. Used to generate text responses. + title: Text + OpenAI.TextResponseFormatConfigurationType: + anyOf: + - type: string + - type: string + enum: + - text + - json_schema + - json_object + OpenAI.TextResponseFormatJsonSchema: + type: object + required: + - type + - name + - schema + properties: + type: + type: string + enum: + - json_schema + description: The type of response format being defined. Always `json_schema`. + x-stainless-const: true + description: + type: string + description: |- + A description of what the response format is for, used by the model to + determine how to respond in the format. + name: + type: string + description: |- + The name of the response format. Must be a-z, A-Z, 0-9, or contain + underscores and dashes, with a maximum length of 64. + schema: + $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema' + strict: + anyOf: + - type: boolean + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' + description: |- + JSON Schema response format. Used to generate structured JSON responses. + Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). + title: JSON schema + OpenAI.ThreadObject: + type: object + required: + - id + - object + - created_at + - tool_resources + - metadata + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - thread + description: The object type, which is always `thread`. + x-stainless-const: true + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the thread was created. + tool_resources: + anyOf: + - $ref: '#/components/schemas/OpenAI.ThreadObjectToolResources' + - type: 'null' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). + title: Thread + x-oaiMeta: + name: The thread object + beta: true + example: | + { + "id": "thread_abc123", + "object": "thread", + "created_at": 1698107661, + "metadata": {} + } + OpenAI.ThreadObjectToolResources: + type: object + properties: + code_interpreter: + $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter' + file_search: + $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch' + OpenAI.ThreadObjectToolResourcesCodeInterpreter: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + OpenAI.ThreadObjectToolResourcesFileSearch: + type: object + properties: + vector_store_ids: + type: array + items: + type: string + maxItems: 1 + OpenAI.TokenLimits: + type: object + properties: + post_instructions: + type: integer + minimum: 0 + OpenAI.Tool: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ToolType' + discriminator: + propertyName: type + mapping: + code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool' + function: '#/components/schemas/OpenAI.FunctionTool' + file_search: '#/components/schemas/OpenAI.FileSearchTool' + computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool' + web_search: '#/components/schemas/OpenAI.WebSearchTool' + mcp: '#/components/schemas/OpenAI.MCPTool' + image_generation: '#/components/schemas/OpenAI.ImageGenTool' + local_shell: '#/components/schemas/OpenAI.LocalShellToolParam' + shell: '#/components/schemas/OpenAI.FunctionShellToolParam' + custom: '#/components/schemas/OpenAI.CustomToolParam' + web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool' + apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam' + description: A tool that can be used to generate a response. + OpenAI.ToolChoiceAllowed: + type: object + required: + - type + - mode + - tools + properties: + type: + type: string + enum: + - allowed_tools + description: Allowed tool configuration type. Always `allowed_tools`. + x-stainless-const: true + mode: + type: string + enum: + - auto + - required + description: |- + Constrains the tools available to the model to a pre-defined set. + `auto` allows the model to pick from among the allowed tools and generate a + message. + `required` requires the model to call one or more of the allowed tools. + tools: + type: array + items: + type: object + unevaluatedProperties: {} + description: |- + A list of tool definitions that the model should be allowed to call. + For the Responses API, the list of tool definitions might look like: + ```json + [ + { "type": "function", "name": "get_weather" }, + { "type": "mcp", "server_label": "deepwiki" }, + { "type": "image_generation" } + ] + ``` + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: Constrains the tools available to the model to a pre-defined set. + title: Allowed tools + OpenAI.ToolChoiceCodeInterpreter: + type: object + required: + - type + properties: + type: + type: string + enum: + - code_interpreter + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: |- + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + OpenAI.ToolChoiceComputerUsePreview: + type: object + required: + - type + properties: + type: + type: string + enum: + - computer_use_preview + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: |- + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + OpenAI.ToolChoiceCustom: + type: object + required: + - type + - name + properties: + type: + type: string + enum: + - custom + description: For custom tool calling, the type is always `custom`. + x-stainless-const: true + name: + type: string + description: The name of the custom tool to call. + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: Use this option to force the model to call a specific custom tool. + title: Custom tool + OpenAI.ToolChoiceFileSearch: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_search + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: |- + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + OpenAI.ToolChoiceFunction: + type: object + required: + - type + - name + properties: + type: + type: string + enum: + - function + description: For function calling, the type is always `function`. + x-stainless-const: true + name: + type: string + description: The name of the function to call. + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: Use this option to force the model to call a specific function. + title: Function tool + OpenAI.ToolChoiceImageGeneration: + type: object + required: + - type + properties: + type: + type: string + enum: + - image_generation + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: |- + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + OpenAI.ToolChoiceMCP: + type: object + required: + - type + - server_label + properties: + type: + type: string + enum: + - mcp + description: For MCP tools, the type is always `mcp`. + x-stainless-const: true + server_label: + type: string + description: The label of the MCP server to use. + name: + anyOf: + - type: string + - type: 'null' + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: Use this option to force the model to call a specific tool on a remote MCP server. + title: MCP tool + OpenAI.ToolChoiceOptions: + type: string + enum: + - none + - auto + - required + description: |- + Controls which (if any) tool is called by the model. + `none` means the model will not call any tool and instead generates a message. + `auto` means the model can pick between generating a message or calling one or + more tools. + `required` means the model must call one or more tools. + title: Tool choice mode + OpenAI.ToolChoiceParam: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ToolChoiceParamType' + discriminator: + propertyName: type + mapping: + allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed' + mcp: '#/components/schemas/OpenAI.ToolChoiceMCP' + custom: '#/components/schemas/OpenAI.ToolChoiceCustom' + apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam' + shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam' + file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch' + web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview' + computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview' + web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311' + image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration' + code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter' + description: |- + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + OpenAI.ToolChoiceParamType: + anyOf: + - type: string + - type: string + enum: + - allowed_tools + - function + - mcp + - custom + - apply_patch + - shell + - file_search + - web_search_preview + - computer_use_preview + - web_search_preview_2025_03_11 + - image_generation + - code_interpreter + OpenAI.ToolChoiceWebSearchPreview: + type: object + required: + - type + properties: + type: + type: string + enum: + - web_search_preview + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: 'Note: web_search is not yet available via Azure OpenAI.' + OpenAI.ToolChoiceWebSearchPreview20250311: + type: object + required: + - type + properties: + type: + type: string + enum: + - web_search_preview_2025_03_11 + allOf: + - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + description: |- + Indicates that the model should use a built-in tool to generate a response. + [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). + OpenAI.ToolType: + anyOf: + - type: string + - type: string + enum: + - function + - file_search + - computer_use_preview + - web_search + - mcp + - code_interpreter + - image_generation + - local_shell + - shell + - custom + - web_search_preview + - apply_patch + OpenAI.ToolsArray: + type: array + items: + $ref: '#/components/schemas/OpenAI.Tool' + description: |- + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + We support the following categories of tools: + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. + OpenAI.TopLogProb: + type: object + required: + - token + - logprob + - bytes + properties: + token: + type: string + logprob: + type: number + bytes: + type: array + items: + type: integer + description: The top log probability of a token. + title: Top log probability + OpenAI.TranscriptionSegment: + type: object + required: + - id + - seek + - start + - end + - text + - tokens + - temperature + - avg_logprob + - compression_ratio + - no_speech_prob + properties: + id: + type: integer + description: Unique identifier of the segment. + seek: + type: integer + description: Seek offset of the segment. + start: + type: number + format: float + description: Start time of the segment in seconds. + end: + type: number + format: float + description: End time of the segment in seconds. + text: + type: string + description: Text content of the segment. + tokens: + type: array + items: + type: integer + description: Array of token IDs for the text content. + temperature: + type: number + format: float + description: Temperature parameter used for generating the segment. + avg_logprob: + type: number + format: float + description: Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. + compression_ratio: + type: number + format: float + description: Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. + no_speech_prob: + type: number + format: float + description: Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent. + OpenAI.TranscriptionWord: + type: object + required: + - word + - start + - end + properties: + word: + type: string + description: The text content of the word. + start: + type: number + format: float + description: Start time of the word in seconds. + end: + type: number + format: float + description: End time of the word in seconds. + OpenAI.TruncationObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - auto + - last_messages + description: The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + last_messages: + anyOf: + - type: integer + - type: 'null' + description: Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. + title: Thread Truncation Controls + OpenAI.Type: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - type + description: |- + Specifies the event type. For a type action, this property is + always set to `type`. + x-stainless-const: true + default: type + text: + type: string + description: The text to type. + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: An action to type in text. + title: Type + OpenAI.UpdateConversationBody: + type: object + required: + - metadata + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: |- + Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. + Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. + OpenAI.UpdateVectorStoreFileAttributesRequest: + type: object + required: + - attributes + properties: + attributes: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' + - type: 'null' + x-oaiMeta: + name: Update vector store file attributes request + OpenAI.UpdateVectorStoreRequest: + type: object + properties: + name: + anyOf: + - type: string + - type: 'null' + description: The name of the vector store. + expires_after: + $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter' + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + OpenAI.UrlCitationBody: + type: object + required: + - type + - url + - start_index + - end_index + - title + properties: + type: + type: string + enum: + - url_citation + description: The type of the URL citation. Always `url_citation`. + x-stainless-const: true + default: url_citation + url: + type: string + format: uri + description: The URL of the web resource. + start_index: + type: integer + description: The index of the first character of the URL citation in the message. + end_index: + type: integer + description: The index of the last character of the URL citation in the message. + title: + type: string + description: The title of the web resource. + allOf: + - $ref: '#/components/schemas/OpenAI.Annotation' + description: A citation for a web resource used to generate a model response. + title: URL citation + OpenAI.ValidateGraderResponse: + type: object + properties: + grader: + anyOf: + - $ref: '#/components/schemas/OpenAI.GraderStringCheck' + - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' + - $ref: '#/components/schemas/OpenAI.GraderPython' + - $ref: '#/components/schemas/OpenAI.GraderScoreModel' + - $ref: '#/components/schemas/OpenAI.GraderMulti' + - $ref: '#/components/schemas/GraderEndpoint' + description: The grader used for the fine-tuning job. + title: ValidateGraderResponse + OpenAI.VectorStoreExpirationAfter: + type: object + required: + - anchor + - days + properties: + anchor: + type: string + enum: + - last_active_at + description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.' + x-stainless-const: true + days: + type: integer + minimum: 1 + maximum: 365 + description: The number of days after the anchor time that the vector store will expire. + description: The expiration policy for a vector store. + title: Vector store expiration policy + OpenAI.VectorStoreFileAttributes: + type: object + unevaluatedProperties: + anyOf: + - type: string + - type: number + - type: boolean + description: |- + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. Keys are strings + with a maximum length of 64 characters. Values are strings with a maximum + length of 512 characters, booleans, or numbers. + x-oaiTypeLabel: map + OpenAI.VectorStoreFileBatchObject: + type: object + required: + - id + - object + - created_at + - vector_store_id + - status + - file_counts + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - vector_store.files_batch + description: The object type, which is always `vector_store.file_batch`. + x-stainless-const: true + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the vector store files batch was created. + vector_store_id: + type: string + description: The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. + status: + type: string + enum: + - in_progress + - completed + - cancelled + - failed + description: The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. + file_counts: + $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts' + description: A batch of files attached to a vector store. + title: Vector store file batch + x-oaiMeta: + name: The vector store files batch object + beta: true + example: | + { + "id": "vsfb_123", + "object": "vector_store.files_batch", + "created_at": 1698107661, + "vector_store_id": "vs_abc123", + "status": "completed", + "file_counts": { + "in_progress": 0, + "completed": 100, + "failed": 0, + "cancelled": 0, + "total": 100 + } + } + OpenAI.VectorStoreFileBatchObjectFileCounts: + type: object + required: + - in_progress + - completed + - failed + - cancelled + - total + properties: + in_progress: + type: integer + completed: + type: integer + failed: + type: integer + cancelled: + type: integer + total: + type: integer + OpenAI.VectorStoreFileObject: + type: object + required: + - id + - object + - usage_bytes + - created_at + - vector_store_id + - status + - last_error + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - vector_store.file + description: The object type, which is always `vector_store.file`. + x-stainless-const: true + usage_bytes: + type: integer + description: The total vector store usage in bytes. Note that this may be different from the original file size. + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the vector store file was created. + vector_store_id: + type: string + description: The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. + status: + type: string + enum: + - in_progress + - completed + - cancelled + - failed + description: The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. + last_error: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileObjectLastError' + - type: 'null' + chunking_strategy: + $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse' + attributes: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' + - type: 'null' + description: A list of files attached to a vector store. + title: Vector store files + x-oaiMeta: + name: The vector store file object + beta: true + example: | + { + "id": "file-abc123", + "object": "vector_store.file", + "usage_bytes": 1234, + "created_at": 1698107661, + "vector_store_id": "vs_abc123", + "status": "completed", + "last_error": null, + "chunking_strategy": { + "type": "static", + "static": { + "max_chunk_size_tokens": 800, + "chunk_overlap_tokens": 400 + } + } + } + OpenAI.VectorStoreFileObjectLastError: + type: object + required: + - code + - message + properties: + code: + type: string + enum: + - server_error + - unsupported_file + - invalid_file + message: + type: string + OpenAI.VectorStoreObject: + type: object + required: + - id + - object + - created_at + - name + - usage_bytes + - file_counts + - status + - last_active_at + - metadata + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - vector_store + description: The object type, which is always `vector_store`. + x-stainless-const: true + created_at: + type: integer + format: unixtime + description: The Unix timestamp (in seconds) for when the vector store was created. + name: + type: string + description: The name of the vector store. + usage_bytes: + type: integer + description: The total number of bytes used by the files in the vector store. + file_counts: + $ref: '#/components/schemas/OpenAI.VectorStoreObjectFileCounts' + status: + type: string + enum: + - expired + - in_progress + - completed + description: The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. + expires_after: + $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter' + expires_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + last_active_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + description: A vector store is a collection of processed files can be used by the `file_search` tool. + title: Vector store + x-oaiMeta: + name: The vector store object + example: | + { + "id": "vs_123", + "object": "vector_store", + "created_at": 1698107661, + "usage_bytes": 123456, + "last_active_at": 1698107661, + "name": "my_vector_store", + "status": "completed", + "file_counts": { + "in_progress": 0, + "completed": 100, + "cancelled": 0, + "failed": 0, + "total": 100 + }, + "last_used_at": 1698107661 + } + OpenAI.VectorStoreObjectFileCounts: + type: object + required: + - in_progress + - completed + - failed + - cancelled + - total + properties: + in_progress: + type: integer + completed: + type: integer + failed: + type: integer + cancelled: + type: integer + total: + type: integer + OpenAI.VectorStoreSearchRequest: + type: object + required: + - query + properties: + query: + anyOf: + - type: string + - type: array + items: + type: string + description: A query string for a search + rewrite_query: + type: boolean + description: Whether to rewrite the natural language query for vector search. + max_num_results: + type: integer + minimum: 1 + maximum: 50 + description: The maximum number of results to return. This number should be between 1 and 50 inclusive. + default: 10 + filters: + anyOf: + - $ref: '#/components/schemas/OpenAI.ComparisonFilter' + - $ref: '#/components/schemas/OpenAI.CompoundFilter' + description: A filter to apply based on file attributes. + ranking_options: + allOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions' + description: Ranking options for search. + x-oaiMeta: + name: Vector store search request + OpenAI.VectorStoreSearchRequestRankingOptions: + type: object + properties: + ranker: + type: string + enum: + - none + - auto + - default-2024-11-15 + default: auto + score_threshold: + type: number + minimum: 0 + maximum: 1 + OpenAI.VectorStoreSearchResultContentObject: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: The type of content. + text: + type: string + description: The text content returned from search. + x-oaiMeta: + name: Vector store search result content object + OpenAI.VectorStoreSearchResultItem: + type: object + required: + - file_id + - filename + - score + - attributes + - content + properties: + file_id: + type: string + description: The ID of the vector store file. + filename: + type: string + description: The name of the vector store file. + score: + type: number + minimum: 0 + maximum: 1 + description: The similarity score for the result. + attributes: + anyOf: + - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' + - type: 'null' + content: + type: array + items: + $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultContentObject' + description: Content chunks from the file. + x-oaiMeta: + name: Vector store search result item + OpenAI.VectorStoreSearchResultsPage: + type: object + required: + - object + - search_query + - data + - has_more + - next_page + properties: + object: + type: string + enum: + - vector_store.search_results.page + description: The object type, which is always `vector_store.search_results.page` + x-stainless-const: true + search_query: + type: array + items: + type: string + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultItem' + description: The list of search result items. + has_more: + type: boolean + description: Indicates if there are more results to fetch. + next_page: + anyOf: + - type: string + - type: 'null' + x-oaiMeta: + name: Vector store search results page + OpenAI.Verbosity: + anyOf: + - type: string + enum: + - low + - medium + - high + - type: 'null' + description: |- + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. + OpenAI.VoiceIdsShared: + anyOf: + - type: string + - type: string + enum: + - alloy + - ash + - ballad + - coral + - echo + - sage + - shimmer + - verse + - marin + - cedar + OpenAI.Wait: + type: object + required: + - type + properties: + type: + type: string + enum: + - wait + description: |- + Specifies the event type. For a wait action, this property is + always set to `wait`. + x-stainless-const: true + default: wait + allOf: + - $ref: '#/components/schemas/OpenAI.ComputerAction' + description: A wait action. + title: Wait + OpenAI.WebSearchActionFind: + type: object + required: + - type + - url + - pattern + properties: + type: + type: string + enum: + - find_in_page + description: The action type. + x-stainless-const: true + url: + type: string + format: uri + description: The URL of the page searched for the pattern. + pattern: + type: string + description: The pattern or text to search for within the page. + description: 'Action type "find": Searches for a pattern within a loaded page.' + title: Find action + OpenAI.WebSearchActionOpenPage: + type: object + required: + - type + - url + properties: + type: + type: string + enum: + - open_page + description: The action type. + x-stainless-const: true + url: + type: string + format: uri + description: The URL opened by the model. + description: Action type "open_page" - Opens a specific URL from search results. + title: Open page action + OpenAI.WebSearchActionSearch: + type: object + required: + - type + - query + properties: + type: + type: string + enum: + - search + description: The action type. + x-stainless-const: true + query: + type: string + description: '[DEPRECATED] The search query.' + deprecated: true + queries: + type: array + items: + type: string + description: The search queries. + title: Search queries + sources: + type: array + items: + $ref: '#/components/schemas/OpenAI.WebSearchActionSearchSources' + description: The sources used in the search. + title: Web search sources + description: Action type "search" - Performs a web search query. + title: Search action + OpenAI.WebSearchActionSearchSources: + type: object + required: + - type + - url + properties: + type: + type: string + enum: + - url + x-stainless-const: true + url: + type: string + OpenAI.WebSearchApproximateLocation: + type: object + properties: + type: + type: string + enum: + - approximate + description: The type of location approximation. Always `approximate`. + x-stainless-const: true + default: approximate + country: + anyOf: + - type: string + - type: 'null' + region: + anyOf: + - type: string + - type: 'null' + city: + anyOf: + - type: string + - type: 'null' + timezone: + anyOf: + - type: string + - type: 'null' + description: The approximate location of the user. + title: Web search approximate location + OpenAI.WebSearchPreviewTool: + type: object + required: + - type + properties: + type: + type: string + enum: + - web_search_preview + description: The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + x-stainless-const: true + default: web_search_preview + user_location: + anyOf: + - $ref: '#/components/schemas/OpenAI.ApproximateLocation' + - type: 'null' + search_context_size: + allOf: + - $ref: '#/components/schemas/OpenAI.SearchContextSize' + description: High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: 'Note: web_search is not yet available via Azure OpenAI.' + title: Web search preview + OpenAI.WebSearchTool: + type: object + required: + - type + properties: + type: + type: string + enum: + - web_search + description: The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. + default: web_search + filters: + anyOf: + - $ref: '#/components/schemas/OpenAI.WebSearchToolFilters' + - type: 'null' + user_location: + anyOf: + - $ref: '#/components/schemas/OpenAI.WebSearchApproximateLocation' + - type: 'null' + search_context_size: + type: string + enum: + - low + - medium + - high + description: High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + default: medium + allOf: + - $ref: '#/components/schemas/OpenAI.Tool' + description: 'Note: web_search is not yet available via Azure OpenAI.' + title: Web search + OpenAI.WebSearchToolFilters: + type: object + properties: + allowed_domains: + anyOf: + - type: array + items: + type: string + - type: 'null' + Order: + type: string + enum: + - asc + - desc + ResponseFormatJSONSchemaRequest: + type: object + required: + - type + - json_schema + properties: + type: + type: string + enum: + - json_schema + description: Type of response format + json_schema: + type: object + unevaluatedProperties: {} + description: JSON Schema for the response format + SpeechGenerationResponse: + type: object + required: + - audio + properties: + audio: + type: string + contentEncoding: base64 + description: The generated audio, generated in the requested audio output format. + description: A representation of a response for a text-to-speech operation. + SpeechGenerationResponseFormat: + oneOf: + - type: string + - type: string + enum: + - mp3 + - opus + - aac + - flac + - wav + - pcm + description: The supported audio output formats for text-to-speech. + SpeechVoice: + anyOf: + - type: string + - type: string + enum: + - alloy + - echo + - fable + - onyx + - nova + - shimmer + description: The available voices for text-to-speech. + VideoContent: + type: object + required: + - content + properties: + content: + type: string + contentEncoding: base64 + VideoContentVariant: + anyOf: + - type: string + enum: + - video + - thumbnail + - spritesheet + - type: string + description: Selectable asset variants for downloaded content. + VideoIdParameter: + type: object + required: + - video-id + properties: + video-id: + type: string + description: The ID of the video to use for the Azure OpenAI request. + VideoList: + type: object + required: + - object + - data + - has_more + properties: + object: + type: string + enum: + - list + data: + type: array + items: + $ref: '#/components/schemas/VideoResource' + description: The list of video generation jobs. + has_more: + type: boolean + description: A flag indicating whether there are more jobs available after the list. + first_id: + type: string + description: The ID of the first video in the current page, if available. + last_id: + type: string + description: The ID of the last video in the current page, if available. + description: A list of video generation jobs. + VideoResource: + type: object + required: + - id + - object + - model + - status + - progress + - created_at + - size + - seconds + properties: + id: + type: string + description: Unique identifier for the video job. + object: + type: string + description: The object type, which is always `video`. + model: + type: string + description: The video generation model deployment that produced the job. + status: + allOf: + - $ref: '#/components/schemas/VideoStatus' + description: Current lifecycle status of the video job. + progress: + type: integer + format: int32 + description: Approximate completion percentage for the generation task. + created_at: + type: integer + format: unixtime + description: Unix timestamp (seconds) for when the job was created. + completed_at: + type: integer + format: unixtime + description: Unix timestamp (seconds) for when the job completed, if finished. + expires_at: + type: integer + format: unixtime + description: Unix timestamp (seconds) for when the video generation expires (and will be deleted). + size: + allOf: + - $ref: '#/components/schemas/VideoSize' + description: The resolution of the generated video. + seconds: + allOf: + - $ref: '#/components/schemas/VideoSeconds' + description: Duration of the generated clip in seconds. + remixed_from_video_id: + type: string + description: Identifier of the source video if this video is a remix. + error: + allOf: + - $ref: '#/components/schemas/Error' + description: Error payload that explains why generation failed, if applicable. + description: Structured information describing a generated video job. + VideoSeconds: + anyOf: + - type: string + enum: + - '4' + - '8' + - '12' + - type: string + description: Supported clip durations, measured in seconds. + VideoSize: + anyOf: + - type: string + enum: + - 720x1280 + - 1280x720 + - 1024x1792 + - 1792x1024 + - type: string + description: Output dimensions formatted as `{width}x{height}`. + VideoStatus: + anyOf: + - type: string + enum: + - queued + - in_progress + - completed + - failed + - type: string + description: Lifecycle state of a generated video. + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: api-key + ApiKeyAuth_: + type: apiKey + in: header + name: authorization + OAuth2Auth: + type: oauth2 + flows: + implicit: + authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize + scopes: + https://cognitiveservices.azure.com/.default: '' +servers: + - url: '{endpoint}/openai/v1' + description: Azure AI Foundry Models APIs + variables: + endpoint: + default: '' + description: |- + A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname. + For example: + https://westus.api.cognitive.microsoft.com). \ No newline at end of file diff --git a/pom.xml b/pom.xml index d5732ec82..50df289bb 100644 --- a/pom.xml +++ b/pom.xml @@ -35,6 +35,7 @@ core-services/prompt-registry foundation-models/openai foundation-models/sap-rpt + foundation-models/openai-responses scm:git:git://github.com/SAP/ai-sdk-java.git @@ -251,6 +252,11 @@ openai ${project.version} + + com.sap.ai.sdk.foundationmodels + openai-responses + ${project.version} + com.sap.ai.sdk.foundationmodels sap-rpt @@ -662,6 +668,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/client/* com/sap/ai/sdk/core/model/* com/sap/ai/sdk/foundationmodels/openai/generated/model/* + com/sap/ai/sdk/foundationmodels/openai-responses/generated/** com/sap/ai/sdk/foundationmodels/rpt/generated/** com/sap/ai/sdk/orchestration/model/* com/sap/ai/sdk/grounding/client/* @@ -690,6 +697,7 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* com/sap/ai/sdk/foundationmodels/openai/generated/model/* + com/sap/ai/sdk/foundationmodels/openai-responses/generated/** com/sap/ai/sdk/foundationmodels/rpt/generated/** com/sap/ai/sdk/grounding/client/* com/sap/ai/sdk/grounding/model/* From a2c9456da7de886f278cf804abf3cf2e6a458c62 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 3 Mar 2026 16:00:00 +0100 Subject: [PATCH 02/31] Generation partial-success --- foundation-models/openai-responses/pom.xml | 87 +- .../generated/client/ResponsesApi.java | 494 +++ .../AzureContentFilterBlocklistResult.java | 254 ++ ...tentFilterBlocklistResultDetailsInner.java | 244 ++ .../AzureContentFilterCompletionTextSpan.java | 264 ++ ...lterCompletionTextSpanDetectionResult.java | 345 ++ .../AzureContentFilterCustomTopicResult.java | 252 ++ ...ntFilterCustomTopicResultDetailsInner.java | 244 ++ .../AzureContentFilterDetectionResult.java | 244 ++ .../AzureContentFilterForResponsesAPI.java | 369 +++ ...rsonallyIdentifiableInformationResult.java | 371 +++ ...zureContentFilterResultForChoiceError.java | 244 ++ ...rResultForChoiceProtectedMaterialCode.java | 311 ++ ...orChoiceProtectedMaterialCodeCitation.java | 234 ++ .../AzureContentFilterResultOffsets.java | 294 ++ ...reContentFilterResultsForResponsesAPI.java | 883 +++++ .../AzureContentFilterSeverityResult.java | 309 ++ .../model/AzurePiiSubCategoryResult.java | 344 ++ .../model/CreateBatchDefaultResponse.java | 378 +++ .../model/CreateResponse200Response.java | 1975 +++++++++++ ...CreateResponse200ResponseInstructions.java | 58 + .../model/DeleteResponse200Response.java | 395 +++ .../model/OpenAIConversationReference.java | 190 ++ .../generated/model/OpenAIInputItem.java | 188 ++ .../generated/model/OpenAIInputItemType.java | 33 + .../generated/model/OpenAIOutputItem.java | 188 ++ .../generated/model/OpenAIOutputItemType.java | 33 + .../generated/model/OpenAIPrompt.java | 266 ++ .../generated/model/OpenAIReasoning.java | 369 +++ .../model/OpenAIReasoningEffort.java | 72 + .../generated/model/OpenAIResponseError.java | 233 ++ .../model/OpenAIResponseErrorCode.java | 96 + .../OpenAIResponseIncompleteDetails.java | 235 ++ .../model/OpenAIResponseTextParam.java | 214 ++ .../generated/model/OpenAIResponseUsage.java | 407 +++ ...OpenAIResponseUsageInputTokensDetails.java | 192 ++ ...penAIResponseUsageOutputTokensDetails.java | 198 ++ ...OpenAITextResponseFormatConfiguration.java | 206 ++ ...AITextResponseFormatConfigurationType.java | 36 + .../responses/generated/model/OpenAITool.java | 188 ++ .../model/OpenAIToolChoiceParam.java | 192 ++ .../model/OpenAIToolChoiceParamType.java | 33 + .../generated/model/OpenAIToolType.java | 33 + .../generated/model/OpenAIVerbosity.java | 66 + .../resources/spec/azure-v1-v1-generated.json | 2903 ++++++++++++++--- .../resources/spec/azure-v1-v1-generated.yaml | 3 +- 46 files changed, 14683 insertions(+), 484 deletions(-) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index 9aeb9976c..490e6c853 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -81,7 +81,7 @@ generate-sources - ${project.basedir}/src/main/resources/spec/azure-v1-v1-generated.json + ${project.basedir}/src/main/resources/spec/azure-v1-v1-generated.yaml com.sap.ai.sdk.foundationmodels.openai.responses.generated.model com.sap.ai.sdk.foundationmodels.openai.responses.generated.client @@ -94,24 +94,73 @@ true - - /batches/** - /chat/completions - /completions - /containers/** - /conversations/** - /embeddings - /evals/** - /files/** - /fine_tuning/** - /models/** - /realtime/** - /threads/** - /vector_stores/** - - - - + /batches + /batches/{batch_id} + /batches/{batch_id}/cancel + /chat/completions + /completions + /containers + /containers/{container_id} + /containers/{container_id}/files + /containers/{container_id}/files/{file_id} + /containers/{container_id}/files/{file_id}/content + /conversations + /conversations/{conversation_id} + /conversations/{conversation_id}/items + /conversations/{conversation_id}/items/{item_id} + /embeddings + /evals + /evals/{eval_id} + /evals/{eval_id}/runs + /evals/{eval_id}/runs/{run_id} + /evals/{eval_id}/runs/{run_id}/output_items + /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id} + /files + /files/{file_id} + /files/{file_id}/content + /fine_tuning/alpha/graders/run + /fine_tuning/alpha/graders/validate + /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions + /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id} + /fine_tuning/jobs + /fine_tuning/jobs/{fine_tuning_job_id} + /fine_tuning/jobs/{fine_tuning_job_id}/cancel + /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints + /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy + /fine_tuning/jobs/{fine_tuning_job_id}/events + /fine_tuning/jobs/{fine_tuning_job_id}/pause + /fine_tuning/jobs/{fine_tuning_job_id}/resume + /models + /models/{model} + /realtime/calls + /realtime/calls/{call_id}/accept + /realtime/calls/{call_id}/hangup + /realtime/calls/{call_id}/refer + /realtime/calls/{call_id}/reject + /realtime/client_secrets + /realtime/sessions + /realtime/transcription_sessions + /threads + /threads/runs + /threads/{thread_id} + /threads/{thread_id}/messages + /threads/{thread_id}/messages/{message_id} + /threads/{thread_id}/runs + /threads/{thread_id}/runs/{run_id} + /threads/{thread_id}/runs/{run_id}/cancel + /threads/{thread_id}/runs/{run_id}/steps + /threads/{thread_id}/runs/{run_id}/steps/{step_id} + /threads/{thread_id}/runs/{run_id}/submit_tool_outputs + /vector_stores + /vector_stores/{vector_store_id} + /vector_stores/{vector_store_id}/file_batches + /vector_stores/{vector_store_id}/file_batches/{batch_id} + /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel + /vector_stores/{vector_store_id}/file_batches/{batch_id}/files + /vector_stores/{vector_store_id}/files + /vector_stores/{vector_store_id}/files/{file_id} + /vector_stores/{vector_store_id}/files/{file_id}/content + /vector_stores/{vector_store_id}/search true diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java new file mode 100644 index 000000000..28a8d0b78 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java @@ -0,0 +1,494 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.client; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.AzureAIFoundryModelsApiVersion; +import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.CreateResponse200Response; +import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.DeleteResponse200Response; +import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAICreateResponse; +import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAIIncludeEnum; +import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAIResponseItemList; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import com.sap.cloud.sdk.services.openapi.apache.ApiClient; +import com.sap.cloud.sdk.services.openapi.apache.BaseApi; +import com.sap.cloud.sdk.services.openapi.apache.Pair; +import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.StringJoiner; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Azure AI Foundry Models Service in version v1. + * + *

No description provided (generated by Openapi Generator + * https://github.com/openapitools/openapi-generator) + */ +public class ResponsesApi extends BaseApi { + + /** Instantiates this API class to invoke operations on the Azure AI Foundry Models Service */ + public ResponsesApi() {} + + /** + * Instantiates this API class to invoke operations on the Azure AI Foundry Models Service. + * + * @param httpDestination The destination that API should be used with + */ + public ResponsesApi(@Nonnull final Destination httpDestination) { + super(httpDestination); + } + + /** + * Instantiates this API class to invoke operations on the Azure AI Foundry Models Service based + * on a given {@link ApiClient}. + * + * @param apiClient ApiClient to invoke the API on + */ + public ResponsesApi(@Nonnull final ApiClient apiClient) { + super(apiClient); + } + + /** + * Cancels a model response with the given ID. Only responses created with the background + * parameter set to true can be cancelled. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId (required) The value for the parameter responseId + * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to + * use for this request. `v1` if not otherwise specified. + * @return CreateResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CreateResponse200Response cancelResponse( + @Nonnull final String responseId, @Nullable final AzureAIFoundryModelsApiVersion apiVersion) + throws OpenApiRequestException { + + // verify the required parameter 'responseId' is set + if (responseId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'responseId' when calling cancelResponse") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/responses/{response_id}/cancel" + .replaceAll( + "\\{" + "response_id" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(responseId))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Cancels a model response with the given ID. Only responses created with the background + * parameter set to true can be cancelled. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId The value for the parameter responseId + * @return CreateResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CreateResponse200Response cancelResponse(@Nonnull final String responseId) + throws OpenApiRequestException { + return cancelResponse(responseId, null); + } + + /** + * Creates a model response. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param body (required) The value for the parameter body + * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to + * use for this request. `v1` if not otherwise specified. + * @return CreateResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CreateResponse200Response createResponse( + @Nonnull final OpenAICreateResponse body, + @Nullable final AzureAIFoundryModelsApiVersion apiVersion) + throws OpenApiRequestException { + + // verify the required parameter 'body' is set + if (body == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'body' when calling createResponse") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = "/responses"; + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); + + final String[] localVarAccepts = {"application/json", "text/event-stream"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {"application/json"}; + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "POST", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + body, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Creates a model response. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param body The value for the parameter body + * @return CreateResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CreateResponse200Response createResponse(@Nonnull final OpenAICreateResponse body) + throws OpenApiRequestException { + return createResponse(body, null); + } + + /** + * Deletes a response by ID. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId (required) The value for the parameter responseId + * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to + * use for this request. `v1` if not otherwise specified. + * @return DeleteResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DeleteResponse200Response deleteResponse( + @Nonnull final String responseId, @Nullable final AzureAIFoundryModelsApiVersion apiVersion) + throws OpenApiRequestException { + + // verify the required parameter 'responseId' is set + if (responseId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'responseId' when calling deleteResponse") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/responses/{response_id}" + .replaceAll( + "\\{" + "response_id" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(responseId))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "DELETE", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Deletes a response by ID. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId The value for the parameter responseId + * @return DeleteResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public DeleteResponse200Response deleteResponse(@Nonnull final String responseId) + throws OpenApiRequestException { + return deleteResponse(responseId, null); + } + + /** + * Retrieves a model response with the given ID. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId (required) The value for the parameter responseId + * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to + * use for this request. `v1` if not otherwise specified. + * @param include (optional) Additional fields to include in the response. See the include + * parameter for Response creation above for more information. + * @param stream (optional) If set to true, the model response data will be streamed to the client + * as it is generated using server-sent events. + * @param startingAfter (optional) The sequence number of the event after which to start + * streaming. + * @param includeObfuscation (optional, default to true) When true, stream obfuscation will be + * enabled. Stream obfuscation adds random characters to an `obfuscation` field on + * streaming delta events to normalize payload sizes as a mitigation to certain side-channel + * attacks. These obfuscation fields are included by default, but add a small amount of + * overhead to the data stream. You can set `include_obfuscation` to false to + * optimize for bandwidth if you trust the network links between your application and the + * OpenAI API. + * @return CreateResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CreateResponse200Response getResponse( + @Nullable final String responseId, + @Nullable final AzureAIFoundryModelsApiVersion apiVersion, + @Nullable final List include, + @Nullable final Boolean stream, + @Nullable final Integer startingAfter, + @Nullable final Boolean includeObfuscation) + throws OpenApiRequestException { + + // verify the required parameter 'responseId' is set + if (responseId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'responseId' when calling getResponse") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/responses/{response_id}" + .replaceAll( + "\\{" + "response_id" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(responseId))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); + localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("multi", "include[]", include)); + localVarQueryParams.addAll(ApiClient.parameterToPair("stream", stream)); + localVarQueryParams.addAll(ApiClient.parameterToPair("starting_after", startingAfter)); + localVarQueryParams.addAll( + ApiClient.parameterToPair("include_obfuscation", includeObfuscation)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Retrieves a model response with the given ID. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId The value for the parameter responseId + * @return CreateResponse200Response + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public CreateResponse200Response getResponse(@Nullable final String responseId) + throws OpenApiRequestException { + return getResponse(responseId, null, null, null, null, null); + } + + /** + * Returns a list of input items for a given response. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId (required) The value for the parameter responseId + * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to + * use for this request. `v1` if not otherwise specified. + * @param limit (optional, default to 20) A limit on the number of objects to be returned. Limit + * can range between 1 and 100, and the default is 20. + * @param order (optional) Sort order by the `created_at` timestamp of the objects. + * `asc` for ascending order and`desc` for descending order. + * @param after (optional) A cursor for use in pagination. `after` is an object ID that + * defines your place in the list. For instance, if you make a list request and receive 100 + * objects, ending with obj_foo, your subsequent call can include after=obj_foo in order + * to fetch the next page of the list. + * @param before (optional) A cursor for use in pagination. `before` is an object ID + * that defines your place in the list. For instance, if you make a list request and receive + * 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in + * order to fetch the previous page of the list. + * @return OpenAIResponseItemList + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenAIResponseItemList listInputItems( + @Nonnull final String responseId, + @Nullable final AzureAIFoundryModelsApiVersion apiVersion, + @Nullable final Integer limit, + @Nullable final String order, + @Nullable final String after, + @Nullable final String before) + throws OpenApiRequestException { + + // verify the required parameter 'responseId' is set + if (responseId == null) { + throw new OpenApiRequestException( + "Missing the required parameter 'responseId' when calling listInputItems") + .statusCode(400); + } + + // create path and map variables + final String localVarPath = + "/responses/{response_id}/input_items" + .replaceAll( + "\\{" + "response_id" + "\\}", + ApiClient.escapeString(ApiClient.parameterToString(responseId))); + + final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + final List localVarQueryParams = new ArrayList(); + final List localVarCollectionQueryParams = new ArrayList(); + final Map localVarHeaderParams = new HashMap(); + final Map localVarFormParams = new HashMap(); + + localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); + localVarQueryParams.addAll(ApiClient.parameterToPair("limit", limit)); + localVarQueryParams.addAll(ApiClient.parameterToPair("order", order)); + localVarQueryParams.addAll(ApiClient.parameterToPair("after", after)); + localVarQueryParams.addAll(ApiClient.parameterToPair("before", before)); + + final String[] localVarAccepts = {"application/json"}; + final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); + final String[] localVarContentTypes = {}; + + final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); + + final TypeReference localVarReturnType = + new TypeReference() {}; + + return apiClient.invokeAPI( + localVarPath, + "GET", + localVarQueryParams, + localVarCollectionQueryParams, + localVarQueryStringJoiner.toString(), + null, + localVarHeaderParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarReturnType); + } + + /** + * Returns a list of input items for a given response. + * + *

200 - The request has succeeded. + * + *

0 - An unexpected error response. + * + * @param responseId The value for the parameter responseId + * @return OpenAIResponseItemList + * @throws OpenApiRequestException if an error occurs while attempting to invoke the API + */ + @Nonnull + public OpenAIResponseItemList listInputItems(@Nonnull final String responseId) + throws OpenApiRequestException { + return listInputItems(responseId, null, null, null, null, null); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java new file mode 100644 index 000000000..376b278e2 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java @@ -0,0 +1,254 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A collection of true/false filtering results for configured custom blocklists. */ +// CHECKSTYLE:OFF +public class AzureContentFilterBlocklistResult +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("details") + private List details = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterBlocklistResult. */ + protected AzureContentFilterBlocklistResult() {} + + /** + * Set the filtered of this {@link AzureContentFilterBlocklistResult} instance and return the same + * instance. + * + * @param filtered A value indicating whether any of the detailed blocklists resulted in a + * filtering action. + * @return The same instance of this {@link AzureContentFilterBlocklistResult} class + */ + @Nonnull + public AzureContentFilterBlocklistResult filtered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * A value indicating whether any of the detailed blocklists resulted in a filtering action. + * + * @return filtered The filtered of this {@link AzureContentFilterBlocklistResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterBlocklistResult} instance. + * + * @param filtered A value indicating whether any of the detailed blocklists resulted in a + * filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the details of this {@link AzureContentFilterBlocklistResult} instance and return the same + * instance. + * + * @param details The pairs of individual blocklist IDs and whether they resulted in a filtering + * action. + * @return The same instance of this {@link AzureContentFilterBlocklistResult} class + */ + @Nonnull + public AzureContentFilterBlocklistResult details( + @Nullable final List details) { + this.details = details; + return this; + } + + /** + * Add one details instance to this {@link AzureContentFilterBlocklistResult}. + * + * @param detailsItem The details that should be added + * @return The same instance of type {@link AzureContentFilterBlocklistResult} + */ + @Nonnull + public AzureContentFilterBlocklistResult addDetailsItem( + @Nonnull final AzureContentFilterBlocklistResultDetailsInner detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * The pairs of individual blocklist IDs and whether they resulted in a filtering action. + * + * @return details The details of this {@link AzureContentFilterBlocklistResult} instance. + */ + @Nonnull + public List getDetails() { + return details; + } + + /** + * Set the details of this {@link AzureContentFilterBlocklistResult} instance. + * + * @param details The pairs of individual blocklist IDs and whether they resulted in a filtering + * action. + */ + public void setDetails( + @Nullable final List details) { + this.details = details; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterBlocklistResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentFilterBlocklistResult} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterBlocklistResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterBlocklistResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (details != null) declaredFields.put("details", details); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterBlocklistResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterBlocklistResult azureContentFilterBlocklistResult = + (AzureContentFilterBlocklistResult) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterBlocklistResult.cloudSdkCustomFields) + && Objects.equals(this.filtered, azureContentFilterBlocklistResult.filtered) + && Objects.equals(this.details, azureContentFilterBlocklistResult.details); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, details, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterBlocklistResult {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterBlocklistResult} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> new AzureContentFilterBlocklistResult().filtered(filtered); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterBlocklistResult} instance. + * + * @param filtered A value indicating whether any of the detailed blocklists resulted in a + * filtering action. + * @return The AzureContentFilterBlocklistResult instance. + */ + AzureContentFilterBlocklistResult filtered(@Nonnull final Boolean filtered); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java new file mode 100644 index 000000000..c6c8bf9fc --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java @@ -0,0 +1,244 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterBlocklistResultDetailsInner */ +// CHECKSTYLE:OFF +public class AzureContentFilterBlocklistResultDetailsInner +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterBlocklistResultDetailsInner. */ + protected AzureContentFilterBlocklistResultDetailsInner() {} + + /** + * Set the filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} instance and + * return the same instance. + * + * @param filtered A value indicating whether the blocklist produced a filtering action. + * @return The same instance of this {@link AzureContentFilterBlocklistResultDetailsInner} class + */ + @Nonnull + public AzureContentFilterBlocklistResultDetailsInner filtered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * A value indicating whether the blocklist produced a filtering action. + * + * @return filtered The filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} + * instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. + * + * @param filtered A value indicating whether the blocklist produced a filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance and return + * the same instance. + * + * @param id The ID of the custom blocklist evaluated. + * @return The same instance of this {@link AzureContentFilterBlocklistResultDetailsInner} class + */ + @Nonnull + public AzureContentFilterBlocklistResultDetailsInner id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * The ID of the custom blocklist evaluated. + * + * @return id The id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. + * + * @param id The ID of the custom blocklist evaluated. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterBlocklistResultDetailsInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterBlocklistResultDetailsInner} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterBlocklistResultDetailsInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterBlocklistResultDetailsInner} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterBlocklistResultDetailsInner} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterBlocklistResultDetailsInner + azureContentFilterBlocklistResultDetailsInner = + (AzureContentFilterBlocklistResultDetailsInner) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterBlocklistResultDetailsInner.cloudSdkCustomFields) + && Objects.equals(this.filtered, azureContentFilterBlocklistResultDetailsInner.filtered) + && Objects.equals(this.id, azureContentFilterBlocklistResultDetailsInner.id); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterBlocklistResultDetailsInner {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterBlocklistResultDetailsInner} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> + (id) -> new AzureContentFilterBlocklistResultDetailsInner().filtered(filtered).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. + * + * @param filtered A value indicating whether the blocklist produced a filtering action. + * @return The AzureContentFilterBlocklistResultDetailsInner builder. + */ + Builder1 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. + * + * @param id The ID of the custom blocklist evaluated. + * @return The AzureContentFilterBlocklistResultDetailsInner instance. + */ + AzureContentFilterBlocklistResultDetailsInner id(@Nonnull final String id); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java new file mode 100644 index 000000000..3319f856b --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java @@ -0,0 +1,264 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A representation of a span of completion text as used by Azure OpenAI content filter results. */ +// CHECKSTYLE:OFF +public class AzureContentFilterCompletionTextSpan +// CHECKSTYLE:ON +{ + @JsonProperty("completion_start_offset") + private Integer completionStartOffset; + + @JsonProperty("completion_end_offset") + private Integer completionEndOffset; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterCompletionTextSpan. */ + protected AzureContentFilterCompletionTextSpan() {} + + /** + * Set the completionStartOffset of this {@link AzureContentFilterCompletionTextSpan} instance and + * return the same instance. + * + * @param completionStartOffset Offset of the UTF32 code point which begins the span. + * @return The same instance of this {@link AzureContentFilterCompletionTextSpan} class + */ + @Nonnull + public AzureContentFilterCompletionTextSpan completionStartOffset( + @Nonnull final Integer completionStartOffset) { + this.completionStartOffset = completionStartOffset; + return this; + } + + /** + * Offset of the UTF32 code point which begins the span. + * + * @return completionStartOffset The completionStartOffset of this {@link + * AzureContentFilterCompletionTextSpan} instance. + */ + @Nonnull + public Integer getCompletionStartOffset() { + return completionStartOffset; + } + + /** + * Set the completionStartOffset of this {@link AzureContentFilterCompletionTextSpan} instance. + * + * @param completionStartOffset Offset of the UTF32 code point which begins the span. + */ + public void setCompletionStartOffset(@Nonnull final Integer completionStartOffset) { + this.completionStartOffset = completionStartOffset; + } + + /** + * Set the completionEndOffset of this {@link AzureContentFilterCompletionTextSpan} instance and + * return the same instance. + * + * @param completionEndOffset Offset of the first UTF32 code point which is excluded from the + * span. This field is always equal to completion_start_offset for empty spans. This field is + * always larger than completion_start_offset for non-empty spans. + * @return The same instance of this {@link AzureContentFilterCompletionTextSpan} class + */ + @Nonnull + public AzureContentFilterCompletionTextSpan completionEndOffset( + @Nonnull final Integer completionEndOffset) { + this.completionEndOffset = completionEndOffset; + return this; + } + + /** + * Offset of the first UTF32 code point which is excluded from the span. This field is always + * equal to completion_start_offset for empty spans. This field is always larger than + * completion_start_offset for non-empty spans. + * + * @return completionEndOffset The completionEndOffset of this {@link + * AzureContentFilterCompletionTextSpan} instance. + */ + @Nonnull + public Integer getCompletionEndOffset() { + return completionEndOffset; + } + + /** + * Set the completionEndOffset of this {@link AzureContentFilterCompletionTextSpan} instance. + * + * @param completionEndOffset Offset of the first UTF32 code point which is excluded from the + * span. This field is always equal to completion_start_offset for empty spans. This field is + * always larger than completion_start_offset for non-empty spans. + */ + public void setCompletionEndOffset(@Nonnull final Integer completionEndOffset) { + this.completionEndOffset = completionEndOffset; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterCompletionTextSpan}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterCompletionTextSpan} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterCompletionTextSpan has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterCompletionTextSpan} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (completionStartOffset != null) + declaredFields.put("completionStartOffset", completionStartOffset); + if (completionEndOffset != null) declaredFields.put("completionEndOffset", completionEndOffset); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterCompletionTextSpan} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterCompletionTextSpan azureContentFilterCompletionTextSpan = + (AzureContentFilterCompletionTextSpan) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterCompletionTextSpan.cloudSdkCustomFields) + && Objects.equals( + this.completionStartOffset, azureContentFilterCompletionTextSpan.completionStartOffset) + && Objects.equals( + this.completionEndOffset, azureContentFilterCompletionTextSpan.completionEndOffset); + } + + @Override + public int hashCode() { + return Objects.hash(completionStartOffset, completionEndOffset, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterCompletionTextSpan {\n"); + sb.append(" completionStartOffset: ") + .append(toIndentedString(completionStartOffset)) + .append("\n"); + sb.append(" completionEndOffset: ") + .append(toIndentedString(completionEndOffset)) + .append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterCompletionTextSpan} instance with all required arguments. + */ + public static Builder create() { + return (completionStartOffset) -> + (completionEndOffset) -> + new AzureContentFilterCompletionTextSpan() + .completionStartOffset(completionStartOffset) + .completionEndOffset(completionEndOffset); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the completionStartOffset of this {@link AzureContentFilterCompletionTextSpan} instance. + * + * @param completionStartOffset Offset of the UTF32 code point which begins the span. + * @return The AzureContentFilterCompletionTextSpan builder. + */ + Builder1 completionStartOffset(@Nonnull final Integer completionStartOffset); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the completionEndOffset of this {@link AzureContentFilterCompletionTextSpan} instance. + * + * @param completionEndOffset Offset of the first UTF32 code point which is excluded from the + * span. This field is always equal to completion_start_offset for empty spans. This field + * is always larger than completion_start_offset for non-empty spans. + * @return The AzureContentFilterCompletionTextSpan instance. + */ + AzureContentFilterCompletionTextSpan completionEndOffset( + @Nonnull final Integer completionEndOffset); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java new file mode 100644 index 000000000..265965eec --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java @@ -0,0 +1,345 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterCompletionTextSpanDetectionResult */ +// CHECKSTYLE:OFF +public class AzureContentFilterCompletionTextSpanDetectionResult +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("detected") + private Boolean detected; + + @JsonProperty("details") + private List details = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterCompletionTextSpanDetectionResult. */ + protected AzureContentFilterCompletionTextSpanDetectionResult() {} + + /** + * Set the filtered of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance + * and return the same instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The same instance of this {@link AzureContentFilterCompletionTextSpanDetectionResult} + * class + */ + @Nonnull + public AzureContentFilterCompletionTextSpanDetectionResult filtered( + @Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * Whether the content detection resulted in a content filtering action. + * + * @return filtered The filtered of this {@link + * AzureContentFilterCompletionTextSpanDetectionResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the detected of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance + * and return the same instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The same instance of this {@link AzureContentFilterCompletionTextSpanDetectionResult} + * class + */ + @Nonnull + public AzureContentFilterCompletionTextSpanDetectionResult detected( + @Nonnull final Boolean detected) { + this.detected = detected; + return this; + } + + /** + * Whether the labeled content category was detected in the content. + * + * @return detected The detected of this {@link + * AzureContentFilterCompletionTextSpanDetectionResult} instance. + */ + @Nonnull + public Boolean isDetected() { + return detected; + } + + /** + * Set the detected of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. + * + * @param detected Whether the labeled content category was detected in the content. + */ + public void setDetected(@Nonnull final Boolean detected) { + this.detected = detected; + } + + /** + * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance + * and return the same instance. + * + * @param details Detailed information about the detected completion text spans. + * @return The same instance of this {@link AzureContentFilterCompletionTextSpanDetectionResult} + * class + */ + @Nonnull + public AzureContentFilterCompletionTextSpanDetectionResult details( + @Nonnull final List details) { + this.details = details; + return this; + } + + /** + * Add one details instance to this {@link AzureContentFilterCompletionTextSpanDetectionResult}. + * + * @param detailsItem The details that should be added + * @return The same instance of type {@link AzureContentFilterCompletionTextSpanDetectionResult} + */ + @Nonnull + public AzureContentFilterCompletionTextSpanDetectionResult addDetailsItem( + @Nonnull final AzureContentFilterCompletionTextSpan detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * Detailed information about the detected completion text spans. + * + * @return details The details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} + * instance. + */ + @Nonnull + public List getDetails() { + return details; + } + + /** + * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. + * + * @param details Detailed information about the detected completion text spans. + */ + public void setDetails(@Nonnull final List details) { + this.details = details; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterCompletionTextSpanDetectionResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterCompletionTextSpanDetectionResult} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterCompletionTextSpanDetectionResult has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * AzureContentFilterCompletionTextSpanDetectionResult} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + if (details != null) declaredFields.put("details", details); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * AzureContentFilterCompletionTextSpanDetectionResult} instance. If the map previously contained + * a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterCompletionTextSpanDetectionResult + azureContentFilterCompletionTextSpanDetectionResult = + (AzureContentFilterCompletionTextSpanDetectionResult) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterCompletionTextSpanDetectionResult.cloudSdkCustomFields) + && Objects.equals( + this.filtered, azureContentFilterCompletionTextSpanDetectionResult.filtered) + && Objects.equals( + this.detected, azureContentFilterCompletionTextSpanDetectionResult.detected) + && Objects.equals( + this.details, azureContentFilterCompletionTextSpanDetectionResult.details); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, detected, details, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterCompletionTextSpanDetectionResult {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterCompletionTextSpanDetectionResult} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> + (detected) -> + (details) -> + new AzureContentFilterCompletionTextSpanDetectionResult() + .filtered(filtered) + .detected(detected) + .details(details); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterCompletionTextSpanDetectionResult} + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The AzureContentFilterCompletionTextSpanDetectionResult builder. + */ + Builder1 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the detected of this {@link AzureContentFilterCompletionTextSpanDetectionResult} + * instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The AzureContentFilterCompletionTextSpanDetectionResult builder. + */ + Builder2 detected(@Nonnull final Boolean detected); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. + * + * @param details Detailed information about the detected completion text spans. + * @return The AzureContentFilterCompletionTextSpanDetectionResult instance. + */ + AzureContentFilterCompletionTextSpanDetectionResult details( + @Nonnull final List details); + + /** + * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. + * + * @param details Detailed information about the detected completion text spans. + * @return The AzureContentFilterCompletionTextSpanDetectionResult instance. + */ + default AzureContentFilterCompletionTextSpanDetectionResult details( + @Nonnull final AzureContentFilterCompletionTextSpan... details) { + return details(Arrays.asList(details)); + } + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java new file mode 100644 index 000000000..aef180317 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java @@ -0,0 +1,252 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A collection of true/false filtering results for configured custom topics. */ +// CHECKSTYLE:OFF +public class AzureContentFilterCustomTopicResult +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("details") + private List details = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterCustomTopicResult. */ + protected AzureContentFilterCustomTopicResult() {} + + /** + * Set the filtered of this {@link AzureContentFilterCustomTopicResult} instance and return the + * same instance. + * + * @param filtered A value indicating whether any of the detailed topics resulted in a filtering + * action. + * @return The same instance of this {@link AzureContentFilterCustomTopicResult} class + */ + @Nonnull + public AzureContentFilterCustomTopicResult filtered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * A value indicating whether any of the detailed topics resulted in a filtering action. + * + * @return filtered The filtered of this {@link AzureContentFilterCustomTopicResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterCustomTopicResult} instance. + * + * @param filtered A value indicating whether any of the detailed topics resulted in a filtering + * action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the details of this {@link AzureContentFilterCustomTopicResult} instance and return the + * same instance. + * + * @param details The pairs of individual topic IDs and whether they are detected. + * @return The same instance of this {@link AzureContentFilterCustomTopicResult} class + */ + @Nonnull + public AzureContentFilterCustomTopicResult details( + @Nullable final List details) { + this.details = details; + return this; + } + + /** + * Add one details instance to this {@link AzureContentFilterCustomTopicResult}. + * + * @param detailsItem The details that should be added + * @return The same instance of type {@link AzureContentFilterCustomTopicResult} + */ + @Nonnull + public AzureContentFilterCustomTopicResult addDetailsItem( + @Nonnull final AzureContentFilterCustomTopicResultDetailsInner detailsItem) { + if (this.details == null) { + this.details = new ArrayList<>(); + } + this.details.add(detailsItem); + return this; + } + + /** + * The pairs of individual topic IDs and whether they are detected. + * + * @return details The details of this {@link AzureContentFilterCustomTopicResult} instance. + */ + @Nonnull + public List getDetails() { + return details; + } + + /** + * Set the details of this {@link AzureContentFilterCustomTopicResult} instance. + * + * @param details The pairs of individual topic IDs and whether they are detected. + */ + public void setDetails( + @Nullable final List details) { + this.details = details; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterCustomTopicResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentFilterCustomTopicResult} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterCustomTopicResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterCustomTopicResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (details != null) declaredFields.put("details", details); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterCustomTopicResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterCustomTopicResult azureContentFilterCustomTopicResult = + (AzureContentFilterCustomTopicResult) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterCustomTopicResult.cloudSdkCustomFields) + && Objects.equals(this.filtered, azureContentFilterCustomTopicResult.filtered) + && Objects.equals(this.details, azureContentFilterCustomTopicResult.details); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, details, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterCustomTopicResult {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" details: ").append(toIndentedString(details)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterCustomTopicResult} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> new AzureContentFilterCustomTopicResult().filtered(filtered); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterCustomTopicResult} instance. + * + * @param filtered A value indicating whether any of the detailed topics resulted in a filtering + * action. + * @return The AzureContentFilterCustomTopicResult instance. + */ + AzureContentFilterCustomTopicResult filtered(@Nonnull final Boolean filtered); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java new file mode 100644 index 000000000..32a38eea5 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java @@ -0,0 +1,244 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterCustomTopicResultDetailsInner */ +// CHECKSTYLE:OFF +public class AzureContentFilterCustomTopicResultDetailsInner +// CHECKSTYLE:ON +{ + @JsonProperty("detected") + private Boolean detected; + + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterCustomTopicResultDetailsInner. */ + protected AzureContentFilterCustomTopicResultDetailsInner() {} + + /** + * Set the detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance and + * return the same instance. + * + * @param detected A value indicating whether the topic is detected. + * @return The same instance of this {@link AzureContentFilterCustomTopicResultDetailsInner} class + */ + @Nonnull + public AzureContentFilterCustomTopicResultDetailsInner detected(@Nonnull final Boolean detected) { + this.detected = detected; + return this; + } + + /** + * A value indicating whether the topic is detected. + * + * @return detected The detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} + * instance. + */ + @Nonnull + public Boolean isDetected() { + return detected; + } + + /** + * Set the detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. + * + * @param detected A value indicating whether the topic is detected. + */ + public void setDetected(@Nonnull final Boolean detected) { + this.detected = detected; + } + + /** + * Set the id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance and return + * the same instance. + * + * @param id The ID of the custom topic evaluated. + * @return The same instance of this {@link AzureContentFilterCustomTopicResultDetailsInner} class + */ + @Nonnull + public AzureContentFilterCustomTopicResultDetailsInner id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * The ID of the custom topic evaluated. + * + * @return id The id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. + * + * @param id The ID of the custom topic evaluated. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterCustomTopicResultDetailsInner}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterCustomTopicResultDetailsInner} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterCustomTopicResultDetailsInner has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterCustomTopicResultDetailsInner} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (detected != null) declaredFields.put("detected", detected); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterCustomTopicResultDetailsInner} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterCustomTopicResultDetailsInner + azureContentFilterCustomTopicResultDetailsInner = + (AzureContentFilterCustomTopicResultDetailsInner) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterCustomTopicResultDetailsInner.cloudSdkCustomFields) + && Objects.equals(this.detected, azureContentFilterCustomTopicResultDetailsInner.detected) + && Objects.equals(this.id, azureContentFilterCustomTopicResultDetailsInner.id); + } + + @Override + public int hashCode() { + return Objects.hash(detected, id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterCustomTopicResultDetailsInner {\n"); + sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterCustomTopicResultDetailsInner} instance with all required arguments. + */ + public static Builder create() { + return (detected) -> + (id) -> new AzureContentFilterCustomTopicResultDetailsInner().detected(detected).id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. + * + * @param detected A value indicating whether the topic is detected. + * @return The AzureContentFilterCustomTopicResultDetailsInner builder. + */ + Builder1 detected(@Nonnull final Boolean detected); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. + * + * @param id The ID of the custom topic evaluated. + * @return The AzureContentFilterCustomTopicResultDetailsInner instance. + */ + AzureContentFilterCustomTopicResultDetailsInner id(@Nonnull final String id); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java new file mode 100644 index 000000000..5bb299bd2 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java @@ -0,0 +1,244 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * A labeled content filter result item that indicates whether the content was detected and whether + * the content was filtered. + */ +// CHECKSTYLE:OFF +public class AzureContentFilterDetectionResult +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("detected") + private Boolean detected; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterDetectionResult. */ + protected AzureContentFilterDetectionResult() {} + + /** + * Set the filtered of this {@link AzureContentFilterDetectionResult} instance and return the same + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The same instance of this {@link AzureContentFilterDetectionResult} class + */ + @Nonnull + public AzureContentFilterDetectionResult filtered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * Whether the content detection resulted in a content filtering action. + * + * @return filtered The filtered of this {@link AzureContentFilterDetectionResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterDetectionResult} instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the detected of this {@link AzureContentFilterDetectionResult} instance and return the same + * instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The same instance of this {@link AzureContentFilterDetectionResult} class + */ + @Nonnull + public AzureContentFilterDetectionResult detected(@Nonnull final Boolean detected) { + this.detected = detected; + return this; + } + + /** + * Whether the labeled content category was detected in the content. + * + * @return detected The detected of this {@link AzureContentFilterDetectionResult} instance. + */ + @Nonnull + public Boolean isDetected() { + return detected; + } + + /** + * Set the detected of this {@link AzureContentFilterDetectionResult} instance. + * + * @param detected Whether the labeled content category was detected in the content. + */ + public void setDetected(@Nonnull final Boolean detected) { + this.detected = detected; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterDetectionResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentFilterDetectionResult} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterDetectionResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterDetectionResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterDetectionResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterDetectionResult azureContentFilterDetectionResult = + (AzureContentFilterDetectionResult) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterDetectionResult.cloudSdkCustomFields) + && Objects.equals(this.filtered, azureContentFilterDetectionResult.filtered) + && Objects.equals(this.detected, azureContentFilterDetectionResult.detected); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, detected, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterDetectionResult {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterDetectionResult} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> + (detected) -> new AzureContentFilterDetectionResult().filtered(filtered).detected(detected); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterDetectionResult} instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The AzureContentFilterDetectionResult builder. + */ + Builder1 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the detected of this {@link AzureContentFilterDetectionResult} instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The AzureContentFilterDetectionResult instance. + */ + AzureContentFilterDetectionResult detected(@Nonnull final Boolean detected); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java new file mode 100644 index 000000000..9cf835684 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java @@ -0,0 +1,369 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterForResponsesAPI */ +// CHECKSTYLE:OFF +public class AzureContentFilterForResponsesAPI +// CHECKSTYLE:ON +{ + @JsonProperty("blocked") + private Boolean blocked; + + @JsonProperty("source_type") + private String sourceType; + + @JsonProperty("content_filter_results") + private AzureContentFilterResultsForResponsesAPI contentFilterResults; + + @JsonProperty("content_filter_offsets") + private AzureContentFilterResultOffsets contentFilterOffsets; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterForResponsesAPI. */ + protected AzureContentFilterForResponsesAPI() {} + + /** + * Set the blocked of this {@link AzureContentFilterForResponsesAPI} instance and return the same + * instance. + * + * @param blocked Indicate if the response is blocked. + * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterForResponsesAPI blocked(@Nonnull final Boolean blocked) { + this.blocked = blocked; + return this; + } + + /** + * Indicate if the response is blocked. + * + * @return blocked The blocked of this {@link AzureContentFilterForResponsesAPI} instance. + */ + @Nonnull + public Boolean isBlocked() { + return blocked; + } + + /** + * Set the blocked of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param blocked Indicate if the response is blocked. + */ + public void setBlocked(@Nonnull final Boolean blocked) { + this.blocked = blocked; + } + + /** + * Set the sourceType of this {@link AzureContentFilterForResponsesAPI} instance and return the + * same instance. + * + * @param sourceType The name of the source type of the message. + * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterForResponsesAPI sourceType(@Nonnull final String sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * The name of the source type of the message. + * + * @return sourceType The sourceType of this {@link AzureContentFilterForResponsesAPI} instance. + */ + @Nonnull + public String getSourceType() { + return sourceType; + } + + /** + * Set the sourceType of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param sourceType The name of the source type of the message. + */ + public void setSourceType(@Nonnull final String sourceType) { + this.sourceType = sourceType; + } + + /** + * Set the contentFilterResults of this {@link AzureContentFilterForResponsesAPI} instance and + * return the same instance. + * + * @param contentFilterResults A content filter result for a single response item produced by a + * generative AI system. + * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterForResponsesAPI contentFilterResults( + @Nonnull final AzureContentFilterResultsForResponsesAPI contentFilterResults) { + this.contentFilterResults = contentFilterResults; + return this; + } + + /** + * A content filter result for a single response item produced by a generative AI system. + * + * @return contentFilterResults The contentFilterResults of this {@link + * AzureContentFilterForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI getContentFilterResults() { + return contentFilterResults; + } + + /** + * Set the contentFilterResults of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param contentFilterResults A content filter result for a single response item produced by a + * generative AI system. + */ + public void setContentFilterResults( + @Nonnull final AzureContentFilterResultsForResponsesAPI contentFilterResults) { + this.contentFilterResults = contentFilterResults; + } + + /** + * Set the contentFilterOffsets of this {@link AzureContentFilterForResponsesAPI} instance and + * return the same instance. + * + * @param contentFilterOffsets The contentFilterOffsets of this {@link + * AzureContentFilterForResponsesAPI} + * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterForResponsesAPI contentFilterOffsets( + @Nonnull final AzureContentFilterResultOffsets contentFilterOffsets) { + this.contentFilterOffsets = contentFilterOffsets; + return this; + } + + /** + * Get contentFilterOffsets + * + * @return contentFilterOffsets The contentFilterOffsets of this {@link + * AzureContentFilterForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterResultOffsets getContentFilterOffsets() { + return contentFilterOffsets; + } + + /** + * Set the contentFilterOffsets of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param contentFilterOffsets The contentFilterOffsets of this {@link + * AzureContentFilterForResponsesAPI} + */ + public void setContentFilterOffsets( + @Nonnull final AzureContentFilterResultOffsets contentFilterOffsets) { + this.contentFilterOffsets = contentFilterOffsets; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterForResponsesAPI}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentFilterForResponsesAPI} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterForResponsesAPI has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterForResponsesAPI} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (blocked != null) declaredFields.put("blocked", blocked); + if (sourceType != null) declaredFields.put("sourceType", sourceType); + if (contentFilterResults != null) + declaredFields.put("contentFilterResults", contentFilterResults); + if (contentFilterOffsets != null) + declaredFields.put("contentFilterOffsets", contentFilterOffsets); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterForResponsesAPI} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterForResponsesAPI azureContentFilterForResponsesAPI = + (AzureContentFilterForResponsesAPI) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterForResponsesAPI.cloudSdkCustomFields) + && Objects.equals(this.blocked, azureContentFilterForResponsesAPI.blocked) + && Objects.equals(this.sourceType, azureContentFilterForResponsesAPI.sourceType) + && Objects.equals( + this.contentFilterResults, azureContentFilterForResponsesAPI.contentFilterResults) + && Objects.equals( + this.contentFilterOffsets, azureContentFilterForResponsesAPI.contentFilterOffsets); + } + + @Override + public int hashCode() { + return Objects.hash( + blocked, sourceType, contentFilterResults, contentFilterOffsets, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterForResponsesAPI {\n"); + sb.append(" blocked: ").append(toIndentedString(blocked)).append("\n"); + sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); + sb.append(" contentFilterResults: ") + .append(toIndentedString(contentFilterResults)) + .append("\n"); + sb.append(" contentFilterOffsets: ") + .append(toIndentedString(contentFilterOffsets)) + .append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterForResponsesAPI} instance with all required arguments. + */ + public static Builder create() { + return (blocked) -> + (sourceType) -> + (contentFilterResults) -> + (contentFilterOffsets) -> + new AzureContentFilterForResponsesAPI() + .blocked(blocked) + .sourceType(sourceType) + .contentFilterResults(contentFilterResults) + .contentFilterOffsets(contentFilterOffsets); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the blocked of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param blocked Indicate if the response is blocked. + * @return The AzureContentFilterForResponsesAPI builder. + */ + Builder1 blocked(@Nonnull final Boolean blocked); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the sourceType of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param sourceType The name of the source type of the message. + * @return The AzureContentFilterForResponsesAPI builder. + */ + Builder2 sourceType(@Nonnull final String sourceType); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the contentFilterResults of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param contentFilterResults A content filter result for a single response item produced by a + * generative AI system. + * @return The AzureContentFilterForResponsesAPI builder. + */ + Builder3 contentFilterResults( + @Nonnull final AzureContentFilterResultsForResponsesAPI contentFilterResults); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the contentFilterOffsets of this {@link AzureContentFilterForResponsesAPI} instance. + * + * @param contentFilterOffsets The contentFilterOffsets of this {@link + * AzureContentFilterForResponsesAPI} + * @return The AzureContentFilterForResponsesAPI instance. + */ + AzureContentFilterForResponsesAPI contentFilterOffsets( + @Nonnull final AzureContentFilterResultOffsets contentFilterOffsets); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java new file mode 100644 index 000000000..6ddd0091e --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java @@ -0,0 +1,371 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterPersonallyIdentifiableInformationResult */ +// CHECKSTYLE:OFF +public class AzureContentFilterPersonallyIdentifiableInformationResult +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("detected") + private Boolean detected; + + @JsonProperty("redacted_text") + private String redactedText; + + @JsonProperty("sub_categories") + private List subCategories = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterPersonallyIdentifiableInformationResult. */ + protected AzureContentFilterPersonallyIdentifiableInformationResult() {} + + /** + * Set the filtered of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance and return the same instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The same instance of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} class + */ + @Nonnull + public AzureContentFilterPersonallyIdentifiableInformationResult filtered( + @Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * Whether the content detection resulted in a content filtering action. + * + * @return filtered The filtered of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the detected of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance and return the same instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The same instance of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} class + */ + @Nonnull + public AzureContentFilterPersonallyIdentifiableInformationResult detected( + @Nonnull final Boolean detected) { + this.detected = detected; + return this; + } + + /** + * Whether the labeled content category was detected in the content. + * + * @return detected The detected of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance. + */ + @Nonnull + public Boolean isDetected() { + return detected; + } + + /** + * Set the detected of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance. + * + * @param detected Whether the labeled content category was detected in the content. + */ + public void setDetected(@Nonnull final Boolean detected) { + this.detected = detected; + } + + /** + * Set the redactedText of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance and return the same instance. + * + * @param redactedText The redacted text with PII information removed or masked. + * @return The same instance of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} class + */ + @Nonnull + public AzureContentFilterPersonallyIdentifiableInformationResult redactedText( + @Nullable final String redactedText) { + this.redactedText = redactedText; + return this; + } + + /** + * The redacted text with PII information removed or masked. + * + * @return redactedText The redactedText of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance. + */ + @Nonnull + public String getRedactedText() { + return redactedText; + } + + /** + * Set the redactedText of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance. + * + * @param redactedText The redacted text with PII information removed or masked. + */ + public void setRedactedText(@Nullable final String redactedText) { + this.redactedText = redactedText; + } + + /** + * Set the subCategories of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance and return the same instance. + * + * @param subCategories Detailed results for individual PIIHarmSubCategory(s). + * @return The same instance of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} class + */ + @Nonnull + public AzureContentFilterPersonallyIdentifiableInformationResult subCategories( + @Nullable final List subCategories) { + this.subCategories = subCategories; + return this; + } + + /** + * Add one subCategories instance to this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult}. + * + * @param subCategoriesItem The subCategories that should be added + * @return The same instance of type {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} + */ + @Nonnull + public AzureContentFilterPersonallyIdentifiableInformationResult addSubCategoriesItem( + @Nonnull final AzurePiiSubCategoryResult subCategoriesItem) { + if (this.subCategories == null) { + this.subCategories = new ArrayList<>(); + } + this.subCategories.add(subCategoriesItem); + return this; + } + + /** + * Detailed results for individual PIIHarmSubCategory(s). + * + * @return subCategories The subCategories of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance. + */ + @Nonnull + public List getSubCategories() { + return subCategories; + } + + /** + * Set the subCategories of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance. + * + * @param subCategories Detailed results for individual PIIHarmSubCategory(s). + */ + public void setSubCategories(@Nullable final List subCategories) { + this.subCategories = subCategories; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterPersonallyIdentifiableInformationResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterPersonallyIdentifiableInformationResult has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + if (redactedText != null) declaredFields.put("redactedText", redactedText); + if (subCategories != null) declaredFields.put("subCategories", subCategories); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterPersonallyIdentifiableInformationResult + azureContentFilterPersonallyIdentifiableInformationResult = + (AzureContentFilterPersonallyIdentifiableInformationResult) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterPersonallyIdentifiableInformationResult.cloudSdkCustomFields) + && Objects.equals( + this.filtered, azureContentFilterPersonallyIdentifiableInformationResult.filtered) + && Objects.equals( + this.detected, azureContentFilterPersonallyIdentifiableInformationResult.detected) + && Objects.equals( + this.redactedText, + azureContentFilterPersonallyIdentifiableInformationResult.redactedText) + && Objects.equals( + this.subCategories, + azureContentFilterPersonallyIdentifiableInformationResult.subCategories); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, detected, redactedText, subCategories, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterPersonallyIdentifiableInformationResult {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); + sb.append(" redactedText: ").append(toIndentedString(redactedText)).append("\n"); + sb.append(" subCategories: ").append(toIndentedString(subCategories)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterPersonallyIdentifiableInformationResult} instance with all required + * arguments. + */ + public static Builder create() { + return (filtered) -> + (detected) -> + new AzureContentFilterPersonallyIdentifiableInformationResult() + .filtered(filtered) + .detected(detected); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The AzureContentFilterPersonallyIdentifiableInformationResult builder. + */ + Builder1 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the detected of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} + * instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The AzureContentFilterPersonallyIdentifiableInformationResult instance. + */ + AzureContentFilterPersonallyIdentifiableInformationResult detected( + @Nonnull final Boolean detected); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java new file mode 100644 index 000000000..8052e2c64 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java @@ -0,0 +1,244 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * If present, details about an error that prevented content filtering from completing its + * evaluation. + */ +// CHECKSTYLE:OFF +public class AzureContentFilterResultForChoiceError +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private Integer code; + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterResultForChoiceError. */ + protected AzureContentFilterResultForChoiceError() {} + + /** + * Set the code of this {@link AzureContentFilterResultForChoiceError} instance and return the + * same instance. + * + * @param code A distinct, machine-readable code associated with the error. + * @return The same instance of this {@link AzureContentFilterResultForChoiceError} class + */ + @Nonnull + public AzureContentFilterResultForChoiceError code(@Nonnull final Integer code) { + this.code = code; + return this; + } + + /** + * A distinct, machine-readable code associated with the error. + * + * @return code The code of this {@link AzureContentFilterResultForChoiceError} instance. + */ + @Nonnull + public Integer getCode() { + return code; + } + + /** + * Set the code of this {@link AzureContentFilterResultForChoiceError} instance. + * + * @param code A distinct, machine-readable code associated with the error. + */ + public void setCode(@Nonnull final Integer code) { + this.code = code; + } + + /** + * Set the message of this {@link AzureContentFilterResultForChoiceError} instance and return the + * same instance. + * + * @param message A human-readable message associated with the error. + * @return The same instance of this {@link AzureContentFilterResultForChoiceError} class + */ + @Nonnull + public AzureContentFilterResultForChoiceError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * A human-readable message associated with the error. + * + * @return message The message of this {@link AzureContentFilterResultForChoiceError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link AzureContentFilterResultForChoiceError} instance. + * + * @param message A human-readable message associated with the error. + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterResultForChoiceError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterResultForChoiceError} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterResultForChoiceError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterResultForChoiceError} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterResultForChoiceError} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterResultForChoiceError azureContentFilterResultForChoiceError = + (AzureContentFilterResultForChoiceError) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterResultForChoiceError.cloudSdkCustomFields) + && Objects.equals(this.code, azureContentFilterResultForChoiceError.code) + && Objects.equals(this.message, azureContentFilterResultForChoiceError.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterResultForChoiceError {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterResultForChoiceError} instance with all required arguments. + */ + public static Builder create() { + return (code) -> + (message) -> new AzureContentFilterResultForChoiceError().code(code).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link AzureContentFilterResultForChoiceError} instance. + * + * @param code A distinct, machine-readable code associated with the error. + * @return The AzureContentFilterResultForChoiceError builder. + */ + Builder1 code(@Nonnull final Integer code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link AzureContentFilterResultForChoiceError} instance. + * + * @param message A human-readable message associated with the error. + * @return The AzureContentFilterResultForChoiceError instance. + */ + AzureContentFilterResultForChoiceError message(@Nonnull final String message); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java new file mode 100644 index 000000000..dc9654c76 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java @@ -0,0 +1,311 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * A detection result that describes a match against licensed code or other protected source + * material. + */ +// CHECKSTYLE:OFF +public class AzureContentFilterResultForChoiceProtectedMaterialCode +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("detected") + private Boolean detected; + + @JsonProperty("citation") + private AzureContentFilterResultForChoiceProtectedMaterialCodeCitation citation; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterResultForChoiceProtectedMaterialCode. */ + protected AzureContentFilterResultForChoiceProtectedMaterialCode() {} + + /** + * Set the filtered of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance and return the same instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The same instance of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} class + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCode filtered( + @Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * Whether the content detection resulted in a content filtering action. + * + * @return filtered The filtered of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the detected of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance and return the same instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The same instance of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} class + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCode detected( + @Nonnull final Boolean detected) { + this.detected = detected; + return this; + } + + /** + * Whether the labeled content category was detected in the content. + * + * @return detected The detected of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + */ + @Nonnull + public Boolean isDetected() { + return detected; + } + + /** + * Set the detected of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance. + * + * @param detected Whether the labeled content category was detected in the content. + */ + public void setDetected(@Nonnull final Boolean detected) { + this.detected = detected; + } + + /** + * Set the citation of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance and return the same instance. + * + * @param citation The citation of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} + * @return The same instance of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} class + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCode citation( + @Nullable final AzureContentFilterResultForChoiceProtectedMaterialCodeCitation citation) { + this.citation = citation; + return this; + } + + /** + * Get citation + * + * @return citation The citation of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation getCitation() { + return citation; + } + + /** + * Set the citation of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance. + * + * @param citation The citation of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} + */ + public void setCitation( + @Nullable final AzureContentFilterResultForChoiceProtectedMaterialCodeCitation citation) { + this.citation = citation; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterResultForChoiceProtectedMaterialCode has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + if (citation != null) declaredFields.put("citation", citation); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterResultForChoiceProtectedMaterialCode + azureContentFilterResultForChoiceProtectedMaterialCode = + (AzureContentFilterResultForChoiceProtectedMaterialCode) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterResultForChoiceProtectedMaterialCode.cloudSdkCustomFields) + && Objects.equals( + this.filtered, azureContentFilterResultForChoiceProtectedMaterialCode.filtered) + && Objects.equals( + this.detected, azureContentFilterResultForChoiceProtectedMaterialCode.detected) + && Objects.equals( + this.citation, azureContentFilterResultForChoiceProtectedMaterialCode.citation); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, detected, citation, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterResultForChoiceProtectedMaterialCode {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); + sb.append(" citation: ").append(toIndentedString(citation)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterResultForChoiceProtectedMaterialCode} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> + (detected) -> + new AzureContentFilterResultForChoiceProtectedMaterialCode() + .filtered(filtered) + .detected(detected); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action. + * @return The AzureContentFilterResultForChoiceProtectedMaterialCode builder. + */ + Builder1 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the detected of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * instance. + * + * @param detected Whether the labeled content category was detected in the content. + * @return The AzureContentFilterResultForChoiceProtectedMaterialCode instance. + */ + AzureContentFilterResultForChoiceProtectedMaterialCode detected( + @Nonnull final Boolean detected); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java new file mode 100644 index 000000000..96386d19c --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java @@ -0,0 +1,234 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** If available, the citation details describing the associated license and its location. */ +// CHECKSTYLE:OFF +public class AzureContentFilterResultForChoiceProtectedMaterialCodeCitation +// CHECKSTYLE:ON +{ + @JsonProperty("license") + private String license; + + @JsonProperty("URL") + private URI URL; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterResultForChoiceProtectedMaterialCodeCitation. */ + protected AzureContentFilterResultForChoiceProtectedMaterialCodeCitation() {} + + /** + * Set the license of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} + * instance and return the same instance. + * + * @param license The name or identifier of the license associated with the detection. + * @return The same instance of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} class + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation license( + @Nullable final String license) { + this.license = license; + return this; + } + + /** + * The name or identifier of the license associated with the detection. + * + * @return license The license of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + */ + @Nonnull + public String getLicense() { + return license; + } + + /** + * Set the license of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} + * instance. + * + * @param license The name or identifier of the license associated with the detection. + */ + public void setLicense(@Nullable final String license) { + this.license = license; + } + + /** + * Set the URL of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} + * instance and return the same instance. + * + * @param URL The URL associated with the license. + * @return The same instance of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} class + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation URL( + @Nullable final URI URL) { + this.URL = URL; + return this; + } + + /** + * The URL associated with the license. + * + * @return URL The URL of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + */ + @Nonnull + public URI getURL() { + return URL; + } + + /** + * Set the URL of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} + * instance. + * + * @param URL The URL associated with the license. + */ + public void setURL(@Nullable final URI URL) { + this.URL = URL; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterResultForChoiceProtectedMaterialCodeCitation has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (license != null) declaredFields.put("license", license); + if (URL != null) declaredFields.put("URL", URL); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterResultForChoiceProtectedMaterialCodeCitation + azureContentFilterResultForChoiceProtectedMaterialCodeCitation = + (AzureContentFilterResultForChoiceProtectedMaterialCodeCitation) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterResultForChoiceProtectedMaterialCodeCitation.cloudSdkCustomFields) + && Objects.equals( + this.license, azureContentFilterResultForChoiceProtectedMaterialCodeCitation.license) + && Objects.equals( + this.URL, azureContentFilterResultForChoiceProtectedMaterialCodeCitation.URL); + } + + @Override + public int hashCode() { + return Objects.hash(license, URL, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterResultForChoiceProtectedMaterialCodeCitation {\n"); + sb.append(" license: ").append(toIndentedString(license)).append("\n"); + sb.append(" URL: ").append(toIndentedString(URL)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a new {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + * No arguments are required. + */ + public static AzureContentFilterResultForChoiceProtectedMaterialCodeCitation create() { + return new AzureContentFilterResultForChoiceProtectedMaterialCodeCitation(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java new file mode 100644 index 000000000..7dcb1bc28 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java @@ -0,0 +1,294 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterResultOffsets */ +// CHECKSTYLE:OFF +public class AzureContentFilterResultOffsets +// CHECKSTYLE:ON +{ + @JsonProperty("start_offset") + private Integer startOffset; + + @JsonProperty("end_offset") + private Integer endOffset; + + @JsonProperty("check_offset") + private Integer checkOffset; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterResultOffsets. */ + protected AzureContentFilterResultOffsets() {} + + /** + * Set the startOffset of this {@link AzureContentFilterResultOffsets} instance and return the + * same instance. + * + * @param startOffset The startOffset of this {@link AzureContentFilterResultOffsets} + * @return The same instance of this {@link AzureContentFilterResultOffsets} class + */ + @Nonnull + public AzureContentFilterResultOffsets startOffset(@Nonnull final Integer startOffset) { + this.startOffset = startOffset; + return this; + } + + /** + * Get startOffset + * + * @return startOffset The startOffset of this {@link AzureContentFilterResultOffsets} instance. + */ + @Nonnull + public Integer getStartOffset() { + return startOffset; + } + + /** + * Set the startOffset of this {@link AzureContentFilterResultOffsets} instance. + * + * @param startOffset The startOffset of this {@link AzureContentFilterResultOffsets} + */ + public void setStartOffset(@Nonnull final Integer startOffset) { + this.startOffset = startOffset; + } + + /** + * Set the endOffset of this {@link AzureContentFilterResultOffsets} instance and return the same + * instance. + * + * @param endOffset The endOffset of this {@link AzureContentFilterResultOffsets} + * @return The same instance of this {@link AzureContentFilterResultOffsets} class + */ + @Nonnull + public AzureContentFilterResultOffsets endOffset(@Nonnull final Integer endOffset) { + this.endOffset = endOffset; + return this; + } + + /** + * Get endOffset + * + * @return endOffset The endOffset of this {@link AzureContentFilterResultOffsets} instance. + */ + @Nonnull + public Integer getEndOffset() { + return endOffset; + } + + /** + * Set the endOffset of this {@link AzureContentFilterResultOffsets} instance. + * + * @param endOffset The endOffset of this {@link AzureContentFilterResultOffsets} + */ + public void setEndOffset(@Nonnull final Integer endOffset) { + this.endOffset = endOffset; + } + + /** + * Set the checkOffset of this {@link AzureContentFilterResultOffsets} instance and return the + * same instance. + * + * @param checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} + * @return The same instance of this {@link AzureContentFilterResultOffsets} class + */ + @Nonnull + public AzureContentFilterResultOffsets checkOffset(@Nonnull final Integer checkOffset) { + this.checkOffset = checkOffset; + return this; + } + + /** + * Get checkOffset + * + * @return checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} instance. + */ + @Nonnull + public Integer getCheckOffset() { + return checkOffset; + } + + /** + * Set the checkOffset of this {@link AzureContentFilterResultOffsets} instance. + * + * @param checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} + */ + public void setCheckOffset(@Nonnull final Integer checkOffset) { + this.checkOffset = checkOffset; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureContentFilterResultOffsets}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentFilterResultOffsets} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterResultOffsets has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterResultOffsets} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (startOffset != null) declaredFields.put("startOffset", startOffset); + if (endOffset != null) declaredFields.put("endOffset", endOffset); + if (checkOffset != null) declaredFields.put("checkOffset", checkOffset); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterResultOffsets} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterResultOffsets azureContentFilterResultOffsets = + (AzureContentFilterResultOffsets) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterResultOffsets.cloudSdkCustomFields) + && Objects.equals(this.startOffset, azureContentFilterResultOffsets.startOffset) + && Objects.equals(this.endOffset, azureContentFilterResultOffsets.endOffset) + && Objects.equals(this.checkOffset, azureContentFilterResultOffsets.checkOffset); + } + + @Override + public int hashCode() { + return Objects.hash(startOffset, endOffset, checkOffset, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterResultOffsets {\n"); + sb.append(" startOffset: ").append(toIndentedString(startOffset)).append("\n"); + sb.append(" endOffset: ").append(toIndentedString(endOffset)).append("\n"); + sb.append(" checkOffset: ").append(toIndentedString(checkOffset)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterResultOffsets} instance with all required arguments. + */ + public static Builder create() { + return (startOffset) -> + (endOffset) -> + (checkOffset) -> + new AzureContentFilterResultOffsets() + .startOffset(startOffset) + .endOffset(endOffset) + .checkOffset(checkOffset); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the startOffset of this {@link AzureContentFilterResultOffsets} instance. + * + * @param startOffset The startOffset of this {@link AzureContentFilterResultOffsets} + * @return The AzureContentFilterResultOffsets builder. + */ + Builder1 startOffset(@Nonnull final Integer startOffset); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the endOffset of this {@link AzureContentFilterResultOffsets} instance. + * + * @param endOffset The endOffset of this {@link AzureContentFilterResultOffsets} + * @return The AzureContentFilterResultOffsets builder. + */ + Builder2 endOffset(@Nonnull final Integer endOffset); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the checkOffset of this {@link AzureContentFilterResultOffsets} instance. + * + * @param checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} + * @return The AzureContentFilterResultOffsets instance. + */ + AzureContentFilterResultOffsets checkOffset(@Nonnull final Integer checkOffset); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java new file mode 100644 index 000000000..9d7a50bce --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java @@ -0,0 +1,883 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** AzureContentFilterResultsForResponsesAPI */ +// CHECKSTYLE:OFF +public class AzureContentFilterResultsForResponsesAPI +// CHECKSTYLE:ON +{ + @JsonProperty("sexual") + private AzureContentFilterSeverityResult sexual; + + @JsonProperty("hate") + private AzureContentFilterSeverityResult hate; + + @JsonProperty("violence") + private AzureContentFilterSeverityResult violence; + + @JsonProperty("self_harm") + private AzureContentFilterSeverityResult selfHarm; + + @JsonProperty("profanity") + private AzureContentFilterDetectionResult profanity; + + @JsonProperty("custom_blocklists") + private AzureContentFilterBlocklistResult customBlocklists; + + @JsonProperty("custom_topics") + private AzureContentFilterCustomTopicResult customTopics; + + @JsonProperty("error") + private AzureContentFilterResultForChoiceError error; + + @JsonProperty("jailbreak") + private AzureContentFilterDetectionResult jailbreak; + + @JsonProperty("task_adherence") + private AzureContentFilterDetectionResult taskAdherence; + + @JsonProperty("protected_material_text") + private AzureContentFilterDetectionResult protectedMaterialText; + + @JsonProperty("protected_material_code") + private AzureContentFilterResultForChoiceProtectedMaterialCode protectedMaterialCode; + + @JsonProperty("ungrounded_material") + private AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial; + + @JsonProperty("personally_identifiable_information") + private AzureContentFilterPersonallyIdentifiableInformationResult + personallyIdentifiableInformation; + + @JsonProperty("indirect_attack") + private AzureContentFilterDetectionResult indirectAttack; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterResultsForResponsesAPI. */ + protected AzureContentFilterResultsForResponsesAPI() {} + + /** + * Set the sexual of this {@link AzureContentFilterResultsForResponsesAPI} instance and return the + * same instance. + * + * @param sexual A content filter category for language related to anatomical organs and genitals, + * romantic relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical + * sexual acts, including those portrayed as an assault or a forced sexual violent act against + * one's will, prostitution, pornography, and abuse. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI sexual( + @Nullable final AzureContentFilterSeverityResult sexual) { + this.sexual = sexual; + return this; + } + + /** + * A content filter category for language related to anatomical organs and genitals, romantic + * relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, + * including those portrayed as an assault or a forced sexual violent act against one's will, + * prostitution, pornography, and abuse. + * + * @return sexual The sexual of this {@link AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterSeverityResult getSexual() { + return sexual; + } + + /** + * Set the sexual of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param sexual A content filter category for language related to anatomical organs and genitals, + * romantic relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical + * sexual acts, including those portrayed as an assault or a forced sexual violent act against + * one's will, prostitution, pornography, and abuse. + */ + public void setSexual(@Nullable final AzureContentFilterSeverityResult sexual) { + this.sexual = sexual; + } + + /** + * Set the hate of this {@link AzureContentFilterResultsForResponsesAPI} instance and return the + * same instance. + * + * @param hate A content filter category that can refer to any content that attacks or uses + * pejorative or discriminatory language with reference to a person or identity group based on + * certain differentiating attributes of these groups including but not limited to race, + * ethnicity, nationality, gender identity and expression, sexual orientation, religion, + * immigration status, ability status, personal appearance, and body size. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI hate( + @Nullable final AzureContentFilterSeverityResult hate) { + this.hate = hate; + return this; + } + + /** + * A content filter category that can refer to any content that attacks or uses pejorative or + * discriminatory language with reference to a person or identity group based on certain + * differentiating attributes of these groups including but not limited to race, ethnicity, + * nationality, gender identity and expression, sexual orientation, religion, immigration status, + * ability status, personal appearance, and body size. + * + * @return hate The hate of this {@link AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterSeverityResult getHate() { + return hate; + } + + /** + * Set the hate of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param hate A content filter category that can refer to any content that attacks or uses + * pejorative or discriminatory language with reference to a person or identity group based on + * certain differentiating attributes of these groups including but not limited to race, + * ethnicity, nationality, gender identity and expression, sexual orientation, religion, + * immigration status, ability status, personal appearance, and body size. + */ + public void setHate(@Nullable final AzureContentFilterSeverityResult hate) { + this.hate = hate; + } + + /** + * Set the violence of this {@link AzureContentFilterResultsForResponsesAPI} instance and return + * the same instance. + * + * @param violence A content filter category for language related to physical actions intended to + * hurt, injure, damage, or kill someone or something; describes weapons, guns and related + * entities, such as manufactures, associations, legislation, and so on. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI violence( + @Nullable final AzureContentFilterSeverityResult violence) { + this.violence = violence; + return this; + } + + /** + * A content filter category for language related to physical actions intended to hurt, injure, + * damage, or kill someone or something; describes weapons, guns and related entities, such as + * manufactures, associations, legislation, and so on. + * + * @return violence The violence of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + */ + @Nonnull + public AzureContentFilterSeverityResult getViolence() { + return violence; + } + + /** + * Set the violence of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param violence A content filter category for language related to physical actions intended to + * hurt, injure, damage, or kill someone or something; describes weapons, guns and related + * entities, such as manufactures, associations, legislation, and so on. + */ + public void setViolence(@Nullable final AzureContentFilterSeverityResult violence) { + this.violence = violence; + } + + /** + * Set the selfHarm of this {@link AzureContentFilterResultsForResponsesAPI} instance and return + * the same instance. + * + * @param selfHarm A content filter category that describes language related to physical actions + * intended to purposely hurt, injure, damage one's body or kill oneself. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI selfHarm( + @Nullable final AzureContentFilterSeverityResult selfHarm) { + this.selfHarm = selfHarm; + return this; + } + + /** + * A content filter category that describes language related to physical actions intended to + * purposely hurt, injure, damage one's body or kill oneself. + * + * @return selfHarm The selfHarm of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + */ + @Nonnull + public AzureContentFilterSeverityResult getSelfHarm() { + return selfHarm; + } + + /** + * Set the selfHarm of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param selfHarm A content filter category that describes language related to physical actions + * intended to purposely hurt, injure, damage one's body or kill oneself. + */ + public void setSelfHarm(@Nullable final AzureContentFilterSeverityResult selfHarm) { + this.selfHarm = selfHarm; + } + + /** + * Set the profanity of this {@link AzureContentFilterResultsForResponsesAPI} instance and return + * the same instance. + * + * @param profanity A detection result that identifies whether crude, vulgar, or otherwise + * objection language is present in the content. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI profanity( + @Nullable final AzureContentFilterDetectionResult profanity) { + this.profanity = profanity; + return this; + } + + /** + * A detection result that identifies whether crude, vulgar, or otherwise objection language is + * present in the content. + * + * @return profanity The profanity of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + */ + @Nonnull + public AzureContentFilterDetectionResult getProfanity() { + return profanity; + } + + /** + * Set the profanity of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param profanity A detection result that identifies whether crude, vulgar, or otherwise + * objection language is present in the content. + */ + public void setProfanity(@Nullable final AzureContentFilterDetectionResult profanity) { + this.profanity = profanity; + } + + /** + * Set the customBlocklists of this {@link AzureContentFilterResultsForResponsesAPI} instance and + * return the same instance. + * + * @param customBlocklists A collection of binary filtering outcomes for configured custom + * blocklists. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI customBlocklists( + @Nullable final AzureContentFilterBlocklistResult customBlocklists) { + this.customBlocklists = customBlocklists; + return this; + } + + /** + * A collection of binary filtering outcomes for configured custom blocklists. + * + * @return customBlocklists The customBlocklists of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterBlocklistResult getCustomBlocklists() { + return customBlocklists; + } + + /** + * Set the customBlocklists of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param customBlocklists A collection of binary filtering outcomes for configured custom + * blocklists. + */ + public void setCustomBlocklists( + @Nullable final AzureContentFilterBlocklistResult customBlocklists) { + this.customBlocklists = customBlocklists; + } + + /** + * Set the customTopics of this {@link AzureContentFilterResultsForResponsesAPI} instance and + * return the same instance. + * + * @param customTopics A collection of binary filtering outcomes for configured custom topics. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI customTopics( + @Nullable final AzureContentFilterCustomTopicResult customTopics) { + this.customTopics = customTopics; + return this; + } + + /** + * A collection of binary filtering outcomes for configured custom topics. + * + * @return customTopics The customTopics of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + */ + @Nonnull + public AzureContentFilterCustomTopicResult getCustomTopics() { + return customTopics; + } + + /** + * Set the customTopics of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param customTopics A collection of binary filtering outcomes for configured custom topics. + */ + public void setCustomTopics(@Nullable final AzureContentFilterCustomTopicResult customTopics) { + this.customTopics = customTopics; + } + + /** + * Set the error of this {@link AzureContentFilterResultsForResponsesAPI} instance and return the + * same instance. + * + * @param error The error of this {@link AzureContentFilterResultsForResponsesAPI} + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI error( + @Nullable final AzureContentFilterResultForChoiceError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterResultForChoiceError getError() { + return error; + } + + /** + * Set the error of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param error The error of this {@link AzureContentFilterResultsForResponsesAPI} + */ + public void setError(@Nullable final AzureContentFilterResultForChoiceError error) { + this.error = error; + } + + /** + * Set the jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} instance and return + * the same instance. + * + * @param jailbreak A detection result that describes user prompt injection attacks, where + * malicious users deliberately exploit system vulnerabilities to elicit unauthorized behavior + * from the LLM. This could lead to inappropriate content generation or violations of + * system-imposed restrictions. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI jailbreak( + @Nonnull final AzureContentFilterDetectionResult jailbreak) { + this.jailbreak = jailbreak; + return this; + } + + /** + * A detection result that describes user prompt injection attacks, where malicious users + * deliberately exploit system vulnerabilities to elicit unauthorized behavior from the LLM. This + * could lead to inappropriate content generation or violations of system-imposed restrictions. + * + * @return jailbreak The jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + */ + @Nonnull + public AzureContentFilterDetectionResult getJailbreak() { + return jailbreak; + } + + /** + * Set the jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param jailbreak A detection result that describes user prompt injection attacks, where + * malicious users deliberately exploit system vulnerabilities to elicit unauthorized behavior + * from the LLM. This could lead to inappropriate content generation or violations of + * system-imposed restrictions. + */ + public void setJailbreak(@Nonnull final AzureContentFilterDetectionResult jailbreak) { + this.jailbreak = jailbreak; + } + + /** + * Set the taskAdherence of this {@link AzureContentFilterResultsForResponsesAPI} instance and + * return the same instance. + * + * @param taskAdherence A detection result that indicates if the execution flow still sticks the + * plan. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI taskAdherence( + @Nonnull final AzureContentFilterDetectionResult taskAdherence) { + this.taskAdherence = taskAdherence; + return this; + } + + /** + * A detection result that indicates if the execution flow still sticks the plan. + * + * @return taskAdherence The taskAdherence of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterDetectionResult getTaskAdherence() { + return taskAdherence; + } + + /** + * Set the taskAdherence of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param taskAdherence A detection result that indicates if the execution flow still sticks the + * plan. + */ + public void setTaskAdherence(@Nonnull final AzureContentFilterDetectionResult taskAdherence) { + this.taskAdherence = taskAdherence; + } + + /** + * Set the protectedMaterialText of this {@link AzureContentFilterResultsForResponsesAPI} instance + * and return the same instance. + * + * @param protectedMaterialText A detection result that describes a match against text protected + * under copyright or other status. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI protectedMaterialText( + @Nullable final AzureContentFilterDetectionResult protectedMaterialText) { + this.protectedMaterialText = protectedMaterialText; + return this; + } + + /** + * A detection result that describes a match against text protected under copyright or other + * status. + * + * @return protectedMaterialText The protectedMaterialText of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterDetectionResult getProtectedMaterialText() { + return protectedMaterialText; + } + + /** + * Set the protectedMaterialText of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + * + * @param protectedMaterialText A detection result that describes a match against text protected + * under copyright or other status. + */ + public void setProtectedMaterialText( + @Nullable final AzureContentFilterDetectionResult protectedMaterialText) { + this.protectedMaterialText = protectedMaterialText; + } + + /** + * Set the protectedMaterialCode of this {@link AzureContentFilterResultsForResponsesAPI} instance + * and return the same instance. + * + * @param protectedMaterialCode The protectedMaterialCode of this {@link + * AzureContentFilterResultsForResponsesAPI} + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI protectedMaterialCode( + @Nullable + final AzureContentFilterResultForChoiceProtectedMaterialCode protectedMaterialCode) { + this.protectedMaterialCode = protectedMaterialCode; + return this; + } + + /** + * Get protectedMaterialCode + * + * @return protectedMaterialCode The protectedMaterialCode of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterResultForChoiceProtectedMaterialCode getProtectedMaterialCode() { + return protectedMaterialCode; + } + + /** + * Set the protectedMaterialCode of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. + * + * @param protectedMaterialCode The protectedMaterialCode of this {@link + * AzureContentFilterResultsForResponsesAPI} + */ + public void setProtectedMaterialCode( + @Nullable + final AzureContentFilterResultForChoiceProtectedMaterialCode protectedMaterialCode) { + this.protectedMaterialCode = protectedMaterialCode; + } + + /** + * Set the ungroundedMaterial of this {@link AzureContentFilterResultsForResponsesAPI} instance + * and return the same instance. + * + * @param ungroundedMaterial The ungroundedMaterial of this {@link + * AzureContentFilterResultsForResponsesAPI} + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI ungroundedMaterial( + @Nullable final AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial) { + this.ungroundedMaterial = ungroundedMaterial; + return this; + } + + /** + * Get ungroundedMaterial + * + * @return ungroundedMaterial The ungroundedMaterial of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterCompletionTextSpanDetectionResult getUngroundedMaterial() { + return ungroundedMaterial; + } + + /** + * Set the ungroundedMaterial of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param ungroundedMaterial The ungroundedMaterial of this {@link + * AzureContentFilterResultsForResponsesAPI} + */ + public void setUngroundedMaterial( + @Nullable final AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial) { + this.ungroundedMaterial = ungroundedMaterial; + } + + /** + * Set the personallyIdentifiableInformation of this {@link + * AzureContentFilterResultsForResponsesAPI} instance and return the same instance. + * + * @param personallyIdentifiableInformation A detection result that describes matches against + * Personal Identifiable Information with configurable subcategories. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI personallyIdentifiableInformation( + @Nullable + final AzureContentFilterPersonallyIdentifiableInformationResult + personallyIdentifiableInformation) { + this.personallyIdentifiableInformation = personallyIdentifiableInformation; + return this; + } + + /** + * A detection result that describes matches against Personal Identifiable Information with + * configurable subcategories. + * + * @return personallyIdentifiableInformation The personallyIdentifiableInformation of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterPersonallyIdentifiableInformationResult + getPersonallyIdentifiableInformation() { + return personallyIdentifiableInformation; + } + + /** + * Set the personallyIdentifiableInformation of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + * + * @param personallyIdentifiableInformation A detection result that describes matches against + * Personal Identifiable Information with configurable subcategories. + */ + public void setPersonallyIdentifiableInformation( + @Nullable + final AzureContentFilterPersonallyIdentifiableInformationResult + personallyIdentifiableInformation) { + this.personallyIdentifiableInformation = personallyIdentifiableInformation; + } + + /** + * Set the indirectAttack of this {@link AzureContentFilterResultsForResponsesAPI} instance and + * return the same instance. + * + * @param indirectAttack A detection result that describes attacks on systems powered by + * Generative AI models that can happen every time an application processes information that + * wasn’t directly authored by either the developer of the application or the user. + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class + */ + @Nonnull + public AzureContentFilterResultsForResponsesAPI indirectAttack( + @Nullable final AzureContentFilterDetectionResult indirectAttack) { + this.indirectAttack = indirectAttack; + return this; + } + + /** + * A detection result that describes attacks on systems powered by Generative AI models that can + * happen every time an application processes information that wasn’t directly authored by either + * the developer of the application or the user. + * + * @return indirectAttack The indirectAttack of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + */ + @Nonnull + public AzureContentFilterDetectionResult getIndirectAttack() { + return indirectAttack; + } + + /** + * Set the indirectAttack of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param indirectAttack A detection result that describes attacks on systems powered by + * Generative AI models that can happen every time an application processes information that + * wasn’t directly authored by either the developer of the application or the user. + */ + public void setIndirectAttack(@Nullable final AzureContentFilterDetectionResult indirectAttack) { + this.indirectAttack = indirectAttack; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * AzureContentFilterResultsForResponsesAPI}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * AzureContentFilterResultsForResponsesAPI} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterResultsForResponsesAPI has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterResultsForResponsesAPI} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (sexual != null) declaredFields.put("sexual", sexual); + if (hate != null) declaredFields.put("hate", hate); + if (violence != null) declaredFields.put("violence", violence); + if (selfHarm != null) declaredFields.put("selfHarm", selfHarm); + if (profanity != null) declaredFields.put("profanity", profanity); + if (customBlocklists != null) declaredFields.put("customBlocklists", customBlocklists); + if (customTopics != null) declaredFields.put("customTopics", customTopics); + if (error != null) declaredFields.put("error", error); + if (jailbreak != null) declaredFields.put("jailbreak", jailbreak); + if (taskAdherence != null) declaredFields.put("taskAdherence", taskAdherence); + if (protectedMaterialText != null) + declaredFields.put("protectedMaterialText", protectedMaterialText); + if (protectedMaterialCode != null) + declaredFields.put("protectedMaterialCode", protectedMaterialCode); + if (ungroundedMaterial != null) declaredFields.put("ungroundedMaterial", ungroundedMaterial); + if (personallyIdentifiableInformation != null) + declaredFields.put("personallyIdentifiableInformation", personallyIdentifiableInformation); + if (indirectAttack != null) declaredFields.put("indirectAttack", indirectAttack); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterResultsForResponsesAPI} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterResultsForResponsesAPI azureContentFilterResultsForResponsesAPI = + (AzureContentFilterResultsForResponsesAPI) o; + return Objects.equals( + this.cloudSdkCustomFields, + azureContentFilterResultsForResponsesAPI.cloudSdkCustomFields) + && Objects.equals(this.sexual, azureContentFilterResultsForResponsesAPI.sexual) + && Objects.equals(this.hate, azureContentFilterResultsForResponsesAPI.hate) + && Objects.equals(this.violence, azureContentFilterResultsForResponsesAPI.violence) + && Objects.equals(this.selfHarm, azureContentFilterResultsForResponsesAPI.selfHarm) + && Objects.equals(this.profanity, azureContentFilterResultsForResponsesAPI.profanity) + && Objects.equals( + this.customBlocklists, azureContentFilterResultsForResponsesAPI.customBlocklists) + && Objects.equals(this.customTopics, azureContentFilterResultsForResponsesAPI.customTopics) + && Objects.equals(this.error, azureContentFilterResultsForResponsesAPI.error) + && Objects.equals(this.jailbreak, azureContentFilterResultsForResponsesAPI.jailbreak) + && Objects.equals( + this.taskAdherence, azureContentFilterResultsForResponsesAPI.taskAdherence) + && Objects.equals( + this.protectedMaterialText, + azureContentFilterResultsForResponsesAPI.protectedMaterialText) + && Objects.equals( + this.protectedMaterialCode, + azureContentFilterResultsForResponsesAPI.protectedMaterialCode) + && Objects.equals( + this.ungroundedMaterial, azureContentFilterResultsForResponsesAPI.ungroundedMaterial) + && Objects.equals( + this.personallyIdentifiableInformation, + azureContentFilterResultsForResponsesAPI.personallyIdentifiableInformation) + && Objects.equals( + this.indirectAttack, azureContentFilterResultsForResponsesAPI.indirectAttack); + } + + @Override + public int hashCode() { + return Objects.hash( + sexual, + hate, + violence, + selfHarm, + profanity, + customBlocklists, + customTopics, + error, + jailbreak, + taskAdherence, + protectedMaterialText, + protectedMaterialCode, + ungroundedMaterial, + personallyIdentifiableInformation, + indirectAttack, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterResultsForResponsesAPI {\n"); + sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n"); + sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); + sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); + sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); + sb.append(" profanity: ").append(toIndentedString(profanity)).append("\n"); + sb.append(" customBlocklists: ").append(toIndentedString(customBlocklists)).append("\n"); + sb.append(" customTopics: ").append(toIndentedString(customTopics)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" jailbreak: ").append(toIndentedString(jailbreak)).append("\n"); + sb.append(" taskAdherence: ").append(toIndentedString(taskAdherence)).append("\n"); + sb.append(" protectedMaterialText: ") + .append(toIndentedString(protectedMaterialText)) + .append("\n"); + sb.append(" protectedMaterialCode: ") + .append(toIndentedString(protectedMaterialCode)) + .append("\n"); + sb.append(" ungroundedMaterial: ").append(toIndentedString(ungroundedMaterial)).append("\n"); + sb.append(" personallyIdentifiableInformation: ") + .append(toIndentedString(personallyIdentifiableInformation)) + .append("\n"); + sb.append(" indirectAttack: ").append(toIndentedString(indirectAttack)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterResultsForResponsesAPI} instance with all required arguments. + */ + public static Builder create() { + return (jailbreak) -> + (taskAdherence) -> + new AzureContentFilterResultsForResponsesAPI() + .jailbreak(jailbreak) + .taskAdherence(taskAdherence); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param jailbreak A detection result that describes user prompt injection attacks, where + * malicious users deliberately exploit system vulnerabilities to elicit unauthorized + * behavior from the LLM. This could lead to inappropriate content generation or violations + * of system-imposed restrictions. + * @return The AzureContentFilterResultsForResponsesAPI builder. + */ + Builder1 jailbreak(@Nonnull final AzureContentFilterDetectionResult jailbreak); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the taskAdherence of this {@link AzureContentFilterResultsForResponsesAPI} instance. + * + * @param taskAdherence A detection result that indicates if the execution flow still sticks the + * plan. + * @return The AzureContentFilterResultsForResponsesAPI instance. + */ + AzureContentFilterResultsForResponsesAPI taskAdherence( + @Nonnull final AzureContentFilterDetectionResult taskAdherence); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java new file mode 100644 index 000000000..1cc724c53 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java @@ -0,0 +1,309 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * A labeled content filter result item that indicates whether the content was filtered and what the + * qualitative severity level of the content was, as evaluated against content filter configuration + * for the category. + */ +// CHECKSTYLE:OFF +public class AzureContentFilterSeverityResult +// CHECKSTYLE:ON +{ + @JsonProperty("filtered") + private Boolean filtered; + + /** The labeled severity of the content. */ + public enum SeverityEnum { + /** The SAFE option of this AzureContentFilterSeverityResult */ + SAFE("safe"), + + /** The LOW option of this AzureContentFilterSeverityResult */ + LOW("low"), + + /** The MEDIUM option of this AzureContentFilterSeverityResult */ + MEDIUM("medium"), + + /** The HIGH option of this AzureContentFilterSeverityResult */ + HIGH("high"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this AzureContentFilterSeverityResult */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SeverityEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type AzureContentFilterSeverityResult + */ + @JsonCreator + @Nonnull + public static SeverityEnum fromValue(@Nonnull final String value) { + for (SeverityEnum b : SeverityEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("severity") + private SeverityEnum severity; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzureContentFilterSeverityResult. */ + protected AzureContentFilterSeverityResult() {} + + /** + * Set the filtered of this {@link AzureContentFilterSeverityResult} instance and return the same + * instance. + * + * @param filtered Whether the content severity resulted in a content filtering action. + * @return The same instance of this {@link AzureContentFilterSeverityResult} class + */ + @Nonnull + public AzureContentFilterSeverityResult filtered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * Whether the content severity resulted in a content filtering action. + * + * @return filtered The filtered of this {@link AzureContentFilterSeverityResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzureContentFilterSeverityResult} instance. + * + * @param filtered Whether the content severity resulted in a content filtering action. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the severity of this {@link AzureContentFilterSeverityResult} instance and return the same + * instance. + * + * @param severity The labeled severity of the content. + * @return The same instance of this {@link AzureContentFilterSeverityResult} class + */ + @Nonnull + public AzureContentFilterSeverityResult severity(@Nonnull final SeverityEnum severity) { + this.severity = severity; + return this; + } + + /** + * The labeled severity of the content. + * + * @return severity The severity of this {@link AzureContentFilterSeverityResult} instance. + */ + @Nonnull + public SeverityEnum getSeverity() { + return severity; + } + + /** + * Set the severity of this {@link AzureContentFilterSeverityResult} instance. + * + * @param severity The labeled severity of the content. + */ + public void setSeverity(@Nonnull final SeverityEnum severity) { + this.severity = severity; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzureContentFilterSeverityResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzureContentFilterSeverityResult} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzureContentFilterSeverityResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzureContentFilterSeverityResult} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (filtered != null) declaredFields.put("filtered", filtered); + if (severity != null) declaredFields.put("severity", severity); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzureContentFilterSeverityResult} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzureContentFilterSeverityResult azureContentFilterSeverityResult = + (AzureContentFilterSeverityResult) o; + return Objects.equals( + this.cloudSdkCustomFields, azureContentFilterSeverityResult.cloudSdkCustomFields) + && Objects.equals(this.filtered, azureContentFilterSeverityResult.filtered) + && Objects.equals(this.severity, azureContentFilterSeverityResult.severity); + } + + @Override + public int hashCode() { + return Objects.hash(filtered, severity, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzureContentFilterSeverityResult {\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzureContentFilterSeverityResult} instance with all required arguments. + */ + public static Builder create() { + return (filtered) -> + (severity) -> new AzureContentFilterSeverityResult().filtered(filtered).severity(severity); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the filtered of this {@link AzureContentFilterSeverityResult} instance. + * + * @param filtered Whether the content severity resulted in a content filtering action. + * @return The AzureContentFilterSeverityResult builder. + */ + Builder1 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the severity of this {@link AzureContentFilterSeverityResult} instance. + * + * @param severity The labeled severity of the content. + * @return The AzureContentFilterSeverityResult instance. + */ + AzureContentFilterSeverityResult severity(@Nonnull final SeverityEnum severity); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java new file mode 100644 index 000000000..4446c0365 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java @@ -0,0 +1,344 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Result details for individual PIIHarmSubCategory(s). */ +// CHECKSTYLE:OFF +public class AzurePiiSubCategoryResult +// CHECKSTYLE:ON +{ + @JsonProperty("sub_category") + private String subCategory; + + @JsonProperty("filtered") + private Boolean filtered; + + @JsonProperty("detected") + private Boolean detected; + + @JsonProperty("redacted") + private Boolean redacted; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for AzurePiiSubCategoryResult. */ + protected AzurePiiSubCategoryResult() {} + + /** + * Set the subCategory of this {@link AzurePiiSubCategoryResult} instance and return the same + * instance. + * + * @param subCategory The PIIHarmSubCategory that was evaluated. + * @return The same instance of this {@link AzurePiiSubCategoryResult} class + */ + @Nonnull + public AzurePiiSubCategoryResult subCategory(@Nonnull final String subCategory) { + this.subCategory = subCategory; + return this; + } + + /** + * The PIIHarmSubCategory that was evaluated. + * + * @return subCategory The subCategory of this {@link AzurePiiSubCategoryResult} instance. + */ + @Nonnull + public String getSubCategory() { + return subCategory; + } + + /** + * Set the subCategory of this {@link AzurePiiSubCategoryResult} instance. + * + * @param subCategory The PIIHarmSubCategory that was evaluated. + */ + public void setSubCategory(@Nonnull final String subCategory) { + this.subCategory = subCategory; + } + + /** + * Set the filtered of this {@link AzurePiiSubCategoryResult} instance and return the same + * instance. + * + * @param filtered Whether the content detection resulted in a content filtering action for this + * subcategory. + * @return The same instance of this {@link AzurePiiSubCategoryResult} class + */ + @Nonnull + public AzurePiiSubCategoryResult filtered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + return this; + } + + /** + * Whether the content detection resulted in a content filtering action for this subcategory. + * + * @return filtered The filtered of this {@link AzurePiiSubCategoryResult} instance. + */ + @Nonnull + public Boolean isFiltered() { + return filtered; + } + + /** + * Set the filtered of this {@link AzurePiiSubCategoryResult} instance. + * + * @param filtered Whether the content detection resulted in a content filtering action for this + * subcategory. + */ + public void setFiltered(@Nonnull final Boolean filtered) { + this.filtered = filtered; + } + + /** + * Set the detected of this {@link AzurePiiSubCategoryResult} instance and return the same + * instance. + * + * @param detected Whether the labeled content subcategory was detected in the content. + * @return The same instance of this {@link AzurePiiSubCategoryResult} class + */ + @Nonnull + public AzurePiiSubCategoryResult detected(@Nonnull final Boolean detected) { + this.detected = detected; + return this; + } + + /** + * Whether the labeled content subcategory was detected in the content. + * + * @return detected The detected of this {@link AzurePiiSubCategoryResult} instance. + */ + @Nonnull + public Boolean isDetected() { + return detected; + } + + /** + * Set the detected of this {@link AzurePiiSubCategoryResult} instance. + * + * @param detected Whether the labeled content subcategory was detected in the content. + */ + public void setDetected(@Nonnull final Boolean detected) { + this.detected = detected; + } + + /** + * Set the redacted of this {@link AzurePiiSubCategoryResult} instance and return the same + * instance. + * + * @param redacted Whether the content was redacted for this subcategory. + * @return The same instance of this {@link AzurePiiSubCategoryResult} class + */ + @Nonnull + public AzurePiiSubCategoryResult redacted(@Nonnull final Boolean redacted) { + this.redacted = redacted; + return this; + } + + /** + * Whether the content was redacted for this subcategory. + * + * @return redacted The redacted of this {@link AzurePiiSubCategoryResult} instance. + */ + @Nonnull + public Boolean isRedacted() { + return redacted; + } + + /** + * Set the redacted of this {@link AzurePiiSubCategoryResult} instance. + * + * @param redacted Whether the content was redacted for this subcategory. + */ + public void setRedacted(@Nonnull final Boolean redacted) { + this.redacted = redacted; + } + + /** + * Get the names of the unrecognizable properties of the {@link AzurePiiSubCategoryResult}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link AzurePiiSubCategoryResult} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "AzurePiiSubCategoryResult has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link AzurePiiSubCategoryResult} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (subCategory != null) declaredFields.put("subCategory", subCategory); + if (filtered != null) declaredFields.put("filtered", filtered); + if (detected != null) declaredFields.put("detected", detected); + if (redacted != null) declaredFields.put("redacted", redacted); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link AzurePiiSubCategoryResult} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final AzurePiiSubCategoryResult azurePiiSubCategoryResult = (AzurePiiSubCategoryResult) o; + return Objects.equals(this.cloudSdkCustomFields, azurePiiSubCategoryResult.cloudSdkCustomFields) + && Objects.equals(this.subCategory, azurePiiSubCategoryResult.subCategory) + && Objects.equals(this.filtered, azurePiiSubCategoryResult.filtered) + && Objects.equals(this.detected, azurePiiSubCategoryResult.detected) + && Objects.equals(this.redacted, azurePiiSubCategoryResult.redacted); + } + + @Override + public int hashCode() { + return Objects.hash(subCategory, filtered, detected, redacted, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class AzurePiiSubCategoryResult {\n"); + sb.append(" subCategory: ").append(toIndentedString(subCategory)).append("\n"); + sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); + sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); + sb.append(" redacted: ").append(toIndentedString(redacted)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * AzurePiiSubCategoryResult} instance with all required arguments. + */ + public static Builder create() { + return (subCategory) -> + (filtered) -> + (detected) -> + (redacted) -> + new AzurePiiSubCategoryResult() + .subCategory(subCategory) + .filtered(filtered) + .detected(detected) + .redacted(redacted); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the subCategory of this {@link AzurePiiSubCategoryResult} instance. + * + * @param subCategory The PIIHarmSubCategory that was evaluated. + * @return The AzurePiiSubCategoryResult builder. + */ + Builder1 subCategory(@Nonnull final String subCategory); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the filtered of this {@link AzurePiiSubCategoryResult} instance. + * + * @param filtered Whether the content detection resulted in a content filtering action for this + * subcategory. + * @return The AzurePiiSubCategoryResult builder. + */ + Builder2 filtered(@Nonnull final Boolean filtered); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the detected of this {@link AzurePiiSubCategoryResult} instance. + * + * @param detected Whether the labeled content subcategory was detected in the content. + * @return The AzurePiiSubCategoryResult builder. + */ + Builder3 detected(@Nonnull final Boolean detected); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the redacted of this {@link AzurePiiSubCategoryResult} instance. + * + * @param redacted Whether the content was redacted for this subcategory. + * @return The AzurePiiSubCategoryResult instance. + */ + AzurePiiSubCategoryResult redacted(@Nonnull final Boolean redacted); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java new file mode 100644 index 000000000..0ff3bb1a4 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java @@ -0,0 +1,378 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CreateBatchDefaultResponse */ +// CHECKSTYLE:OFF +public class CreateBatchDefaultResponse +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonProperty("param") + private String param; + + @JsonProperty("type") + private String type; + + @JsonProperty("inner_error") + private Object innerError = null; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CreateBatchDefaultResponse. */ + protected CreateBatchDefaultResponse() {} + + /** + * Set the code of this {@link CreateBatchDefaultResponse} instance and return the same instance. + * + * @param code The code of this {@link CreateBatchDefaultResponse} + * @return The same instance of this {@link CreateBatchDefaultResponse} class + */ + @Nonnull + public CreateBatchDefaultResponse code(@Nullable final String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code The code of this {@link CreateBatchDefaultResponse} instance. + */ + @Nullable + public String getCode() { + return code; + } + + /** + * Set the code of this {@link CreateBatchDefaultResponse} instance. + * + * @param code The code of this {@link CreateBatchDefaultResponse} + */ + public void setCode(@Nullable final String code) { + this.code = code; + } + + /** + * Set the message of this {@link CreateBatchDefaultResponse} instance and return the same + * instance. + * + * @param message The message of this {@link CreateBatchDefaultResponse} + * @return The same instance of this {@link CreateBatchDefaultResponse} class + */ + @Nonnull + public CreateBatchDefaultResponse message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link CreateBatchDefaultResponse} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link CreateBatchDefaultResponse} instance. + * + * @param message The message of this {@link CreateBatchDefaultResponse} + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Set the param of this {@link CreateBatchDefaultResponse} instance and return the same instance. + * + * @param param The param of this {@link CreateBatchDefaultResponse} + * @return The same instance of this {@link CreateBatchDefaultResponse} class + */ + @Nonnull + public CreateBatchDefaultResponse param(@Nullable final String param) { + this.param = param; + return this; + } + + /** + * Get param + * + * @return param The param of this {@link CreateBatchDefaultResponse} instance. + */ + @Nullable + public String getParam() { + return param; + } + + /** + * Set the param of this {@link CreateBatchDefaultResponse} instance. + * + * @param param The param of this {@link CreateBatchDefaultResponse} + */ + public void setParam(@Nullable final String param) { + this.param = param; + } + + /** + * Set the type of this {@link CreateBatchDefaultResponse} instance and return the same instance. + * + * @param type The type of this {@link CreateBatchDefaultResponse} + * @return The same instance of this {@link CreateBatchDefaultResponse} class + */ + @Nonnull + public CreateBatchDefaultResponse type(@Nonnull final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link CreateBatchDefaultResponse} instance. + */ + @Nonnull + public String getType() { + return type; + } + + /** + * Set the type of this {@link CreateBatchDefaultResponse} instance. + * + * @param type The type of this {@link CreateBatchDefaultResponse} + */ + public void setType(@Nonnull final String type) { + this.type = type; + } + + /** + * Set the innerError of this {@link CreateBatchDefaultResponse} instance and return the same + * instance. + * + * @param innerError The innerError of this {@link CreateBatchDefaultResponse} + * @return The same instance of this {@link CreateBatchDefaultResponse} class + */ + @Nonnull + public CreateBatchDefaultResponse innerError(@Nullable final Object innerError) { + this.innerError = innerError; + return this; + } + + /** + * Get innerError + * + * @return innerError The innerError of this {@link CreateBatchDefaultResponse} instance. + */ + @Nullable + public Object getInnerError() { + return innerError; + } + + /** + * Set the innerError of this {@link CreateBatchDefaultResponse} instance. + * + * @param innerError The innerError of this {@link CreateBatchDefaultResponse} + */ + public void setInnerError(@Nullable final Object innerError) { + this.innerError = innerError; + } + + /** + * Get the names of the unrecognizable properties of the {@link CreateBatchDefaultResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CreateBatchDefaultResponse} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CreateBatchDefaultResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link CreateBatchDefaultResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + if (param != null) declaredFields.put("param", param); + if (type != null) declaredFields.put("type", type); + if (innerError != null) declaredFields.put("innerError", innerError); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link CreateBatchDefaultResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CreateBatchDefaultResponse createBatchDefaultResponse = (CreateBatchDefaultResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, createBatchDefaultResponse.cloudSdkCustomFields) + && Objects.equals(this.code, createBatchDefaultResponse.code) + && Objects.equals(this.message, createBatchDefaultResponse.message) + && Objects.equals(this.param, createBatchDefaultResponse.param) + && Objects.equals(this.type, createBatchDefaultResponse.type) + && Objects.equals(this.innerError, createBatchDefaultResponse.innerError); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, param, type, innerError, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CreateBatchDefaultResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" innerError: ").append(toIndentedString(innerError)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CreateBatchDefaultResponse} instance with all required arguments. + */ + public static Builder create() { + return (code) -> + (message) -> + (param) -> + (type) -> + new CreateBatchDefaultResponse() + .code(code) + .message(message) + .param(param) + .type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link CreateBatchDefaultResponse} instance. + * + * @param code The code of this {@link CreateBatchDefaultResponse} + * @return The CreateBatchDefaultResponse builder. + */ + Builder1 code(@Nullable final String code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link CreateBatchDefaultResponse} instance. + * + * @param message The message of this {@link CreateBatchDefaultResponse} + * @return The CreateBatchDefaultResponse builder. + */ + Builder2 message(@Nonnull final String message); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the param of this {@link CreateBatchDefaultResponse} instance. + * + * @param param The param of this {@link CreateBatchDefaultResponse} + * @return The CreateBatchDefaultResponse builder. + */ + Builder3 param(@Nullable final String param); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the type of this {@link CreateBatchDefaultResponse} instance. + * + * @param type The type of this {@link CreateBatchDefaultResponse} + * @return The CreateBatchDefaultResponse instance. + */ + CreateBatchDefaultResponse type(@Nonnull final String type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java new file mode 100644 index 000000000..f309ccd2e --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java @@ -0,0 +1,1975 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CreateResponse200Response */ +// CHECKSTYLE:OFF +public class CreateResponse200Response +// CHECKSTYLE:ON +{ + @JsonProperty("metadata") + private Object metadata; + + @JsonProperty("top_logprobs") + private Integer topLogprobs; + + @JsonProperty("temperature") + private BigDecimal temperature; + + @JsonProperty("top_p") + private BigDecimal topP; + + @JsonProperty("user") + private String user; + + @JsonProperty("safety_identifier") + private String safetyIdentifier; + + @JsonProperty("prompt_cache_key") + private String promptCacheKey; + + /** Gets or Sets promptCacheRetention */ + public enum PromptCacheRetentionEnum { + /** The IN_MEMORY option of this CreateResponse200Response */ + IN_MEMORY("in-memory"), + + /** The _24H option of this CreateResponse200Response */ + _24H("24h"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PromptCacheRetentionEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type CreateResponse200Response + */ + @JsonCreator + @Nullable + public static PromptCacheRetentionEnum fromValue(@Nonnull final String value) { + for (PromptCacheRetentionEnum b : PromptCacheRetentionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("prompt_cache_retention") + private PromptCacheRetentionEnum promptCacheRetention; + + @JsonProperty("previous_response_id") + private String previousResponseId; + + @JsonProperty("model") + private String model; + + @JsonProperty("reasoning") + private OpenAIReasoning reasoning; + + @JsonProperty("background") + private Boolean background; + + @JsonProperty("max_output_tokens") + private Integer maxOutputTokens; + + @JsonProperty("max_tool_calls") + private Integer maxToolCalls; + + @JsonProperty("text") + private OpenAIResponseTextParam text; + + @JsonProperty("tools") + private List tools = new ArrayList<>(); + + @JsonProperty("tool_choice") + private OpenAIToolChoiceParam toolChoice; + + @JsonProperty("prompt") + private OpenAIPrompt prompt; + + /** Gets or Sets truncation */ + public enum TruncationEnum { + /** The AUTO option of this CreateResponse200Response */ + AUTO("auto"), + + /** The DISABLED option of this CreateResponse200Response */ + DISABLED("disabled"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TruncationEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type CreateResponse200Response + */ + @JsonCreator + @Nullable + public static TruncationEnum fromValue(@Nonnull final String value) { + for (TruncationEnum b : TruncationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("truncation") + private TruncationEnum truncation; + + @JsonProperty("id") + private String id; + + /** The object type of this resource - always set to `response`. */ + public enum ObjectEnum { + /** The RESPONSE option of this CreateResponse200Response */ + RESPONSE("response"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ObjectEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type CreateResponse200Response + */ + @JsonCreator + @Nonnull + public static ObjectEnum fromValue(@Nonnull final String value) { + for (ObjectEnum b : ObjectEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("object") + private ObjectEnum _object; + + /** + * The status of the response generation. One of `completed`, `failed`, + * `in_progress`, `cancelled`, `queued`, or `incomplete`. + */ + public enum StatusEnum { + /** The COMPLETED option of this CreateResponse200Response */ + COMPLETED("completed"), + + /** The FAILED option of this CreateResponse200Response */ + FAILED("failed"), + + /** The IN_PROGRESS option of this CreateResponse200Response */ + IN_PROGRESS("in_progress"), + + /** The CANCELLED option of this CreateResponse200Response */ + CANCELLED("cancelled"), + + /** The QUEUED option of this CreateResponse200Response */ + QUEUED("queued"), + + /** The INCOMPLETE option of this CreateResponse200Response */ + INCOMPLETE("incomplete"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type CreateResponse200Response + */ + @JsonCreator + @Nonnull + public static StatusEnum fromValue(@Nonnull final String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("created_at") + private Integer createdAt; + + @JsonProperty("completed_at") + private OffsetDateTime completedAt; + + @JsonProperty("error") + private OpenAIResponseError error; + + @JsonProperty("incomplete_details") + private OpenAIResponseIncompleteDetails incompleteDetails; + + @JsonProperty("output") + private List output = new ArrayList<>(); + + @JsonProperty("instructions") + private CreateResponse200ResponseInstructions instructions; + + @JsonProperty("output_text") + private String outputText; + + @JsonProperty("usage") + private OpenAIResponseUsage usage; + + @JsonProperty("parallel_tool_calls") + private Boolean parallelToolCalls = true; + + @JsonProperty("conversation") + private OpenAIConversationReference conversation; + + @JsonProperty("content_filters") + private List contentFilters = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CreateResponse200Response. */ + protected CreateResponse200Response() {} + + /** + * Set the metadata of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and querying + * for objects via API or the dashboard. Keys are strings with a maximum length of 64 + * characters. Values are strings with a maximum length of 512 characters. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response metadata(@Nullable final Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing + * additional information about the object in a structured format, and querying for objects via + * API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are + * strings with a maximum length of 512 characters. + * + * @return metadata The metadata of this {@link CreateResponse200Response} instance. + */ + @Nullable + public Object getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link CreateResponse200Response} instance. + * + * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and querying + * for objects via API or the dashboard. Keys are strings with a maximum length of 64 + * characters. Values are strings with a maximum length of 512 characters. + */ + public void setMetadata(@Nullable final Object metadata) { + this.metadata = metadata; + } + + /** + * Set the topLogprobs of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param topLogprobs The topLogprobs of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response topLogprobs(@Nullable final Integer topLogprobs) { + this.topLogprobs = topLogprobs; + return this; + } + + /** + * Get topLogprobs + * + * @return topLogprobs The topLogprobs of this {@link CreateResponse200Response} instance. + */ + @Nullable + public Integer getTopLogprobs() { + return topLogprobs; + } + + /** + * Set the topLogprobs of this {@link CreateResponse200Response} instance. + * + * @param topLogprobs The topLogprobs of this {@link CreateResponse200Response} + */ + public void setTopLogprobs(@Nullable final Integer topLogprobs) { + this.topLogprobs = topLogprobs; + } + + /** + * Set the temperature of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param temperature The temperature of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response temperature(@Nullable final BigDecimal temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get temperature + * + * @return temperature The temperature of this {@link CreateResponse200Response} instance. + */ + @Nullable + public BigDecimal getTemperature() { + return temperature; + } + + /** + * Set the temperature of this {@link CreateResponse200Response} instance. + * + * @param temperature The temperature of this {@link CreateResponse200Response} + */ + public void setTemperature(@Nullable final BigDecimal temperature) { + this.temperature = temperature; + } + + /** + * Set the topP of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param topP The topP of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response topP(@Nullable final BigDecimal topP) { + this.topP = topP; + return this; + } + + /** + * Get topP + * + * @return topP The topP of this {@link CreateResponse200Response} instance. + */ + @Nullable + public BigDecimal getTopP() { + return topP; + } + + /** + * Set the topP of this {@link CreateResponse200Response} instance. + * + * @param topP The topP of this {@link CreateResponse200Response} + */ + public void setTopP(@Nullable final BigDecimal topP) { + this.topP = topP; + } + + /** + * Set the user of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param user This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by + * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response user(@Nullable final String user) { + this.user = user; + return this; + } + + /** + * This field is being replaced by `safety_identifier` and `prompt_cache_key`. + * Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier + * for your end-users. Used to boost cache hit rates by better bucketing similar requests and to + * help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * @return user The user of this {@link CreateResponse200Response} instance. + * @deprecated + */ + @Deprecated + @Nonnull + public String getUser() { + return user; + } + + /** + * Set the user of this {@link CreateResponse200Response} instance. + * + * @param user This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by + * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + public void setUser(@Nullable final String user) { + this.user = user; + } + + /** + * Set the safetyIdentifier of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param safetyIdentifier A stable identifier used to help detect users of your application that + * may be violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in order to + * avoid sending us any identifying information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response safetyIdentifier(@Nullable final String safetyIdentifier) { + this.safetyIdentifier = safetyIdentifier; + return this; + } + + /** + * A stable identifier used to help detect users of your application that may be violating + * OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We + * recommend hashing their username or email address, in order to avoid sending us any identifying + * information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * @return safetyIdentifier The safetyIdentifier of this {@link CreateResponse200Response} + * instance. + */ + @Nonnull + public String getSafetyIdentifier() { + return safetyIdentifier; + } + + /** + * Set the safetyIdentifier of this {@link CreateResponse200Response} instance. + * + * @param safetyIdentifier A stable identifier used to help detect users of your application that + * may be violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in order to + * avoid sending us any identifying information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + public void setSafetyIdentifier(@Nullable final String safetyIdentifier) { + this.safetyIdentifier = safetyIdentifier; + } + + /** + * Set the promptCacheKey of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your + * cache hit rates. Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response promptCacheKey(@Nullable final String promptCacheKey) { + this.promptCacheKey = promptCacheKey; + return this; + } + + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + * Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + * + * @return promptCacheKey The promptCacheKey of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public String getPromptCacheKey() { + return promptCacheKey; + } + + /** + * Set the promptCacheKey of this {@link CreateResponse200Response} instance. + * + * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your + * cache hit rates. Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + */ + public void setPromptCacheKey(@Nullable final String promptCacheKey) { + this.promptCacheKey = promptCacheKey; + } + + /** + * Set the promptCacheRetention of this {@link CreateResponse200Response} instance and return the + * same instance. + * + * @param promptCacheRetention The promptCacheRetention of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response promptCacheRetention( + @Nullable final PromptCacheRetentionEnum promptCacheRetention) { + this.promptCacheRetention = promptCacheRetention; + return this; + } + + /** + * Get promptCacheRetention + * + * @return promptCacheRetention The promptCacheRetention of this {@link CreateResponse200Response} + * instance. + */ + @Nullable + public PromptCacheRetentionEnum getPromptCacheRetention() { + return promptCacheRetention; + } + + /** + * Set the promptCacheRetention of this {@link CreateResponse200Response} instance. + * + * @param promptCacheRetention The promptCacheRetention of this {@link CreateResponse200Response} + */ + public void setPromptCacheRetention( + @Nullable final PromptCacheRetentionEnum promptCacheRetention) { + this.promptCacheRetention = promptCacheRetention; + } + + /** + * Set the previousResponseId of this {@link CreateResponse200Response} instance and return the + * same instance. + * + * @param previousResponseId The previousResponseId of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response previousResponseId(@Nullable final String previousResponseId) { + this.previousResponseId = previousResponseId; + return this; + } + + /** + * Get previousResponseId + * + * @return previousResponseId The previousResponseId of this {@link CreateResponse200Response} + * instance. + */ + @Nullable + public String getPreviousResponseId() { + return previousResponseId; + } + + /** + * Set the previousResponseId of this {@link CreateResponse200Response} instance. + * + * @param previousResponseId The previousResponseId of this {@link CreateResponse200Response} + */ + public void setPreviousResponseId(@Nullable final String previousResponseId) { + this.previousResponseId = previousResponseId; + } + + /** + * Set the model of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. + * OpenAI offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model + * guide](https://platform.openai.com/docs/models) to browse and compare available models. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response model(@Nullable final String model) { + this.model = model; + return this; + } + + /** + * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + * offers a wide range of models with different capabilities, performance characteristics, and + * price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and + * compare available models. + * + * @return model The model of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public String getModel() { + return model; + } + + /** + * Set the model of this {@link CreateResponse200Response} instance. + * + * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. + * OpenAI offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model + * guide](https://platform.openai.com/docs/models) to browse and compare available models. + */ + public void setModel(@Nullable final String model) { + this.model = model; + } + + /** + * Set the reasoning of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param reasoning The reasoning of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response reasoning(@Nullable final OpenAIReasoning reasoning) { + this.reasoning = reasoning; + return this; + } + + /** + * Get reasoning + * + * @return reasoning The reasoning of this {@link CreateResponse200Response} instance. + */ + @Nullable + public OpenAIReasoning getReasoning() { + return reasoning; + } + + /** + * Set the reasoning of this {@link CreateResponse200Response} instance. + * + * @param reasoning The reasoning of this {@link CreateResponse200Response} + */ + public void setReasoning(@Nullable final OpenAIReasoning reasoning) { + this.reasoning = reasoning; + } + + /** + * Set the background of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param background The background of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response background(@Nullable final Boolean background) { + this.background = background; + return this; + } + + /** + * Get background + * + * @return background The background of this {@link CreateResponse200Response} instance. + */ + @Nullable + public Boolean isBackground() { + return background; + } + + /** + * Set the background of this {@link CreateResponse200Response} instance. + * + * @param background The background of this {@link CreateResponse200Response} + */ + public void setBackground(@Nullable final Boolean background) { + this.background = background; + } + + /** + * Set the maxOutputTokens of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param maxOutputTokens The maxOutputTokens of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response maxOutputTokens(@Nullable final Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + return this; + } + + /** + * Get maxOutputTokens + * + * @return maxOutputTokens The maxOutputTokens of this {@link CreateResponse200Response} instance. + */ + @Nullable + public Integer getMaxOutputTokens() { + return maxOutputTokens; + } + + /** + * Set the maxOutputTokens of this {@link CreateResponse200Response} instance. + * + * @param maxOutputTokens The maxOutputTokens of this {@link CreateResponse200Response} + */ + public void setMaxOutputTokens(@Nullable final Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + } + + /** + * Set the maxToolCalls of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param maxToolCalls The maxToolCalls of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response maxToolCalls(@Nullable final Integer maxToolCalls) { + this.maxToolCalls = maxToolCalls; + return this; + } + + /** + * Get maxToolCalls + * + * @return maxToolCalls The maxToolCalls of this {@link CreateResponse200Response} instance. + */ + @Nullable + public Integer getMaxToolCalls() { + return maxToolCalls; + } + + /** + * Set the maxToolCalls of this {@link CreateResponse200Response} instance. + * + * @param maxToolCalls The maxToolCalls of this {@link CreateResponse200Response} + */ + public void setMaxToolCalls(@Nullable final Integer maxToolCalls) { + this.maxToolCalls = maxToolCalls; + } + + /** + * Set the text of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param text The text of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response text(@Nullable final OpenAIResponseTextParam text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public OpenAIResponseTextParam getText() { + return text; + } + + /** + * Set the text of this {@link CreateResponse200Response} instance. + * + * @param text The text of this {@link CreateResponse200Response} + */ + public void setText(@Nullable final OpenAIResponseTextParam text) { + this.text = text; + } + + /** + * Set the tools of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param tools An array of tools the model may call while generating a response. You can specify + * which tool to use by setting the `tool_choice` parameter. We support the + * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that + * extend the model's capabilities, like [web + * search](https://platform.openai.com/docs/guides/tools-web-search) or [file + * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: + * Integrations with third-party systems via custom MCP servers or predefined connectors such + * as Google Drive and SharePoint. Learn more about [MCP + * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own + * code with strongly typed arguments and outputs. Learn more about [function + * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom + * tools to call your own code. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response tools(@Nullable final List tools) { + this.tools = tools; + return this; + } + + /** + * Add one tools instance to this {@link CreateResponse200Response}. + * + * @param toolsItem The tools that should be added + * @return The same instance of type {@link CreateResponse200Response} + */ + @Nonnull + public CreateResponse200Response addToolsItem(@Nonnull final OpenAITool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * An array of tools the model may call while generating a response. You can specify which tool to + * use by setting the `tool_choice` parameter. We support the following categories of + * tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: Integrations + * with third-party systems via custom MCP servers or predefined connectors such as Google Drive + * and SharePoint. Learn more about [MCP + * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own code + * with strongly typed arguments and outputs. Learn more about [function + * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom + * tools to call your own code. + * + * @return tools The tools of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public List getTools() { + return tools; + } + + /** + * Set the tools of this {@link CreateResponse200Response} instance. + * + * @param tools An array of tools the model may call while generating a response. You can specify + * which tool to use by setting the `tool_choice` parameter. We support the + * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that + * extend the model's capabilities, like [web + * search](https://platform.openai.com/docs/guides/tools-web-search) or [file + * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: + * Integrations with third-party systems via custom MCP servers or predefined connectors such + * as Google Drive and SharePoint. Learn more about [MCP + * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own + * code with strongly typed arguments and outputs. Learn more about [function + * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom + * tools to call your own code. + */ + public void setTools(@Nullable final List tools) { + this.tools = tools; + } + + /** + * Set the toolChoice of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param toolChoice The toolChoice of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response toolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get toolChoice + * + * @return toolChoice The toolChoice of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public OpenAIToolChoiceParam getToolChoice() { + return toolChoice; + } + + /** + * Set the toolChoice of this {@link CreateResponse200Response} instance. + * + * @param toolChoice The toolChoice of this {@link CreateResponse200Response} + */ + public void setToolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { + this.toolChoice = toolChoice; + } + + /** + * Set the prompt of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param prompt The prompt of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response prompt(@Nullable final OpenAIPrompt prompt) { + this.prompt = prompt; + return this; + } + + /** + * Get prompt + * + * @return prompt The prompt of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public OpenAIPrompt getPrompt() { + return prompt; + } + + /** + * Set the prompt of this {@link CreateResponse200Response} instance. + * + * @param prompt The prompt of this {@link CreateResponse200Response} + */ + public void setPrompt(@Nullable final OpenAIPrompt prompt) { + this.prompt = prompt; + } + + /** + * Set the truncation of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param truncation The truncation of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response truncation(@Nullable final TruncationEnum truncation) { + this.truncation = truncation; + return this; + } + + /** + * Get truncation + * + * @return truncation The truncation of this {@link CreateResponse200Response} instance. + */ + @Nullable + public TruncationEnum getTruncation() { + return truncation; + } + + /** + * Set the truncation of this {@link CreateResponse200Response} instance. + * + * @param truncation The truncation of this {@link CreateResponse200Response} + */ + public void setTruncation(@Nullable final TruncationEnum truncation) { + this.truncation = truncation; + } + + /** + * Set the id of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param id Unique identifier for this Response. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this Response. + * + * @return id The id of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link CreateResponse200Response} instance. + * + * @param id Unique identifier for this Response. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the _object of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param _object The object type of this resource - always set to `response`. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response _object(@Nonnull final ObjectEnum _object) { + this._object = _object; + return this; + } + + /** + * The object type of this resource - always set to `response`. + * + * @return _object The _object of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public ObjectEnum getObject() { + return _object; + } + + /** + * Set the _object of this {@link CreateResponse200Response} instance. + * + * @param _object The object type of this resource - always set to `response`. + */ + public void setObject(@Nonnull final ObjectEnum _object) { + this._object = _object; + } + + /** + * Set the status of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param status The status of the response generation. One of `completed`, + * `failed`, `in_progress`, `cancelled`, `queued`, or + * `incomplete`. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response status(@Nullable final StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the response generation. One of `completed`, `failed`, + * `in_progress`, `cancelled`, `queued`, or `incomplete`. + * + * @return status The status of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public StatusEnum getStatus() { + return status; + } + + /** + * Set the status of this {@link CreateResponse200Response} instance. + * + * @param status The status of the response generation. One of `completed`, + * `failed`, `in_progress`, `cancelled`, `queued`, or + * `incomplete`. + */ + public void setStatus(@Nullable final StatusEnum status) { + this.status = status; + } + + /** + * Set the createdAt of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param createdAt Unix timestamp (in seconds) of when this Response was created. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response createdAt(@Nonnull final Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp (in seconds) of when this Response was created. + * + * @return createdAt The createdAt of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public Integer getCreatedAt() { + return createdAt; + } + + /** + * Set the createdAt of this {@link CreateResponse200Response} instance. + * + * @param createdAt Unix timestamp (in seconds) of when this Response was created. + */ + public void setCreatedAt(@Nonnull final Integer createdAt) { + this.createdAt = createdAt; + } + + /** + * Set the completedAt of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param completedAt The completedAt of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response completedAt(@Nullable final OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + /** + * Get completedAt + * + * @return completedAt The completedAt of this {@link CreateResponse200Response} instance. + */ + @Nullable + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + /** + * Set the completedAt of this {@link CreateResponse200Response} instance. + * + * @param completedAt The completedAt of this {@link CreateResponse200Response} + */ + public void setCompletedAt(@Nullable final OffsetDateTime completedAt) { + this.completedAt = completedAt; + } + + /** + * Set the error of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param error The error of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response error(@Nullable final OpenAIResponseError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link CreateResponse200Response} instance. + */ + @Nullable + public OpenAIResponseError getError() { + return error; + } + + /** + * Set the error of this {@link CreateResponse200Response} instance. + * + * @param error The error of this {@link CreateResponse200Response} + */ + public void setError(@Nullable final OpenAIResponseError error) { + this.error = error; + } + + /** + * Set the incompleteDetails of this {@link CreateResponse200Response} instance and return the + * same instance. + * + * @param incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response incompleteDetails( + @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { + this.incompleteDetails = incompleteDetails; + return this; + } + + /** + * Get incompleteDetails + * + * @return incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} + * instance. + */ + @Nullable + public OpenAIResponseIncompleteDetails getIncompleteDetails() { + return incompleteDetails; + } + + /** + * Set the incompleteDetails of this {@link CreateResponse200Response} instance. + * + * @param incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} + */ + public void setIncompleteDetails( + @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { + this.incompleteDetails = incompleteDetails; + } + + /** + * Set the output of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param output An array of content items generated by the model. - The length and order of items + * in the `output` array is dependent on the model's response. - Rather than + * accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response output(@Nonnull final List output) { + this.output = output; + return this; + } + + /** + * Add one output instance to this {@link CreateResponse200Response}. + * + * @param outputItem The output that should be added + * @return The same instance of type {@link CreateResponse200Response} + */ + @Nonnull + public CreateResponse200Response addOutputItem(@Nonnull final OpenAIOutputItem outputItem) { + if (this.output == null) { + this.output = new ArrayList<>(); + } + this.output.add(outputItem); + return this; + } + + /** + * An array of content items generated by the model. - The length and order of items in the + * `output` array is dependent on the model's response. - Rather than accessing the + * first item in the `output` array and assuming it's an `assistant` + * message with the content generated by the model, you might consider using the + * `output_text` property where supported in SDKs. + * + * @return output The output of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public List getOutput() { + return output; + } + + /** + * Set the output of this {@link CreateResponse200Response} instance. + * + * @param output An array of content items generated by the model. - The length and order of items + * in the `output` array is dependent on the model's response. - Rather than + * accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + */ + public void setOutput(@Nonnull final List output) { + this.output = output; + } + + /** + * Set the instructions of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param instructions The instructions of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response instructions( + @Nullable final CreateResponse200ResponseInstructions instructions) { + this.instructions = instructions; + return this; + } + + /** + * Get instructions + * + * @return instructions The instructions of this {@link CreateResponse200Response} instance. + */ + @Nullable + public CreateResponse200ResponseInstructions getInstructions() { + return instructions; + } + + /** + * Set the instructions of this {@link CreateResponse200Response} instance. + * + * @param instructions The instructions of this {@link CreateResponse200Response} + */ + public void setInstructions(@Nullable final CreateResponse200ResponseInstructions instructions) { + this.instructions = instructions; + } + + /** + * Set the outputText of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param outputText The outputText of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response outputText(@Nullable final String outputText) { + this.outputText = outputText; + return this; + } + + /** + * Get outputText + * + * @return outputText The outputText of this {@link CreateResponse200Response} instance. + */ + @Nullable + public String getOutputText() { + return outputText; + } + + /** + * Set the outputText of this {@link CreateResponse200Response} instance. + * + * @param outputText The outputText of this {@link CreateResponse200Response} + */ + public void setOutputText(@Nullable final String outputText) { + this.outputText = outputText; + } + + /** + * Set the usage of this {@link CreateResponse200Response} instance and return the same instance. + * + * @param usage The usage of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response usage(@Nullable final OpenAIResponseUsage usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * + * @return usage The usage of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public OpenAIResponseUsage getUsage() { + return usage; + } + + /** + * Set the usage of this {@link CreateResponse200Response} instance. + * + * @param usage The usage of this {@link CreateResponse200Response} + */ + public void setUsage(@Nullable final OpenAIResponseUsage usage) { + this.usage = usage; + } + + /** + * Set the parallelToolCalls of this {@link CreateResponse200Response} instance and return the + * same instance. + * + * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response parallelToolCalls(@Nonnull final Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + return this; + } + + /** + * Whether to allow the model to run tool calls in parallel. + * + * @return parallelToolCalls The parallelToolCalls of this {@link CreateResponse200Response} + * instance. + */ + @Nonnull + public Boolean isParallelToolCalls() { + return parallelToolCalls; + } + + /** + * Set the parallelToolCalls of this {@link CreateResponse200Response} instance. + * + * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. + */ + public void setParallelToolCalls(@Nonnull final Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + } + + /** + * Set the conversation of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param conversation The conversation of this {@link CreateResponse200Response} + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response conversation( + @Nullable final OpenAIConversationReference conversation) { + this.conversation = conversation; + return this; + } + + /** + * Get conversation + * + * @return conversation The conversation of this {@link CreateResponse200Response} instance. + */ + @Nullable + public OpenAIConversationReference getConversation() { + return conversation; + } + + /** + * Set the conversation of this {@link CreateResponse200Response} instance. + * + * @param conversation The conversation of this {@link CreateResponse200Response} + */ + public void setConversation(@Nullable final OpenAIConversationReference conversation) { + this.conversation = conversation; + } + + /** + * Set the contentFilters of this {@link CreateResponse200Response} instance and return the same + * instance. + * + * @param contentFilters The content filter results from RAI. + * @return The same instance of this {@link CreateResponse200Response} class + */ + @Nonnull + public CreateResponse200Response contentFilters( + @Nonnull final List contentFilters) { + this.contentFilters = contentFilters; + return this; + } + + /** + * Add one contentFilters instance to this {@link CreateResponse200Response}. + * + * @param contentFiltersItem The contentFilters that should be added + * @return The same instance of type {@link CreateResponse200Response} + */ + @Nonnull + public CreateResponse200Response addContentFiltersItem( + @Nonnull final AzureContentFilterForResponsesAPI contentFiltersItem) { + if (this.contentFilters == null) { + this.contentFilters = new ArrayList<>(); + } + this.contentFilters.add(contentFiltersItem); + return this; + } + + /** + * The content filter results from RAI. + * + * @return contentFilters The contentFilters of this {@link CreateResponse200Response} instance. + */ + @Nonnull + public List getContentFilters() { + return contentFilters; + } + + /** + * Set the contentFilters of this {@link CreateResponse200Response} instance. + * + * @param contentFilters The content filter results from RAI. + */ + public void setContentFilters( + @Nonnull final List contentFilters) { + this.contentFilters = contentFilters; + } + + /** + * Get the names of the unrecognizable properties of the {@link CreateResponse200Response}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CreateResponse200Response} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CreateResponse200Response has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link CreateResponse200Response} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (metadata != null) declaredFields.put("metadata", metadata); + if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); + if (temperature != null) declaredFields.put("temperature", temperature); + if (topP != null) declaredFields.put("topP", topP); + if (user != null) declaredFields.put("user", user); + if (safetyIdentifier != null) declaredFields.put("safetyIdentifier", safetyIdentifier); + if (promptCacheKey != null) declaredFields.put("promptCacheKey", promptCacheKey); + if (promptCacheRetention != null) + declaredFields.put("promptCacheRetention", promptCacheRetention); + if (previousResponseId != null) declaredFields.put("previousResponseId", previousResponseId); + if (model != null) declaredFields.put("model", model); + if (reasoning != null) declaredFields.put("reasoning", reasoning); + if (background != null) declaredFields.put("background", background); + if (maxOutputTokens != null) declaredFields.put("maxOutputTokens", maxOutputTokens); + if (maxToolCalls != null) declaredFields.put("maxToolCalls", maxToolCalls); + if (text != null) declaredFields.put("text", text); + if (tools != null) declaredFields.put("tools", tools); + if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); + if (prompt != null) declaredFields.put("prompt", prompt); + if (truncation != null) declaredFields.put("truncation", truncation); + if (id != null) declaredFields.put("id", id); + if (_object != null) declaredFields.put("_object", _object); + if (status != null) declaredFields.put("status", status); + if (createdAt != null) declaredFields.put("createdAt", createdAt); + if (completedAt != null) declaredFields.put("completedAt", completedAt); + if (error != null) declaredFields.put("error", error); + if (incompleteDetails != null) declaredFields.put("incompleteDetails", incompleteDetails); + if (output != null) declaredFields.put("output", output); + if (instructions != null) declaredFields.put("instructions", instructions); + if (outputText != null) declaredFields.put("outputText", outputText); + if (usage != null) declaredFields.put("usage", usage); + if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); + if (conversation != null) declaredFields.put("conversation", conversation); + if (contentFilters != null) declaredFields.put("contentFilters", contentFilters); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link CreateResponse200Response} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CreateResponse200Response createResponse200Response = (CreateResponse200Response) o; + return Objects.equals(this.cloudSdkCustomFields, createResponse200Response.cloudSdkCustomFields) + && Objects.equals(this.metadata, createResponse200Response.metadata) + && Objects.equals(this.topLogprobs, createResponse200Response.topLogprobs) + && Objects.equals(this.temperature, createResponse200Response.temperature) + && Objects.equals(this.topP, createResponse200Response.topP) + && Objects.equals(this.user, createResponse200Response.user) + && Objects.equals(this.safetyIdentifier, createResponse200Response.safetyIdentifier) + && Objects.equals(this.promptCacheKey, createResponse200Response.promptCacheKey) + && Objects.equals(this.promptCacheRetention, createResponse200Response.promptCacheRetention) + && Objects.equals(this.previousResponseId, createResponse200Response.previousResponseId) + && Objects.equals(this.model, createResponse200Response.model) + && Objects.equals(this.reasoning, createResponse200Response.reasoning) + && Objects.equals(this.background, createResponse200Response.background) + && Objects.equals(this.maxOutputTokens, createResponse200Response.maxOutputTokens) + && Objects.equals(this.maxToolCalls, createResponse200Response.maxToolCalls) + && Objects.equals(this.text, createResponse200Response.text) + && Objects.equals(this.tools, createResponse200Response.tools) + && Objects.equals(this.toolChoice, createResponse200Response.toolChoice) + && Objects.equals(this.prompt, createResponse200Response.prompt) + && Objects.equals(this.truncation, createResponse200Response.truncation) + && Objects.equals(this.id, createResponse200Response.id) + && Objects.equals(this._object, createResponse200Response._object) + && Objects.equals(this.status, createResponse200Response.status) + && Objects.equals(this.createdAt, createResponse200Response.createdAt) + && Objects.equals(this.completedAt, createResponse200Response.completedAt) + && Objects.equals(this.error, createResponse200Response.error) + && Objects.equals(this.incompleteDetails, createResponse200Response.incompleteDetails) + && Objects.equals(this.output, createResponse200Response.output) + && Objects.equals(this.instructions, createResponse200Response.instructions) + && Objects.equals(this.outputText, createResponse200Response.outputText) + && Objects.equals(this.usage, createResponse200Response.usage) + && Objects.equals(this.parallelToolCalls, createResponse200Response.parallelToolCalls) + && Objects.equals(this.conversation, createResponse200Response.conversation) + && Objects.equals(this.contentFilters, createResponse200Response.contentFilters); + } + + @Override + public int hashCode() { + return Objects.hash( + metadata, + topLogprobs, + temperature, + topP, + user, + safetyIdentifier, + promptCacheKey, + promptCacheRetention, + previousResponseId, + model, + reasoning, + background, + maxOutputTokens, + maxToolCalls, + text, + tools, + toolChoice, + prompt, + truncation, + id, + _object, + status, + createdAt, + completedAt, + error, + incompleteDetails, + output, + instructions, + outputText, + usage, + parallelToolCalls, + conversation, + contentFilters, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CreateResponse200Response {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" safetyIdentifier: ").append(toIndentedString(safetyIdentifier)).append("\n"); + sb.append(" promptCacheKey: ").append(toIndentedString(promptCacheKey)).append("\n"); + sb.append(" promptCacheRetention: ") + .append(toIndentedString(promptCacheRetention)) + .append("\n"); + sb.append(" previousResponseId: ").append(toIndentedString(previousResponseId)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" reasoning: ").append(toIndentedString(reasoning)).append("\n"); + sb.append(" background: ").append(toIndentedString(background)).append("\n"); + sb.append(" maxOutputTokens: ").append(toIndentedString(maxOutputTokens)).append("\n"); + sb.append(" maxToolCalls: ").append(toIndentedString(maxToolCalls)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); + sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); + sb.append(" truncation: ").append(toIndentedString(truncation)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" incompleteDetails: ").append(toIndentedString(incompleteDetails)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" outputText: ").append(toIndentedString(outputText)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append(" parallelToolCalls: ").append(toIndentedString(parallelToolCalls)).append("\n"); + sb.append(" conversation: ").append(toIndentedString(conversation)).append("\n"); + sb.append(" contentFilters: ").append(toIndentedString(contentFilters)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CreateResponse200Response} instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (_object) -> + (createdAt) -> + (error) -> + (incompleteDetails) -> + (output) -> + (instructions) -> + (parallelToolCalls) -> + (contentFilters) -> + new CreateResponse200Response() + .id(id) + ._object(_object) + .createdAt(createdAt) + .error(error) + .incompleteDetails(incompleteDetails) + .output(output) + .instructions(instructions) + .parallelToolCalls(parallelToolCalls) + .contentFilters(contentFilters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link CreateResponse200Response} instance. + * + * @param id Unique identifier for this Response. + * @return The CreateResponse200Response builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _object of this {@link CreateResponse200Response} instance. + * + * @param _object The object type of this resource - always set to `response`. + * @return The CreateResponse200Response builder. + */ + Builder2 _object(@Nonnull final ObjectEnum _object); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the createdAt of this {@link CreateResponse200Response} instance. + * + * @param createdAt Unix timestamp (in seconds) of when this Response was created. + * @return The CreateResponse200Response builder. + */ + Builder3 createdAt(@Nonnull final Integer createdAt); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the error of this {@link CreateResponse200Response} instance. + * + * @param error The error of this {@link CreateResponse200Response} + * @return The CreateResponse200Response builder. + */ + Builder4 error(@Nullable final OpenAIResponseError error); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the incompleteDetails of this {@link CreateResponse200Response} instance. + * + * @param incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} + * @return The CreateResponse200Response builder. + */ + Builder5 incompleteDetails(@Nullable final OpenAIResponseIncompleteDetails incompleteDetails); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the output of this {@link CreateResponse200Response} instance. + * + * @param output An array of content items generated by the model. - The length and order of + * items in the `output` array is dependent on the model's response. - Rather + * than accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + * @return The CreateResponse200Response builder. + */ + Builder6 output(@Nonnull final List output); + + /** + * Set the output of this {@link CreateResponse200Response} instance. + * + * @param output An array of content items generated by the model. - The length and order of + * items in the `output` array is dependent on the model's response. - Rather + * than accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + * @return The CreateResponse200Response builder. + */ + default Builder6 output(@Nonnull final OpenAIOutputItem... output) { + return output(Arrays.asList(output)); + } + } + + /** Builder helper class. */ + public interface Builder6 { + /** + * Set the instructions of this {@link CreateResponse200Response} instance. + * + * @param instructions The instructions of this {@link CreateResponse200Response} + * @return The CreateResponse200Response builder. + */ + Builder7 instructions(@Nullable final CreateResponse200ResponseInstructions instructions); + } + + /** Builder helper class. */ + public interface Builder7 { + /** + * Set the parallelToolCalls of this {@link CreateResponse200Response} instance. + * + * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. + * @return The CreateResponse200Response builder. + */ + Builder8 parallelToolCalls(@Nonnull final Boolean parallelToolCalls); + } + + /** Builder helper class. */ + public interface Builder8 { + /** + * Set the contentFilters of this {@link CreateResponse200Response} instance. + * + * @param contentFilters The content filter results from RAI. + * @return The CreateResponse200Response instance. + */ + CreateResponse200Response contentFilters( + @Nonnull final List contentFilters); + + /** + * Set the contentFilters of this {@link CreateResponse200Response} instance. + * + * @param contentFilters The content filter results from RAI. + * @return The CreateResponse200Response instance. + */ + default CreateResponse200Response contentFilters( + @Nonnull final AzureContentFilterForResponsesAPI... contentFilters) { + return contentFilters(Arrays.asList(contentFilters)); + } + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java new file mode 100644 index 000000000..bff51feb3 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java @@ -0,0 +1,58 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import java.util.List; +import javax.annotation.Nonnull; + +/** CreateResponse200ResponseInstructions */ +public interface CreateResponse200ResponseInstructions { + /** + * Helper class to create {@code List } that implements {@link + * CreateResponse200ResponseInstructions}. + */ + record ListOfOpenAIInputItems( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) + implements CreateResponse200ResponseInstructions {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val the value to use + * @return a new instance of {@link ListOfOpenAIInputItems}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfOpenAIInputItems createListOfOpenAIInputItems( + @Nonnull final List val) { + return new ListOfOpenAIInputItems(val); + } + + /** + * Helper class to create {@code String } that implements {@link + * CreateResponse200ResponseInstructions}. + */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements CreateResponse200ResponseInstructions {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java new file mode 100644 index 000000000..4a3d4e5d3 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java @@ -0,0 +1,395 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** DeleteResponse200Response */ +// CHECKSTYLE:OFF +public class DeleteResponse200Response +// CHECKSTYLE:ON +{ + /** Gets or Sets _object */ + public enum ObjectEnum { + /** The RESPONSE_DELETED option of this DeleteResponse200Response */ + RESPONSE_DELETED("response.deleted"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this DeleteResponse200Response */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ObjectEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type DeleteResponse200Response + */ + @JsonCreator + @Nonnull + public static ObjectEnum fromValue(@Nonnull final String value) { + for (ObjectEnum b : ObjectEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("object") + private ObjectEnum _object; + + @JsonProperty("id") + private String id; + + /** Gets or Sets deleted */ + public enum DeletedEnum { + /** The TRUE option of this DeleteResponse200Response */ + TRUE("true"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this DeleteResponse200Response */ + UNKNOWN_DEFAULT_OPEN_API("11184809"); + + private Boolean value; + + DeletedEnum(Boolean value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public Boolean getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type DeleteResponse200Response + */ + @JsonCreator + @Nonnull + public static DeletedEnum fromValue(@Nonnull final Boolean value) { + for (DeletedEnum b : DeletedEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("deleted") + private DeletedEnum deleted; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for DeleteResponse200Response. */ + protected DeleteResponse200Response() {} + + /** + * Set the _object of this {@link DeleteResponse200Response} instance and return the same + * instance. + * + * @param _object The _object of this {@link DeleteResponse200Response} + * @return The same instance of this {@link DeleteResponse200Response} class + */ + @Nonnull + public DeleteResponse200Response _object(@Nonnull final ObjectEnum _object) { + this._object = _object; + return this; + } + + /** + * Get _object + * + * @return _object The _object of this {@link DeleteResponse200Response} instance. + */ + @Nonnull + public ObjectEnum getObject() { + return _object; + } + + /** + * Set the _object of this {@link DeleteResponse200Response} instance. + * + * @param _object The _object of this {@link DeleteResponse200Response} + */ + public void setObject(@Nonnull final ObjectEnum _object) { + this._object = _object; + } + + /** + * Set the id of this {@link DeleteResponse200Response} instance and return the same instance. + * + * @param id The id of this {@link DeleteResponse200Response} + * @return The same instance of this {@link DeleteResponse200Response} class + */ + @Nonnull + public DeleteResponse200Response id(@Nullable final String id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id The id of this {@link DeleteResponse200Response} instance. + */ + @Nullable + public String getId() { + return id; + } + + /** + * Set the id of this {@link DeleteResponse200Response} instance. + * + * @param id The id of this {@link DeleteResponse200Response} + */ + public void setId(@Nullable final String id) { + this.id = id; + } + + /** + * Set the deleted of this {@link DeleteResponse200Response} instance and return the same + * instance. + * + * @param deleted The deleted of this {@link DeleteResponse200Response} + * @return The same instance of this {@link DeleteResponse200Response} class + */ + @Nonnull + public DeleteResponse200Response deleted(@Nonnull final DeletedEnum deleted) { + this.deleted = deleted; + return this; + } + + /** + * Get deleted + * + * @return deleted The deleted of this {@link DeleteResponse200Response} instance. + */ + @Nonnull + public DeletedEnum isDeleted() { + return deleted; + } + + /** + * Set the deleted of this {@link DeleteResponse200Response} instance. + * + * @param deleted The deleted of this {@link DeleteResponse200Response} + */ + public void setDeleted(@Nonnull final DeletedEnum deleted) { + this.deleted = deleted; + } + + /** + * Get the names of the unrecognizable properties of the {@link DeleteResponse200Response}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link DeleteResponse200Response} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "DeleteResponse200Response has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link DeleteResponse200Response} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (_object != null) declaredFields.put("_object", _object); + if (id != null) declaredFields.put("id", id); + if (deleted != null) declaredFields.put("deleted", deleted); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link DeleteResponse200Response} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final DeleteResponse200Response deleteResponse200Response = (DeleteResponse200Response) o; + return Objects.equals(this.cloudSdkCustomFields, deleteResponse200Response.cloudSdkCustomFields) + && Objects.equals(this._object, deleteResponse200Response._object) + && Objects.equals(this.id, deleteResponse200Response.id) + && Objects.equals(this.deleted, deleteResponse200Response.deleted); + } + + @Override + public int hashCode() { + return Objects.hash(_object, id, deleted, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class DeleteResponse200Response {\n"); + sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * DeleteResponse200Response} instance with all required arguments. + */ + public static Builder create() { + return (_object) -> + (id) -> + (deleted) -> new DeleteResponse200Response()._object(_object).id(id).deleted(deleted); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the _object of this {@link DeleteResponse200Response} instance. + * + * @param _object The _object of this {@link DeleteResponse200Response} + * @return The DeleteResponse200Response builder. + */ + Builder1 _object(@Nonnull final ObjectEnum _object); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the id of this {@link DeleteResponse200Response} instance. + * + * @param id The id of this {@link DeleteResponse200Response} + * @return The DeleteResponse200Response builder. + */ + Builder2 id(@Nullable final String id); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the deleted of this {@link DeleteResponse200Response} instance. + * + * @param deleted The deleted of this {@link DeleteResponse200Response} + * @return The DeleteResponse200Response instance. + */ + DeleteResponse200Response deleted(@Nonnull final DeletedEnum deleted); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java new file mode 100644 index 000000000..8021c0d56 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java @@ -0,0 +1,190 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * The conversation that this response belonged to. Input items and output items from this response + * were automatically added to this conversation. + */ +// CHECKSTYLE:OFF +public class OpenAIConversationReference +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIConversationReference. */ + protected OpenAIConversationReference() {} + + /** + * Set the id of this {@link OpenAIConversationReference} instance and return the same instance. + * + * @param id The unique ID of the conversation that this response was associated with. + * @return The same instance of this {@link OpenAIConversationReference} class + */ + @Nonnull + public OpenAIConversationReference id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the conversation that this response was associated with. + * + * @return id The id of this {@link OpenAIConversationReference} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link OpenAIConversationReference} instance. + * + * @param id The unique ID of the conversation that this response was associated with. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIConversationReference}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIConversationReference} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIConversationReference has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIConversationReference} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIConversationReference} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIConversationReference openAIConversationReference = (OpenAIConversationReference) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIConversationReference.cloudSdkCustomFields) + && Objects.equals(this.id, openAIConversationReference.id); + } + + @Override + public int hashCode() { + return Objects.hash(id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIConversationReference {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIConversationReference} instance with all required arguments. + */ + public static Builder create() { + return (id) -> new OpenAIConversationReference().id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link OpenAIConversationReference} instance. + * + * @param id The unique ID of the conversation that this response was associated with. + * @return The OpenAIConversationReference instance. + */ + OpenAIConversationReference id(@Nonnull final String id); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java new file mode 100644 index 000000000..cc1f5d457 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java @@ -0,0 +1,188 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIInputItem */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAIInputItem +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIInputItemType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIInputItem. */ + protected OpenAIInputItem() {} + + /** + * Set the type of this {@link OpenAIInputItem} instance and return the same instance. + * + * @param type The type of this {@link OpenAIInputItem} + * @return The same instance of this {@link OpenAIInputItem} class + */ + @Nonnull + public OpenAIInputItem type(@Nonnull final OpenAIInputItemType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIInputItem} instance. + */ + @Nonnull + public OpenAIInputItemType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIInputItem} instance. + * + * @param type The type of this {@link OpenAIInputItem} + */ + public void setType(@Nonnull final OpenAIInputItemType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIInputItem}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIInputItem} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIInputItem has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIInputItem} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIInputItem} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIInputItem openAIInputItem = (OpenAIInputItem) o; + return Objects.equals(this.cloudSdkCustomFields, openAIInputItem.cloudSdkCustomFields) + && Objects.equals(this.type, openAIInputItem.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIInputItem {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIInputItem} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIInputItem().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIInputItem} instance. + * + * @param type The type of this {@link OpenAIInputItem} + * @return The OpenAIInputItem instance. + */ + OpenAIInputItem type(@Nonnull final OpenAIInputItemType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java new file mode 100644 index 000000000..5cb83e869 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIInputItemType */ +public interface OpenAIInputItemType { + /** Helper class to create {@code String } that implements {@link OpenAIInputItemType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIInputItemType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java new file mode 100644 index 000000000..cdaf82f92 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java @@ -0,0 +1,188 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIOutputItem */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAIOutputItem +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIOutputItemType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIOutputItem. */ + protected OpenAIOutputItem() {} + + /** + * Set the type of this {@link OpenAIOutputItem} instance and return the same instance. + * + * @param type The type of this {@link OpenAIOutputItem} + * @return The same instance of this {@link OpenAIOutputItem} class + */ + @Nonnull + public OpenAIOutputItem type(@Nonnull final OpenAIOutputItemType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIOutputItem} instance. + */ + @Nonnull + public OpenAIOutputItemType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIOutputItem} instance. + * + * @param type The type of this {@link OpenAIOutputItem} + */ + public void setType(@Nonnull final OpenAIOutputItemType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIOutputItem}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIOutputItem} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIOutputItem has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIOutputItem} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIOutputItem} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIOutputItem openAIOutputItem = (OpenAIOutputItem) o; + return Objects.equals(this.cloudSdkCustomFields, openAIOutputItem.cloudSdkCustomFields) + && Objects.equals(this.type, openAIOutputItem.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIOutputItem {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIOutputItem} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIOutputItem().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIOutputItem} instance. + * + * @param type The type of this {@link OpenAIOutputItem} + * @return The OpenAIOutputItem instance. + */ + OpenAIOutputItem type(@Nonnull final OpenAIOutputItemType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java new file mode 100644 index 000000000..347d0aca6 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIOutputItemType */ +public interface OpenAIOutputItemType { + /** Helper class to create {@code String } that implements {@link OpenAIOutputItemType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIOutputItemType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java new file mode 100644 index 000000000..304cb14bd --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java @@ -0,0 +1,266 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Reference to a prompt template and its variables. [Learn + * more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + */ +// CHECKSTYLE:OFF +public class OpenAIPrompt +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonProperty("version") + private String version; + + @JsonProperty("variables") + private Object variables; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIPrompt. */ + protected OpenAIPrompt() {} + + /** + * Set the id of this {@link OpenAIPrompt} instance and return the same instance. + * + * @param id The unique identifier of the prompt template to use. + * @return The same instance of this {@link OpenAIPrompt} class + */ + @Nonnull + public OpenAIPrompt id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the prompt template to use. + * + * @return id The id of this {@link OpenAIPrompt} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link OpenAIPrompt} instance. + * + * @param id The unique identifier of the prompt template to use. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the version of this {@link OpenAIPrompt} instance and return the same instance. + * + * @param version The version of this {@link OpenAIPrompt} + * @return The same instance of this {@link OpenAIPrompt} class + */ + @Nonnull + public OpenAIPrompt version(@Nullable final String version) { + this.version = version; + return this; + } + + /** + * Get version + * + * @return version The version of this {@link OpenAIPrompt} instance. + */ + @Nullable + public String getVersion() { + return version; + } + + /** + * Set the version of this {@link OpenAIPrompt} instance. + * + * @param version The version of this {@link OpenAIPrompt} + */ + public void setVersion(@Nullable final String version) { + this.version = version; + } + + /** + * Set the variables of this {@link OpenAIPrompt} instance and return the same instance. + * + * @param variables Optional map of values to substitute in for variables in your prompt. The + * substitution values can either be strings, or other Response input types like images or + * files. + * @return The same instance of this {@link OpenAIPrompt} class + */ + @Nonnull + public OpenAIPrompt variables(@Nullable final Object variables) { + this.variables = variables; + return this; + } + + /** + * Optional map of values to substitute in for variables in your prompt. The substitution values + * can either be strings, or other Response input types like images or files. + * + * @return variables The variables of this {@link OpenAIPrompt} instance. + */ + @Nullable + public Object getVariables() { + return variables; + } + + /** + * Set the variables of this {@link OpenAIPrompt} instance. + * + * @param variables Optional map of values to substitute in for variables in your prompt. The + * substitution values can either be strings, or other Response input types like images or + * files. + */ + public void setVariables(@Nullable final Object variables) { + this.variables = variables; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIPrompt}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIPrompt} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIPrompt has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIPrompt} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + if (version != null) declaredFields.put("version", version); + if (variables != null) declaredFields.put("variables", variables); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIPrompt} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIPrompt openAIPrompt = (OpenAIPrompt) o; + return Objects.equals(this.cloudSdkCustomFields, openAIPrompt.cloudSdkCustomFields) + && Objects.equals(this.id, openAIPrompt.id) + && Objects.equals(this.version, openAIPrompt.version) + && Objects.equals(this.variables, openAIPrompt.variables); + } + + @Override + public int hashCode() { + return Objects.hash(id, version, variables, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIPrompt {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" variables: ").append(toIndentedString(variables)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIPrompt} instance + * with all required arguments. + */ + public static Builder create() { + return (id) -> new OpenAIPrompt().id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link OpenAIPrompt} instance. + * + * @param id The unique identifier of the prompt template to use. + * @return The OpenAIPrompt instance. + */ + OpenAIPrompt id(@Nonnull final String id); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java new file mode 100644 index 000000000..18ba98898 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java @@ -0,0 +1,369 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * **gpt-5 and o-series models only** Configuration options for [reasoning + * models](https://platform.openai.com/docs/guides/reasoning). + */ +// CHECKSTYLE:OFF +public class OpenAIReasoning +// CHECKSTYLE:ON +{ + @JsonProperty("effort") + private OpenAIReasoningEffort effort; + + /** Gets or Sets summary */ + public enum SummaryEnum { + /** The AUTO option of this OpenAIReasoning */ + AUTO("auto"), + + /** The CONCISE option of this OpenAIReasoning */ + CONCISE("concise"), + + /** The DETAILED option of this OpenAIReasoning */ + DETAILED("detailed"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIReasoning */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + SummaryEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIReasoning + */ + @JsonCreator + @Nullable + public static SummaryEnum fromValue(@Nonnull final String value) { + for (SummaryEnum b : SummaryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("summary") + private SummaryEnum summary; + + /** Gets or Sets generateSummary */ + public enum GenerateSummaryEnum { + /** The AUTO option of this OpenAIReasoning */ + AUTO("auto"), + + /** The CONCISE option of this OpenAIReasoning */ + CONCISE("concise"), + + /** The DETAILED option of this OpenAIReasoning */ + DETAILED("detailed"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIReasoning */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + GenerateSummaryEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIReasoning + */ + @JsonCreator + @Nullable + public static GenerateSummaryEnum fromValue(@Nonnull final String value) { + for (GenerateSummaryEnum b : GenerateSummaryEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("generate_summary") + private GenerateSummaryEnum generateSummary; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIReasoning. */ + protected OpenAIReasoning() {} + + /** + * Set the effort of this {@link OpenAIReasoning} instance and return the same instance. + * + * @param effort The effort of this {@link OpenAIReasoning} + * @return The same instance of this {@link OpenAIReasoning} class + */ + @Nonnull + public OpenAIReasoning effort(@Nullable final OpenAIReasoningEffort effort) { + this.effort = effort; + return this; + } + + /** + * Get effort + * + * @return effort The effort of this {@link OpenAIReasoning} instance. + */ + @Nullable + public OpenAIReasoningEffort getEffort() { + return effort; + } + + /** + * Set the effort of this {@link OpenAIReasoning} instance. + * + * @param effort The effort of this {@link OpenAIReasoning} + */ + public void setEffort(@Nullable final OpenAIReasoningEffort effort) { + this.effort = effort; + } + + /** + * Set the summary of this {@link OpenAIReasoning} instance and return the same instance. + * + * @param summary The summary of this {@link OpenAIReasoning} + * @return The same instance of this {@link OpenAIReasoning} class + */ + @Nonnull + public OpenAIReasoning summary(@Nullable final SummaryEnum summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * + * @return summary The summary of this {@link OpenAIReasoning} instance. + */ + @Nullable + public SummaryEnum getSummary() { + return summary; + } + + /** + * Set the summary of this {@link OpenAIReasoning} instance. + * + * @param summary The summary of this {@link OpenAIReasoning} + */ + public void setSummary(@Nullable final SummaryEnum summary) { + this.summary = summary; + } + + /** + * Set the generateSummary of this {@link OpenAIReasoning} instance and return the same instance. + * + * @param generateSummary The generateSummary of this {@link OpenAIReasoning} + * @return The same instance of this {@link OpenAIReasoning} class + */ + @Nonnull + public OpenAIReasoning generateSummary(@Nullable final GenerateSummaryEnum generateSummary) { + this.generateSummary = generateSummary; + return this; + } + + /** + * Get generateSummary + * + * @return generateSummary The generateSummary of this {@link OpenAIReasoning} instance. + */ + @Nullable + public GenerateSummaryEnum getGenerateSummary() { + return generateSummary; + } + + /** + * Set the generateSummary of this {@link OpenAIReasoning} instance. + * + * @param generateSummary The generateSummary of this {@link OpenAIReasoning} + */ + public void setGenerateSummary(@Nullable final GenerateSummaryEnum generateSummary) { + this.generateSummary = generateSummary; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIReasoning}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIReasoning} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIReasoning has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIReasoning} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (effort != null) declaredFields.put("effort", effort); + if (summary != null) declaredFields.put("summary", summary); + if (generateSummary != null) declaredFields.put("generateSummary", generateSummary); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIReasoning} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIReasoning openAIReasoning = (OpenAIReasoning) o; + return Objects.equals(this.cloudSdkCustomFields, openAIReasoning.cloudSdkCustomFields) + && Objects.equals(this.effort, openAIReasoning.effort) + && Objects.equals(this.summary, openAIReasoning.summary) + && Objects.equals(this.generateSummary, openAIReasoning.generateSummary); + } + + @Override + public int hashCode() { + return Objects.hash(effort, summary, generateSummary, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIReasoning {\n"); + sb.append(" effort: ").append(toIndentedString(effort)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" generateSummary: ").append(toIndentedString(generateSummary)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link OpenAIReasoning} instance. No arguments are required. */ + public static OpenAIReasoning create() { + return new OpenAIReasoning(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java new file mode 100644 index 000000000..8d617103b --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java @@ -0,0 +1,72 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets OpenAI.ReasoningEffort */ +public enum OpenAIReasoningEffort { + NONE("none"), + + MINIMAL("minimal"), + + LOW("low"), + + MEDIUM("medium"), + + HIGH("high"), + + XHIGH("xhigh"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + OpenAIReasoningEffort(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static OpenAIReasoningEffort fromValue(@Nonnull final String value) { + for (final OpenAIReasoningEffort b : OpenAIReasoningEffort.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java new file mode 100644 index 000000000..d0fc412e1 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java @@ -0,0 +1,233 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** An error object returned when the model fails to generate a Response. */ +// CHECKSTYLE:OFF +public class OpenAIResponseError +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private OpenAIResponseErrorCode code; + + @JsonProperty("message") + private String message; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseError. */ + protected OpenAIResponseError() {} + + /** + * Set the code of this {@link OpenAIResponseError} instance and return the same instance. + * + * @param code The code of this {@link OpenAIResponseError} + * @return The same instance of this {@link OpenAIResponseError} class + */ + @Nonnull + public OpenAIResponseError code(@Nonnull final OpenAIResponseErrorCode code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code The code of this {@link OpenAIResponseError} instance. + */ + @Nonnull + public OpenAIResponseErrorCode getCode() { + return code; + } + + /** + * Set the code of this {@link OpenAIResponseError} instance. + * + * @param code The code of this {@link OpenAIResponseError} + */ + public void setCode(@Nonnull final OpenAIResponseErrorCode code) { + this.code = code; + } + + /** + * Set the message of this {@link OpenAIResponseError} instance and return the same instance. + * + * @param message A human-readable description of the error. + * @return The same instance of this {@link OpenAIResponseError} class + */ + @Nonnull + public OpenAIResponseError message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * A human-readable description of the error. + * + * @return message The message of this {@link OpenAIResponseError} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link OpenAIResponseError} instance. + * + * @param message A human-readable description of the error. + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseError}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseError} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseError has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseError} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseError} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseError openAIResponseError = (OpenAIResponseError) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseError.cloudSdkCustomFields) + && Objects.equals(this.code, openAIResponseError.code) + && Objects.equals(this.message, openAIResponseError.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseError {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseError} + * instance with all required arguments. + */ + public static Builder create() { + return (code) -> (message) -> new OpenAIResponseError().code(code).message(message); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link OpenAIResponseError} instance. + * + * @param code The code of this {@link OpenAIResponseError} + * @return The OpenAIResponseError builder. + */ + Builder1 code(@Nonnull final OpenAIResponseErrorCode code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link OpenAIResponseError} instance. + * + * @param message A human-readable description of the error. + * @return The OpenAIResponseError instance. + */ + OpenAIResponseError message(@Nonnull final String message); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java new file mode 100644 index 000000000..fc51482c4 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java @@ -0,0 +1,96 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** The error code for the response. */ +public enum OpenAIResponseErrorCode { + SERVER_ERROR("server_error"), + + RATE_LIMIT_EXCEEDED("rate_limit_exceeded"), + + INVALID_PROMPT("invalid_prompt"), + + VECTOR_STORE_TIMEOUT("vector_store_timeout"), + + INVALID_IMAGE("invalid_image"), + + INVALID_IMAGE_FORMAT("invalid_image_format"), + + INVALID_BASE64_IMAGE("invalid_base64_image"), + + INVALID_IMAGE_URL("invalid_image_url"), + + IMAGE_TOO_LARGE("image_too_large"), + + IMAGE_TOO_SMALL("image_too_small"), + + IMAGE_PARSE_ERROR("image_parse_error"), + + IMAGE_CONTENT_POLICY_VIOLATION("image_content_policy_violation"), + + INVALID_IMAGE_MODE("invalid_image_mode"), + + IMAGE_FILE_TOO_LARGE("image_file_too_large"), + + UNSUPPORTED_IMAGE_MEDIA_TYPE("unsupported_image_media_type"), + + EMPTY_IMAGE_FILE("empty_image_file"), + + FAILED_TO_DOWNLOAD_IMAGE("failed_to_download_image"), + + IMAGE_FILE_NOT_FOUND("image_file_not_found"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + OpenAIResponseErrorCode(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static OpenAIResponseErrorCode fromValue(@Nonnull final String value) { + for (final OpenAIResponseErrorCode b : OpenAIResponseErrorCode.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java new file mode 100644 index 000000000..0cd076e36 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java @@ -0,0 +1,235 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIResponseIncompleteDetails */ +// CHECKSTYLE:OFF +public class OpenAIResponseIncompleteDetails +// CHECKSTYLE:ON +{ + /** Gets or Sets reason */ + public enum ReasonEnum { + /** The MAX_OUTPUT_TOKENS option of this OpenAIResponseIncompleteDetails */ + MAX_OUTPUT_TOKENS("max_output_tokens"), + + /** The CONTENT_FILTER option of this OpenAIResponseIncompleteDetails */ + CONTENT_FILTER("content_filter"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseIncompleteDetails */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ReasonEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseIncompleteDetails + */ + @JsonCreator + @Nonnull + public static ReasonEnum fromValue(@Nonnull final String value) { + for (ReasonEnum b : ReasonEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("reason") + private ReasonEnum reason; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseIncompleteDetails. */ + protected OpenAIResponseIncompleteDetails() {} + + /** + * Set the reason of this {@link OpenAIResponseIncompleteDetails} instance and return the same + * instance. + * + * @param reason The reason of this {@link OpenAIResponseIncompleteDetails} + * @return The same instance of this {@link OpenAIResponseIncompleteDetails} class + */ + @Nonnull + public OpenAIResponseIncompleteDetails reason(@Nullable final ReasonEnum reason) { + this.reason = reason; + return this; + } + + /** + * Get reason + * + * @return reason The reason of this {@link OpenAIResponseIncompleteDetails} instance. + */ + @Nonnull + public ReasonEnum getReason() { + return reason; + } + + /** + * Set the reason of this {@link OpenAIResponseIncompleteDetails} instance. + * + * @param reason The reason of this {@link OpenAIResponseIncompleteDetails} + */ + public void setReason(@Nullable final ReasonEnum reason) { + this.reason = reason; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseIncompleteDetails}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseIncompleteDetails} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseIncompleteDetails has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseIncompleteDetails} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (reason != null) declaredFields.put("reason", reason); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseIncompleteDetails} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseIncompleteDetails openAIResponseIncompleteDetails = + (OpenAIResponseIncompleteDetails) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseIncompleteDetails.cloudSdkCustomFields) + && Objects.equals(this.reason, openAIResponseIncompleteDetails.reason); + } + + @Override + public int hashCode() { + return Objects.hash(reason, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseIncompleteDetails {\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link OpenAIResponseIncompleteDetails} instance. No arguments are required. */ + public static OpenAIResponseIncompleteDetails create() { + return new OpenAIResponseIncompleteDetails(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java new file mode 100644 index 000000000..df2798b49 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java @@ -0,0 +1,214 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Configuration options for a text response from the model. Can be plain text or structured JSON + * data. Learn more: - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - + * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + */ +// CHECKSTYLE:OFF +public class OpenAIResponseTextParam +// CHECKSTYLE:ON +{ + @JsonProperty("format") + private OpenAITextResponseFormatConfiguration format; + + @JsonProperty("verbosity") + private OpenAIVerbosity verbosity; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseTextParam. */ + protected OpenAIResponseTextParam() {} + + /** + * Set the format of this {@link OpenAIResponseTextParam} instance and return the same instance. + * + * @param format The format of this {@link OpenAIResponseTextParam} + * @return The same instance of this {@link OpenAIResponseTextParam} class + */ + @Nonnull + public OpenAIResponseTextParam format( + @Nullable final OpenAITextResponseFormatConfiguration format) { + this.format = format; + return this; + } + + /** + * Get format + * + * @return format The format of this {@link OpenAIResponseTextParam} instance. + */ + @Nonnull + public OpenAITextResponseFormatConfiguration getFormat() { + return format; + } + + /** + * Set the format of this {@link OpenAIResponseTextParam} instance. + * + * @param format The format of this {@link OpenAIResponseTextParam} + */ + public void setFormat(@Nullable final OpenAITextResponseFormatConfiguration format) { + this.format = format; + } + + /** + * Set the verbosity of this {@link OpenAIResponseTextParam} instance and return the same + * instance. + * + * @param verbosity The verbosity of this {@link OpenAIResponseTextParam} + * @return The same instance of this {@link OpenAIResponseTextParam} class + */ + @Nonnull + public OpenAIResponseTextParam verbosity(@Nullable final OpenAIVerbosity verbosity) { + this.verbosity = verbosity; + return this; + } + + /** + * Get verbosity + * + * @return verbosity The verbosity of this {@link OpenAIResponseTextParam} instance. + */ + @Nullable + public OpenAIVerbosity getVerbosity() { + return verbosity; + } + + /** + * Set the verbosity of this {@link OpenAIResponseTextParam} instance. + * + * @param verbosity The verbosity of this {@link OpenAIResponseTextParam} + */ + public void setVerbosity(@Nullable final OpenAIVerbosity verbosity) { + this.verbosity = verbosity; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseTextParam}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseTextParam} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseTextParam has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseTextParam} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (format != null) declaredFields.put("format", format); + if (verbosity != null) declaredFields.put("verbosity", verbosity); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseTextParam} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseTextParam openAIResponseTextParam = (OpenAIResponseTextParam) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseTextParam.cloudSdkCustomFields) + && Objects.equals(this.format, openAIResponseTextParam.format) + && Objects.equals(this.verbosity, openAIResponseTextParam.verbosity); + } + + @Override + public int hashCode() { + return Objects.hash(format, verbosity, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseTextParam {\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" verbosity: ").append(toIndentedString(verbosity)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link OpenAIResponseTextParam} instance. No arguments are required. */ + public static OpenAIResponseTextParam create() { + return new OpenAIResponseTextParam(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java new file mode 100644 index 000000000..26212d576 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java @@ -0,0 +1,407 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Represents token usage details including input tokens, output tokens, a breakdown of output + * tokens, and the total tokens used. + */ +// CHECKSTYLE:OFF +public class OpenAIResponseUsage +// CHECKSTYLE:ON +{ + @JsonProperty("input_tokens") + private Integer inputTokens; + + @JsonProperty("input_tokens_details") + private OpenAIResponseUsageInputTokensDetails inputTokensDetails; + + @JsonProperty("output_tokens") + private Integer outputTokens; + + @JsonProperty("output_tokens_details") + private OpenAIResponseUsageOutputTokensDetails outputTokensDetails; + + @JsonProperty("total_tokens") + private Integer totalTokens; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseUsage. */ + protected OpenAIResponseUsage() {} + + /** + * Set the inputTokens of this {@link OpenAIResponseUsage} instance and return the same instance. + * + * @param inputTokens The number of input tokens. + * @return The same instance of this {@link OpenAIResponseUsage} class + */ + @Nonnull + public OpenAIResponseUsage inputTokens(@Nonnull final Integer inputTokens) { + this.inputTokens = inputTokens; + return this; + } + + /** + * The number of input tokens. + * + * @return inputTokens The inputTokens of this {@link OpenAIResponseUsage} instance. + */ + @Nonnull + public Integer getInputTokens() { + return inputTokens; + } + + /** + * Set the inputTokens of this {@link OpenAIResponseUsage} instance. + * + * @param inputTokens The number of input tokens. + */ + public void setInputTokens(@Nonnull final Integer inputTokens) { + this.inputTokens = inputTokens; + } + + /** + * Set the inputTokensDetails of this {@link OpenAIResponseUsage} instance and return the same + * instance. + * + * @param inputTokensDetails A detailed breakdown of the input tokens. + * @return The same instance of this {@link OpenAIResponseUsage} class + */ + @Nonnull + public OpenAIResponseUsage inputTokensDetails( + @Nonnull final OpenAIResponseUsageInputTokensDetails inputTokensDetails) { + this.inputTokensDetails = inputTokensDetails; + return this; + } + + /** + * A detailed breakdown of the input tokens. + * + * @return inputTokensDetails The inputTokensDetails of this {@link OpenAIResponseUsage} instance. + */ + @Nonnull + public OpenAIResponseUsageInputTokensDetails getInputTokensDetails() { + return inputTokensDetails; + } + + /** + * Set the inputTokensDetails of this {@link OpenAIResponseUsage} instance. + * + * @param inputTokensDetails A detailed breakdown of the input tokens. + */ + public void setInputTokensDetails( + @Nonnull final OpenAIResponseUsageInputTokensDetails inputTokensDetails) { + this.inputTokensDetails = inputTokensDetails; + } + + /** + * Set the outputTokens of this {@link OpenAIResponseUsage} instance and return the same instance. + * + * @param outputTokens The number of output tokens. + * @return The same instance of this {@link OpenAIResponseUsage} class + */ + @Nonnull + public OpenAIResponseUsage outputTokens(@Nonnull final Integer outputTokens) { + this.outputTokens = outputTokens; + return this; + } + + /** + * The number of output tokens. + * + * @return outputTokens The outputTokens of this {@link OpenAIResponseUsage} instance. + */ + @Nonnull + public Integer getOutputTokens() { + return outputTokens; + } + + /** + * Set the outputTokens of this {@link OpenAIResponseUsage} instance. + * + * @param outputTokens The number of output tokens. + */ + public void setOutputTokens(@Nonnull final Integer outputTokens) { + this.outputTokens = outputTokens; + } + + /** + * Set the outputTokensDetails of this {@link OpenAIResponseUsage} instance and return the same + * instance. + * + * @param outputTokensDetails A detailed breakdown of the output tokens. + * @return The same instance of this {@link OpenAIResponseUsage} class + */ + @Nonnull + public OpenAIResponseUsage outputTokensDetails( + @Nonnull final OpenAIResponseUsageOutputTokensDetails outputTokensDetails) { + this.outputTokensDetails = outputTokensDetails; + return this; + } + + /** + * A detailed breakdown of the output tokens. + * + * @return outputTokensDetails The outputTokensDetails of this {@link OpenAIResponseUsage} + * instance. + */ + @Nonnull + public OpenAIResponseUsageOutputTokensDetails getOutputTokensDetails() { + return outputTokensDetails; + } + + /** + * Set the outputTokensDetails of this {@link OpenAIResponseUsage} instance. + * + * @param outputTokensDetails A detailed breakdown of the output tokens. + */ + public void setOutputTokensDetails( + @Nonnull final OpenAIResponseUsageOutputTokensDetails outputTokensDetails) { + this.outputTokensDetails = outputTokensDetails; + } + + /** + * Set the totalTokens of this {@link OpenAIResponseUsage} instance and return the same instance. + * + * @param totalTokens The total number of tokens used. + * @return The same instance of this {@link OpenAIResponseUsage} class + */ + @Nonnull + public OpenAIResponseUsage totalTokens(@Nonnull final Integer totalTokens) { + this.totalTokens = totalTokens; + return this; + } + + /** + * The total number of tokens used. + * + * @return totalTokens The totalTokens of this {@link OpenAIResponseUsage} instance. + */ + @Nonnull + public Integer getTotalTokens() { + return totalTokens; + } + + /** + * Set the totalTokens of this {@link OpenAIResponseUsage} instance. + * + * @param totalTokens The total number of tokens used. + */ + public void setTotalTokens(@Nonnull final Integer totalTokens) { + this.totalTokens = totalTokens; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseUsage}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseUsage} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseUsage has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseUsage} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (inputTokens != null) declaredFields.put("inputTokens", inputTokens); + if (inputTokensDetails != null) declaredFields.put("inputTokensDetails", inputTokensDetails); + if (outputTokens != null) declaredFields.put("outputTokens", outputTokens); + if (outputTokensDetails != null) declaredFields.put("outputTokensDetails", outputTokensDetails); + if (totalTokens != null) declaredFields.put("totalTokens", totalTokens); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseUsage} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseUsage openAIResponseUsage = (OpenAIResponseUsage) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseUsage.cloudSdkCustomFields) + && Objects.equals(this.inputTokens, openAIResponseUsage.inputTokens) + && Objects.equals(this.inputTokensDetails, openAIResponseUsage.inputTokensDetails) + && Objects.equals(this.outputTokens, openAIResponseUsage.outputTokens) + && Objects.equals(this.outputTokensDetails, openAIResponseUsage.outputTokensDetails) + && Objects.equals(this.totalTokens, openAIResponseUsage.totalTokens); + } + + @Override + public int hashCode() { + return Objects.hash( + inputTokens, + inputTokensDetails, + outputTokens, + outputTokensDetails, + totalTokens, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseUsage {\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); + sb.append(" inputTokensDetails: ").append(toIndentedString(inputTokensDetails)).append("\n"); + sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); + sb.append(" outputTokensDetails: ") + .append(toIndentedString(outputTokensDetails)) + .append("\n"); + sb.append(" totalTokens: ").append(toIndentedString(totalTokens)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseUsage} + * instance with all required arguments. + */ + public static Builder create() { + return (inputTokens) -> + (inputTokensDetails) -> + (outputTokens) -> + (outputTokensDetails) -> + (totalTokens) -> + new OpenAIResponseUsage() + .inputTokens(inputTokens) + .inputTokensDetails(inputTokensDetails) + .outputTokens(outputTokens) + .outputTokensDetails(outputTokensDetails) + .totalTokens(totalTokens); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the inputTokens of this {@link OpenAIResponseUsage} instance. + * + * @param inputTokens The number of input tokens. + * @return The OpenAIResponseUsage builder. + */ + Builder1 inputTokens(@Nonnull final Integer inputTokens); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the inputTokensDetails of this {@link OpenAIResponseUsage} instance. + * + * @param inputTokensDetails A detailed breakdown of the input tokens. + * @return The OpenAIResponseUsage builder. + */ + Builder2 inputTokensDetails( + @Nonnull final OpenAIResponseUsageInputTokensDetails inputTokensDetails); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputTokens of this {@link OpenAIResponseUsage} instance. + * + * @param outputTokens The number of output tokens. + * @return The OpenAIResponseUsage builder. + */ + Builder3 outputTokens(@Nonnull final Integer outputTokens); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the outputTokensDetails of this {@link OpenAIResponseUsage} instance. + * + * @param outputTokensDetails A detailed breakdown of the output tokens. + * @return The OpenAIResponseUsage builder. + */ + Builder4 outputTokensDetails( + @Nonnull final OpenAIResponseUsageOutputTokensDetails outputTokensDetails); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the totalTokens of this {@link OpenAIResponseUsage} instance. + * + * @param totalTokens The total number of tokens used. + * @return The OpenAIResponseUsage instance. + */ + OpenAIResponseUsage totalTokens(@Nonnull final Integer totalTokens); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java new file mode 100644 index 000000000..9326932a8 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java @@ -0,0 +1,192 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIResponseUsageInputTokensDetails */ +// CHECKSTYLE:OFF +public class OpenAIResponseUsageInputTokensDetails +// CHECKSTYLE:ON +{ + @JsonProperty("cached_tokens") + private Integer cachedTokens; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseUsageInputTokensDetails. */ + protected OpenAIResponseUsageInputTokensDetails() {} + + /** + * Set the cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} instance and return + * the same instance. + * + * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} + * @return The same instance of this {@link OpenAIResponseUsageInputTokensDetails} class + */ + @Nonnull + public OpenAIResponseUsageInputTokensDetails cachedTokens(@Nullable final Integer cachedTokens) { + this.cachedTokens = cachedTokens; + return this; + } + + /** + * Get cachedTokens + * + * @return cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} + * instance. + */ + @Nullable + public Integer getCachedTokens() { + return cachedTokens; + } + + /** + * Set the cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} instance. + * + * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} + */ + public void setCachedTokens(@Nullable final Integer cachedTokens) { + this.cachedTokens = cachedTokens; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseUsageInputTokensDetails}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseUsageInputTokensDetails} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseUsageInputTokensDetails has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseUsageInputTokensDetails} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (cachedTokens != null) declaredFields.put("cachedTokens", cachedTokens); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseUsageInputTokensDetails} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseUsageInputTokensDetails openAIResponseUsageInputTokensDetails = + (OpenAIResponseUsageInputTokensDetails) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseUsageInputTokensDetails.cloudSdkCustomFields) + && Objects.equals(this.cachedTokens, openAIResponseUsageInputTokensDetails.cachedTokens); + } + + @Override + public int hashCode() { + return Objects.hash(cachedTokens, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseUsageInputTokensDetails {\n"); + sb.append(" cachedTokens: ").append(toIndentedString(cachedTokens)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseUsageInputTokensDetails} instance with all required arguments. + */ + public static Builder create() { + return (cachedTokens) -> new OpenAIResponseUsageInputTokensDetails().cachedTokens(cachedTokens); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} instance. + * + * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} + * @return The OpenAIResponseUsageInputTokensDetails instance. + */ + OpenAIResponseUsageInputTokensDetails cachedTokens(@Nullable final Integer cachedTokens); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java new file mode 100644 index 000000000..2e53b2f51 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java @@ -0,0 +1,198 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIResponseUsageOutputTokensDetails */ +// CHECKSTYLE:OFF +public class OpenAIResponseUsageOutputTokensDetails +// CHECKSTYLE:ON +{ + @JsonProperty("reasoning_tokens") + private Integer reasoningTokens; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseUsageOutputTokensDetails. */ + protected OpenAIResponseUsageOutputTokensDetails() {} + + /** + * Set the reasoningTokens of this {@link OpenAIResponseUsageOutputTokensDetails} instance and + * return the same instance. + * + * @param reasoningTokens The reasoningTokens of this {@link + * OpenAIResponseUsageOutputTokensDetails} + * @return The same instance of this {@link OpenAIResponseUsageOutputTokensDetails} class + */ + @Nonnull + public OpenAIResponseUsageOutputTokensDetails reasoningTokens( + @Nullable final Integer reasoningTokens) { + this.reasoningTokens = reasoningTokens; + return this; + } + + /** + * Get reasoningTokens + * + * @return reasoningTokens The reasoningTokens of this {@link + * OpenAIResponseUsageOutputTokensDetails} instance. + */ + @Nullable + public Integer getReasoningTokens() { + return reasoningTokens; + } + + /** + * Set the reasoningTokens of this {@link OpenAIResponseUsageOutputTokensDetails} instance. + * + * @param reasoningTokens The reasoningTokens of this {@link + * OpenAIResponseUsageOutputTokensDetails} + */ + public void setReasoningTokens(@Nullable final Integer reasoningTokens) { + this.reasoningTokens = reasoningTokens; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseUsageOutputTokensDetails}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseUsageOutputTokensDetails} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseUsageOutputTokensDetails has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseUsageOutputTokensDetails} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (reasoningTokens != null) declaredFields.put("reasoningTokens", reasoningTokens); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseUsageOutputTokensDetails} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseUsageOutputTokensDetails openAIResponseUsageOutputTokensDetails = + (OpenAIResponseUsageOutputTokensDetails) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseUsageOutputTokensDetails.cloudSdkCustomFields) + && Objects.equals( + this.reasoningTokens, openAIResponseUsageOutputTokensDetails.reasoningTokens); + } + + @Override + public int hashCode() { + return Objects.hash(reasoningTokens, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseUsageOutputTokensDetails {\n"); + sb.append(" reasoningTokens: ").append(toIndentedString(reasoningTokens)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseUsageOutputTokensDetails} instance with all required arguments. + */ + public static Builder create() { + return (reasoningTokens) -> + new OpenAIResponseUsageOutputTokensDetails().reasoningTokens(reasoningTokens); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the reasoningTokens of this {@link OpenAIResponseUsageOutputTokensDetails} instance. + * + * @param reasoningTokens The reasoningTokens of this {@link + * OpenAIResponseUsageOutputTokensDetails} + * @return The OpenAIResponseUsageOutputTokensDetails instance. + */ + OpenAIResponseUsageOutputTokensDetails reasoningTokens(@Nullable final Integer reasoningTokens); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java new file mode 100644 index 000000000..d67cc888e --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java @@ -0,0 +1,206 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * An object specifying the format that the model must output. Configuring `{ + * \"type\": \"json_schema\" }` enables Structured Outputs, which ensures + * the model will match your supplied JSON schema. Learn more in the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). The default format is `{ + * \"type\": \"text\" }` with no additional options. *Not recommended for + * gpt-4o and newer models:** Setting to `{ \"type\": \"json_object\" + * }` enables the older JSON mode, which ensures the message the model generates is valid JSON. + * Using `json_schema` is preferred for models that support it. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAITextResponseFormatConfiguration +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAITextResponseFormatConfigurationType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAITextResponseFormatConfiguration. */ + protected OpenAITextResponseFormatConfiguration() {} + + /** + * Set the type of this {@link OpenAITextResponseFormatConfiguration} instance and return the same + * instance. + * + * @param type The type of this {@link OpenAITextResponseFormatConfiguration} + * @return The same instance of this {@link OpenAITextResponseFormatConfiguration} class + */ + @Nonnull + public OpenAITextResponseFormatConfiguration type( + @Nonnull final OpenAITextResponseFormatConfigurationType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAITextResponseFormatConfiguration} instance. + */ + @Nonnull + public OpenAITextResponseFormatConfigurationType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAITextResponseFormatConfiguration} instance. + * + * @param type The type of this {@link OpenAITextResponseFormatConfiguration} + */ + public void setType(@Nonnull final OpenAITextResponseFormatConfigurationType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAITextResponseFormatConfiguration}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAITextResponseFormatConfiguration} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAITextResponseFormatConfiguration has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAITextResponseFormatConfiguration} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAITextResponseFormatConfiguration} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAITextResponseFormatConfiguration openAITextResponseFormatConfiguration = + (OpenAITextResponseFormatConfiguration) o; + return Objects.equals( + this.cloudSdkCustomFields, openAITextResponseFormatConfiguration.cloudSdkCustomFields) + && Objects.equals(this.type, openAITextResponseFormatConfiguration.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAITextResponseFormatConfiguration {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAITextResponseFormatConfiguration} instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAITextResponseFormatConfiguration().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAITextResponseFormatConfiguration} instance. + * + * @param type The type of this {@link OpenAITextResponseFormatConfiguration} + * @return The OpenAITextResponseFormatConfiguration instance. + */ + OpenAITextResponseFormatConfiguration type( + @Nonnull final OpenAITextResponseFormatConfigurationType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java new file mode 100644 index 000000000..9193f4d00 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java @@ -0,0 +1,36 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAITextResponseFormatConfigurationType */ +public interface OpenAITextResponseFormatConfigurationType { + /** + * Helper class to create {@code String } that implements {@link + * OpenAITextResponseFormatConfigurationType}. + */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAITextResponseFormatConfigurationType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java new file mode 100644 index 000000000..be2685852 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java @@ -0,0 +1,188 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A tool that can be used to generate a response. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAITool +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIToolType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAITool. */ + protected OpenAITool() {} + + /** + * Set the type of this {@link OpenAITool} instance and return the same instance. + * + * @param type The type of this {@link OpenAITool} + * @return The same instance of this {@link OpenAITool} class + */ + @Nonnull + public OpenAITool type(@Nonnull final OpenAIToolType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAITool} instance. + */ + @Nonnull + public OpenAIToolType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAITool} instance. + * + * @param type The type of this {@link OpenAITool} + */ + public void setType(@Nonnull final OpenAIToolType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAITool}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAITool} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAITool has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAITool} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAITool} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAITool openAITool = (OpenAITool) o; + return Objects.equals(this.cloudSdkCustomFields, openAITool.cloudSdkCustomFields) + && Objects.equals(this.type, openAITool.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAITool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAITool} instance + * with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAITool().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAITool} instance. + * + * @param type The type of this {@link OpenAITool} + * @return The OpenAITool instance. + */ + OpenAITool type(@Nonnull final OpenAIToolType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java new file mode 100644 index 000000000..a29dd85a6 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java @@ -0,0 +1,192 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * How the model should select which tool (or tools) to use when generating a response. See the + * `tools` parameter to see how to specify which tools the model can call. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAIToolChoiceParam +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIToolChoiceParamType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIToolChoiceParam. */ + protected OpenAIToolChoiceParam() {} + + /** + * Set the type of this {@link OpenAIToolChoiceParam} instance and return the same instance. + * + * @param type The type of this {@link OpenAIToolChoiceParam} + * @return The same instance of this {@link OpenAIToolChoiceParam} class + */ + @Nonnull + public OpenAIToolChoiceParam type(@Nonnull final OpenAIToolChoiceParamType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIToolChoiceParam} instance. + */ + @Nonnull + public OpenAIToolChoiceParamType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIToolChoiceParam} instance. + * + * @param type The type of this {@link OpenAIToolChoiceParam} + */ + public void setType(@Nonnull final OpenAIToolChoiceParamType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIToolChoiceParam}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIToolChoiceParam} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIToolChoiceParam has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIToolChoiceParam} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIToolChoiceParam} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIToolChoiceParam openAIToolChoiceParam = (OpenAIToolChoiceParam) o; + return Objects.equals(this.cloudSdkCustomFields, openAIToolChoiceParam.cloudSdkCustomFields) + && Objects.equals(this.type, openAIToolChoiceParam.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIToolChoiceParam {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIToolChoiceParam} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIToolChoiceParam().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIToolChoiceParam} instance. + * + * @param type The type of this {@link OpenAIToolChoiceParam} + * @return The OpenAIToolChoiceParam instance. + */ + OpenAIToolChoiceParam type(@Nonnull final OpenAIToolChoiceParamType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java new file mode 100644 index 000000000..ee210e6e1 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIToolChoiceParamType */ +public interface OpenAIToolChoiceParamType { + /** Helper class to create {@code String } that implements {@link OpenAIToolChoiceParamType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIToolChoiceParamType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java new file mode 100644 index 000000000..6d2d8a38d --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIToolType */ +public interface OpenAIToolType { + /** Helper class to create {@code String } that implements {@link OpenAIToolType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIToolType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java new file mode 100644 index 000000000..e1763bef2 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java @@ -0,0 +1,66 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets OpenAI.Verbosity */ +public enum OpenAIVerbosity { + LOW("low"), + + MEDIUM("medium"), + + HIGH("high"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + OpenAIVerbosity(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static OpenAIVerbosity fromValue(@Nonnull final String value) { + for (final OpenAIVerbosity b : OpenAIVerbosity.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json index 18a9e41f9..d80ee4bf8 100644 --- a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json +++ b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json @@ -1,14 +1,17 @@ { - "openapi": "3.2.0", + "openapi": "3.1.0", "info": { "title": "Azure AI Foundry Models Service", "license": { "name": "MIT", "url": "https://github.com/openai/openai-openapi/blob/master/LICENSE" }, - "version": "v1" + "version": "preview" }, "tags": [ + { + "name": "Audio" + }, { "name": "Batch" }, @@ -36,6 +39,9 @@ { "name": "Fine-tuning" }, + { + "name": "Images" + }, { "name": "Models" }, @@ -50,9 +56,503 @@ }, { "name": "Vector Stores" + }, + { + "name": "Videos" } ], "paths": { + "/audio/speech": { + "post": { + "operationId": "createSpeech", + "summary": "Generates text-to-speech audio from the input text.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/octet-stream": { + "schema": { + "contentMediaType": "application/octet-stream" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Audio" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "The model to use for this text-to-speech request.", + "x-oaiTypeLabel": "string" + }, + "input": { + "type": "string", + "maxLength": 4096, + "description": "The text to generate audio for. The maximum length is 4096 characters." + }, + "instructions": { + "type": "string", + "maxLength": 4096, + "description": "Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`." + }, + "stream_format": { + "type": "string", + "enum": [ + "sse", + "audio" + ], + "description": "The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.", + "default": "audio" + }, + "response_format": { + "allOf": [ + { + "$ref": "#/components/schemas/SpeechGenerationResponseFormat" + } + ], + "description": "The audio output format for the spoken text. By default, the MP3 format will be used." + }, + "speed": { + "type": "number", + "format": "float", + "minimum": 0.25, + "maximum": 4, + "description": "The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech.", + "default": 1 + }, + "voice": { + "allOf": [ + { + "$ref": "#/components/schemas/SpeechVoice" + } + ], + "description": "The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`." + } + }, + "required": [ + "model", + "input", + "voice" + ] + } + } + } + }, + "x-ms-examples": { + "Create a speech request": { + "$ref": "./examples/audio_speech.yaml" + } + } + } + }, + "/audio/transcriptions": { + "post": { + "operationId": "createTranscription", + "summary": "Transcribes audio into the input language.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureAudioTranscriptionResponse" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Audio" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "object", + "description": "The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.", + "x-oaiTypeLabel": "file", + "x-oaiMeta": { + "exampleFilePath": "speech.mp3" + } + }, + "model": { + "type": "string", + "description": "The model to use for this transcription request.", + "x-oaiTypeLabel": "string" + }, + "language": { + "type": "object", + "description": "The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency." + }, + "prompt": { + "type": "object", + "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`." + }, + "response_format": { + "type": "object" + }, + "temperature": { + "type": "object", + "description": "The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit." + }, + "include": { + "type": "object", + "description": "Additional information to include in the transcription response.\n `logprobs` will return the log probabilities of the tokens in the\n response to understand the model's confidence in the transcription.\n `logprobs` only works with response_format set to `json` and only with\n the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`." + }, + "timestamp_granularities": { + "type": "object", + "description": "The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.\n This option is not available for `gpt-4o-transcribe-diarize`." + }, + "stream": { + "type": "object" + }, + "chunking_strategy": { + "type": "object" + }, + "known_speaker_names": { + "type": "object" + }, + "known_speaker_references": { + "type": "object" + }, + "filename": { + "type": "string", + "description": "The optional filename or descriptive identifier to associate with with the audio data." + } + }, + "required": [ + "file", + "model" + ] + } + } + } + }, + "x-ms-examples": { + "Create a transcription request": { + "$ref": "./examples/audio_transcription.yaml" + } + } + } + }, + "/audio/translations": { + "post": { + "operationId": "createTranslation", + "summary": "Gets English language transcribed text and associated metadata from provided spoken audio data.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureAudioTranslationResponse" + } + }, + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Audio" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "object", + "description": "The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.", + "x-oaiTypeLabel": "file", + "x-oaiMeta": { + "exampleFilePath": "speech.mp3" + } + }, + "model": { + "type": "string", + "description": "The model to use for this transcription request.", + "x-oaiTypeLabel": "string" + }, + "prompt": { + "type": "object", + "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English." + }, + "response_format": { + "type": "object", + "description": "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`." + }, + "temperature": { + "type": "object", + "description": "The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit." + }, + "filename": { + "type": "string", + "description": "The optional filename or descriptive identifier to associate with with the audio data" + } + }, + "required": [ + "file", + "model" + ] + } + } + } + }, + "x-ms-examples": { + "Create an audio translation request": { + "$ref": "./examples/audio_translation.yaml" + } + } + } + }, "/batches": { "post": { "operationId": "createBatch", @@ -90,6 +590,22 @@ "schema": { "type": "string" } + }, + "deployment-enqueued-tokens": { + "required": true, + "description": "Sum of enqueued tokens of all jobs that target to the deployment.", + "schema": { + "type": "integer", + "format": "int64" + } + }, + "deployment-maximum-enqueued-tokens": { + "required": true, + "description": "Maximum enqueued tokens of the deployment.", + "schema": { + "type": "integer", + "format": "int64" + } } }, "content": { @@ -102,7 +618,10 @@ "endpoint", "completion_window", "status", - "created_at" + "created_at", + "input_blob", + "output_blob", + "error_blob" ], "properties": { "id": { @@ -219,6 +738,39 @@ } ] }, + "input_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing the input file for the batch." + }, + "output_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of successfully executed requests." + }, + "error_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of requests with errors." + }, "input_file_id": { "anyOf": [ { @@ -303,6 +855,27 @@ "type": "string", "description": "The ID of an uploaded file that contains requests for the new batch.\n\nSee [upload file](/docs/api-reference/files/create) for how to upload a file.\n\nYour input file must be formatted as a [JSONL file](/docs/api-reference/batch/requestInput),\nand must be uploaded with the purpose `batch`." }, + "input_blob": { + "type": "string", + "description": "The url of an Azure Storage blob to use as input for the batch." + }, + "output_folder": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "uri", + "description": "The url of the Azure Storage folder where the batch output would be saved." + }, + "delimiter": { + "type": "string", + "description": "Optional. The delimiter used in the folder path, by default /." + } + }, + "required": [ + "url" + ] + }, "endpoint": { "type": "string", "enum": [ @@ -317,6 +890,9 @@ "24h" ], "description": "The time frame within which the batch should be processed. Currently only `24h` is supported." + }, + "output_expires_after": { + "$ref": "#/components/schemas/FileExpiresAfter" } }, "required": [ @@ -377,6 +953,26 @@ "default": 20 }, "explode": false + }, + { + "name": "$filter", + "in": "query", + "required": false, + "description": "The OData expression to describe the filtering conditions.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "$orderby", + "in": "query", + "required": false, + "description": "The OData expression to describe the sorting order.", + "schema": { + "type": "string" + }, + "explode": false } ], "responses": { @@ -517,7 +1113,10 @@ "endpoint", "completion_window", "status", - "created_at" + "created_at", + "input_blob", + "output_blob", + "error_blob" ], "properties": { "id": { @@ -634,6 +1233,39 @@ } ] }, + "input_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing the input file for the batch." + }, + "output_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of successfully executed requests." + }, + "error_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of requests with errors." + }, "input_file_id": { "anyOf": [ { @@ -767,7 +1399,10 @@ "endpoint", "completion_window", "status", - "created_at" + "created_at", + "input_blob", + "output_blob", + "error_blob" ], "properties": { "id": { @@ -884,6 +1519,39 @@ } ] }, + "input_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing the input file for the batch." + }, + "output_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of successfully executed requests." + }, + "error_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of requests with errors." + }, "input_file_id": { "anyOf": [ { @@ -6319,17 +6987,403 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.RunGraderRequest" + "$ref": "#/components/schemas/OpenAI.RunGraderRequest" + } + } + } + } + } + }, + "/fine_tuning/alpha/graders/validate": { + "post": { + "operationId": "validateGrader", + "summary": "Validate a grader.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ValidateGraderResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "grader": { + "anyOf": [ + { + "$ref": "#/components/schemas/OpenAI.GraderStringCheck" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderPython" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderScoreModel" + }, + { + "$ref": "#/components/schemas/OpenAI.GraderMulti" + }, + { + "$ref": "#/components/schemas/GraderEndpoint" + } + ] + } + } + } + } + } + } + } + }, + "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions": { + "get": { + "operationId": "listFineTuningCheckpointPermissions", + "summary": "List checkpoint permissions", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuned_model_checkpoint", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint to get permissions for.", + "schema": { + "type": "string" + } + }, + { + "name": "project_id", + "in": "query", + "required": false, + "description": "The ID of the project to get permissions for.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last permission ID from the previous pagination request.", + "schema": { + "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Number of permissions to retrieve.", + "schema": { + "type": "integer", + "format": "int32", + "default": 10 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "description": "The order in which to retrieve permissions.", + "schema": { + "type": "string", + "enum": [ + "ascending", + "descending" + ], + "default": "descending" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ] + }, + "post": { + "operationId": "createFineTuningCheckpointPermission", + "summary": "Create checkpoint permissions", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "fine_tuned_model_checkpoint", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint to create a permission for.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Fine-tuning" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest" } } } } } }, - "/fine_tuning/alpha/graders/validate": { - "post": { - "operationId": "validateGrader", - "summary": "Validate a grader.", + "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}": { + "delete": { + "operationId": "deleteFineTuningCheckpointPermission", + "summary": "Delete checkpoint permission", "parameters": [ { "name": "api-version", @@ -6340,15 +7394,42 @@ "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", "default": "v1" } + }, + { + "name": "fine_tuned_model_checkpoint", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint to delete a permission for.", + "schema": { + "type": "string" + } + }, + { + "name": "permission_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuned model checkpoint permission to delete.", + "schema": { + "type": "string" + } } ], "responses": { "200": { "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.ValidateGraderResponse" + "$ref": "#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse" } } } @@ -6410,47 +7491,13 @@ }, "tags": [ "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "grader": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.GraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderPython" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderScoreModel" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderMulti" - }, - { - "$ref": "#/components/schemas/GraderEndpoint" - } - ] - } - } - } - } - } - } + ] } }, - "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions": { - "get": { - "operationId": "listFineTuningCheckpointPermissions", - "summary": "List checkpoint permissions", + "/fine_tuning/jobs": { + "post": { + "operationId": "createFineTuningJob", + "summary": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", "parameters": [ { "name": "api-version", @@ -6461,62 +7508,6 @@ "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", "default": "v1" } - }, - { - "name": "fine_tuned_model_checkpoint", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint to get permissions for.", - "schema": { - "type": "string" - } - }, - { - "name": "project_id", - "in": "query", - "required": false, - "description": "The ID of the project to get permissions for.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last permission ID from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Number of permissions to retrieve.", - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "The order in which to retrieve permissions.", - "schema": { - "type": "string", - "enum": [ - "ascending", - "descending" - ], - "default": "descending" - }, - "explode": false } ], "responses": { @@ -6534,7 +7525,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" + "$ref": "#/components/schemas/OpenAI.FineTuningJob" } } } @@ -6596,11 +7587,21 @@ }, "tags": [ "Fine-tuning" - ] + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest" + } + } + } + } }, - "post": { - "operationId": "createFineTuningCheckpointPermission", - "summary": "Create checkpoint permissions", + "get": { + "operationId": "listPaginatedFineTuningJobs", + "summary": "List your organization's fine-tuning jobs", "parameters": [ { "name": "api-version", @@ -6613,13 +7614,26 @@ } }, { - "name": "fine_tuned_model_checkpoint", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint to create a permission for.", + "name": "after", + "in": "query", + "required": false, + "description": "Identifier for the last job from the previous pagination request.", "schema": { "type": "string" - } + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "description": "Number of fine-tuning jobs to retrieve.", + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false } ], "responses": { @@ -6637,7 +7651,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" + "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse" } } } @@ -6699,23 +7713,13 @@ }, "tags": [ "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest" - } - } - } - } + ] } }, - "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}": { - "delete": { - "operationId": "deleteFineTuningCheckpointPermission", - "summary": "Delete checkpoint permission", + "/fine_tuning/jobs/{fine_tuning_job_id}": { + "get": { + "operationId": "retrieveFineTuningJob", + "summary": "Get info about a fine-tuning job.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", "parameters": [ { "name": "api-version", @@ -6728,19 +7732,10 @@ } }, { - "name": "fine_tuned_model_checkpoint", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint to delete a permission for.", - "schema": { - "type": "string" - } - }, - { - "name": "permission_id", + "name": "fine_tuning_job_id", "in": "path", "required": true, - "description": "The ID of the fine-tuned model checkpoint permission to delete.", + "description": "The ID of the fine-tuning job.", "schema": { "type": "string" } @@ -6761,7 +7756,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse" + "$ref": "#/components/schemas/OpenAI.FineTuningJob" } } } @@ -6826,10 +7821,10 @@ ] } }, - "/fine_tuning/jobs": { + "/fine_tuning/jobs/{fine_tuning_job_id}/cancel": { "post": { - "operationId": "createFineTuningJob", - "summary": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", + "operationId": "cancelFineTuningJob", + "summary": "Immediately cancel a fine-tune job.", "parameters": [ { "name": "api-version", @@ -6840,6 +7835,15 @@ "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", "default": "v1" } + }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to cancel.", + "schema": { + "type": "string" + } } ], "responses": { @@ -6919,21 +7923,13 @@ }, "tags": [ "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest" - } - } - } - } - }, + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": { "get": { - "operationId": "listPaginatedFineTuningJobs", - "summary": "List your organization's fine-tuning jobs", + "operationId": "listFineTuningJobCheckpoints", + "summary": "List the checkpoints for a fine-tuning job.", "parameters": [ { "name": "api-version", @@ -6945,11 +7941,20 @@ "default": "v1" } }, + { + "name": "fine_tuning_job_id", + "in": "path", + "required": true, + "description": "The ID of the fine-tuning job to get checkpoints for.", + "schema": { + "type": "string" + } + }, { "name": "after", "in": "query", "required": false, - "description": "Identifier for the last job from the previous pagination request.", + "description": "Identifier for the last checkpoint ID from the previous pagination request.", "schema": { "type": "string" }, @@ -6959,11 +7964,11 @@ "name": "limit", "in": "query", "required": false, - "description": "Number of fine-tuning jobs to retrieve.", + "description": "Number of checkpoints to retrieve.", "schema": { "type": "integer", "format": "int32", - "default": 20 + "default": 10 }, "explode": false } @@ -6983,7 +7988,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse" + "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse" } } } @@ -7048,10 +8053,10 @@ ] } }, - "/fine_tuning/jobs/{fine_tuning_job_id}": { - "get": { - "operationId": "retrieveFineTuningJob", - "summary": "Get info about a fine-tuning job.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", + "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy": { + "post": { + "operationId": "FineTuning_CopyCheckpoint", + "description": "Creates a copy of a fine-tuning checkpoint at the given destination account and region.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", "parameters": [ { "name": "api-version", @@ -7063,11 +8068,41 @@ "default": "v1" } }, + { + "name": "aoai-copy-ft-checkpoints", + "in": "header", + "required": true, + "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", + "schema": { + "type": "string", + "enum": [ + "preview" + ] + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, { "name": "fine_tuning_job_id", "in": "path", "required": true, - "description": "The ID of the fine-tuning job.", + "schema": { + "type": "string" + } + }, + { + "name": "fine_tuning_checkpoint_id", + "in": "path", + "required": true, "schema": { "type": "string" } @@ -7088,7 +8123,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" + "$ref": "#/components/schemas/CopyModelResponse" } } } @@ -7150,13 +8185,21 @@ }, "tags": [ "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/cancel": { - "post": { - "operationId": "cancelFineTuningJob", - "summary": "Immediately cancel a fine-tune job.", + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CopyModelRequest" + } + } + } + } + }, + "get": { + "operationId": "FineTuning_GetCheckpoint", + "description": "Gets the status of a fine-tuning checkpoint copy.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", "parameters": [ { "name": "api-version", @@ -7168,11 +8211,41 @@ "default": "v1" } }, + { + "name": "aoai-copy-ft-checkpoints", + "in": "header", + "required": true, + "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", + "schema": { + "type": "string", + "enum": [ + "preview" + ] + } + }, + { + "name": "accept", + "in": "header", + "required": true, + "schema": { + "type": "string", + "enum": [ + "application/json" + ] + } + }, { "name": "fine_tuning_job_id", "in": "path", "required": true, - "description": "The ID of the fine-tuning job to cancel.", + "schema": { + "type": "string" + } + }, + { + "name": "fine_tuning_checkpoint_id", + "in": "path", + "required": true, "schema": { "type": "string" } @@ -7193,7 +8266,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" + "$ref": "#/components/schemas/CopyModelResponse" } } } @@ -7258,10 +8331,10 @@ ] } }, - "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": { + "/fine_tuning/jobs/{fine_tuning_job_id}/events": { "get": { - "operationId": "listFineTuningJobCheckpoints", - "summary": "List the checkpoints for a fine-tuning job.", + "operationId": "listFineTuningEvents", + "summary": "Get status updates for a fine-tuning job.", "parameters": [ { "name": "api-version", @@ -7277,7 +8350,7 @@ "name": "fine_tuning_job_id", "in": "path", "required": true, - "description": "The ID of the fine-tuning job to get checkpoints for.", + "description": "The ID of the fine-tuning job to get events for.", "schema": { "type": "string" } @@ -7286,7 +8359,7 @@ "name": "after", "in": "query", "required": false, - "description": "Identifier for the last checkpoint ID from the previous pagination request.", + "description": "Identifier for the last event from the previous pagination request.", "schema": { "type": "string" }, @@ -7296,11 +8369,11 @@ "name": "limit", "in": "query", "required": false, - "description": "Number of checkpoints to retrieve.", + "description": "Number of events to retrieve.", "schema": { "type": "integer", "format": "int32", - "default": 10 + "default": 20 }, "explode": false } @@ -7320,7 +8393,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse" + "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse" } } } @@ -7385,10 +8458,10 @@ ] } }, - "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy": { + "/fine_tuning/jobs/{fine_tuning_job_id}/pause": { "post": { - "operationId": "FineTuning_CopyCheckpoint", - "description": "Creates a copy of a fine-tuning checkpoint at the given destination account and region.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", + "operationId": "pauseFineTuningJob", + "summary": "Pause a fine-tune job.", "parameters": [ { "name": "api-version", @@ -7400,41 +8473,11 @@ "default": "v1" } }, - { - "name": "aoai-copy-ft-checkpoints", - "in": "header", - "required": true, - "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", - "schema": { - "type": "string", - "enum": [ - "preview" - ] - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, { "name": "fine_tuning_job_id", "in": "path", "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fine_tuning_checkpoint_id", - "in": "path", - "required": true, + "description": "The ID of the fine-tuning job to pause.", "schema": { "type": "string" } @@ -7455,7 +8498,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CopyModelResponse" + "$ref": "#/components/schemas/OpenAI.FineTuningJob" } } } @@ -7517,21 +8560,13 @@ }, "tags": [ "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CopyModelRequest" - } - } - } - } - }, - "get": { - "operationId": "FineTuning_GetCheckpoint", - "description": "Gets the status of a fine-tuning checkpoint copy.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", + ] + } + }, + "/fine_tuning/jobs/{fine_tuning_job_id}/resume": { + "post": { + "operationId": "resumeFineTuningJob", + "summary": "Resume a paused fine-tune job.", "parameters": [ { "name": "api-version", @@ -7543,41 +8578,11 @@ "default": "v1" } }, - { - "name": "aoai-copy-ft-checkpoints", - "in": "header", - "required": true, - "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", - "schema": { - "type": "string", - "enum": [ - "preview" - ] - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, { "name": "fine_tuning_job_id", "in": "path", "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fine_tuning_checkpoint_id", - "in": "path", - "required": true, + "description": "The ID of the fine-tuning job to resume.", "schema": { "type": "string" } @@ -7598,7 +8603,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CopyModelResponse" + "$ref": "#/components/schemas/OpenAI.FineTuningJob" } } } @@ -7663,10 +8668,9 @@ ] } }, - "/fine_tuning/jobs/{fine_tuning_job_id}/events": { - "get": { - "operationId": "listFineTuningEvents", - "summary": "Get status updates for a fine-tuning job.", + "/images/edits": { + "post": { + "operationId": "createImageEdit", "parameters": [ { "name": "api-version", @@ -7677,37 +8681,6 @@ "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", "default": "v1" } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to get events for.", - "schema": { - "type": "string" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last event from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Number of events to retrieve.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false } ], "responses": { @@ -7725,7 +8698,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse" + "$ref": "#/components/schemas/OpenAI.ImagesResponse" } } } @@ -7786,14 +8759,23 @@ } }, "tags": [ - "Fine-tuning" - ] + "Images" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateImageEditRequest" + } + } + } + } } }, - "/fine_tuning/jobs/{fine_tuning_job_id}/pause": { + "/images/generations": { "post": { - "operationId": "pauseFineTuningJob", - "summary": "Pause a fine-tune job.", + "operationId": "createImage", "parameters": [ { "name": "api-version", @@ -7804,15 +8786,6 @@ "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", "default": "v1" } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to pause.", - "schema": { - "type": "string" - } } ], "responses": { @@ -7830,7 +8803,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" + "$ref": "#/components/schemas/OpenAI.ImagesResponse" } } } @@ -7891,14 +8864,28 @@ } }, "tags": [ - "Fine-tuning" - ] + "Images" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateImageRequest" + } + } + } + }, + "x-ms-examples": { + "Create an image request": { + "$ref": "./examples/images.yaml" + } + } } }, - "/fine_tuning/jobs/{fine_tuning_job_id}/resume": { + "/images/variations": { "post": { - "operationId": "resumeFineTuningJob", - "summary": "Resume a paused fine-tune job.", + "operationId": "createImageVariation", "parameters": [ { "name": "api-version", @@ -7909,15 +8896,6 @@ "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", "default": "v1" } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to resume.", - "schema": { - "type": "string" - } } ], "responses": { @@ -7935,7 +8913,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" + "$ref": "#/components/schemas/OpenAI.ImagesResponse" } } } @@ -7996,8 +8974,18 @@ } }, "tags": [ - "Fine-tuning" - ] + "Images" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.CreateImageVariationRequest" + } + } + } + } } }, "/models": { @@ -14973,13 +15961,318 @@ }, "tags": [ "Vector Stores" - ] + ] + } + }, + "/vector_stores/{vector_store_id}/files/{file_id}/content": { + "get": { + "operationId": "retrieveVectorStoreFileContent", + "summary": "Retrieve vector store file content", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to search.", + "schema": { + "type": "string" + } + }, + { + "name": "file_id", + "in": "path", + "required": true, + "description": "The ID of the file to retrieve content for.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ] + } + }, + "/vector_stores/{vector_store_id}/search": { + "post": { + "operationId": "searchVectorStore", + "summary": "Search vector store", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "name": "vector_store_id", + "in": "path", + "required": true, + "description": "The ID of the vector store to search.", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "message": { + "type": "string" + }, + "param": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "type": { + "type": "string" + }, + "inner_error": {} + }, + "required": [ + "code", + "message", + "param", + "type" + ] + } + } + } + } + }, + "tags": [ + "Vector Stores" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequest" + } + } + } + } } }, - "/vector_stores/{vector_store_id}/files/{file_id}/content": { + "/videos": { + "post": { + "operationId": "Videos_Create", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + } + ], + "description": "Creates a new video generation job.", + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VideoResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" + } + } + } + } + }, + "tags": [ + "Videos" + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateVideoBody" + } + }, + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/CreateVideoBodyWithInputReference" + }, + "encoding": { + "seconds": { + "contentType": "text/plain" + }, + "size": { + "contentType": "text/plain" + }, + "input_reference": { + "contentType": "*/*" + } + } + } + } + } + }, "get": { - "operationId": "retrieveVectorStoreFileContent", - "summary": "Retrieve vector store file content", + "operationId": "Videos_List", + "description": "Lists video generation jobs.", "parameters": [ { "name": "api-version", @@ -14992,22 +16285,89 @@ } }, { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to search.", + "name": "after", + "in": "query", + "required": false, "schema": { "type": "string" + }, + "explode": false + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "format": "int32", + "default": 20 + }, + "explode": false + }, + { + "name": "order", + "in": "query", + "required": false, + "schema": { + "$ref": "#/components/schemas/Order", + "default": "desc" + }, + "explode": false + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "headers": { + "apim-request-id": { + "required": false, + "description": "A request ID used for troubleshooting purposes.", + "schema": { + "type": "string" + } + } + }, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VideoList" + } + } } }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" + } + } + } + } + }, + "tags": [ + "Videos" + ] + } + }, + "/videos/{video-id}": { + "get": { + "operationId": "Videos_Get", + "description": "Retrieves properties of a video generation job.", + "parameters": [ { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to retrieve content for.", + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", "schema": { - "type": "string" + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" } + }, + { + "$ref": "#/components/parameters/VideoIdParameter" } ], "responses": { @@ -15025,13 +16385,47 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" + "$ref": "#/components/schemas/VideoResource" } } } }, "default": { "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" + } + } + } + } + }, + "tags": [ + "Videos" + ] + }, + "delete": { + "operationId": "Videos_Delete", + "description": "Deletes a video generation job.", + "parameters": [ + { + "name": "api-version", + "in": "query", + "required": false, + "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", + "schema": { + "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", + "default": "v1" + } + }, + { + "$ref": "#/components/parameters/VideoIdParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", "headers": { "apim-request-id": { "required": false, @@ -15044,56 +16438,31 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] + "$ref": "#/components/schemas/DeletedVideoResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" } } } } }, "tags": [ - "Vector Stores" + "Videos" ] } }, - "/vector_stores/{vector_store_id}/search": { - "post": { - "operationId": "searchVectorStore", - "summary": "Search vector store", + "/videos/{video-id}/content": { + "get": { + "operationId": "Videos_RetrieveContent", + "description": "Retrieves a thumbnail of the generated video content.", "parameters": [ { "name": "api-version", @@ -15106,13 +16475,17 @@ } }, { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to search.", + "$ref": "#/components/parameters/VideoIdParameter" + }, + { + "name": "variant", + "in": "query", + "required": false, "schema": { - "type": "string" - } + "$ref": "#/components/schemas/VideoContentVariant", + "default": "video" + }, + "explode": false } ], "responses": { @@ -15125,18 +16498,60 @@ "schema": { "type": "string" } + }, + "content-length": { + "required": true, + "schema": { + "type": "integer" + } } }, "content": { - "application/json": { + "image/jpg": { "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" + "contentMediaType": "image/jpg" + } + }, + "image/webp": { + "schema": { + "contentMediaType": "image/webp" + } + }, + "video/mp4": { + "schema": { + "contentMediaType": "video/mp4" } } } }, "default": { "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" + } + } + } + } + }, + "tags": [ + "Videos" + ] + } + }, + "/videos/{video-id}/remix": { + "post": { + "operationId": "Videos_Remix", + "description": "Use an existing generated video and change it with a prompt.", + "parameters": [ + { + "$ref": "#/components/parameters/VideoIdParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", "headers": { "apim-request-id": { "required": false, @@ -15149,56 +16564,40 @@ "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] + "$ref": "#/components/schemas/VideoResource" + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" } } } } }, "tags": [ - "Vector Stores" + "Videos" ], "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequest" + "type": "object", + "properties": { + "prompt": { + "type": "string", + "minLength": 1 + } + }, + "required": [ + "prompt" + ] } } } @@ -15220,6 +16619,17 @@ } ], "components": { + "parameters": { + "VideoIdParameter": { + "name": "video-id", + "in": "path", + "required": true, + "description": "The ID of the video to use for the Azure OpenAI request.", + "schema": { + "type": "string" + } + } + }, "schemas": { "AudioSegment": { "type": "object", @@ -16290,6 +17700,47 @@ } } }, + "AzureOpenAIVideoGenerationErrorResponse": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "The distinct, machine-generated identifier for the error." + }, + "message": { + "type": "string", + "description": "A human-readable message associated with the error." + }, + "param": { + "type": "string", + "description": "If applicable, the request input parameter associated with the error" + }, + "type": { + "type": "string", + "description": "If applicable, the input line number associated with the error." + }, + "inner_error": { + "type": "object", + "properties": { + "code": { + "type": "string", + "enum": [ + "ResponsibleAIPolicyViolation" + ], + "description": "The code associated with the inner error." + }, + "revised_prompt": { + "type": "string", + "description": "If applicable, the modified prompt used for generation." + }, + "error_details": { + "description": "The content filter result details associated with the inner error." + } + }, + "description": "If applicable, an upstream error that originated this error." + } + } + }, "AzurePiiSubCategory": { "type": "object", "required": [ @@ -16491,35 +17942,41 @@ }, "CreateVideoBodyWithInputReference": { "type": "object", - "required": [ - "model", - "prompt", - "input_reference" - ], "properties": { "model": { - "type": "object", + "type": "string", "description": "The name of the deployment to use for this request." }, "prompt": { - "type": "object", + "type": "string", "description": "Text prompt that describes the video to generate." }, "seconds": { - "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/VideoSeconds" + } + ], "description": "Clip duration in seconds. Defaults to 4 seconds." }, "size": { - "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/VideoSize" + } + ], "description": "Output resolution formatted as width x height. Defaults to 720x1280." }, "input_reference": { - "type": "object", "description": "Optional image reference that guides generation.", "x-oaiTypeLabel": "file" } }, - "description": "The properties of a video generation job request with media files." + "required": [ + "model", + "prompt", + "input_reference" + ] }, "CreateVideoRemixBody": { "type": "object", @@ -16639,6 +18096,30 @@ } } }, + "FileExpiresAfter": { + "type": "object", + "required": [ + "anchor", + "seconds" + ], + "properties": { + "anchor": { + "type": "string", + "enum": [ + "created_at" + ], + "description": "Defines the anchor relative to what time the absolute expiration should be generated from." + }, + "seconds": { + "type": "integer", + "format": "int64", + "minimum": 1209600, + "maximum": 2592000, + "description": "\"The relative expiration time in seconds.\\r\\nRange: [1209600 - 2592000]." + } + }, + "description": "Defines a expiration for the file." + }, "GraderEndpoint": { "type": "object", "required": [ @@ -17227,7 +18708,10 @@ "endpoint", "completion_window", "status", - "created_at" + "created_at", + "input_blob", + "output_blob", + "error_blob" ], "properties": { "id": { @@ -17344,6 +18828,39 @@ } ] }, + "input_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing the input file for the batch." + }, + "output_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of successfully executed requests." + }, + "error_blob": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "The blob url containing outputs of requests with errors." + }, "input_file_id": { "anyOf": [ { @@ -22535,6 +24052,301 @@ } } }, + "OpenAI.CreateImageEditRequest": { + "type": "object", + "required": [ + "image", + "prompt" + ], + "properties": { + "image": { + "type": "object", + "description": "The image(s) to edit. Must be a supported image file or an array of images.\n For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`\n file less than 50MB. You can provide up to 16 images.\n For `dall-e-2`, you can only provide one image, and it should be a square\n `png` file less than 4MB.", + "x-oaiMeta": { + "exampleFilePath": "otter.png" + } + }, + "prompt": { + "type": "object", + "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models." + }, + "mask": { + "type": "object", + "description": "An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.", + "x-oaiMeta": { + "exampleFilePath": "mask.png" + } + }, + "background": { + "type": "object", + "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`." + }, + "model": { + "type": "string", + "description": "The model to use for image generation. Only `dall-e-2` and the GPT image models are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.", + "x-oaiTypeLabel": "string" + }, + "n": { + "type": "object", + "description": "The number of images to generate. Must be between 1 and 10." + }, + "size": { + "type": "object", + "description": "The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`." + }, + "response_format": { + "type": "object", + "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as the GPT image models always return base64-encoded images." + }, + "output_format": { + "type": "object", + "description": "The format in which the generated images are returned. This parameter is\n only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.\n The default value is `png`." + }, + "output_compression": { + "type": "object", + "description": "The compression level (0-100%) for the generated images. This parameter\n is only supported for the GPT image models with the `webp` or `jpeg` output\n formats, and defaults to 100." + }, + "user": { + "type": "object", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." + }, + "input_fidelity": { + "type": "object" + }, + "stream": { + "type": "object", + "description": "Edit the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information." + }, + "partial_images": { + "type": "object" + }, + "quality": { + "type": "object", + "description": "The quality of the image that will be generated. `high`, `medium` and `low` are only supported for the GPT image models. `dall-e-2` only supports `standard` quality. Defaults to `auto`." + } + } + }, + "OpenAI.CreateImageRequest": { + "type": "object", + "required": [ + "prompt" + ], + "properties": { + "prompt": { + "type": "string", + "description": "A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`." + }, + "model": { + "type": "string", + "description": "The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.", + "x-oaiTypeLabel": "string" + }, + "n": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 1, + "maximum": 10, + "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", + "default": 1 + }, + "quality": { + "anyOf": [ + { + "type": "string", + "enum": [ + "standard", + "hd", + "low", + "medium", + "high", + "auto" + ] + }, + { + "type": "null" + } + ], + "description": "The quality of the image that will be generated.\n - `auto` (default value) will automatically select the best quality for the given model.\n - `high`, `medium` and `low` are supported for the GPT image models.\n - `hd` and `standard` are supported for `dall-e-3`.\n - `standard` is the only option for `dall-e-2`.", + "default": "auto" + }, + "response_format": { + "anyOf": [ + { + "type": "string", + "enum": [ + "url", + "b64_json" + ] + }, + { + "type": "null" + } + ], + "description": "The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.", + "default": "url" + }, + "output_format": { + "anyOf": [ + { + "type": "string", + "enum": [ + "png", + "jpeg", + "webp" + ] + }, + { + "type": "null" + } + ], + "description": "The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.", + "default": "png" + }, + "output_compression": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.", + "default": 100 + }, + "stream": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "description": "Generate the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information.\n This parameter is only supported for the GPT image models." + }, + "partial_images": { + "$ref": "#/components/schemas/OpenAI.PartialImages" + }, + "size": { + "anyOf": [ + { + "type": "string", + "enum": [ + "auto", + "1024x1024", + "1536x1024", + "1024x1536", + "256x256", + "512x512", + "1792x1024", + "1024x1792" + ] + }, + { + "type": "null" + } + ], + "description": "The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.", + "default": "auto" + }, + "moderation": { + "anyOf": [ + { + "type": "string", + "enum": [ + "low", + "auto" + ] + }, + { + "type": "null" + } + ], + "description": "Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).", + "default": "auto" + }, + "background": { + "anyOf": [ + { + "type": "string", + "enum": [ + "transparent", + "opaque", + "auto" + ] + }, + { + "type": "null" + } + ], + "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`.", + "default": "auto" + }, + "style": { + "anyOf": [ + { + "type": "string", + "enum": [ + "vivid", + "natural" + ] + }, + { + "type": "null" + } + ], + "description": "The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.", + "default": "vivid" + }, + "user": { + "type": "string", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." + } + } + }, + "OpenAI.CreateImageVariationRequest": { + "type": "object", + "required": [ + "image" + ], + "properties": { + "image": { + "type": "object", + "description": "The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.", + "x-oaiMeta": { + "exampleFilePath": "otter.png" + } + }, + "model": { + "type": "string", + "description": "The model to use for image generation. Only `dall-e-2` is supported at this time.", + "x-oaiTypeLabel": "string" + }, + "n": { + "type": "object", + "description": "The number of images to generate. Must be between 1 and 10." + }, + "response_format": { + "type": "object", + "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated." + }, + "size": { + "type": "object", + "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`." + }, + "user": { + "type": "object", + "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." + } + } + }, "OpenAI.CreateMessageRequest": { "type": "object", "required": [ @@ -27097,6 +28909,36 @@ } } }, + "OpenAI.Image": { + "type": "object", + "required": [ + "prompt_filter_results", + "content_filter_results" + ], + "properties": { + "b64_json": { + "type": "string", + "contentEncoding": "base64", + "description": "The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`." + }, + "url": { + "type": "string", + "format": "uri", + "description": "When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for the GPT image models." + }, + "revised_prompt": { + "type": "string", + "description": "For `dall-e-3` only, the revised prompt that was used to generate the image." + }, + "prompt_filter_results": { + "$ref": "#/components/schemas/AzureContentFilterImagePromptResults" + }, + "content_filter_results": { + "$ref": "#/components/schemas/AzureContentFilterImageResponseResults" + } + }, + "description": "Represents the content or the URL of an image generated by the OpenAI API." + }, "OpenAI.ImageDetail": { "type": "string", "enum": [ @@ -27105,6 +28947,44 @@ "auto" ] }, + "OpenAI.ImageGenInputUsageDetails": { + "type": "object", + "required": [ + "text_tokens", + "image_tokens" + ], + "properties": { + "text_tokens": { + "type": "integer", + "description": "The number of text tokens in the input prompt." + }, + "image_tokens": { + "type": "integer", + "description": "The number of image tokens in the input prompt." + } + }, + "description": "The input tokens detailed information for the image generation.", + "title": "Input usage details" + }, + "OpenAI.ImageGenOutputTokensDetails": { + "type": "object", + "required": [ + "image_tokens", + "text_tokens" + ], + "properties": { + "image_tokens": { + "type": "integer", + "description": "The number of image output tokens generated by the model." + }, + "text_tokens": { + "type": "integer", + "description": "The number of text output tokens generated by the model." + } + }, + "description": "The output token details for the image generation.", + "title": "Image generation output token details" + }, "OpenAI.ImageGenTool": { "type": "object", "required": [ @@ -27237,6 +29117,102 @@ } } }, + "OpenAI.ImageGenUsage": { + "type": "object", + "required": [ + "input_tokens", + "total_tokens", + "output_tokens", + "input_tokens_details" + ], + "properties": { + "input_tokens": { + "type": "integer", + "description": "The number of tokens (images and text) in the input prompt." + }, + "total_tokens": { + "type": "integer", + "description": "The total number of tokens (images and text) used for the image generation." + }, + "output_tokens": { + "type": "integer", + "description": "The number of output tokens generated by the model." + }, + "output_tokens_details": { + "$ref": "#/components/schemas/OpenAI.ImageGenOutputTokensDetails" + }, + "input_tokens_details": { + "$ref": "#/components/schemas/OpenAI.ImageGenInputUsageDetails" + } + }, + "description": "For `gpt-image-1` only, the token usage information for the image generation.", + "title": "Image generation usage" + }, + "OpenAI.ImagesResponse": { + "type": "object", + "required": [ + "created" + ], + "properties": { + "created": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) of when the image was created." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAI.Image" + }, + "description": "The list of generated images." + }, + "background": { + "type": "string", + "enum": [ + "transparent", + "opaque" + ], + "description": "The background parameter used for the image generation. Either `transparent` or `opaque`." + }, + "output_format": { + "type": "string", + "enum": [ + "png", + "webp", + "jpeg" + ], + "description": "The output format of the image generation. Either `png`, `webp`, or `jpeg`." + }, + "size": { + "type": "string", + "enum": [ + "1024x1024", + "1024x1536", + "1536x1024" + ], + "description": "The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`." + }, + "quality": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "description": "The quality of the image generated. Either `low`, `medium`, or `high`." + }, + "usage": { + "$ref": "#/components/schemas/OpenAI.ImageGenUsage" + } + }, + "description": "The response from the image generation endpoint.", + "title": "Image generation response", + "x-oaiMeta": { + "name": "The image generation response", + "group": "images", + "example": "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n ],\n \"background\": \"transparent\",\n \"output_format\": \"png\",\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n" + } + }, "OpenAI.IncludeEnum": { "anyOf": [ { @@ -31708,6 +33684,19 @@ "type": "boolean", "description": "Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use." }, + "OpenAI.PartialImages": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "minimum": 0, + "maximum": 3, + "description": "The number of partial images to generate. This parameter is used for\nstreaming responses that return partial images. Value must be between 0 and 3.\nWhen set to 0, the response will be a single image sent in one streaming event.\nNote that the final image may be sent before the full number of partial images\nare generated if the full image is generated more quickly." + }, "OpenAI.PredictionContent": { "type": "object", "required": [ @@ -38651,18 +40640,6 @@ ], "description": "Selectable asset variants for downloaded content." }, - "VideoIdParameter": { - "type": "object", - "required": [ - "video-id" - ], - "properties": { - "video-id": { - "type": "string", - "description": "The ID of the video to use for the Azure OpenAI request." - } - } - }, "VideoList": { "type": "object", "required": [ diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml index 8a39439a3..7bcefbdfb 100644 --- a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml +++ b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml @@ -1,4 +1,4 @@ -openapi: 3.2.0 +openapi: 3.1.0 info: title: Azure AI Foundry Models Service license: @@ -12626,7 +12626,6 @@ components: items: anyOf: - $ref: '#/components/schemas/OpenAI.ComparisonFilter' - - {} description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. description: Combine multiple filters using `and` or `or`. title: Compound Filter From aed34ae3fcd7b7a4ab5181e142841d680d7129a3 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 6 Mar 2026 19:09:47 +0100 Subject: [PATCH 03/31] Remove examples --- .../resources/spec/azure-v1-v1-generated.yaml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml index 7bcefbdfb..b6629813d 100644 --- a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml +++ b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml @@ -1076,9 +1076,6 @@ paths: required: - messages - model - x-ms-examples: - Create a chat completion: - $ref: ./examples/chat_completions.yaml /completions: post: operationId: createCompletion @@ -1321,9 +1318,6 @@ paths: default: <|endoftext|> required: - model - x-ms-examples: - Create a chat completion: - $ref: ./examples/completions.yaml /containers: get: operationId: listContainers @@ -2660,9 +2654,6 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAI.CreateEmbeddingRequest' - x-ms-examples: - Create an embedding request: - $ref: ./examples/embeddings.yaml /evals: get: operationId: listEvals @@ -3783,9 +3774,6 @@ paths: multipart/form-data: schema: $ref: '#/components/schemas/OpenAI.CreateFileRequest' - x-ms-examples: - Create a file request: - $ref: ./examples/files.yaml get: operationId: listFiles parameters: @@ -6527,9 +6515,6 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAI.CreateResponse' - x-ms-examples: - Create a response request: - $ref: ./examples/responses.yaml /responses/{response_id}: get: operationId: getResponse @@ -8665,9 +8650,6 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAI.CreateVectorStoreRequest' - x-ms-examples: - Create a vector store request: - $ref: ./examples/vector_stores.yaml /vector_stores/{vector_store_id}: get: operationId: getVectorStore From 9e7c90de4495360598ad308b7ec84f003818765b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 10 Mar 2026 13:35:46 +0100 Subject: [PATCH 04/31] Successfully filter by path --- foundation-models/openai-responses/pom.xml | 73 +- .../generated/client/ResponsesApi.java | 101 +- .../model/AzureAIFoundryModelsApiVersion.java | 64 + ...reContentFilterResultsForResponsesAPI.java | 18 +- ...entFilterResultsForResponsesAPIError.java} | 76 +- ...ForResponsesAPIProtectedMaterialCode.java} | 95 +- ...nsesAPIProtectedMaterialCodeCitation.java} | 76 +- .../model/CreateResponseDefaultResponse.java | 345 + .../model/DeleteResponse200Response.java | 395 - ...e.java => GetResponseDefaultResponse.java} | 158 +- .../generated/model/OpenAIAnnotation.java | 188 + .../generated/model/OpenAIAnnotationType.java | 33 + .../model/OpenAIConversationParam.java | 58 + .../model/OpenAIConversationParam2.java | 185 + .../generated/model/OpenAICreateResponse.java | 1392 + .../generated/model/OpenAIImageDetail.java | 66 + .../generated/model/OpenAIIncludeEnum.java | 46 + .../model/OpenAIInputFileContent.java | 390 + .../model/OpenAIInputImageContent.java | 371 + .../generated/model/OpenAIInputParam.java | 61 + .../model/OpenAIInputTextContent.java | 289 + .../generated/model/OpenAIItemResource.java | 188 + .../model/OpenAIItemResourceType.java | 33 + .../generated/model/OpenAIOutputContent.java | 189 + .../model/OpenAIOutputContentType.java | 33 + .../generated/model/OpenAIResponse.java | 1947 + .../model/OpenAIResponseAudioDeltaEvent.java | 351 + ...enAIResponseAudioTranscriptDeltaEvent.java | 356 + ...onseCodeInterpreterCallCodeDeltaEvent.java | 477 + ...nseCodeInterpreterCallInProgressEvent.java | 434 + ...eCodeInterpreterCallInterpretingEvent.java | 436 + .../OpenAIResponseContentPartAddedEvent.java | 508 + .../model/OpenAIResponseCreatedEvent.java | 347 + ...ResponseCustomToolCallInputDeltaEvent.java | 462 + .../model/OpenAIResponseErrorEvent.java | 444 + .../model/OpenAIResponseFailedEvent.java | 345 + ...ResponseFileSearchCallInProgressEvent.java | 412 + ...IResponseFileSearchCallSearchingEvent.java | 412 + ...sponseFunctionCallArgumentsDeltaEvent.java | 469 + ...AIResponseImageGenCallGeneratingEvent.java | 413 + ...AIResponseImageGenCallInProgressEvent.java | 411 + ...ResponseImageGenCallPartialImageEvent.java | 534 + .../model/OpenAIResponseInProgressEvent.java | 351 + .../model/OpenAIResponseIncompleteEvent.java | 351 + .../model/OpenAIResponseInstructions.java | 55 + .../model/OpenAIResponseItemList.java | 471 + .../model/OpenAIResponseLogProb.java | 295 + .../OpenAIResponseLogProbTopLogprobs.java | 215 + ...nAIResponseMCPCallArgumentsDeltaEvent.java | 463 + .../OpenAIResponseMCPCallFailedEvent.java | 402 + .../OpenAIResponseMCPCallInProgressEvent.java | 405 + ...OpenAIResponseMCPListToolsFailedEvent.java | 406 + ...AIResponseMCPListToolsInProgressEvent.java | 410 + .../OpenAIResponseOutputItemAddedEvent.java | 404 + ...esponseOutputTextAnnotationAddedEvent.java | 585 + .../model/OpenAIResponseQueuedEvent.java | 345 + ...esponseReasoningSummaryPartAddedEvent.java | 522 + ...nseReasoningSummaryPartAddedEventPart.java | 307 + ...esponseReasoningSummaryTextDeltaEvent.java | 521 + ...OpenAIResponseReasoningTextDeltaEvent.java | 510 + .../OpenAIResponseRefusalDeltaEvent.java | 505 + .../model/OpenAIResponseStreamOptions.java | 191 + .../model/OpenAIResponseTextDeltaEvent.java | 594 + ...OpenAIResponseUsageInputTokensDetails.java | 8 +- ...penAIResponseUsageOutputTokensDetails.java | 8 +- ...IResponseWebSearchCallInProgressEvent.java | 412 + ...AIResponseWebSearchCallSearchingEvent.java | 410 + .../resources/spec/azure-responses-only.yaml | 3972 ++ .../resources/spec/azure-v1-v1-generated.json | 40850 ---------------- .../main/resources/spec/filter-config.yaml | 8 + 70 files changed, 26019 insertions(+), 41638 deletions(-) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java rename foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/{AzureContentFilterResultForChoiceError.java => AzureContentFilterResultsForResponsesAPIError.java} (68%) rename foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/{AzureContentFilterResultForChoiceProtectedMaterialCode.java => AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java} (63%) rename foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/{AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java => AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java} (63%) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java rename foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/{CreateBatchDefaultResponse.java => GetResponseDefaultResponse.java} (57%) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java create mode 100644 foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml delete mode 100644 foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json create mode 100644 foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index 490e6c853..daa4120a6 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -81,9 +81,10 @@ generate-sources - ${project.basedir}/src/main/resources/spec/azure-v1-v1-generated.yaml + ${project.basedir}/src/main/resources/spec/azure-responses-only.yaml com.sap.ai.sdk.foundationmodels.openai.responses.generated.model com.sap.ai.sdk.foundationmodels.openai.responses.generated.client + true apache-httpclient create @@ -92,76 +93,6 @@ true true true - - - /batches - /batches/{batch_id} - /batches/{batch_id}/cancel - /chat/completions - /completions - /containers - /containers/{container_id} - /containers/{container_id}/files - /containers/{container_id}/files/{file_id} - /containers/{container_id}/files/{file_id}/content - /conversations - /conversations/{conversation_id} - /conversations/{conversation_id}/items - /conversations/{conversation_id}/items/{item_id} - /embeddings - /evals - /evals/{eval_id} - /evals/{eval_id}/runs - /evals/{eval_id}/runs/{run_id} - /evals/{eval_id}/runs/{run_id}/output_items - /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id} - /files - /files/{file_id} - /files/{file_id}/content - /fine_tuning/alpha/graders/run - /fine_tuning/alpha/graders/validate - /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions - /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id} - /fine_tuning/jobs - /fine_tuning/jobs/{fine_tuning_job_id} - /fine_tuning/jobs/{fine_tuning_job_id}/cancel - /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints - /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy - /fine_tuning/jobs/{fine_tuning_job_id}/events - /fine_tuning/jobs/{fine_tuning_job_id}/pause - /fine_tuning/jobs/{fine_tuning_job_id}/resume - /models - /models/{model} - /realtime/calls - /realtime/calls/{call_id}/accept - /realtime/calls/{call_id}/hangup - /realtime/calls/{call_id}/refer - /realtime/calls/{call_id}/reject - /realtime/client_secrets - /realtime/sessions - /realtime/transcription_sessions - /threads - /threads/runs - /threads/{thread_id} - /threads/{thread_id}/messages - /threads/{thread_id}/messages/{message_id} - /threads/{thread_id}/runs - /threads/{thread_id}/runs/{run_id} - /threads/{thread_id}/runs/{run_id}/cancel - /threads/{thread_id}/runs/{run_id}/steps - /threads/{thread_id}/runs/{run_id}/steps/{step_id} - /threads/{thread_id}/runs/{run_id}/submit_tool_outputs - /vector_stores - /vector_stores/{vector_store_id} - /vector_stores/{vector_store_id}/file_batches - /vector_stores/{vector_store_id}/file_batches/{batch_id} - /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel - /vector_stores/{vector_store_id}/file_batches/{batch_id}/files - /vector_stores/{vector_store_id}/files - /vector_stores/{vector_store_id}/files/{file_id} - /vector_stores/{vector_store_id}/files/{file_id}/content - /vector_stores/{vector_store_id}/search - true diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java index 28a8d0b78..7c1ead00c 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java @@ -3,7 +3,6 @@ import com.fasterxml.jackson.core.type.TypeReference; import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.AzureAIFoundryModelsApiVersion; import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.CreateResponse200Response; -import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.DeleteResponse200Response; import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAICreateResponse; import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAIIncludeEnum; import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAIResponseItemList; @@ -139,7 +138,7 @@ public CreateResponse200Response cancelResponse(@Nonnull final String responseId * *

0 - An unexpected error response. * - * @param body (required) The value for the parameter body + * @param openAICreateResponse (required) The value for the parameter openAICreateResponse * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to * use for this request. `v1` if not otherwise specified. * @return CreateResponse200Response @@ -147,14 +146,14 @@ public CreateResponse200Response cancelResponse(@Nonnull final String responseId */ @Nonnull public CreateResponse200Response createResponse( - @Nonnull final OpenAICreateResponse body, + @Nonnull final OpenAICreateResponse openAICreateResponse, @Nullable final AzureAIFoundryModelsApiVersion apiVersion) throws OpenApiRequestException { - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'openAICreateResponse' is set + if (openAICreateResponse == null) { throw new OpenApiRequestException( - "Missing the required parameter 'body' when calling createResponse") + "Missing the required parameter 'openAICreateResponse' when calling createResponse") .statusCode(400); } @@ -183,7 +182,7 @@ public CreateResponse200Response createResponse( localVarQueryParams, localVarCollectionQueryParams, localVarQueryStringJoiner.toString(), - body, + openAICreateResponse, localVarHeaderParams, localVarFormParams, localVarAccept, @@ -198,94 +197,14 @@ public CreateResponse200Response createResponse( * *

0 - An unexpected error response. * - * @param body The value for the parameter body + * @param openAICreateResponse The value for the parameter openAICreateResponse * @return CreateResponse200Response * @throws OpenApiRequestException if an error occurs while attempting to invoke the API */ @Nonnull - public CreateResponse200Response createResponse(@Nonnull final OpenAICreateResponse body) - throws OpenApiRequestException { - return createResponse(body, null); - } - - /** - * Deletes a response by ID. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId (required) The value for the parameter responseId - * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to - * use for this request. `v1` if not otherwise specified. - * @return DeleteResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DeleteResponse200Response deleteResponse( - @Nonnull final String responseId, @Nullable final AzureAIFoundryModelsApiVersion apiVersion) - throws OpenApiRequestException { - - // verify the required parameter 'responseId' is set - if (responseId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'responseId' when calling deleteResponse") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/responses/{response_id}" - .replaceAll( - "\\{" + "response_id" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(responseId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() {}; - - return apiClient.invokeAPI( - localVarPath, - "DELETE", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - null, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - * Deletes a response by ID. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId The value for the parameter responseId - * @return DeleteResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public DeleteResponse200Response deleteResponse(@Nonnull final String responseId) - throws OpenApiRequestException { - return deleteResponse(responseId, null); + public CreateResponse200Response createResponse( + @Nonnull final OpenAICreateResponse openAICreateResponse) throws OpenApiRequestException { + return createResponse(openAICreateResponse, null); } /** diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java new file mode 100644 index 000000000..813c5d762 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java @@ -0,0 +1,64 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets AzureAIFoundryModelsApiVersion */ +public enum AzureAIFoundryModelsApiVersion { + V1("v1"), + + PREVIEW("preview"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + AzureAIFoundryModelsApiVersion(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static AzureAIFoundryModelsApiVersion fromValue(@Nonnull final String value) { + for (final AzureAIFoundryModelsApiVersion b : AzureAIFoundryModelsApiVersion.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java index 9d7a50bce..a5b0e21ae 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java @@ -50,7 +50,7 @@ public class AzureContentFilterResultsForResponsesAPI private AzureContentFilterCustomTopicResult customTopics; @JsonProperty("error") - private AzureContentFilterResultForChoiceError error; + private AzureContentFilterResultsForResponsesAPIError error; @JsonProperty("jailbreak") private AzureContentFilterDetectionResult jailbreak; @@ -62,7 +62,7 @@ public class AzureContentFilterResultsForResponsesAPI private AzureContentFilterDetectionResult protectedMaterialText; @JsonProperty("protected_material_code") - private AzureContentFilterResultForChoiceProtectedMaterialCode protectedMaterialCode; + private AzureContentFilterResultsForResponsesAPIProtectedMaterialCode protectedMaterialCode; @JsonProperty("ungrounded_material") private AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial; @@ -361,7 +361,7 @@ public void setCustomTopics(@Nullable final AzureContentFilterCustomTopicResult */ @Nonnull public AzureContentFilterResultsForResponsesAPI error( - @Nullable final AzureContentFilterResultForChoiceError error) { + @Nullable final AzureContentFilterResultsForResponsesAPIError error) { this.error = error; return this; } @@ -372,7 +372,7 @@ public AzureContentFilterResultsForResponsesAPI error( * @return error The error of this {@link AzureContentFilterResultsForResponsesAPI} instance. */ @Nonnull - public AzureContentFilterResultForChoiceError getError() { + public AzureContentFilterResultsForResponsesAPIError getError() { return error; } @@ -381,7 +381,7 @@ public AzureContentFilterResultForChoiceError getError() { * * @param error The error of this {@link AzureContentFilterResultsForResponsesAPI} */ - public void setError(@Nullable final AzureContentFilterResultForChoiceError error) { + public void setError(@Nullable final AzureContentFilterResultsForResponsesAPIError error) { this.error = error; } @@ -513,7 +513,8 @@ public void setProtectedMaterialText( @Nonnull public AzureContentFilterResultsForResponsesAPI protectedMaterialCode( @Nullable - final AzureContentFilterResultForChoiceProtectedMaterialCode protectedMaterialCode) { + final AzureContentFilterResultsForResponsesAPIProtectedMaterialCode + protectedMaterialCode) { this.protectedMaterialCode = protectedMaterialCode; return this; } @@ -525,7 +526,7 @@ public AzureContentFilterResultsForResponsesAPI protectedMaterialCode( * AzureContentFilterResultsForResponsesAPI} instance. */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCode getProtectedMaterialCode() { + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode getProtectedMaterialCode() { return protectedMaterialCode; } @@ -538,7 +539,8 @@ public AzureContentFilterResultForChoiceProtectedMaterialCode getProtectedMateri */ public void setProtectedMaterialCode( @Nullable - final AzureContentFilterResultForChoiceProtectedMaterialCode protectedMaterialCode) { + final AzureContentFilterResultsForResponsesAPIProtectedMaterialCode + protectedMaterialCode) { this.protectedMaterialCode = protectedMaterialCode; } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java similarity index 68% rename from foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java rename to foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java index 8052e2c64..09a47973b 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceError.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java @@ -28,7 +28,7 @@ * evaluation. */ // CHECKSTYLE:OFF -public class AzureContentFilterResultForChoiceError +public class AzureContentFilterResultsForResponsesAPIError // CHECKSTYLE:ON { @JsonProperty("code") @@ -40,18 +40,18 @@ public class AzureContentFilterResultForChoiceError @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for AzureContentFilterResultForChoiceError. */ - protected AzureContentFilterResultForChoiceError() {} + /** Default constructor for AzureContentFilterResultsForResponsesAPIError. */ + protected AzureContentFilterResultsForResponsesAPIError() {} /** - * Set the code of this {@link AzureContentFilterResultForChoiceError} instance and return the - * same instance. + * Set the code of this {@link AzureContentFilterResultsForResponsesAPIError} instance and return + * the same instance. * * @param code A distinct, machine-readable code associated with the error. - * @return The same instance of this {@link AzureContentFilterResultForChoiceError} class + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPIError} class */ @Nonnull - public AzureContentFilterResultForChoiceError code(@Nonnull final Integer code) { + public AzureContentFilterResultsForResponsesAPIError code(@Nonnull final Integer code) { this.code = code; return this; } @@ -59,7 +59,7 @@ public AzureContentFilterResultForChoiceError code(@Nonnull final Integer code) /** * A distinct, machine-readable code associated with the error. * - * @return code The code of this {@link AzureContentFilterResultForChoiceError} instance. + * @return code The code of this {@link AzureContentFilterResultsForResponsesAPIError} instance. */ @Nonnull public Integer getCode() { @@ -67,7 +67,7 @@ public Integer getCode() { } /** - * Set the code of this {@link AzureContentFilterResultForChoiceError} instance. + * Set the code of this {@link AzureContentFilterResultsForResponsesAPIError} instance. * * @param code A distinct, machine-readable code associated with the error. */ @@ -76,14 +76,14 @@ public void setCode(@Nonnull final Integer code) { } /** - * Set the message of this {@link AzureContentFilterResultForChoiceError} instance and return the - * same instance. + * Set the message of this {@link AzureContentFilterResultsForResponsesAPIError} instance and + * return the same instance. * * @param message A human-readable message associated with the error. - * @return The same instance of this {@link AzureContentFilterResultForChoiceError} class + * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPIError} class */ @Nonnull - public AzureContentFilterResultForChoiceError message(@Nonnull final String message) { + public AzureContentFilterResultsForResponsesAPIError message(@Nonnull final String message) { this.message = message; return this; } @@ -91,7 +91,8 @@ public AzureContentFilterResultForChoiceError message(@Nonnull final String mess /** * A human-readable message associated with the error. * - * @return message The message of this {@link AzureContentFilterResultForChoiceError} instance. + * @return message The message of this {@link AzureContentFilterResultsForResponsesAPIError} + * instance. */ @Nonnull public String getMessage() { @@ -99,7 +100,7 @@ public String getMessage() { } /** - * Set the message of this {@link AzureContentFilterResultForChoiceError} instance. + * Set the message of this {@link AzureContentFilterResultsForResponsesAPIError} instance. * * @param message A human-readable message associated with the error. */ @@ -109,7 +110,7 @@ public void setMessage(@Nonnull final String message) { /** * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultForChoiceError}. + * AzureContentFilterResultsForResponsesAPIError}. * * @return The set of properties names */ @@ -121,7 +122,7 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultForChoiceError} instance. + * AzureContentFilterResultsForResponsesAPIError} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -133,14 +134,14 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "AzureContentFilterResultForChoiceError has no field with name '" + name + "'."); + "AzureContentFilterResultsForResponsesAPIError has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link AzureContentFilterResultForChoiceError} instance - * including unrecognized properties. + * Get the value of all properties of this {@link AzureContentFilterResultsForResponsesAPIError} + * instance including unrecognized properties. * * @return The map of all properties */ @@ -154,9 +155,9 @@ public Map toMap() { } /** - * Set an unrecognizable property of this {@link AzureContentFilterResultForChoiceError} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. + * Set an unrecognizable property of this {@link AzureContentFilterResultsForResponsesAPIError} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -174,12 +175,14 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final AzureContentFilterResultForChoiceError azureContentFilterResultForChoiceError = - (AzureContentFilterResultForChoiceError) o; + final AzureContentFilterResultsForResponsesAPIError + azureContentFilterResultsForResponsesAPIError = + (AzureContentFilterResultsForResponsesAPIError) o; return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterResultForChoiceError.cloudSdkCustomFields) - && Objects.equals(this.code, azureContentFilterResultForChoiceError.code) - && Objects.equals(this.message, azureContentFilterResultForChoiceError.message); + this.cloudSdkCustomFields, + azureContentFilterResultsForResponsesAPIError.cloudSdkCustomFields) + && Objects.equals(this.code, azureContentFilterResultsForResponsesAPIError.code) + && Objects.equals(this.message, azureContentFilterResultsForResponsesAPIError.message); } @Override @@ -191,7 +194,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultForChoiceError {\n"); + sb.append("class AzureContentFilterResultsForResponsesAPIError {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); cloudSdkCustomFields.forEach( @@ -213,20 +216,21 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterResultForChoiceError} instance with all required arguments. + * AzureContentFilterResultsForResponsesAPIError} instance with all required arguments. */ public static Builder create() { return (code) -> - (message) -> new AzureContentFilterResultForChoiceError().code(code).message(message); + (message) -> + new AzureContentFilterResultsForResponsesAPIError().code(code).message(message); } /** Builder helper class. */ public interface Builder { /** - * Set the code of this {@link AzureContentFilterResultForChoiceError} instance. + * Set the code of this {@link AzureContentFilterResultsForResponsesAPIError} instance. * * @param code A distinct, machine-readable code associated with the error. - * @return The AzureContentFilterResultForChoiceError builder. + * @return The AzureContentFilterResultsForResponsesAPIError builder. */ Builder1 code(@Nonnull final Integer code); } @@ -234,11 +238,11 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the message of this {@link AzureContentFilterResultForChoiceError} instance. + * Set the message of this {@link AzureContentFilterResultsForResponsesAPIError} instance. * * @param message A human-readable message associated with the error. - * @return The AzureContentFilterResultForChoiceError instance. + * @return The AzureContentFilterResultsForResponsesAPIError instance. */ - AzureContentFilterResultForChoiceError message(@Nonnull final String message); + AzureContentFilterResultsForResponsesAPIError message(@Nonnull final String message); } } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java similarity index 63% rename from foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java rename to foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java index dc9654c76..02a74973c 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCode.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java @@ -28,7 +28,7 @@ * material. */ // CHECKSTYLE:OFF -public class AzureContentFilterResultForChoiceProtectedMaterialCode +public class AzureContentFilterResultsForResponsesAPIProtectedMaterialCode // CHECKSTYLE:ON { @JsonProperty("filtered") @@ -38,24 +38,24 @@ public class AzureContentFilterResultForChoiceProtectedMaterialCode private Boolean detected; @JsonProperty("citation") - private AzureContentFilterResultForChoiceProtectedMaterialCodeCitation citation; + private AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation citation; @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for AzureContentFilterResultForChoiceProtectedMaterialCode. */ - protected AzureContentFilterResultForChoiceProtectedMaterialCode() {} + /** Default constructor for AzureContentFilterResultsForResponsesAPIProtectedMaterialCode. */ + protected AzureContentFilterResultsForResponsesAPIProtectedMaterialCode() {} /** - * Set the filtered of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * Set the filtered of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * instance and return the same instance. * * @param filtered Whether the content detection resulted in a content filtering action. * @return The same instance of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} class + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} class */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCode filtered( + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode filtered( @Nonnull final Boolean filtered) { this.filtered = filtered; return this; @@ -65,7 +65,7 @@ public AzureContentFilterResultForChoiceProtectedMaterialCode filtered( * Whether the content detection resulted in a content filtering action. * * @return filtered The filtered of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. */ @Nonnull public Boolean isFiltered() { @@ -73,7 +73,7 @@ public Boolean isFiltered() { } /** - * Set the filtered of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * Set the filtered of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * instance. * * @param filtered Whether the content detection resulted in a content filtering action. @@ -83,15 +83,15 @@ public void setFiltered(@Nonnull final Boolean filtered) { } /** - * Set the detected of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * Set the detected of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * instance and return the same instance. * * @param detected Whether the labeled content category was detected in the content. * @return The same instance of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} class + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} class */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCode detected( + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode detected( @Nonnull final Boolean detected) { this.detected = detected; return this; @@ -101,7 +101,7 @@ public AzureContentFilterResultForChoiceProtectedMaterialCode detected( * Whether the labeled content category was detected in the content. * * @return detected The detected of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. */ @Nonnull public Boolean isDetected() { @@ -109,7 +109,7 @@ public Boolean isDetected() { } /** - * Set the detected of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * Set the detected of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * instance. * * @param detected Whether the labeled content category was detected in the content. @@ -119,17 +119,18 @@ public void setDetected(@Nonnull final Boolean detected) { } /** - * Set the citation of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * Set the citation of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * instance and return the same instance. * * @param citation The citation of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * @return The same instance of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} class + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} class */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCode citation( - @Nullable final AzureContentFilterResultForChoiceProtectedMaterialCodeCitation citation) { + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode citation( + @Nullable + final AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation citation) { this.citation = citation; return this; } @@ -138,28 +139,29 @@ public AzureContentFilterResultForChoiceProtectedMaterialCode citation( * Get citation * * @return citation The citation of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation getCitation() { + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation getCitation() { return citation; } /** - * Set the citation of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} + * Set the citation of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} * instance. * * @param citation The citation of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} */ public void setCitation( - @Nullable final AzureContentFilterResultForChoiceProtectedMaterialCodeCitation citation) { + @Nullable + final AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation citation) { this.citation = citation; } /** * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode}. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode}. * * @return The set of properties names */ @@ -171,7 +173,7 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -183,7 +185,7 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "AzureContentFilterResultForChoiceProtectedMaterialCode has no field with name '" + "AzureContentFilterResultsForResponsesAPIProtectedMaterialCode has no field with name '" + name + "'."); } @@ -192,7 +194,7 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc /** * Get the value of all properties of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance including unrecognized + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance including unrecognized * properties. * * @return The map of all properties @@ -209,7 +211,7 @@ public Map toMap() { /** * Set an unrecognizable property of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance. If the map previously + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. If the map previously * contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property @@ -228,18 +230,18 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final AzureContentFilterResultForChoiceProtectedMaterialCode - azureContentFilterResultForChoiceProtectedMaterialCode = - (AzureContentFilterResultForChoiceProtectedMaterialCode) o; + final AzureContentFilterResultsForResponsesAPIProtectedMaterialCode + azureContentFilterResultsForResponsesAPIProtectedMaterialCode = + (AzureContentFilterResultsForResponsesAPIProtectedMaterialCode) o; return Objects.equals( this.cloudSdkCustomFields, - azureContentFilterResultForChoiceProtectedMaterialCode.cloudSdkCustomFields) + azureContentFilterResultsForResponsesAPIProtectedMaterialCode.cloudSdkCustomFields) && Objects.equals( - this.filtered, azureContentFilterResultForChoiceProtectedMaterialCode.filtered) + this.filtered, azureContentFilterResultsForResponsesAPIProtectedMaterialCode.filtered) && Objects.equals( - this.detected, azureContentFilterResultForChoiceProtectedMaterialCode.detected) + this.detected, azureContentFilterResultsForResponsesAPIProtectedMaterialCode.detected) && Objects.equals( - this.citation, azureContentFilterResultForChoiceProtectedMaterialCode.citation); + this.citation, azureContentFilterResultsForResponsesAPIProtectedMaterialCode.citation); } @Override @@ -251,7 +253,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultForChoiceProtectedMaterialCode {\n"); + sb.append("class AzureContentFilterResultsForResponsesAPIProtectedMaterialCode {\n"); sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); sb.append(" citation: ").append(toIndentedString(citation)).append("\n"); @@ -274,12 +276,13 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterResultForChoiceProtectedMaterialCode} instance with all required arguments. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance with all required + * arguments. */ public static Builder create() { return (filtered) -> (detected) -> - new AzureContentFilterResultForChoiceProtectedMaterialCode() + new AzureContentFilterResultsForResponsesAPIProtectedMaterialCode() .filtered(filtered) .detected(detected); } @@ -287,11 +290,11 @@ public static Builder create() { /** Builder helper class. */ public interface Builder { /** - * Set the filtered of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} - * instance. + * Set the filtered of this {@link + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. * * @param filtered Whether the content detection resulted in a content filtering action. - * @return The AzureContentFilterResultForChoiceProtectedMaterialCode builder. + * @return The AzureContentFilterResultsForResponsesAPIProtectedMaterialCode builder. */ Builder1 filtered(@Nonnull final Boolean filtered); } @@ -299,13 +302,13 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the detected of this {@link AzureContentFilterResultForChoiceProtectedMaterialCode} - * instance. + * Set the detected of this {@link + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. * * @param detected Whether the labeled content category was detected in the content. - * @return The AzureContentFilterResultForChoiceProtectedMaterialCode instance. + * @return The AzureContentFilterResultsForResponsesAPIProtectedMaterialCode instance. */ - AzureContentFilterResultForChoiceProtectedMaterialCode detected( + AzureContentFilterResultsForResponsesAPIProtectedMaterialCode detected( @Nonnull final Boolean detected); } } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java similarity index 63% rename from foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java rename to foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java index 96386d19c..772d4e0ac 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultForChoiceProtectedMaterialCodeCitation.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java @@ -26,7 +26,7 @@ /** If available, the citation details describing the associated license and its location. */ // CHECKSTYLE:OFF -public class AzureContentFilterResultForChoiceProtectedMaterialCodeCitation +public class AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation // CHECKSTYLE:ON { @JsonProperty("license") @@ -38,19 +38,22 @@ public class AzureContentFilterResultForChoiceProtectedMaterialCodeCitation @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for AzureContentFilterResultForChoiceProtectedMaterialCodeCitation. */ - protected AzureContentFilterResultForChoiceProtectedMaterialCodeCitation() {} + /** + * Default constructor for AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation. + */ + protected AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation() {} /** - * Set the license of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} - * instance and return the same instance. + * Set the license of this {@link + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance and return the + * same instance. * * @param license The name or identifier of the license associated with the detection. * @return The same instance of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} class + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} class */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation license( + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation license( @Nullable final String license) { this.license = license; return this; @@ -60,7 +63,7 @@ public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation license( * The name or identifier of the license associated with the detection. * * @return license The license of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. */ @Nonnull public String getLicense() { @@ -68,8 +71,8 @@ public String getLicense() { } /** - * Set the license of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} - * instance. + * Set the license of this {@link + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. * * @param license The name or identifier of the license associated with the detection. */ @@ -78,15 +81,16 @@ public void setLicense(@Nullable final String license) { } /** - * Set the URL of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} - * instance and return the same instance. + * Set the URL of this {@link + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance and return the + * same instance. * * @param URL The URL associated with the license. * @return The same instance of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} class + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} class */ @Nonnull - public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation URL( + public AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation URL( @Nullable final URI URL) { this.URL = URL; return this; @@ -96,7 +100,7 @@ public AzureContentFilterResultForChoiceProtectedMaterialCodeCitation URL( * The URL associated with the license. * * @return URL The URL of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. */ @Nonnull public URI getURL() { @@ -104,8 +108,8 @@ public URI getURL() { } /** - * Set the URL of this {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} - * instance. + * Set the URL of this {@link + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. * * @param URL The URL associated with the license. */ @@ -115,7 +119,7 @@ public void setURL(@Nullable final URI URL) { /** * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation}. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation}. * * @return The set of properties names */ @@ -127,7 +131,7 @@ public Set getCustomFieldNames() { /** * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. * * @deprecated Use {@link #toMap()} instead. * @param name The name of the property @@ -139,7 +143,7 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "AzureContentFilterResultForChoiceProtectedMaterialCodeCitation has no field with name '" + "AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation has no field with name '" + name + "'."); } @@ -148,8 +152,8 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc /** * Get the value of all properties of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance including unrecognized - * properties. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance including + * unrecognized properties. * * @return The map of all properties */ @@ -164,8 +168,8 @@ public Map toMap() { /** * Set an unrecognizable property of this {@link - * AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. + * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property * @param customFieldValue The value of the property @@ -183,16 +187,18 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final AzureContentFilterResultForChoiceProtectedMaterialCodeCitation - azureContentFilterResultForChoiceProtectedMaterialCodeCitation = - (AzureContentFilterResultForChoiceProtectedMaterialCodeCitation) o; + final AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation + azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation = + (AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation) o; return Objects.equals( this.cloudSdkCustomFields, - azureContentFilterResultForChoiceProtectedMaterialCodeCitation.cloudSdkCustomFields) + azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation + .cloudSdkCustomFields) && Objects.equals( - this.license, azureContentFilterResultForChoiceProtectedMaterialCodeCitation.license) + this.license, + azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.license) && Objects.equals( - this.URL, azureContentFilterResultForChoiceProtectedMaterialCodeCitation.URL); + this.URL, azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.URL); } @Override @@ -204,7 +210,7 @@ public int hashCode() { @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultForChoiceProtectedMaterialCodeCitation {\n"); + sb.append("class AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation {\n"); sb.append(" license: ").append(toIndentedString(license)).append("\n"); sb.append(" URL: ").append(toIndentedString(URL)).append("\n"); cloudSdkCustomFields.forEach( @@ -225,10 +231,10 @@ private String toIndentedString(final java.lang.Object o) { } /** - * Create a new {@link AzureContentFilterResultForChoiceProtectedMaterialCodeCitation} instance. - * No arguments are required. + * Create a new {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} + * instance. No arguments are required. */ - public static AzureContentFilterResultForChoiceProtectedMaterialCodeCitation create() { - return new AzureContentFilterResultForChoiceProtectedMaterialCodeCitation(); + public static AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation create() { + return new AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation(); } } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java new file mode 100644 index 000000000..44caf57af --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java @@ -0,0 +1,345 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** CreateResponseDefaultResponse */ +// CHECKSTYLE:OFF +public class CreateResponseDefaultResponse +// CHECKSTYLE:ON +{ + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonProperty("param") + private String param; + + @JsonProperty("type") + private String type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for CreateResponseDefaultResponse. */ + protected CreateResponseDefaultResponse() {} + + /** + * Set the code of this {@link CreateResponseDefaultResponse} instance and return the same + * instance. + * + * @param code The code of this {@link CreateResponseDefaultResponse} + * @return The same instance of this {@link CreateResponseDefaultResponse} class + */ + @Nonnull + public CreateResponseDefaultResponse code(@Nullable final String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code The code of this {@link CreateResponseDefaultResponse} instance. + */ + @Nullable + public String getCode() { + return code; + } + + /** + * Set the code of this {@link CreateResponseDefaultResponse} instance. + * + * @param code The code of this {@link CreateResponseDefaultResponse} + */ + public void setCode(@Nullable final String code) { + this.code = code; + } + + /** + * Set the message of this {@link CreateResponseDefaultResponse} instance and return the same + * instance. + * + * @param message The message of this {@link CreateResponseDefaultResponse} + * @return The same instance of this {@link CreateResponseDefaultResponse} class + */ + @Nonnull + public CreateResponseDefaultResponse message(@Nullable final String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message The message of this {@link CreateResponseDefaultResponse} instance. + */ + @Nullable + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link CreateResponseDefaultResponse} instance. + * + * @param message The message of this {@link CreateResponseDefaultResponse} + */ + public void setMessage(@Nullable final String message) { + this.message = message; + } + + /** + * Set the param of this {@link CreateResponseDefaultResponse} instance and return the same + * instance. + * + * @param param The param of this {@link CreateResponseDefaultResponse} + * @return The same instance of this {@link CreateResponseDefaultResponse} class + */ + @Nonnull + public CreateResponseDefaultResponse param(@Nullable final String param) { + this.param = param; + return this; + } + + /** + * Get param + * + * @return param The param of this {@link CreateResponseDefaultResponse} instance. + */ + @Nullable + public String getParam() { + return param; + } + + /** + * Set the param of this {@link CreateResponseDefaultResponse} instance. + * + * @param param The param of this {@link CreateResponseDefaultResponse} + */ + public void setParam(@Nullable final String param) { + this.param = param; + } + + /** + * Set the type of this {@link CreateResponseDefaultResponse} instance and return the same + * instance. + * + * @param type The type of this {@link CreateResponseDefaultResponse} + * @return The same instance of this {@link CreateResponseDefaultResponse} class + */ + @Nonnull + public CreateResponseDefaultResponse type(@Nullable final String type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link CreateResponseDefaultResponse} instance. + */ + @Nullable + public String getType() { + return type; + } + + /** + * Set the type of this {@link CreateResponseDefaultResponse} instance. + * + * @param type The type of this {@link CreateResponseDefaultResponse} + */ + public void setType(@Nullable final String type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link CreateResponseDefaultResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link CreateResponseDefaultResponse} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "CreateResponseDefaultResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link CreateResponseDefaultResponse} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + if (param != null) declaredFields.put("param", param); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link CreateResponseDefaultResponse} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final CreateResponseDefaultResponse createResponseDefaultResponse = + (CreateResponseDefaultResponse) o; + return Objects.equals( + this.cloudSdkCustomFields, createResponseDefaultResponse.cloudSdkCustomFields) + && Objects.equals(this.code, createResponseDefaultResponse.code) + && Objects.equals(this.message, createResponseDefaultResponse.message) + && Objects.equals(this.param, createResponseDefaultResponse.param) + && Objects.equals(this.type, createResponseDefaultResponse.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, param, type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class CreateResponseDefaultResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * CreateResponseDefaultResponse} instance with all required arguments. + */ + public static Builder create() { + return (code) -> + (message) -> + (param) -> + (type) -> + new CreateResponseDefaultResponse() + .code(code) + .message(message) + .param(param) + .type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the code of this {@link CreateResponseDefaultResponse} instance. + * + * @param code The code of this {@link CreateResponseDefaultResponse} + * @return The CreateResponseDefaultResponse builder. + */ + Builder1 code(@Nullable final String code); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the message of this {@link CreateResponseDefaultResponse} instance. + * + * @param message The message of this {@link CreateResponseDefaultResponse} + * @return The CreateResponseDefaultResponse builder. + */ + Builder2 message(@Nullable final String message); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the param of this {@link CreateResponseDefaultResponse} instance. + * + * @param param The param of this {@link CreateResponseDefaultResponse} + * @return The CreateResponseDefaultResponse builder. + */ + Builder3 param(@Nullable final String param); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the type of this {@link CreateResponseDefaultResponse} instance. + * + * @param type The type of this {@link CreateResponseDefaultResponse} + * @return The CreateResponseDefaultResponse instance. + */ + CreateResponseDefaultResponse type(@Nullable final String type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java deleted file mode 100644 index 4a3d4e5d3..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/DeleteResponse200Response.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** DeleteResponse200Response */ -// CHECKSTYLE:OFF -public class DeleteResponse200Response -// CHECKSTYLE:ON -{ - /** Gets or Sets _object */ - public enum ObjectEnum { - /** The RESPONSE_DELETED option of this DeleteResponse200Response */ - RESPONSE_DELETED("response.deleted"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this DeleteResponse200Response */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ObjectEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type DeleteResponse200Response - */ - @JsonCreator - @Nonnull - public static ObjectEnum fromValue(@Nonnull final String value) { - for (ObjectEnum b : ObjectEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("object") - private ObjectEnum _object; - - @JsonProperty("id") - private String id; - - /** Gets or Sets deleted */ - public enum DeletedEnum { - /** The TRUE option of this DeleteResponse200Response */ - TRUE("true"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this DeleteResponse200Response */ - UNKNOWN_DEFAULT_OPEN_API("11184809"); - - private Boolean value; - - DeletedEnum(Boolean value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public Boolean getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type DeleteResponse200Response - */ - @JsonCreator - @Nonnull - public static DeletedEnum fromValue(@Nonnull final Boolean value) { - for (DeletedEnum b : DeletedEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("deleted") - private DeletedEnum deleted; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for DeleteResponse200Response. */ - protected DeleteResponse200Response() {} - - /** - * Set the _object of this {@link DeleteResponse200Response} instance and return the same - * instance. - * - * @param _object The _object of this {@link DeleteResponse200Response} - * @return The same instance of this {@link DeleteResponse200Response} class - */ - @Nonnull - public DeleteResponse200Response _object(@Nonnull final ObjectEnum _object) { - this._object = _object; - return this; - } - - /** - * Get _object - * - * @return _object The _object of this {@link DeleteResponse200Response} instance. - */ - @Nonnull - public ObjectEnum getObject() { - return _object; - } - - /** - * Set the _object of this {@link DeleteResponse200Response} instance. - * - * @param _object The _object of this {@link DeleteResponse200Response} - */ - public void setObject(@Nonnull final ObjectEnum _object) { - this._object = _object; - } - - /** - * Set the id of this {@link DeleteResponse200Response} instance and return the same instance. - * - * @param id The id of this {@link DeleteResponse200Response} - * @return The same instance of this {@link DeleteResponse200Response} class - */ - @Nonnull - public DeleteResponse200Response id(@Nullable final String id) { - this.id = id; - return this; - } - - /** - * Get id - * - * @return id The id of this {@link DeleteResponse200Response} instance. - */ - @Nullable - public String getId() { - return id; - } - - /** - * Set the id of this {@link DeleteResponse200Response} instance. - * - * @param id The id of this {@link DeleteResponse200Response} - */ - public void setId(@Nullable final String id) { - this.id = id; - } - - /** - * Set the deleted of this {@link DeleteResponse200Response} instance and return the same - * instance. - * - * @param deleted The deleted of this {@link DeleteResponse200Response} - * @return The same instance of this {@link DeleteResponse200Response} class - */ - @Nonnull - public DeleteResponse200Response deleted(@Nonnull final DeletedEnum deleted) { - this.deleted = deleted; - return this; - } - - /** - * Get deleted - * - * @return deleted The deleted of this {@link DeleteResponse200Response} instance. - */ - @Nonnull - public DeletedEnum isDeleted() { - return deleted; - } - - /** - * Set the deleted of this {@link DeleteResponse200Response} instance. - * - * @param deleted The deleted of this {@link DeleteResponse200Response} - */ - public void setDeleted(@Nonnull final DeletedEnum deleted) { - this.deleted = deleted; - } - - /** - * Get the names of the unrecognizable properties of the {@link DeleteResponse200Response}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link DeleteResponse200Response} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "DeleteResponse200Response has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link DeleteResponse200Response} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (_object != null) declaredFields.put("_object", _object); - if (id != null) declaredFields.put("id", id); - if (deleted != null) declaredFields.put("deleted", deleted); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link DeleteResponse200Response} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final DeleteResponse200Response deleteResponse200Response = (DeleteResponse200Response) o; - return Objects.equals(this.cloudSdkCustomFields, deleteResponse200Response.cloudSdkCustomFields) - && Objects.equals(this._object, deleteResponse200Response._object) - && Objects.equals(this.id, deleteResponse200Response.id) - && Objects.equals(this.deleted, deleteResponse200Response.deleted); - } - - @Override - public int hashCode() { - return Objects.hash(_object, id, deleted, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class DeleteResponse200Response {\n"); - sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" deleted: ").append(toIndentedString(deleted)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * DeleteResponse200Response} instance with all required arguments. - */ - public static Builder create() { - return (_object) -> - (id) -> - (deleted) -> new DeleteResponse200Response()._object(_object).id(id).deleted(deleted); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the _object of this {@link DeleteResponse200Response} instance. - * - * @param _object The _object of this {@link DeleteResponse200Response} - * @return The DeleteResponse200Response builder. - */ - Builder1 _object(@Nonnull final ObjectEnum _object); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the id of this {@link DeleteResponse200Response} instance. - * - * @param id The id of this {@link DeleteResponse200Response} - * @return The DeleteResponse200Response builder. - */ - Builder2 id(@Nullable final String id); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the deleted of this {@link DeleteResponse200Response} instance. - * - * @param deleted The deleted of this {@link DeleteResponse200Response} - * @return The DeleteResponse200Response instance. - */ - DeleteResponse200Response deleted(@Nonnull final DeletedEnum deleted); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java similarity index 57% rename from foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java rename to foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java index 0ff3bb1a4..7998e4661 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateBatchDefaultResponse.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java @@ -23,9 +23,9 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -/** CreateBatchDefaultResponse */ +/** GetResponseDefaultResponse */ // CHECKSTYLE:OFF -public class CreateBatchDefaultResponse +public class GetResponseDefaultResponse // CHECKSTYLE:ON { @JsonProperty("code") @@ -40,23 +40,20 @@ public class CreateBatchDefaultResponse @JsonProperty("type") private String type; - @JsonProperty("inner_error") - private Object innerError = null; - @JsonAnySetter @JsonAnyGetter private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - /** Default constructor for CreateBatchDefaultResponse. */ - protected CreateBatchDefaultResponse() {} + /** Default constructor for GetResponseDefaultResponse. */ + protected GetResponseDefaultResponse() {} /** - * Set the code of this {@link CreateBatchDefaultResponse} instance and return the same instance. + * Set the code of this {@link GetResponseDefaultResponse} instance and return the same instance. * - * @param code The code of this {@link CreateBatchDefaultResponse} - * @return The same instance of this {@link CreateBatchDefaultResponse} class + * @param code The code of this {@link GetResponseDefaultResponse} + * @return The same instance of this {@link GetResponseDefaultResponse} class */ @Nonnull - public CreateBatchDefaultResponse code(@Nullable final String code) { + public GetResponseDefaultResponse code(@Nullable final String code) { this.code = code; return this; } @@ -64,7 +61,7 @@ public CreateBatchDefaultResponse code(@Nullable final String code) { /** * Get code * - * @return code The code of this {@link CreateBatchDefaultResponse} instance. + * @return code The code of this {@link GetResponseDefaultResponse} instance. */ @Nullable public String getCode() { @@ -72,23 +69,23 @@ public String getCode() { } /** - * Set the code of this {@link CreateBatchDefaultResponse} instance. + * Set the code of this {@link GetResponseDefaultResponse} instance. * - * @param code The code of this {@link CreateBatchDefaultResponse} + * @param code The code of this {@link GetResponseDefaultResponse} */ public void setCode(@Nullable final String code) { this.code = code; } /** - * Set the message of this {@link CreateBatchDefaultResponse} instance and return the same + * Set the message of this {@link GetResponseDefaultResponse} instance and return the same * instance. * - * @param message The message of this {@link CreateBatchDefaultResponse} - * @return The same instance of this {@link CreateBatchDefaultResponse} class + * @param message The message of this {@link GetResponseDefaultResponse} + * @return The same instance of this {@link GetResponseDefaultResponse} class */ @Nonnull - public CreateBatchDefaultResponse message(@Nonnull final String message) { + public GetResponseDefaultResponse message(@Nonnull final String message) { this.message = message; return this; } @@ -96,7 +93,7 @@ public CreateBatchDefaultResponse message(@Nonnull final String message) { /** * Get message * - * @return message The message of this {@link CreateBatchDefaultResponse} instance. + * @return message The message of this {@link GetResponseDefaultResponse} instance. */ @Nonnull public String getMessage() { @@ -104,22 +101,22 @@ public String getMessage() { } /** - * Set the message of this {@link CreateBatchDefaultResponse} instance. + * Set the message of this {@link GetResponseDefaultResponse} instance. * - * @param message The message of this {@link CreateBatchDefaultResponse} + * @param message The message of this {@link GetResponseDefaultResponse} */ public void setMessage(@Nonnull final String message) { this.message = message; } /** - * Set the param of this {@link CreateBatchDefaultResponse} instance and return the same instance. + * Set the param of this {@link GetResponseDefaultResponse} instance and return the same instance. * - * @param param The param of this {@link CreateBatchDefaultResponse} - * @return The same instance of this {@link CreateBatchDefaultResponse} class + * @param param The param of this {@link GetResponseDefaultResponse} + * @return The same instance of this {@link GetResponseDefaultResponse} class */ @Nonnull - public CreateBatchDefaultResponse param(@Nullable final String param) { + public GetResponseDefaultResponse param(@Nullable final String param) { this.param = param; return this; } @@ -127,7 +124,7 @@ public CreateBatchDefaultResponse param(@Nullable final String param) { /** * Get param * - * @return param The param of this {@link CreateBatchDefaultResponse} instance. + * @return param The param of this {@link GetResponseDefaultResponse} instance. */ @Nullable public String getParam() { @@ -135,22 +132,22 @@ public String getParam() { } /** - * Set the param of this {@link CreateBatchDefaultResponse} instance. + * Set the param of this {@link GetResponseDefaultResponse} instance. * - * @param param The param of this {@link CreateBatchDefaultResponse} + * @param param The param of this {@link GetResponseDefaultResponse} */ public void setParam(@Nullable final String param) { this.param = param; } /** - * Set the type of this {@link CreateBatchDefaultResponse} instance and return the same instance. + * Set the type of this {@link GetResponseDefaultResponse} instance and return the same instance. * - * @param type The type of this {@link CreateBatchDefaultResponse} - * @return The same instance of this {@link CreateBatchDefaultResponse} class + * @param type The type of this {@link GetResponseDefaultResponse} + * @return The same instance of this {@link GetResponseDefaultResponse} class */ @Nonnull - public CreateBatchDefaultResponse type(@Nonnull final String type) { + public GetResponseDefaultResponse type(@Nonnull final String type) { this.type = type; return this; } @@ -158,7 +155,7 @@ public CreateBatchDefaultResponse type(@Nonnull final String type) { /** * Get type * - * @return type The type of this {@link CreateBatchDefaultResponse} instance. + * @return type The type of this {@link GetResponseDefaultResponse} instance. */ @Nonnull public String getType() { @@ -166,48 +163,16 @@ public String getType() { } /** - * Set the type of this {@link CreateBatchDefaultResponse} instance. + * Set the type of this {@link GetResponseDefaultResponse} instance. * - * @param type The type of this {@link CreateBatchDefaultResponse} + * @param type The type of this {@link GetResponseDefaultResponse} */ public void setType(@Nonnull final String type) { this.type = type; } /** - * Set the innerError of this {@link CreateBatchDefaultResponse} instance and return the same - * instance. - * - * @param innerError The innerError of this {@link CreateBatchDefaultResponse} - * @return The same instance of this {@link CreateBatchDefaultResponse} class - */ - @Nonnull - public CreateBatchDefaultResponse innerError(@Nullable final Object innerError) { - this.innerError = innerError; - return this; - } - - /** - * Get innerError - * - * @return innerError The innerError of this {@link CreateBatchDefaultResponse} instance. - */ - @Nullable - public Object getInnerError() { - return innerError; - } - - /** - * Set the innerError of this {@link CreateBatchDefaultResponse} instance. - * - * @param innerError The innerError of this {@link CreateBatchDefaultResponse} - */ - public void setInnerError(@Nullable final Object innerError) { - this.innerError = innerError; - } - - /** - * Get the names of the unrecognizable properties of the {@link CreateBatchDefaultResponse}. + * Get the names of the unrecognizable properties of the {@link GetResponseDefaultResponse}. * * @return The set of properties names */ @@ -218,7 +183,7 @@ public Set getCustomFieldNames() { } /** - * Get the value of an unrecognizable property of this {@link CreateBatchDefaultResponse} + * Get the value of an unrecognizable property of this {@link GetResponseDefaultResponse} * instance. * * @deprecated Use {@link #toMap()} instead. @@ -231,13 +196,13 @@ public Set getCustomFieldNames() { public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { if (!cloudSdkCustomFields.containsKey(name)) { throw new NoSuchElementException( - "CreateBatchDefaultResponse has no field with name '" + name + "'."); + "GetResponseDefaultResponse has no field with name '" + name + "'."); } return cloudSdkCustomFields.get(name); } /** - * Get the value of all properties of this {@link CreateBatchDefaultResponse} instance including + * Get the value of all properties of this {@link GetResponseDefaultResponse} instance including * unrecognized properties. * * @return The map of all properties @@ -250,12 +215,11 @@ public Map toMap() { if (message != null) declaredFields.put("message", message); if (param != null) declaredFields.put("param", param); if (type != null) declaredFields.put("type", type); - if (innerError != null) declaredFields.put("innerError", innerError); return declaredFields; } /** - * Set an unrecognizable property of this {@link CreateBatchDefaultResponse} instance. If the map + * Set an unrecognizable property of this {@link GetResponseDefaultResponse} instance. If the map * previously contained a mapping for the key, the old value is replaced by the specified value. * * @param customFieldName The name of the property @@ -274,31 +238,29 @@ public boolean equals(@Nullable final java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - final CreateBatchDefaultResponse createBatchDefaultResponse = (CreateBatchDefaultResponse) o; + final GetResponseDefaultResponse getResponseDefaultResponse = (GetResponseDefaultResponse) o; return Objects.equals( - this.cloudSdkCustomFields, createBatchDefaultResponse.cloudSdkCustomFields) - && Objects.equals(this.code, createBatchDefaultResponse.code) - && Objects.equals(this.message, createBatchDefaultResponse.message) - && Objects.equals(this.param, createBatchDefaultResponse.param) - && Objects.equals(this.type, createBatchDefaultResponse.type) - && Objects.equals(this.innerError, createBatchDefaultResponse.innerError); + this.cloudSdkCustomFields, getResponseDefaultResponse.cloudSdkCustomFields) + && Objects.equals(this.code, getResponseDefaultResponse.code) + && Objects.equals(this.message, getResponseDefaultResponse.message) + && Objects.equals(this.param, getResponseDefaultResponse.param) + && Objects.equals(this.type, getResponseDefaultResponse.type); } @Override public int hashCode() { - return Objects.hash(code, message, param, type, innerError, cloudSdkCustomFields); + return Objects.hash(code, message, param, type, cloudSdkCustomFields); } @Override @Nonnull public String toString() { final StringBuilder sb = new StringBuilder(); - sb.append("class CreateBatchDefaultResponse {\n"); + sb.append("class GetResponseDefaultResponse {\n"); sb.append(" code: ").append(toIndentedString(code)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" param: ").append(toIndentedString(param)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" innerError: ").append(toIndentedString(innerError)).append("\n"); cloudSdkCustomFields.forEach( (k, v) -> sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); @@ -318,14 +280,14 @@ private String toIndentedString(final java.lang.Object o) { /** * Create a type-safe, fluent-api builder object to construct a new {@link - * CreateBatchDefaultResponse} instance with all required arguments. + * GetResponseDefaultResponse} instance with all required arguments. */ public static Builder create() { return (code) -> (message) -> (param) -> (type) -> - new CreateBatchDefaultResponse() + new GetResponseDefaultResponse() .code(code) .message(message) .param(param) @@ -335,10 +297,10 @@ public static Builder create() { /** Builder helper class. */ public interface Builder { /** - * Set the code of this {@link CreateBatchDefaultResponse} instance. + * Set the code of this {@link GetResponseDefaultResponse} instance. * - * @param code The code of this {@link CreateBatchDefaultResponse} - * @return The CreateBatchDefaultResponse builder. + * @param code The code of this {@link GetResponseDefaultResponse} + * @return The GetResponseDefaultResponse builder. */ Builder1 code(@Nullable final String code); } @@ -346,10 +308,10 @@ public interface Builder { /** Builder helper class. */ public interface Builder1 { /** - * Set the message of this {@link CreateBatchDefaultResponse} instance. + * Set the message of this {@link GetResponseDefaultResponse} instance. * - * @param message The message of this {@link CreateBatchDefaultResponse} - * @return The CreateBatchDefaultResponse builder. + * @param message The message of this {@link GetResponseDefaultResponse} + * @return The GetResponseDefaultResponse builder. */ Builder2 message(@Nonnull final String message); } @@ -357,10 +319,10 @@ public interface Builder1 { /** Builder helper class. */ public interface Builder2 { /** - * Set the param of this {@link CreateBatchDefaultResponse} instance. + * Set the param of this {@link GetResponseDefaultResponse} instance. * - * @param param The param of this {@link CreateBatchDefaultResponse} - * @return The CreateBatchDefaultResponse builder. + * @param param The param of this {@link GetResponseDefaultResponse} + * @return The GetResponseDefaultResponse builder. */ Builder3 param(@Nullable final String param); } @@ -368,11 +330,11 @@ public interface Builder2 { /** Builder helper class. */ public interface Builder3 { /** - * Set the type of this {@link CreateBatchDefaultResponse} instance. + * Set the type of this {@link GetResponseDefaultResponse} instance. * - * @param type The type of this {@link CreateBatchDefaultResponse} - * @return The CreateBatchDefaultResponse instance. + * @param type The type of this {@link GetResponseDefaultResponse} + * @return The GetResponseDefaultResponse instance. */ - CreateBatchDefaultResponse type(@Nonnull final String type); + GetResponseDefaultResponse type(@Nonnull final String type); } } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java new file mode 100644 index 000000000..16b39d11a --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java @@ -0,0 +1,188 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** An annotation that applies to a span of output text. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAIAnnotation +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIAnnotationType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIAnnotation. */ + protected OpenAIAnnotation() {} + + /** + * Set the type of this {@link OpenAIAnnotation} instance and return the same instance. + * + * @param type The type of this {@link OpenAIAnnotation} + * @return The same instance of this {@link OpenAIAnnotation} class + */ + @Nonnull + public OpenAIAnnotation type(@Nonnull final OpenAIAnnotationType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIAnnotation} instance. + */ + @Nonnull + public OpenAIAnnotationType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIAnnotation} instance. + * + * @param type The type of this {@link OpenAIAnnotation} + */ + public void setType(@Nonnull final OpenAIAnnotationType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIAnnotation}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIAnnotation} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIAnnotation has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIAnnotation} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIAnnotation} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIAnnotation openAIAnnotation = (OpenAIAnnotation) o; + return Objects.equals(this.cloudSdkCustomFields, openAIAnnotation.cloudSdkCustomFields) + && Objects.equals(this.type, openAIAnnotation.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIAnnotation {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIAnnotation} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIAnnotation().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIAnnotation} instance. + * + * @param type The type of this {@link OpenAIAnnotation} + * @return The OpenAIAnnotation instance. + */ + OpenAIAnnotation type(@Nonnull final OpenAIAnnotationType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java new file mode 100644 index 000000000..4b3b6b9cc --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIAnnotationType */ +public interface OpenAIAnnotationType { + /** Helper class to create {@code String } that implements {@link OpenAIAnnotationType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIAnnotationType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java new file mode 100644 index 000000000..a87eb8cfc --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java @@ -0,0 +1,58 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** + * The conversation that this response belongs to. Items from this conversation are prepended to + * `input_items` for this response request. Input items and output items from this + * response are automatically added to this conversation after this response completes. + */ +public interface OpenAIConversationParam { + /** + * Helper class to create {@code OpenAIConversationParam2 } that implements {@link + * OpenAIConversationParam}. + */ + record InnerOpenAIConversationParam2( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull OpenAIConversationParam2 value) + implements OpenAIConversationParam {} + + /** + * Creator to enable deserialization of {@code OpenAIConversationParam2 }. + * + * @param val the value to use + * @return a new instance of {@link InnerOpenAIConversationParam2}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerOpenAIConversationParam2 createInnerOpenAIConversationParam2( + @Nonnull final OpenAIConversationParam2 val) { + return new InnerOpenAIConversationParam2(val); + } + + /** Helper class to create {@code String } that implements {@link OpenAIConversationParam}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIConversationParam {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java new file mode 100644 index 000000000..2e8405959 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java @@ -0,0 +1,185 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** The conversation that this response belongs to. */ +// CHECKSTYLE:OFF +public class OpenAIConversationParam2 +// CHECKSTYLE:ON +{ + @JsonProperty("id") + private String id; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIConversationParam2. */ + protected OpenAIConversationParam2() {} + + /** + * Set the id of this {@link OpenAIConversationParam2} instance and return the same instance. + * + * @param id The unique ID of the conversation. + * @return The same instance of this {@link OpenAIConversationParam2} class + */ + @Nonnull + public OpenAIConversationParam2 id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * The unique ID of the conversation. + * + * @return id The id of this {@link OpenAIConversationParam2} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link OpenAIConversationParam2} instance. + * + * @param id The unique ID of the conversation. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIConversationParam2}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIConversationParam2} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIConversationParam2 has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIConversationParam2} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (id != null) declaredFields.put("id", id); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIConversationParam2} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIConversationParam2 openAIConversationParam2 = (OpenAIConversationParam2) o; + return Objects.equals(this.cloudSdkCustomFields, openAIConversationParam2.cloudSdkCustomFields) + && Objects.equals(this.id, openAIConversationParam2.id); + } + + @Override + public int hashCode() { + return Objects.hash(id, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIConversationParam2 {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIConversationParam2} instance with all required arguments. + */ + public static Builder create() { + return (id) -> new OpenAIConversationParam2().id(id); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link OpenAIConversationParam2} instance. + * + * @param id The unique ID of the conversation. + * @return The OpenAIConversationParam2 instance. + */ + OpenAIConversationParam2 id(@Nonnull final String id); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java new file mode 100644 index 000000000..f0f0bddd8 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java @@ -0,0 +1,1392 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAICreateResponse */ +// CHECKSTYLE:OFF +public class OpenAICreateResponse +// CHECKSTYLE:ON +{ + @JsonProperty("metadata") + private Object metadata; + + @JsonProperty("top_logprobs") + private Integer topLogprobs; + + @JsonProperty("temperature") + private BigDecimal temperature; + + @JsonProperty("top_p") + private BigDecimal topP; + + @JsonProperty("user") + private String user; + + @JsonProperty("safety_identifier") + private String safetyIdentifier; + + @JsonProperty("prompt_cache_key") + private String promptCacheKey; + + /** Gets or Sets promptCacheRetention */ + public enum PromptCacheRetentionEnum { + /** The IN_MEMORY option of this OpenAICreateResponse */ + IN_MEMORY("in-memory"), + + /** The _24H option of this OpenAICreateResponse */ + _24H("24h"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAICreateResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PromptCacheRetentionEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAICreateResponse + */ + @JsonCreator + @Nullable + public static PromptCacheRetentionEnum fromValue(@Nonnull final String value) { + for (PromptCacheRetentionEnum b : PromptCacheRetentionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("prompt_cache_retention") + private PromptCacheRetentionEnum promptCacheRetention; + + @JsonProperty("previous_response_id") + private String previousResponseId; + + @JsonProperty("model") + private String model; + + @JsonProperty("reasoning") + private OpenAIReasoning reasoning; + + @JsonProperty("background") + private Boolean background; + + @JsonProperty("max_output_tokens") + private Integer maxOutputTokens; + + @JsonProperty("max_tool_calls") + private Integer maxToolCalls; + + @JsonProperty("text") + private OpenAIResponseTextParam text; + + @JsonProperty("tools") + private List tools; + + @JsonProperty("tool_choice") + private OpenAIToolChoiceParam toolChoice; + + @JsonProperty("prompt") + private OpenAIPrompt prompt; + + /** Gets or Sets truncation */ + public enum TruncationEnum { + /** The AUTO option of this OpenAICreateResponse */ + AUTO("auto"), + + /** The DISABLED option of this OpenAICreateResponse */ + DISABLED("disabled"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAICreateResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TruncationEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAICreateResponse + */ + @JsonCreator + @Nullable + public static TruncationEnum fromValue(@Nonnull final String value) { + for (TruncationEnum b : TruncationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("truncation") + private TruncationEnum truncation; + + @JsonProperty("input") + private OpenAIInputParam input; + + @JsonProperty("include") + private List include; + + @JsonProperty("parallel_tool_calls") + private Boolean parallelToolCalls; + + @JsonProperty("store") + private Boolean store; + + @JsonProperty("instructions") + private String instructions; + + @JsonProperty("stream") + private Boolean stream; + + @JsonProperty("stream_options") + private OpenAIResponseStreamOptions streamOptions; + + @JsonProperty("conversation") + private OpenAIConversationParam conversation; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAICreateResponse. */ + protected OpenAICreateResponse() {} + + /** + * Set the metadata of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and querying + * for objects via API or the dashboard. Keys are strings with a maximum length of 64 + * characters. Values are strings with a maximum length of 512 characters. + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse metadata(@Nullable final Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing + * additional information about the object in a structured format, and querying for objects via + * API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are + * strings with a maximum length of 512 characters. + * + * @return metadata The metadata of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Object getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link OpenAICreateResponse} instance. + * + * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and querying + * for objects via API or the dashboard. Keys are strings with a maximum length of 64 + * characters. Values are strings with a maximum length of 512 characters. + */ + public void setMetadata(@Nullable final Object metadata) { + this.metadata = metadata; + } + + /** + * Set the topLogprobs of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param topLogprobs The topLogprobs of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse topLogprobs(@Nullable final Integer topLogprobs) { + this.topLogprobs = topLogprobs; + return this; + } + + /** + * Get topLogprobs + * + * @return topLogprobs The topLogprobs of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Integer getTopLogprobs() { + return topLogprobs; + } + + /** + * Set the topLogprobs of this {@link OpenAICreateResponse} instance. + * + * @param topLogprobs The topLogprobs of this {@link OpenAICreateResponse} + */ + public void setTopLogprobs(@Nullable final Integer topLogprobs) { + this.topLogprobs = topLogprobs; + } + + /** + * Set the temperature of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param temperature The temperature of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse temperature(@Nullable final BigDecimal temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get temperature + * + * @return temperature The temperature of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public BigDecimal getTemperature() { + return temperature; + } + + /** + * Set the temperature of this {@link OpenAICreateResponse} instance. + * + * @param temperature The temperature of this {@link OpenAICreateResponse} + */ + public void setTemperature(@Nullable final BigDecimal temperature) { + this.temperature = temperature; + } + + /** + * Set the topP of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param topP The topP of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse topP(@Nullable final BigDecimal topP) { + this.topP = topP; + return this; + } + + /** + * Get topP + * + * @return topP The topP of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public BigDecimal getTopP() { + return topP; + } + + /** + * Set the topP of this {@link OpenAICreateResponse} instance. + * + * @param topP The topP of this {@link OpenAICreateResponse} + */ + public void setTopP(@Nullable final BigDecimal topP) { + this.topP = topP; + } + + /** + * Set the user of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param user This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by + * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse user(@Nullable final String user) { + this.user = user; + return this; + } + + /** + * This field is being replaced by `safety_identifier` and `prompt_cache_key`. + * Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier + * for your end-users. Used to boost cache hit rates by better bucketing similar requests and to + * help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * @return user The user of this {@link OpenAICreateResponse} instance. + * @deprecated + */ + @Deprecated + @Nonnull + public String getUser() { + return user; + } + + /** + * Set the user of this {@link OpenAICreateResponse} instance. + * + * @param user This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by + * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + public void setUser(@Nullable final String user) { + this.user = user; + } + + /** + * Set the safetyIdentifier of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param safetyIdentifier A stable identifier used to help detect users of your application that + * may be violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in order to + * avoid sending us any identifying information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse safetyIdentifier(@Nullable final String safetyIdentifier) { + this.safetyIdentifier = safetyIdentifier; + return this; + } + + /** + * A stable identifier used to help detect users of your application that may be violating + * OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We + * recommend hashing their username or email address, in order to avoid sending us any identifying + * information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * @return safetyIdentifier The safetyIdentifier of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public String getSafetyIdentifier() { + return safetyIdentifier; + } + + /** + * Set the safetyIdentifier of this {@link OpenAICreateResponse} instance. + * + * @param safetyIdentifier A stable identifier used to help detect users of your application that + * may be violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in order to + * avoid sending us any identifying information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + public void setSafetyIdentifier(@Nullable final String safetyIdentifier) { + this.safetyIdentifier = safetyIdentifier; + } + + /** + * Set the promptCacheKey of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your + * cache hit rates. Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse promptCacheKey(@Nullable final String promptCacheKey) { + this.promptCacheKey = promptCacheKey; + return this; + } + + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + * Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + * + * @return promptCacheKey The promptCacheKey of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public String getPromptCacheKey() { + return promptCacheKey; + } + + /** + * Set the promptCacheKey of this {@link OpenAICreateResponse} instance. + * + * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your + * cache hit rates. Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + */ + public void setPromptCacheKey(@Nullable final String promptCacheKey) { + this.promptCacheKey = promptCacheKey; + } + + /** + * Set the promptCacheRetention of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param promptCacheRetention The promptCacheRetention of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse promptCacheRetention( + @Nullable final PromptCacheRetentionEnum promptCacheRetention) { + this.promptCacheRetention = promptCacheRetention; + return this; + } + + /** + * Get promptCacheRetention + * + * @return promptCacheRetention The promptCacheRetention of this {@link OpenAICreateResponse} + * instance. + */ + @Nullable + public PromptCacheRetentionEnum getPromptCacheRetention() { + return promptCacheRetention; + } + + /** + * Set the promptCacheRetention of this {@link OpenAICreateResponse} instance. + * + * @param promptCacheRetention The promptCacheRetention of this {@link OpenAICreateResponse} + */ + public void setPromptCacheRetention( + @Nullable final PromptCacheRetentionEnum promptCacheRetention) { + this.promptCacheRetention = promptCacheRetention; + } + + /** + * Set the previousResponseId of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param previousResponseId The previousResponseId of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse previousResponseId(@Nullable final String previousResponseId) { + this.previousResponseId = previousResponseId; + return this; + } + + /** + * Get previousResponseId + * + * @return previousResponseId The previousResponseId of this {@link OpenAICreateResponse} + * instance. + */ + @Nullable + public String getPreviousResponseId() { + return previousResponseId; + } + + /** + * Set the previousResponseId of this {@link OpenAICreateResponse} instance. + * + * @param previousResponseId The previousResponseId of this {@link OpenAICreateResponse} + */ + public void setPreviousResponseId(@Nullable final String previousResponseId) { + this.previousResponseId = previousResponseId; + } + + /** + * Set the model of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. + * OpenAI offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model + * guide](https://platform.openai.com/docs/models) to browse and compare available models. + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse model(@Nullable final String model) { + this.model = model; + return this; + } + + /** + * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + * offers a wide range of models with different capabilities, performance characteristics, and + * price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and + * compare available models. + * + * @return model The model of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public String getModel() { + return model; + } + + /** + * Set the model of this {@link OpenAICreateResponse} instance. + * + * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. + * OpenAI offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model + * guide](https://platform.openai.com/docs/models) to browse and compare available models. + */ + public void setModel(@Nullable final String model) { + this.model = model; + } + + /** + * Set the reasoning of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param reasoning The reasoning of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse reasoning(@Nullable final OpenAIReasoning reasoning) { + this.reasoning = reasoning; + return this; + } + + /** + * Get reasoning + * + * @return reasoning The reasoning of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public OpenAIReasoning getReasoning() { + return reasoning; + } + + /** + * Set the reasoning of this {@link OpenAICreateResponse} instance. + * + * @param reasoning The reasoning of this {@link OpenAICreateResponse} + */ + public void setReasoning(@Nullable final OpenAIReasoning reasoning) { + this.reasoning = reasoning; + } + + /** + * Set the background of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param background The background of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse background(@Nullable final Boolean background) { + this.background = background; + return this; + } + + /** + * Get background + * + * @return background The background of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Boolean isBackground() { + return background; + } + + /** + * Set the background of this {@link OpenAICreateResponse} instance. + * + * @param background The background of this {@link OpenAICreateResponse} + */ + public void setBackground(@Nullable final Boolean background) { + this.background = background; + } + + /** + * Set the maxOutputTokens of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param maxOutputTokens The maxOutputTokens of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse maxOutputTokens(@Nullable final Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + return this; + } + + /** + * Get maxOutputTokens + * + * @return maxOutputTokens The maxOutputTokens of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Integer getMaxOutputTokens() { + return maxOutputTokens; + } + + /** + * Set the maxOutputTokens of this {@link OpenAICreateResponse} instance. + * + * @param maxOutputTokens The maxOutputTokens of this {@link OpenAICreateResponse} + */ + public void setMaxOutputTokens(@Nullable final Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + } + + /** + * Set the maxToolCalls of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param maxToolCalls The maxToolCalls of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse maxToolCalls(@Nullable final Integer maxToolCalls) { + this.maxToolCalls = maxToolCalls; + return this; + } + + /** + * Get maxToolCalls + * + * @return maxToolCalls The maxToolCalls of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Integer getMaxToolCalls() { + return maxToolCalls; + } + + /** + * Set the maxToolCalls of this {@link OpenAICreateResponse} instance. + * + * @param maxToolCalls The maxToolCalls of this {@link OpenAICreateResponse} + */ + public void setMaxToolCalls(@Nullable final Integer maxToolCalls) { + this.maxToolCalls = maxToolCalls; + } + + /** + * Set the text of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param text The text of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse text(@Nullable final OpenAIResponseTextParam text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public OpenAIResponseTextParam getText() { + return text; + } + + /** + * Set the text of this {@link OpenAICreateResponse} instance. + * + * @param text The text of this {@link OpenAICreateResponse} + */ + public void setText(@Nullable final OpenAIResponseTextParam text) { + this.text = text; + } + + /** + * Set the tools of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param tools An array of tools the model may call while generating a response. You can specify + * which tool to use by setting the `tool_choice` parameter. The two categories of + * tools you can provide the model are: - **Built-in tools**: Tools that are provided by + * OpenAI that extend the model's capabilities, like file search. - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own + * code. + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse tools(@Nullable final List tools) { + this.tools = tools; + return this; + } + + /** + * Add one tools instance to this {@link OpenAICreateResponse}. + * + * @param toolsItem The tools that should be added + * @return The same instance of type {@link OpenAICreateResponse} + */ + @Nonnull + public OpenAICreateResponse addToolsItem(@Nonnull final OpenAITool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * An array of tools the model may call while generating a response. You can specify which tool to + * use by setting the `tool_choice` parameter. The two categories of tools you can + * provide the model are: - **Built-in tools**: Tools that are provided by OpenAI that extend the + * model's capabilities, like file search. - **Function calls (custom tools)**: Functions that + * are defined by you, enabling the model to call your own code. + * + * @return tools The tools of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public List getTools() { + return tools; + } + + /** + * Set the tools of this {@link OpenAICreateResponse} instance. + * + * @param tools An array of tools the model may call while generating a response. You can specify + * which tool to use by setting the `tool_choice` parameter. The two categories of + * tools you can provide the model are: - **Built-in tools**: Tools that are provided by + * OpenAI that extend the model's capabilities, like file search. - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own + * code. + */ + public void setTools(@Nullable final List tools) { + this.tools = tools; + } + + /** + * Set the toolChoice of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param toolChoice The toolChoice of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse toolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get toolChoice + * + * @return toolChoice The toolChoice of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public OpenAIToolChoiceParam getToolChoice() { + return toolChoice; + } + + /** + * Set the toolChoice of this {@link OpenAICreateResponse} instance. + * + * @param toolChoice The toolChoice of this {@link OpenAICreateResponse} + */ + public void setToolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { + this.toolChoice = toolChoice; + } + + /** + * Set the prompt of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param prompt The prompt of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse prompt(@Nullable final OpenAIPrompt prompt) { + this.prompt = prompt; + return this; + } + + /** + * Get prompt + * + * @return prompt The prompt of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public OpenAIPrompt getPrompt() { + return prompt; + } + + /** + * Set the prompt of this {@link OpenAICreateResponse} instance. + * + * @param prompt The prompt of this {@link OpenAICreateResponse} + */ + public void setPrompt(@Nullable final OpenAIPrompt prompt) { + this.prompt = prompt; + } + + /** + * Set the truncation of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param truncation The truncation of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse truncation(@Nullable final TruncationEnum truncation) { + this.truncation = truncation; + return this; + } + + /** + * Get truncation + * + * @return truncation The truncation of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public TruncationEnum getTruncation() { + return truncation; + } + + /** + * Set the truncation of this {@link OpenAICreateResponse} instance. + * + * @param truncation The truncation of this {@link OpenAICreateResponse} + */ + public void setTruncation(@Nullable final TruncationEnum truncation) { + this.truncation = truncation; + } + + /** + * Set the input of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param input The input of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse input(@Nullable final OpenAIInputParam input) { + this.input = input; + return this; + } + + /** + * Get input + * + * @return input The input of this {@link OpenAICreateResponse} instance. + */ + @Nonnull + public OpenAIInputParam getInput() { + return input; + } + + /** + * Set the input of this {@link OpenAICreateResponse} instance. + * + * @param input The input of this {@link OpenAICreateResponse} + */ + public void setInput(@Nullable final OpenAIInputParam input) { + this.input = input; + } + + /** + * Set the include of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param include The include of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse include(@Nullable final List include) { + this.include = include; + return this; + } + + /** + * Add one include instance to this {@link OpenAICreateResponse}. + * + * @param includeItem The include that should be added + * @return The same instance of type {@link OpenAICreateResponse} + */ + @Nonnull + public OpenAICreateResponse addIncludeItem(@Nonnull final OpenAIIncludeEnum includeItem) { + if (this.include == null) { + this.include = new ArrayList<>(); + } + this.include.add(includeItem); + return this; + } + + /** + * Get include + * + * @return include The include of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public List getInclude() { + return include; + } + + /** + * Set the include of this {@link OpenAICreateResponse} instance. + * + * @param include The include of this {@link OpenAICreateResponse} + */ + public void setInclude(@Nullable final List include) { + this.include = include; + } + + /** + * Set the parallelToolCalls of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param parallelToolCalls The parallelToolCalls of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse parallelToolCalls(@Nullable final Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + return this; + } + + /** + * Get parallelToolCalls + * + * @return parallelToolCalls The parallelToolCalls of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Boolean isParallelToolCalls() { + return parallelToolCalls; + } + + /** + * Set the parallelToolCalls of this {@link OpenAICreateResponse} instance. + * + * @param parallelToolCalls The parallelToolCalls of this {@link OpenAICreateResponse} + */ + public void setParallelToolCalls(@Nullable final Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + } + + /** + * Set the store of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param store The store of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse store(@Nullable final Boolean store) { + this.store = store; + return this; + } + + /** + * Get store + * + * @return store The store of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Boolean isStore() { + return store; + } + + /** + * Set the store of this {@link OpenAICreateResponse} instance. + * + * @param store The store of this {@link OpenAICreateResponse} + */ + public void setStore(@Nullable final Boolean store) { + this.store = store; + } + + /** + * Set the instructions of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param instructions The instructions of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse instructions(@Nullable final String instructions) { + this.instructions = instructions; + return this; + } + + /** + * Get instructions + * + * @return instructions The instructions of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public String getInstructions() { + return instructions; + } + + /** + * Set the instructions of this {@link OpenAICreateResponse} instance. + * + * @param instructions The instructions of this {@link OpenAICreateResponse} + */ + public void setInstructions(@Nullable final String instructions) { + this.instructions = instructions; + } + + /** + * Set the stream of this {@link OpenAICreateResponse} instance and return the same instance. + * + * @param stream The stream of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse stream(@Nullable final Boolean stream) { + this.stream = stream; + return this; + } + + /** + * Get stream + * + * @return stream The stream of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public Boolean isStream() { + return stream; + } + + /** + * Set the stream of this {@link OpenAICreateResponse} instance. + * + * @param stream The stream of this {@link OpenAICreateResponse} + */ + public void setStream(@Nullable final Boolean stream) { + this.stream = stream; + } + + /** + * Set the streamOptions of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param streamOptions The streamOptions of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse streamOptions( + @Nullable final OpenAIResponseStreamOptions streamOptions) { + this.streamOptions = streamOptions; + return this; + } + + /** + * Get streamOptions + * + * @return streamOptions The streamOptions of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public OpenAIResponseStreamOptions getStreamOptions() { + return streamOptions; + } + + /** + * Set the streamOptions of this {@link OpenAICreateResponse} instance. + * + * @param streamOptions The streamOptions of this {@link OpenAICreateResponse} + */ + public void setStreamOptions(@Nullable final OpenAIResponseStreamOptions streamOptions) { + this.streamOptions = streamOptions; + } + + /** + * Set the conversation of this {@link OpenAICreateResponse} instance and return the same + * instance. + * + * @param conversation The conversation of this {@link OpenAICreateResponse} + * @return The same instance of this {@link OpenAICreateResponse} class + */ + @Nonnull + public OpenAICreateResponse conversation(@Nullable final OpenAIConversationParam conversation) { + this.conversation = conversation; + return this; + } + + /** + * Get conversation + * + * @return conversation The conversation of this {@link OpenAICreateResponse} instance. + */ + @Nullable + public OpenAIConversationParam getConversation() { + return conversation; + } + + /** + * Set the conversation of this {@link OpenAICreateResponse} instance. + * + * @param conversation The conversation of this {@link OpenAICreateResponse} + */ + public void setConversation(@Nullable final OpenAIConversationParam conversation) { + this.conversation = conversation; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAICreateResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAICreateResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAICreateResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAICreateResponse} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (metadata != null) declaredFields.put("metadata", metadata); + if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); + if (temperature != null) declaredFields.put("temperature", temperature); + if (topP != null) declaredFields.put("topP", topP); + if (user != null) declaredFields.put("user", user); + if (safetyIdentifier != null) declaredFields.put("safetyIdentifier", safetyIdentifier); + if (promptCacheKey != null) declaredFields.put("promptCacheKey", promptCacheKey); + if (promptCacheRetention != null) + declaredFields.put("promptCacheRetention", promptCacheRetention); + if (previousResponseId != null) declaredFields.put("previousResponseId", previousResponseId); + if (model != null) declaredFields.put("model", model); + if (reasoning != null) declaredFields.put("reasoning", reasoning); + if (background != null) declaredFields.put("background", background); + if (maxOutputTokens != null) declaredFields.put("maxOutputTokens", maxOutputTokens); + if (maxToolCalls != null) declaredFields.put("maxToolCalls", maxToolCalls); + if (text != null) declaredFields.put("text", text); + if (tools != null) declaredFields.put("tools", tools); + if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); + if (prompt != null) declaredFields.put("prompt", prompt); + if (truncation != null) declaredFields.put("truncation", truncation); + if (input != null) declaredFields.put("input", input); + if (include != null) declaredFields.put("include", include); + if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); + if (store != null) declaredFields.put("store", store); + if (instructions != null) declaredFields.put("instructions", instructions); + if (stream != null) declaredFields.put("stream", stream); + if (streamOptions != null) declaredFields.put("streamOptions", streamOptions); + if (conversation != null) declaredFields.put("conversation", conversation); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAICreateResponse} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAICreateResponse openAICreateResponse = (OpenAICreateResponse) o; + return Objects.equals(this.cloudSdkCustomFields, openAICreateResponse.cloudSdkCustomFields) + && Objects.equals(this.metadata, openAICreateResponse.metadata) + && Objects.equals(this.topLogprobs, openAICreateResponse.topLogprobs) + && Objects.equals(this.temperature, openAICreateResponse.temperature) + && Objects.equals(this.topP, openAICreateResponse.topP) + && Objects.equals(this.user, openAICreateResponse.user) + && Objects.equals(this.safetyIdentifier, openAICreateResponse.safetyIdentifier) + && Objects.equals(this.promptCacheKey, openAICreateResponse.promptCacheKey) + && Objects.equals(this.promptCacheRetention, openAICreateResponse.promptCacheRetention) + && Objects.equals(this.previousResponseId, openAICreateResponse.previousResponseId) + && Objects.equals(this.model, openAICreateResponse.model) + && Objects.equals(this.reasoning, openAICreateResponse.reasoning) + && Objects.equals(this.background, openAICreateResponse.background) + && Objects.equals(this.maxOutputTokens, openAICreateResponse.maxOutputTokens) + && Objects.equals(this.maxToolCalls, openAICreateResponse.maxToolCalls) + && Objects.equals(this.text, openAICreateResponse.text) + && Objects.equals(this.tools, openAICreateResponse.tools) + && Objects.equals(this.toolChoice, openAICreateResponse.toolChoice) + && Objects.equals(this.prompt, openAICreateResponse.prompt) + && Objects.equals(this.truncation, openAICreateResponse.truncation) + && Objects.equals(this.input, openAICreateResponse.input) + && Objects.equals(this.include, openAICreateResponse.include) + && Objects.equals(this.parallelToolCalls, openAICreateResponse.parallelToolCalls) + && Objects.equals(this.store, openAICreateResponse.store) + && Objects.equals(this.instructions, openAICreateResponse.instructions) + && Objects.equals(this.stream, openAICreateResponse.stream) + && Objects.equals(this.streamOptions, openAICreateResponse.streamOptions) + && Objects.equals(this.conversation, openAICreateResponse.conversation); + } + + @Override + public int hashCode() { + return Objects.hash( + metadata, + topLogprobs, + temperature, + topP, + user, + safetyIdentifier, + promptCacheKey, + promptCacheRetention, + previousResponseId, + model, + reasoning, + background, + maxOutputTokens, + maxToolCalls, + text, + tools, + toolChoice, + prompt, + truncation, + input, + include, + parallelToolCalls, + store, + instructions, + stream, + streamOptions, + conversation, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAICreateResponse {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" safetyIdentifier: ").append(toIndentedString(safetyIdentifier)).append("\n"); + sb.append(" promptCacheKey: ").append(toIndentedString(promptCacheKey)).append("\n"); + sb.append(" promptCacheRetention: ") + .append(toIndentedString(promptCacheRetention)) + .append("\n"); + sb.append(" previousResponseId: ").append(toIndentedString(previousResponseId)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" reasoning: ").append(toIndentedString(reasoning)).append("\n"); + sb.append(" background: ").append(toIndentedString(background)).append("\n"); + sb.append(" maxOutputTokens: ").append(toIndentedString(maxOutputTokens)).append("\n"); + sb.append(" maxToolCalls: ").append(toIndentedString(maxToolCalls)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); + sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); + sb.append(" truncation: ").append(toIndentedString(truncation)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).append("\n"); + sb.append(" include: ").append(toIndentedString(include)).append("\n"); + sb.append(" parallelToolCalls: ").append(toIndentedString(parallelToolCalls)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" stream: ").append(toIndentedString(stream)).append("\n"); + sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).append("\n"); + sb.append(" conversation: ").append(toIndentedString(conversation)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link OpenAICreateResponse} instance. No arguments are required. */ + public static OpenAICreateResponse create() { + return new OpenAICreateResponse(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java new file mode 100644 index 000000000..4432e8024 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java @@ -0,0 +1,66 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import javax.annotation.Nonnull; + +/** Gets or Sets OpenAI.ImageDetail */ +public enum OpenAIImageDetail { + LOW("low"), + + HIGH("high"), + + AUTO("auto"), + + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private final String value; + + OpenAIImageDetail(String value) { + this.value = value; + } + + /** + * @return The enum value. + */ + @JsonValue + public String getValue() { + return value; + } + + /** + * @return The String representation of the enum value. + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Converts the given value to its enum representation. + * + * @param value The input value. + * @return The enum representation of the given value. + */ + @JsonCreator + public static OpenAIImageDetail fromValue(@Nonnull final String value) { + for (final OpenAIImageDetail b : OpenAIImageDetail.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java new file mode 100644 index 000000000..8c9f26225 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java @@ -0,0 +1,46 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** + * Specify additional output data to include in the model response. Currently supported values are: + * - `web_search_call.action.sources`: Include the sources of the web search tool call. - + * `code_interpreter_call.outputs`: Includes the outputs of python code execution in code + * interpreter tool call items. - `computer_call_output.output.image_url`: Include image + * urls from the computer call output. - `file_search_call.results`: Include the search + * results of the file search tool call. - `message.input_image.image_url`: Include image + * urls from the input message. - `message.output_text.logprobs`: Include logprobs with + * assistant messages. - `reasoning.encrypted_content`: Includes an encrypted version of + * reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn + * conversations when using the Responses API statelessly (like when the `store` parameter + * is set to `false`, or when an organization is enrolled in the zero data retention + * program). + */ +public interface OpenAIIncludeEnum { + /** Helper class to create {@code String } that implements {@link OpenAIIncludeEnum}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIIncludeEnum {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java new file mode 100644 index 000000000..528b535b8 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java @@ -0,0 +1,390 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A file input to the model. */ +// CHECKSTYLE:OFF +public class OpenAIInputFileContent +// CHECKSTYLE:ON +{ + /** The type of the input item. Always `input_file`. */ + public enum TypeEnum { + /** The INPUT_FILE option of this OpenAIInputFileContent */ + INPUT_FILE("input_file"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIInputFileContent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIInputFileContent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type = TypeEnum.INPUT_FILE; + + @JsonProperty("file_id") + private String fileId; + + @JsonProperty("filename") + private String filename; + + @JsonProperty("file_url") + private URI fileUrl; + + @JsonProperty("file_data") + private String fileData; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIInputFileContent. */ + protected OpenAIInputFileContent() {} + + /** + * Set the type of this {@link OpenAIInputFileContent} instance and return the same instance. + * + * @param type The type of the input item. Always `input_file`. + * @return The same instance of this {@link OpenAIInputFileContent} class + */ + @Nonnull + public OpenAIInputFileContent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the input item. Always `input_file`. + * + * @return type The type of this {@link OpenAIInputFileContent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIInputFileContent} instance. + * + * @param type The type of the input item. Always `input_file`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the fileId of this {@link OpenAIInputFileContent} instance and return the same instance. + * + * @param fileId The fileId of this {@link OpenAIInputFileContent} + * @return The same instance of this {@link OpenAIInputFileContent} class + */ + @Nonnull + public OpenAIInputFileContent fileId(@Nullable final String fileId) { + this.fileId = fileId; + return this; + } + + /** + * Get fileId + * + * @return fileId The fileId of this {@link OpenAIInputFileContent} instance. + */ + @Nullable + public String getFileId() { + return fileId; + } + + /** + * Set the fileId of this {@link OpenAIInputFileContent} instance. + * + * @param fileId The fileId of this {@link OpenAIInputFileContent} + */ + public void setFileId(@Nullable final String fileId) { + this.fileId = fileId; + } + + /** + * Set the filename of this {@link OpenAIInputFileContent} instance and return the same instance. + * + * @param filename The name of the file to be sent to the model. + * @return The same instance of this {@link OpenAIInputFileContent} class + */ + @Nonnull + public OpenAIInputFileContent filename(@Nullable final String filename) { + this.filename = filename; + return this; + } + + /** + * The name of the file to be sent to the model. + * + * @return filename The filename of this {@link OpenAIInputFileContent} instance. + */ + @Nonnull + public String getFilename() { + return filename; + } + + /** + * Set the filename of this {@link OpenAIInputFileContent} instance. + * + * @param filename The name of the file to be sent to the model. + */ + public void setFilename(@Nullable final String filename) { + this.filename = filename; + } + + /** + * Set the fileUrl of this {@link OpenAIInputFileContent} instance and return the same instance. + * + * @param fileUrl The URL of the file to be sent to the model. + * @return The same instance of this {@link OpenAIInputFileContent} class + */ + @Nonnull + public OpenAIInputFileContent fileUrl(@Nullable final URI fileUrl) { + this.fileUrl = fileUrl; + return this; + } + + /** + * The URL of the file to be sent to the model. + * + * @return fileUrl The fileUrl of this {@link OpenAIInputFileContent} instance. + */ + @Nonnull + public URI getFileUrl() { + return fileUrl; + } + + /** + * Set the fileUrl of this {@link OpenAIInputFileContent} instance. + * + * @param fileUrl The URL of the file to be sent to the model. + */ + public void setFileUrl(@Nullable final URI fileUrl) { + this.fileUrl = fileUrl; + } + + /** + * Set the fileData of this {@link OpenAIInputFileContent} instance and return the same instance. + * + * @param fileData The content of the file to be sent to the model. + * @return The same instance of this {@link OpenAIInputFileContent} class + */ + @Nonnull + public OpenAIInputFileContent fileData(@Nullable final String fileData) { + this.fileData = fileData; + return this; + } + + /** + * The content of the file to be sent to the model. + * + * @return fileData The fileData of this {@link OpenAIInputFileContent} instance. + */ + @Nonnull + public String getFileData() { + return fileData; + } + + /** + * Set the fileData of this {@link OpenAIInputFileContent} instance. + * + * @param fileData The content of the file to be sent to the model. + */ + public void setFileData(@Nullable final String fileData) { + this.fileData = fileData; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIInputFileContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIInputFileContent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIInputFileContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIInputFileContent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (fileId != null) declaredFields.put("fileId", fileId); + if (filename != null) declaredFields.put("filename", filename); + if (fileUrl != null) declaredFields.put("fileUrl", fileUrl); + if (fileData != null) declaredFields.put("fileData", fileData); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIInputFileContent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIInputFileContent openAIInputFileContent = (OpenAIInputFileContent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIInputFileContent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIInputFileContent.type) + && Objects.equals(this.fileId, openAIInputFileContent.fileId) + && Objects.equals(this.filename, openAIInputFileContent.filename) + && Objects.equals(this.fileUrl, openAIInputFileContent.fileUrl) + && Objects.equals(this.fileData, openAIInputFileContent.fileData); + } + + @Override + public int hashCode() { + return Objects.hash(type, fileId, filename, fileUrl, fileData, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIInputFileContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); + sb.append(" fileData: ").append(toIndentedString(fileData)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIInputFileContent} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIInputFileContent().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIInputFileContent} instance. + * + * @param type The type of the input item. Always `input_file`. + * @return The OpenAIInputFileContent instance. + */ + OpenAIInputFileContent type(@Nonnull final TypeEnum type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java new file mode 100644 index 000000000..8a6c94a82 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java @@ -0,0 +1,371 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URI; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * An image input to the model. Learn about [image + * inputs](https://platform.openai.com/docs/guides/vision). + */ +// CHECKSTYLE:OFF +public class OpenAIInputImageContent +// CHECKSTYLE:ON +{ + /** The type of the input item. Always `input_image`. */ + public enum TypeEnum { + /** The INPUT_IMAGE option of this OpenAIInputImageContent */ + INPUT_IMAGE("input_image"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIInputImageContent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIInputImageContent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type = TypeEnum.INPUT_IMAGE; + + @JsonProperty("image_url") + private URI imageUrl; + + @JsonProperty("file_id") + private String fileId; + + @JsonProperty("detail") + private OpenAIImageDetail detail; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIInputImageContent. */ + protected OpenAIInputImageContent() {} + + /** + * Set the type of this {@link OpenAIInputImageContent} instance and return the same instance. + * + * @param type The type of the input item. Always `input_image`. + * @return The same instance of this {@link OpenAIInputImageContent} class + */ + @Nonnull + public OpenAIInputImageContent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the input item. Always `input_image`. + * + * @return type The type of this {@link OpenAIInputImageContent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIInputImageContent} instance. + * + * @param type The type of the input item. Always `input_image`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the imageUrl of this {@link OpenAIInputImageContent} instance and return the same instance. + * + * @param imageUrl The imageUrl of this {@link OpenAIInputImageContent} + * @return The same instance of this {@link OpenAIInputImageContent} class + */ + @Nonnull + public OpenAIInputImageContent imageUrl(@Nullable final URI imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * + * @return imageUrl The imageUrl of this {@link OpenAIInputImageContent} instance. + */ + @Nullable + public URI getImageUrl() { + return imageUrl; + } + + /** + * Set the imageUrl of this {@link OpenAIInputImageContent} instance. + * + * @param imageUrl The imageUrl of this {@link OpenAIInputImageContent} + */ + public void setImageUrl(@Nullable final URI imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * Set the fileId of this {@link OpenAIInputImageContent} instance and return the same instance. + * + * @param fileId The fileId of this {@link OpenAIInputImageContent} + * @return The same instance of this {@link OpenAIInputImageContent} class + */ + @Nonnull + public OpenAIInputImageContent fileId(@Nullable final String fileId) { + this.fileId = fileId; + return this; + } + + /** + * Get fileId + * + * @return fileId The fileId of this {@link OpenAIInputImageContent} instance. + */ + @Nullable + public String getFileId() { + return fileId; + } + + /** + * Set the fileId of this {@link OpenAIInputImageContent} instance. + * + * @param fileId The fileId of this {@link OpenAIInputImageContent} + */ + public void setFileId(@Nullable final String fileId) { + this.fileId = fileId; + } + + /** + * Set the detail of this {@link OpenAIInputImageContent} instance and return the same instance. + * + * @param detail The detail level of the image to be sent to the model. One of `high`, + * `low`, or `auto`. Defaults to `auto`. + * @return The same instance of this {@link OpenAIInputImageContent} class + */ + @Nonnull + public OpenAIInputImageContent detail(@Nonnull final OpenAIImageDetail detail) { + this.detail = detail; + return this; + } + + /** + * The detail level of the image to be sent to the model. One of `high`, + * `low`, or `auto`. Defaults to `auto`. + * + * @return detail The detail of this {@link OpenAIInputImageContent} instance. + */ + @Nonnull + public OpenAIImageDetail getDetail() { + return detail; + } + + /** + * Set the detail of this {@link OpenAIInputImageContent} instance. + * + * @param detail The detail level of the image to be sent to the model. One of `high`, + * `low`, or `auto`. Defaults to `auto`. + */ + public void setDetail(@Nonnull final OpenAIImageDetail detail) { + this.detail = detail; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIInputImageContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIInputImageContent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIInputImageContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIInputImageContent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (imageUrl != null) declaredFields.put("imageUrl", imageUrl); + if (fileId != null) declaredFields.put("fileId", fileId); + if (detail != null) declaredFields.put("detail", detail); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIInputImageContent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIInputImageContent openAIInputImageContent = (OpenAIInputImageContent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIInputImageContent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIInputImageContent.type) + && Objects.equals(this.imageUrl, openAIInputImageContent.imageUrl) + && Objects.equals(this.fileId, openAIInputImageContent.fileId) + && Objects.equals(this.detail, openAIInputImageContent.detail); + } + + @Override + public int hashCode() { + return Objects.hash(type, imageUrl, fileId, detail, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIInputImageContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIInputImageContent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> (detail) -> new OpenAIInputImageContent().type(type).detail(detail); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIInputImageContent} instance. + * + * @param type The type of the input item. Always `input_image`. + * @return The OpenAIInputImageContent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the detail of this {@link OpenAIInputImageContent} instance. + * + * @param detail The detail level of the image to be sent to the model. One of `high`, + * `low`, or `auto`. Defaults to `auto`. + * @return The OpenAIInputImageContent instance. + */ + OpenAIInputImageContent detail(@Nonnull final OpenAIImageDetail detail); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java new file mode 100644 index 000000000..d7992457d --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java @@ -0,0 +1,61 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import java.util.List; +import javax.annotation.Nonnull; + +/** + * Text, image, or file inputs to the model, used to generate a response. Learn more: - [Text inputs + * and outputs](https://platform.openai.com/docs/guides/text) - [Image + * inputs](https://platform.openai.com/docs/guides/images) - [File + * inputs](https://platform.openai.com/docs/guides/pdf-files) - [Conversation + * state](https://platform.openai.com/docs/guides/conversation-state) - [Function + * calling](https://platform.openai.com/docs/guides/function-calling) + */ +public interface OpenAIInputParam { + /** + * Helper class to create {@code List } that implements {@link OpenAIInputParam}. + */ + record ListOfOpenAIInputItems( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) + implements OpenAIInputParam {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val the value to use + * @return a new instance of {@link ListOfOpenAIInputItems}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfOpenAIInputItems createListOfOpenAIInputItems( + @Nonnull final List val) { + return new ListOfOpenAIInputItems(val); + } + + /** Helper class to create {@code String } that implements {@link OpenAIInputParam}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIInputParam {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java new file mode 100644 index 000000000..dfce02e5f --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java @@ -0,0 +1,289 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A text input to the model. */ +// CHECKSTYLE:OFF +public class OpenAIInputTextContent +// CHECKSTYLE:ON +{ + /** The type of the input item. Always `input_text`. */ + public enum TypeEnum { + /** The INPUT_TEXT option of this OpenAIInputTextContent */ + INPUT_TEXT("input_text"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIInputTextContent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIInputTextContent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type = TypeEnum.INPUT_TEXT; + + @JsonProperty("text") + private String text; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIInputTextContent. */ + protected OpenAIInputTextContent() {} + + /** + * Set the type of this {@link OpenAIInputTextContent} instance and return the same instance. + * + * @param type The type of the input item. Always `input_text`. + * @return The same instance of this {@link OpenAIInputTextContent} class + */ + @Nonnull + public OpenAIInputTextContent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the input item. Always `input_text`. + * + * @return type The type of this {@link OpenAIInputTextContent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIInputTextContent} instance. + * + * @param type The type of the input item. Always `input_text`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the text of this {@link OpenAIInputTextContent} instance and return the same instance. + * + * @param text The text input to the model. + * @return The same instance of this {@link OpenAIInputTextContent} class + */ + @Nonnull + public OpenAIInputTextContent text(@Nonnull final String text) { + this.text = text; + return this; + } + + /** + * The text input to the model. + * + * @return text The text of this {@link OpenAIInputTextContent} instance. + */ + @Nonnull + public String getText() { + return text; + } + + /** + * Set the text of this {@link OpenAIInputTextContent} instance. + * + * @param text The text input to the model. + */ + public void setText(@Nonnull final String text) { + this.text = text; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIInputTextContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIInputTextContent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIInputTextContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIInputTextContent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (text != null) declaredFields.put("text", text); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIInputTextContent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIInputTextContent openAIInputTextContent = (OpenAIInputTextContent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIInputTextContent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIInputTextContent.type) + && Objects.equals(this.text, openAIInputTextContent.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIInputTextContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIInputTextContent} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> (text) -> new OpenAIInputTextContent().type(type).text(text); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIInputTextContent} instance. + * + * @param type The type of the input item. Always `input_text`. + * @return The OpenAIInputTextContent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the text of this {@link OpenAIInputTextContent} instance. + * + * @param text The text input to the model. + * @return The OpenAIInputTextContent instance. + */ + OpenAIInputTextContent text(@Nonnull final String text); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java new file mode 100644 index 000000000..4ac76ec08 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java @@ -0,0 +1,188 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Content item used to generate a response. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAIItemResource +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIItemResourceType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIItemResource. */ + protected OpenAIItemResource() {} + + /** + * Set the type of this {@link OpenAIItemResource} instance and return the same instance. + * + * @param type The type of this {@link OpenAIItemResource} + * @return The same instance of this {@link OpenAIItemResource} class + */ + @Nonnull + public OpenAIItemResource type(@Nonnull final OpenAIItemResourceType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIItemResource} instance. + */ + @Nonnull + public OpenAIItemResourceType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIItemResource} instance. + * + * @param type The type of this {@link OpenAIItemResource} + */ + public void setType(@Nonnull final OpenAIItemResourceType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIItemResource}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIItemResource} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIItemResource has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIItemResource} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIItemResource} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIItemResource openAIItemResource = (OpenAIItemResource) o; + return Objects.equals(this.cloudSdkCustomFields, openAIItemResource.cloudSdkCustomFields) + && Objects.equals(this.type, openAIItemResource.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIItemResource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIItemResource} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIItemResource().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIItemResource} instance. + * + * @param type The type of this {@link OpenAIItemResource} + * @return The OpenAIItemResource instance. + */ + OpenAIItemResource type(@Nonnull final OpenAIItemResourceType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java new file mode 100644 index 000000000..82a36ce4c --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIItemResourceType */ +public interface OpenAIItemResourceType { + /** Helper class to create {@code String } that implements {@link OpenAIItemResourceType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIItemResourceType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java new file mode 100644 index 000000000..2ce36299e --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java @@ -0,0 +1,189 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIOutputContent */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) +@JsonSubTypes({}) +// CHECKSTYLE:OFF +public class OpenAIOutputContent +// CHECKSTYLE:ON +{ + @JsonProperty("type") + private OpenAIOutputContentType type; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIOutputContent. */ + protected OpenAIOutputContent() {} + + /** + * Set the type of this {@link OpenAIOutputContent} instance and return the same instance. + * + * @param type The type of this {@link OpenAIOutputContent} + * @return The same instance of this {@link OpenAIOutputContent} class + */ + @Nonnull + public OpenAIOutputContent type(@Nonnull final OpenAIOutputContentType type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIOutputContent} instance. + */ + @Nonnull + public OpenAIOutputContentType getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIOutputContent} instance. + * + * @param type The type of this {@link OpenAIOutputContent} + */ + public void setType(@Nonnull final OpenAIOutputContentType type) { + this.type = type; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIOutputContent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIOutputContent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIOutputContent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIOutputContent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIOutputContent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIOutputContent openAIOutputContent = (OpenAIOutputContent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIOutputContent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIOutputContent.type); + } + + @Override + public int hashCode() { + return Objects.hash(type, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIOutputContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIOutputContent} + * instance with all required arguments. + */ + public static Builder create() { + return (type) -> new OpenAIOutputContent().type(type); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIOutputContent} instance. + * + * @param type The type of this {@link OpenAIOutputContent} + * @return The OpenAIOutputContent instance. + */ + OpenAIOutputContent type(@Nonnull final OpenAIOutputContentType type); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java new file mode 100644 index 000000000..4e13287e2 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java @@ -0,0 +1,33 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import javax.annotation.Nonnull; + +/** OpenAIOutputContentType */ +public interface OpenAIOutputContentType { + /** Helper class to create {@code String } that implements {@link OpenAIOutputContentType}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIOutputContentType {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java new file mode 100644 index 000000000..984f00003 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java @@ -0,0 +1,1947 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIResponse */ +// CHECKSTYLE:OFF +public class OpenAIResponse +// CHECKSTYLE:ON +{ + @JsonProperty("metadata") + private Object metadata; + + @JsonProperty("top_logprobs") + private Integer topLogprobs; + + @JsonProperty("temperature") + private BigDecimal temperature; + + @JsonProperty("top_p") + private BigDecimal topP; + + @JsonProperty("user") + private String user; + + @JsonProperty("safety_identifier") + private String safetyIdentifier; + + @JsonProperty("prompt_cache_key") + private String promptCacheKey; + + /** Gets or Sets promptCacheRetention */ + public enum PromptCacheRetentionEnum { + /** The IN_MEMORY option of this OpenAIResponse */ + IN_MEMORY("in-memory"), + + /** The _24H option of this OpenAIResponse */ + _24H("24h"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + PromptCacheRetentionEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponse + */ + @JsonCreator + @Nullable + public static PromptCacheRetentionEnum fromValue(@Nonnull final String value) { + for (PromptCacheRetentionEnum b : PromptCacheRetentionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("prompt_cache_retention") + private PromptCacheRetentionEnum promptCacheRetention; + + @JsonProperty("previous_response_id") + private String previousResponseId; + + @JsonProperty("model") + private String model; + + @JsonProperty("reasoning") + private OpenAIReasoning reasoning; + + @JsonProperty("background") + private Boolean background; + + @JsonProperty("max_output_tokens") + private Integer maxOutputTokens; + + @JsonProperty("max_tool_calls") + private Integer maxToolCalls; + + @JsonProperty("text") + private OpenAIResponseTextParam text; + + @JsonProperty("tools") + private List tools = new ArrayList<>(); + + @JsonProperty("tool_choice") + private OpenAIToolChoiceParam toolChoice; + + @JsonProperty("prompt") + private OpenAIPrompt prompt; + + /** Gets or Sets truncation */ + public enum TruncationEnum { + /** The AUTO option of this OpenAIResponse */ + AUTO("auto"), + + /** The DISABLED option of this OpenAIResponse */ + DISABLED("disabled"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TruncationEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponse + */ + @JsonCreator + @Nullable + public static TruncationEnum fromValue(@Nonnull final String value) { + for (TruncationEnum b : TruncationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + } + + @JsonProperty("truncation") + private TruncationEnum truncation; + + @JsonProperty("id") + private String id; + + /** The object type of this resource - always set to `response`. */ + public enum ObjectEnum { + /** The RESPONSE option of this OpenAIResponse */ + RESPONSE("response"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ObjectEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponse + */ + @JsonCreator + @Nonnull + public static ObjectEnum fromValue(@Nonnull final String value) { + for (ObjectEnum b : ObjectEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("object") + private ObjectEnum _object; + + /** + * The status of the response generation. One of `completed`, `failed`, + * `in_progress`, `cancelled`, `queued`, or `incomplete`. + */ + public enum StatusEnum { + /** The COMPLETED option of this OpenAIResponse */ + COMPLETED("completed"), + + /** The FAILED option of this OpenAIResponse */ + FAILED("failed"), + + /** The IN_PROGRESS option of this OpenAIResponse */ + IN_PROGRESS("in_progress"), + + /** The CANCELLED option of this OpenAIResponse */ + CANCELLED("cancelled"), + + /** The QUEUED option of this OpenAIResponse */ + QUEUED("queued"), + + /** The INCOMPLETE option of this OpenAIResponse */ + INCOMPLETE("incomplete"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponse + */ + @JsonCreator + @Nonnull + public static StatusEnum fromValue(@Nonnull final String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("status") + private StatusEnum status; + + @JsonProperty("created_at") + private Integer createdAt; + + @JsonProperty("completed_at") + private OffsetDateTime completedAt; + + @JsonProperty("error") + private OpenAIResponseError error; + + @JsonProperty("incomplete_details") + private OpenAIResponseIncompleteDetails incompleteDetails; + + @JsonProperty("output") + private List output = new ArrayList<>(); + + @JsonProperty("instructions") + private OpenAIResponseInstructions instructions; + + @JsonProperty("output_text") + private String outputText; + + @JsonProperty("usage") + private OpenAIResponseUsage usage; + + @JsonProperty("parallel_tool_calls") + private Boolean parallelToolCalls = true; + + @JsonProperty("conversation") + private OpenAIConversationReference conversation; + + @JsonProperty("content_filters") + private List contentFilters = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponse. */ + protected OpenAIResponse() {} + + /** + * Set the metadata of this {@link OpenAIResponse} instance and return the same instance. + * + * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and querying + * for objects via API or the dashboard. Keys are strings with a maximum length of 64 + * characters. Values are strings with a maximum length of 512 characters. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse metadata(@Nullable final Object metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing + * additional information about the object in a structured format, and querying for objects via + * API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are + * strings with a maximum length of 512 characters. + * + * @return metadata The metadata of this {@link OpenAIResponse} instance. + */ + @Nullable + public Object getMetadata() { + return metadata; + } + + /** + * Set the metadata of this {@link OpenAIResponse} instance. + * + * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and querying + * for objects via API or the dashboard. Keys are strings with a maximum length of 64 + * characters. Values are strings with a maximum length of 512 characters. + */ + public void setMetadata(@Nullable final Object metadata) { + this.metadata = metadata; + } + + /** + * Set the topLogprobs of this {@link OpenAIResponse} instance and return the same instance. + * + * @param topLogprobs The topLogprobs of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse topLogprobs(@Nullable final Integer topLogprobs) { + this.topLogprobs = topLogprobs; + return this; + } + + /** + * Get topLogprobs + * + * @return topLogprobs The topLogprobs of this {@link OpenAIResponse} instance. + */ + @Nullable + public Integer getTopLogprobs() { + return topLogprobs; + } + + /** + * Set the topLogprobs of this {@link OpenAIResponse} instance. + * + * @param topLogprobs The topLogprobs of this {@link OpenAIResponse} + */ + public void setTopLogprobs(@Nullable final Integer topLogprobs) { + this.topLogprobs = topLogprobs; + } + + /** + * Set the temperature of this {@link OpenAIResponse} instance and return the same instance. + * + * @param temperature The temperature of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse temperature(@Nullable final BigDecimal temperature) { + this.temperature = temperature; + return this; + } + + /** + * Get temperature + * + * @return temperature The temperature of this {@link OpenAIResponse} instance. + */ + @Nullable + public BigDecimal getTemperature() { + return temperature; + } + + /** + * Set the temperature of this {@link OpenAIResponse} instance. + * + * @param temperature The temperature of this {@link OpenAIResponse} + */ + public void setTemperature(@Nullable final BigDecimal temperature) { + this.temperature = temperature; + } + + /** + * Set the topP of this {@link OpenAIResponse} instance and return the same instance. + * + * @param topP The topP of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse topP(@Nullable final BigDecimal topP) { + this.topP = topP; + return this; + } + + /** + * Get topP + * + * @return topP The topP of this {@link OpenAIResponse} instance. + */ + @Nullable + public BigDecimal getTopP() { + return topP; + } + + /** + * Set the topP of this {@link OpenAIResponse} instance. + * + * @param topP The topP of this {@link OpenAIResponse} + */ + public void setTopP(@Nullable final BigDecimal topP) { + this.topP = topP; + } + + /** + * Set the user of this {@link OpenAIResponse} instance and return the same instance. + * + * @param user This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by + * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse user(@Nullable final String user) { + this.user = user; + return this; + } + + /** + * This field is being replaced by `safety_identifier` and `prompt_cache_key`. + * Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier + * for your end-users. Used to boost cache hit rates by better bucketing similar requests and to + * help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * @return user The user of this {@link OpenAIResponse} instance. + * @deprecated + */ + @Deprecated + @Nonnull + public String getUser() { + return user; + } + + /** + * Set the user of this {@link OpenAIResponse} instance. + * + * @param user This field is being replaced by `safety_identifier` and + * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching + * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by + * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + public void setUser(@Nullable final String user) { + this.user = user; + } + + /** + * Set the safetyIdentifier of this {@link OpenAIResponse} instance and return the same instance. + * + * @param safetyIdentifier A stable identifier used to help detect users of your application that + * may be violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in order to + * avoid sending us any identifying information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse safetyIdentifier(@Nullable final String safetyIdentifier) { + this.safetyIdentifier = safetyIdentifier; + return this; + } + + /** + * A stable identifier used to help detect users of your application that may be violating + * OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We + * recommend hashing their username or email address, in order to avoid sending us any identifying + * information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * @return safetyIdentifier The safetyIdentifier of this {@link OpenAIResponse} instance. + */ + @Nonnull + public String getSafetyIdentifier() { + return safetyIdentifier; + } + + /** + * Set the safetyIdentifier of this {@link OpenAIResponse} instance. + * + * @param safetyIdentifier A stable identifier used to help detect users of your application that + * may be violating OpenAI's usage policies. The IDs should be a string that uniquely + * identifies each user. We recommend hashing their username or email address, in order to + * avoid sending us any identifying information. [Learn + * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + */ + public void setSafetyIdentifier(@Nullable final String safetyIdentifier) { + this.safetyIdentifier = safetyIdentifier; + } + + /** + * Set the promptCacheKey of this {@link OpenAIResponse} instance and return the same instance. + * + * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your + * cache hit rates. Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse promptCacheKey(@Nullable final String promptCacheKey) { + this.promptCacheKey = promptCacheKey; + return this; + } + + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. + * Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + * + * @return promptCacheKey The promptCacheKey of this {@link OpenAIResponse} instance. + */ + @Nonnull + public String getPromptCacheKey() { + return promptCacheKey; + } + + /** + * Set the promptCacheKey of this {@link OpenAIResponse} instance. + * + * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your + * cache hit rates. Replaces the `user` field. [Learn + * more](https://platform.openai.com/docs/guides/prompt-caching). + */ + public void setPromptCacheKey(@Nullable final String promptCacheKey) { + this.promptCacheKey = promptCacheKey; + } + + /** + * Set the promptCacheRetention of this {@link OpenAIResponse} instance and return the same + * instance. + * + * @param promptCacheRetention The promptCacheRetention of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse promptCacheRetention( + @Nullable final PromptCacheRetentionEnum promptCacheRetention) { + this.promptCacheRetention = promptCacheRetention; + return this; + } + + /** + * Get promptCacheRetention + * + * @return promptCacheRetention The promptCacheRetention of this {@link OpenAIResponse} instance. + */ + @Nullable + public PromptCacheRetentionEnum getPromptCacheRetention() { + return promptCacheRetention; + } + + /** + * Set the promptCacheRetention of this {@link OpenAIResponse} instance. + * + * @param promptCacheRetention The promptCacheRetention of this {@link OpenAIResponse} + */ + public void setPromptCacheRetention( + @Nullable final PromptCacheRetentionEnum promptCacheRetention) { + this.promptCacheRetention = promptCacheRetention; + } + + /** + * Set the previousResponseId of this {@link OpenAIResponse} instance and return the same + * instance. + * + * @param previousResponseId The previousResponseId of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse previousResponseId(@Nullable final String previousResponseId) { + this.previousResponseId = previousResponseId; + return this; + } + + /** + * Get previousResponseId + * + * @return previousResponseId The previousResponseId of this {@link OpenAIResponse} instance. + */ + @Nullable + public String getPreviousResponseId() { + return previousResponseId; + } + + /** + * Set the previousResponseId of this {@link OpenAIResponse} instance. + * + * @param previousResponseId The previousResponseId of this {@link OpenAIResponse} + */ + public void setPreviousResponseId(@Nullable final String previousResponseId) { + this.previousResponseId = previousResponseId; + } + + /** + * Set the model of this {@link OpenAIResponse} instance and return the same instance. + * + * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. + * OpenAI offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model + * guide](https://platform.openai.com/docs/models) to browse and compare available models. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse model(@Nullable final String model) { + this.model = model; + return this; + } + + /** + * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + * offers a wide range of models with different capabilities, performance characteristics, and + * price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and + * compare available models. + * + * @return model The model of this {@link OpenAIResponse} instance. + */ + @Nonnull + public String getModel() { + return model; + } + + /** + * Set the model of this {@link OpenAIResponse} instance. + * + * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. + * OpenAI offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model + * guide](https://platform.openai.com/docs/models) to browse and compare available models. + */ + public void setModel(@Nullable final String model) { + this.model = model; + } + + /** + * Set the reasoning of this {@link OpenAIResponse} instance and return the same instance. + * + * @param reasoning The reasoning of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse reasoning(@Nullable final OpenAIReasoning reasoning) { + this.reasoning = reasoning; + return this; + } + + /** + * Get reasoning + * + * @return reasoning The reasoning of this {@link OpenAIResponse} instance. + */ + @Nullable + public OpenAIReasoning getReasoning() { + return reasoning; + } + + /** + * Set the reasoning of this {@link OpenAIResponse} instance. + * + * @param reasoning The reasoning of this {@link OpenAIResponse} + */ + public void setReasoning(@Nullable final OpenAIReasoning reasoning) { + this.reasoning = reasoning; + } + + /** + * Set the background of this {@link OpenAIResponse} instance and return the same instance. + * + * @param background The background of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse background(@Nullable final Boolean background) { + this.background = background; + return this; + } + + /** + * Get background + * + * @return background The background of this {@link OpenAIResponse} instance. + */ + @Nullable + public Boolean isBackground() { + return background; + } + + /** + * Set the background of this {@link OpenAIResponse} instance. + * + * @param background The background of this {@link OpenAIResponse} + */ + public void setBackground(@Nullable final Boolean background) { + this.background = background; + } + + /** + * Set the maxOutputTokens of this {@link OpenAIResponse} instance and return the same instance. + * + * @param maxOutputTokens The maxOutputTokens of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse maxOutputTokens(@Nullable final Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + return this; + } + + /** + * Get maxOutputTokens + * + * @return maxOutputTokens The maxOutputTokens of this {@link OpenAIResponse} instance. + */ + @Nullable + public Integer getMaxOutputTokens() { + return maxOutputTokens; + } + + /** + * Set the maxOutputTokens of this {@link OpenAIResponse} instance. + * + * @param maxOutputTokens The maxOutputTokens of this {@link OpenAIResponse} + */ + public void setMaxOutputTokens(@Nullable final Integer maxOutputTokens) { + this.maxOutputTokens = maxOutputTokens; + } + + /** + * Set the maxToolCalls of this {@link OpenAIResponse} instance and return the same instance. + * + * @param maxToolCalls The maxToolCalls of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse maxToolCalls(@Nullable final Integer maxToolCalls) { + this.maxToolCalls = maxToolCalls; + return this; + } + + /** + * Get maxToolCalls + * + * @return maxToolCalls The maxToolCalls of this {@link OpenAIResponse} instance. + */ + @Nullable + public Integer getMaxToolCalls() { + return maxToolCalls; + } + + /** + * Set the maxToolCalls of this {@link OpenAIResponse} instance. + * + * @param maxToolCalls The maxToolCalls of this {@link OpenAIResponse} + */ + public void setMaxToolCalls(@Nullable final Integer maxToolCalls) { + this.maxToolCalls = maxToolCalls; + } + + /** + * Set the text of this {@link OpenAIResponse} instance and return the same instance. + * + * @param text The text of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse text(@Nullable final OpenAIResponseTextParam text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link OpenAIResponse} instance. + */ + @Nonnull + public OpenAIResponseTextParam getText() { + return text; + } + + /** + * Set the text of this {@link OpenAIResponse} instance. + * + * @param text The text of this {@link OpenAIResponse} + */ + public void setText(@Nullable final OpenAIResponseTextParam text) { + this.text = text; + } + + /** + * Set the tools of this {@link OpenAIResponse} instance and return the same instance. + * + * @param tools An array of tools the model may call while generating a response. You can specify + * which tool to use by setting the `tool_choice` parameter. We support the + * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that + * extend the model's capabilities, like [web + * search](https://platform.openai.com/docs/guides/tools-web-search) or [file + * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: + * Integrations with third-party systems via custom MCP servers or predefined connectors such + * as Google Drive and SharePoint. Learn more about [MCP + * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own + * code with strongly typed arguments and outputs. Learn more about [function + * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom + * tools to call your own code. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse tools(@Nullable final List tools) { + this.tools = tools; + return this; + } + + /** + * Add one tools instance to this {@link OpenAIResponse}. + * + * @param toolsItem The tools that should be added + * @return The same instance of type {@link OpenAIResponse} + */ + @Nonnull + public OpenAIResponse addToolsItem(@Nonnull final OpenAITool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * An array of tools the model may call while generating a response. You can specify which tool to + * use by setting the `tool_choice` parameter. We support the following categories of + * tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's + * capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) or + * [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: Integrations + * with third-party systems via custom MCP servers or predefined connectors such as Google Drive + * and SharePoint. Learn more about [MCP + * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own code + * with strongly typed arguments and outputs. Learn more about [function + * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom + * tools to call your own code. + * + * @return tools The tools of this {@link OpenAIResponse} instance. + */ + @Nonnull + public List getTools() { + return tools; + } + + /** + * Set the tools of this {@link OpenAIResponse} instance. + * + * @param tools An array of tools the model may call while generating a response. You can specify + * which tool to use by setting the `tool_choice` parameter. We support the + * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that + * extend the model's capabilities, like [web + * search](https://platform.openai.com/docs/guides/tools-web-search) or [file + * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: + * Integrations with third-party systems via custom MCP servers or predefined connectors such + * as Google Drive and SharePoint. Learn more about [MCP + * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls + * (custom tools)**: Functions that are defined by you, enabling the model to call your own + * code with strongly typed arguments and outputs. Learn more about [function + * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom + * tools to call your own code. + */ + public void setTools(@Nullable final List tools) { + this.tools = tools; + } + + /** + * Set the toolChoice of this {@link OpenAIResponse} instance and return the same instance. + * + * @param toolChoice The toolChoice of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse toolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { + this.toolChoice = toolChoice; + return this; + } + + /** + * Get toolChoice + * + * @return toolChoice The toolChoice of this {@link OpenAIResponse} instance. + */ + @Nonnull + public OpenAIToolChoiceParam getToolChoice() { + return toolChoice; + } + + /** + * Set the toolChoice of this {@link OpenAIResponse} instance. + * + * @param toolChoice The toolChoice of this {@link OpenAIResponse} + */ + public void setToolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { + this.toolChoice = toolChoice; + } + + /** + * Set the prompt of this {@link OpenAIResponse} instance and return the same instance. + * + * @param prompt The prompt of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse prompt(@Nullable final OpenAIPrompt prompt) { + this.prompt = prompt; + return this; + } + + /** + * Get prompt + * + * @return prompt The prompt of this {@link OpenAIResponse} instance. + */ + @Nonnull + public OpenAIPrompt getPrompt() { + return prompt; + } + + /** + * Set the prompt of this {@link OpenAIResponse} instance. + * + * @param prompt The prompt of this {@link OpenAIResponse} + */ + public void setPrompt(@Nullable final OpenAIPrompt prompt) { + this.prompt = prompt; + } + + /** + * Set the truncation of this {@link OpenAIResponse} instance and return the same instance. + * + * @param truncation The truncation of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse truncation(@Nullable final TruncationEnum truncation) { + this.truncation = truncation; + return this; + } + + /** + * Get truncation + * + * @return truncation The truncation of this {@link OpenAIResponse} instance. + */ + @Nullable + public TruncationEnum getTruncation() { + return truncation; + } + + /** + * Set the truncation of this {@link OpenAIResponse} instance. + * + * @param truncation The truncation of this {@link OpenAIResponse} + */ + public void setTruncation(@Nullable final TruncationEnum truncation) { + this.truncation = truncation; + } + + /** + * Set the id of this {@link OpenAIResponse} instance and return the same instance. + * + * @param id Unique identifier for this Response. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse id(@Nonnull final String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for this Response. + * + * @return id The id of this {@link OpenAIResponse} instance. + */ + @Nonnull + public String getId() { + return id; + } + + /** + * Set the id of this {@link OpenAIResponse} instance. + * + * @param id Unique identifier for this Response. + */ + public void setId(@Nonnull final String id) { + this.id = id; + } + + /** + * Set the _object of this {@link OpenAIResponse} instance and return the same instance. + * + * @param _object The object type of this resource - always set to `response`. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse _object(@Nonnull final ObjectEnum _object) { + this._object = _object; + return this; + } + + /** + * The object type of this resource - always set to `response`. + * + * @return _object The _object of this {@link OpenAIResponse} instance. + */ + @Nonnull + public ObjectEnum getObject() { + return _object; + } + + /** + * Set the _object of this {@link OpenAIResponse} instance. + * + * @param _object The object type of this resource - always set to `response`. + */ + public void setObject(@Nonnull final ObjectEnum _object) { + this._object = _object; + } + + /** + * Set the status of this {@link OpenAIResponse} instance and return the same instance. + * + * @param status The status of the response generation. One of `completed`, + * `failed`, `in_progress`, `cancelled`, `queued`, or + * `incomplete`. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse status(@Nullable final StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the response generation. One of `completed`, `failed`, + * `in_progress`, `cancelled`, `queued`, or `incomplete`. + * + * @return status The status of this {@link OpenAIResponse} instance. + */ + @Nonnull + public StatusEnum getStatus() { + return status; + } + + /** + * Set the status of this {@link OpenAIResponse} instance. + * + * @param status The status of the response generation. One of `completed`, + * `failed`, `in_progress`, `cancelled`, `queued`, or + * `incomplete`. + */ + public void setStatus(@Nullable final StatusEnum status) { + this.status = status; + } + + /** + * Set the createdAt of this {@link OpenAIResponse} instance and return the same instance. + * + * @param createdAt Unix timestamp (in seconds) of when this Response was created. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse createdAt(@Nonnull final Integer createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Unix timestamp (in seconds) of when this Response was created. + * + * @return createdAt The createdAt of this {@link OpenAIResponse} instance. + */ + @Nonnull + public Integer getCreatedAt() { + return createdAt; + } + + /** + * Set the createdAt of this {@link OpenAIResponse} instance. + * + * @param createdAt Unix timestamp (in seconds) of when this Response was created. + */ + public void setCreatedAt(@Nonnull final Integer createdAt) { + this.createdAt = createdAt; + } + + /** + * Set the completedAt of this {@link OpenAIResponse} instance and return the same instance. + * + * @param completedAt The completedAt of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse completedAt(@Nullable final OffsetDateTime completedAt) { + this.completedAt = completedAt; + return this; + } + + /** + * Get completedAt + * + * @return completedAt The completedAt of this {@link OpenAIResponse} instance. + */ + @Nullable + public OffsetDateTime getCompletedAt() { + return completedAt; + } + + /** + * Set the completedAt of this {@link OpenAIResponse} instance. + * + * @param completedAt The completedAt of this {@link OpenAIResponse} + */ + public void setCompletedAt(@Nullable final OffsetDateTime completedAt) { + this.completedAt = completedAt; + } + + /** + * Set the error of this {@link OpenAIResponse} instance and return the same instance. + * + * @param error The error of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse error(@Nullable final OpenAIResponseError error) { + this.error = error; + return this; + } + + /** + * Get error + * + * @return error The error of this {@link OpenAIResponse} instance. + */ + @Nullable + public OpenAIResponseError getError() { + return error; + } + + /** + * Set the error of this {@link OpenAIResponse} instance. + * + * @param error The error of this {@link OpenAIResponse} + */ + public void setError(@Nullable final OpenAIResponseError error) { + this.error = error; + } + + /** + * Set the incompleteDetails of this {@link OpenAIResponse} instance and return the same instance. + * + * @param incompleteDetails The incompleteDetails of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse incompleteDetails( + @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { + this.incompleteDetails = incompleteDetails; + return this; + } + + /** + * Get incompleteDetails + * + * @return incompleteDetails The incompleteDetails of this {@link OpenAIResponse} instance. + */ + @Nullable + public OpenAIResponseIncompleteDetails getIncompleteDetails() { + return incompleteDetails; + } + + /** + * Set the incompleteDetails of this {@link OpenAIResponse} instance. + * + * @param incompleteDetails The incompleteDetails of this {@link OpenAIResponse} + */ + public void setIncompleteDetails( + @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { + this.incompleteDetails = incompleteDetails; + } + + /** + * Set the output of this {@link OpenAIResponse} instance and return the same instance. + * + * @param output An array of content items generated by the model. - The length and order of items + * in the `output` array is dependent on the model's response. - Rather than + * accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse output(@Nonnull final List output) { + this.output = output; + return this; + } + + /** + * Add one output instance to this {@link OpenAIResponse}. + * + * @param outputItem The output that should be added + * @return The same instance of type {@link OpenAIResponse} + */ + @Nonnull + public OpenAIResponse addOutputItem(@Nonnull final OpenAIOutputItem outputItem) { + if (this.output == null) { + this.output = new ArrayList<>(); + } + this.output.add(outputItem); + return this; + } + + /** + * An array of content items generated by the model. - The length and order of items in the + * `output` array is dependent on the model's response. - Rather than accessing the + * first item in the `output` array and assuming it's an `assistant` + * message with the content generated by the model, you might consider using the + * `output_text` property where supported in SDKs. + * + * @return output The output of this {@link OpenAIResponse} instance. + */ + @Nonnull + public List getOutput() { + return output; + } + + /** + * Set the output of this {@link OpenAIResponse} instance. + * + * @param output An array of content items generated by the model. - The length and order of items + * in the `output` array is dependent on the model's response. - Rather than + * accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + */ + public void setOutput(@Nonnull final List output) { + this.output = output; + } + + /** + * Set the instructions of this {@link OpenAIResponse} instance and return the same instance. + * + * @param instructions The instructions of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse instructions(@Nullable final OpenAIResponseInstructions instructions) { + this.instructions = instructions; + return this; + } + + /** + * Get instructions + * + * @return instructions The instructions of this {@link OpenAIResponse} instance. + */ + @Nullable + public OpenAIResponseInstructions getInstructions() { + return instructions; + } + + /** + * Set the instructions of this {@link OpenAIResponse} instance. + * + * @param instructions The instructions of this {@link OpenAIResponse} + */ + public void setInstructions(@Nullable final OpenAIResponseInstructions instructions) { + this.instructions = instructions; + } + + /** + * Set the outputText of this {@link OpenAIResponse} instance and return the same instance. + * + * @param outputText The outputText of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse outputText(@Nullable final String outputText) { + this.outputText = outputText; + return this; + } + + /** + * Get outputText + * + * @return outputText The outputText of this {@link OpenAIResponse} instance. + */ + @Nullable + public String getOutputText() { + return outputText; + } + + /** + * Set the outputText of this {@link OpenAIResponse} instance. + * + * @param outputText The outputText of this {@link OpenAIResponse} + */ + public void setOutputText(@Nullable final String outputText) { + this.outputText = outputText; + } + + /** + * Set the usage of this {@link OpenAIResponse} instance and return the same instance. + * + * @param usage The usage of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse usage(@Nullable final OpenAIResponseUsage usage) { + this.usage = usage; + return this; + } + + /** + * Get usage + * + * @return usage The usage of this {@link OpenAIResponse} instance. + */ + @Nonnull + public OpenAIResponseUsage getUsage() { + return usage; + } + + /** + * Set the usage of this {@link OpenAIResponse} instance. + * + * @param usage The usage of this {@link OpenAIResponse} + */ + public void setUsage(@Nullable final OpenAIResponseUsage usage) { + this.usage = usage; + } + + /** + * Set the parallelToolCalls of this {@link OpenAIResponse} instance and return the same instance. + * + * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse parallelToolCalls(@Nonnull final Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + return this; + } + + /** + * Whether to allow the model to run tool calls in parallel. + * + * @return parallelToolCalls The parallelToolCalls of this {@link OpenAIResponse} instance. + */ + @Nonnull + public Boolean isParallelToolCalls() { + return parallelToolCalls; + } + + /** + * Set the parallelToolCalls of this {@link OpenAIResponse} instance. + * + * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. + */ + public void setParallelToolCalls(@Nonnull final Boolean parallelToolCalls) { + this.parallelToolCalls = parallelToolCalls; + } + + /** + * Set the conversation of this {@link OpenAIResponse} instance and return the same instance. + * + * @param conversation The conversation of this {@link OpenAIResponse} + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse conversation(@Nullable final OpenAIConversationReference conversation) { + this.conversation = conversation; + return this; + } + + /** + * Get conversation + * + * @return conversation The conversation of this {@link OpenAIResponse} instance. + */ + @Nullable + public OpenAIConversationReference getConversation() { + return conversation; + } + + /** + * Set the conversation of this {@link OpenAIResponse} instance. + * + * @param conversation The conversation of this {@link OpenAIResponse} + */ + public void setConversation(@Nullable final OpenAIConversationReference conversation) { + this.conversation = conversation; + } + + /** + * Set the contentFilters of this {@link OpenAIResponse} instance and return the same instance. + * + * @param contentFilters The content filter results from RAI. + * @return The same instance of this {@link OpenAIResponse} class + */ + @Nonnull + public OpenAIResponse contentFilters( + @Nonnull final List contentFilters) { + this.contentFilters = contentFilters; + return this; + } + + /** + * Add one contentFilters instance to this {@link OpenAIResponse}. + * + * @param contentFiltersItem The contentFilters that should be added + * @return The same instance of type {@link OpenAIResponse} + */ + @Nonnull + public OpenAIResponse addContentFiltersItem( + @Nonnull final AzureContentFilterForResponsesAPI contentFiltersItem) { + if (this.contentFilters == null) { + this.contentFilters = new ArrayList<>(); + } + this.contentFilters.add(contentFiltersItem); + return this; + } + + /** + * The content filter results from RAI. + * + * @return contentFilters The contentFilters of this {@link OpenAIResponse} instance. + */ + @Nonnull + public List getContentFilters() { + return contentFilters; + } + + /** + * Set the contentFilters of this {@link OpenAIResponse} instance. + * + * @param contentFilters The content filter results from RAI. + */ + public void setContentFilters( + @Nonnull final List contentFilters) { + this.contentFilters = contentFilters; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponse}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponse} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException("OpenAIResponse has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponse} instance including unrecognized + * properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (metadata != null) declaredFields.put("metadata", metadata); + if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); + if (temperature != null) declaredFields.put("temperature", temperature); + if (topP != null) declaredFields.put("topP", topP); + if (user != null) declaredFields.put("user", user); + if (safetyIdentifier != null) declaredFields.put("safetyIdentifier", safetyIdentifier); + if (promptCacheKey != null) declaredFields.put("promptCacheKey", promptCacheKey); + if (promptCacheRetention != null) + declaredFields.put("promptCacheRetention", promptCacheRetention); + if (previousResponseId != null) declaredFields.put("previousResponseId", previousResponseId); + if (model != null) declaredFields.put("model", model); + if (reasoning != null) declaredFields.put("reasoning", reasoning); + if (background != null) declaredFields.put("background", background); + if (maxOutputTokens != null) declaredFields.put("maxOutputTokens", maxOutputTokens); + if (maxToolCalls != null) declaredFields.put("maxToolCalls", maxToolCalls); + if (text != null) declaredFields.put("text", text); + if (tools != null) declaredFields.put("tools", tools); + if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); + if (prompt != null) declaredFields.put("prompt", prompt); + if (truncation != null) declaredFields.put("truncation", truncation); + if (id != null) declaredFields.put("id", id); + if (_object != null) declaredFields.put("_object", _object); + if (status != null) declaredFields.put("status", status); + if (createdAt != null) declaredFields.put("createdAt", createdAt); + if (completedAt != null) declaredFields.put("completedAt", completedAt); + if (error != null) declaredFields.put("error", error); + if (incompleteDetails != null) declaredFields.put("incompleteDetails", incompleteDetails); + if (output != null) declaredFields.put("output", output); + if (instructions != null) declaredFields.put("instructions", instructions); + if (outputText != null) declaredFields.put("outputText", outputText); + if (usage != null) declaredFields.put("usage", usage); + if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); + if (conversation != null) declaredFields.put("conversation", conversation); + if (contentFilters != null) declaredFields.put("contentFilters", contentFilters); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponse} instance. If the map previously + * contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponse openAIResponse = (OpenAIResponse) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponse.cloudSdkCustomFields) + && Objects.equals(this.metadata, openAIResponse.metadata) + && Objects.equals(this.topLogprobs, openAIResponse.topLogprobs) + && Objects.equals(this.temperature, openAIResponse.temperature) + && Objects.equals(this.topP, openAIResponse.topP) + && Objects.equals(this.user, openAIResponse.user) + && Objects.equals(this.safetyIdentifier, openAIResponse.safetyIdentifier) + && Objects.equals(this.promptCacheKey, openAIResponse.promptCacheKey) + && Objects.equals(this.promptCacheRetention, openAIResponse.promptCacheRetention) + && Objects.equals(this.previousResponseId, openAIResponse.previousResponseId) + && Objects.equals(this.model, openAIResponse.model) + && Objects.equals(this.reasoning, openAIResponse.reasoning) + && Objects.equals(this.background, openAIResponse.background) + && Objects.equals(this.maxOutputTokens, openAIResponse.maxOutputTokens) + && Objects.equals(this.maxToolCalls, openAIResponse.maxToolCalls) + && Objects.equals(this.text, openAIResponse.text) + && Objects.equals(this.tools, openAIResponse.tools) + && Objects.equals(this.toolChoice, openAIResponse.toolChoice) + && Objects.equals(this.prompt, openAIResponse.prompt) + && Objects.equals(this.truncation, openAIResponse.truncation) + && Objects.equals(this.id, openAIResponse.id) + && Objects.equals(this._object, openAIResponse._object) + && Objects.equals(this.status, openAIResponse.status) + && Objects.equals(this.createdAt, openAIResponse.createdAt) + && Objects.equals(this.completedAt, openAIResponse.completedAt) + && Objects.equals(this.error, openAIResponse.error) + && Objects.equals(this.incompleteDetails, openAIResponse.incompleteDetails) + && Objects.equals(this.output, openAIResponse.output) + && Objects.equals(this.instructions, openAIResponse.instructions) + && Objects.equals(this.outputText, openAIResponse.outputText) + && Objects.equals(this.usage, openAIResponse.usage) + && Objects.equals(this.parallelToolCalls, openAIResponse.parallelToolCalls) + && Objects.equals(this.conversation, openAIResponse.conversation) + && Objects.equals(this.contentFilters, openAIResponse.contentFilters); + } + + @Override + public int hashCode() { + return Objects.hash( + metadata, + topLogprobs, + temperature, + topP, + user, + safetyIdentifier, + promptCacheKey, + promptCacheRetention, + previousResponseId, + model, + reasoning, + background, + maxOutputTokens, + maxToolCalls, + text, + tools, + toolChoice, + prompt, + truncation, + id, + _object, + status, + createdAt, + completedAt, + error, + incompleteDetails, + output, + instructions, + outputText, + usage, + parallelToolCalls, + conversation, + contentFilters, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponse {\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" safetyIdentifier: ").append(toIndentedString(safetyIdentifier)).append("\n"); + sb.append(" promptCacheKey: ").append(toIndentedString(promptCacheKey)).append("\n"); + sb.append(" promptCacheRetention: ") + .append(toIndentedString(promptCacheRetention)) + .append("\n"); + sb.append(" previousResponseId: ").append(toIndentedString(previousResponseId)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" reasoning: ").append(toIndentedString(reasoning)).append("\n"); + sb.append(" background: ").append(toIndentedString(background)).append("\n"); + sb.append(" maxOutputTokens: ").append(toIndentedString(maxOutputTokens)).append("\n"); + sb.append(" maxToolCalls: ").append(toIndentedString(maxToolCalls)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); + sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); + sb.append(" truncation: ").append(toIndentedString(truncation)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" incompleteDetails: ").append(toIndentedString(incompleteDetails)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" outputText: ").append(toIndentedString(outputText)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append(" parallelToolCalls: ").append(toIndentedString(parallelToolCalls)).append("\n"); + sb.append(" conversation: ").append(toIndentedString(conversation)).append("\n"); + sb.append(" contentFilters: ").append(toIndentedString(contentFilters)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponse} + * instance with all required arguments. + */ + public static Builder create() { + return (id) -> + (_object) -> + (createdAt) -> + (error) -> + (incompleteDetails) -> + (output) -> + (instructions) -> + (parallelToolCalls) -> + (contentFilters) -> + new OpenAIResponse() + .id(id) + ._object(_object) + .createdAt(createdAt) + .error(error) + .incompleteDetails(incompleteDetails) + .output(output) + .instructions(instructions) + .parallelToolCalls(parallelToolCalls) + .contentFilters(contentFilters); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the id of this {@link OpenAIResponse} instance. + * + * @param id Unique identifier for this Response. + * @return The OpenAIResponse builder. + */ + Builder1 id(@Nonnull final String id); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the _object of this {@link OpenAIResponse} instance. + * + * @param _object The object type of this resource - always set to `response`. + * @return The OpenAIResponse builder. + */ + Builder2 _object(@Nonnull final ObjectEnum _object); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the createdAt of this {@link OpenAIResponse} instance. + * + * @param createdAt Unix timestamp (in seconds) of when this Response was created. + * @return The OpenAIResponse builder. + */ + Builder3 createdAt(@Nonnull final Integer createdAt); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the error of this {@link OpenAIResponse} instance. + * + * @param error The error of this {@link OpenAIResponse} + * @return The OpenAIResponse builder. + */ + Builder4 error(@Nullable final OpenAIResponseError error); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the incompleteDetails of this {@link OpenAIResponse} instance. + * + * @param incompleteDetails The incompleteDetails of this {@link OpenAIResponse} + * @return The OpenAIResponse builder. + */ + Builder5 incompleteDetails(@Nullable final OpenAIResponseIncompleteDetails incompleteDetails); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the output of this {@link OpenAIResponse} instance. + * + * @param output An array of content items generated by the model. - The length and order of + * items in the `output` array is dependent on the model's response. - Rather + * than accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + * @return The OpenAIResponse builder. + */ + Builder6 output(@Nonnull final List output); + + /** + * Set the output of this {@link OpenAIResponse} instance. + * + * @param output An array of content items generated by the model. - The length and order of + * items in the `output` array is dependent on the model's response. - Rather + * than accessing the first item in the `output` array and assuming it's an + * `assistant` message with the content generated by the model, you might consider + * using the `output_text` property where supported in SDKs. + * @return The OpenAIResponse builder. + */ + default Builder6 output(@Nonnull final OpenAIOutputItem... output) { + return output(Arrays.asList(output)); + } + } + + /** Builder helper class. */ + public interface Builder6 { + /** + * Set the instructions of this {@link OpenAIResponse} instance. + * + * @param instructions The instructions of this {@link OpenAIResponse} + * @return The OpenAIResponse builder. + */ + Builder7 instructions(@Nullable final OpenAIResponseInstructions instructions); + } + + /** Builder helper class. */ + public interface Builder7 { + /** + * Set the parallelToolCalls of this {@link OpenAIResponse} instance. + * + * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. + * @return The OpenAIResponse builder. + */ + Builder8 parallelToolCalls(@Nonnull final Boolean parallelToolCalls); + } + + /** Builder helper class. */ + public interface Builder8 { + /** + * Set the contentFilters of this {@link OpenAIResponse} instance. + * + * @param contentFilters The content filter results from RAI. + * @return The OpenAIResponse instance. + */ + OpenAIResponse contentFilters( + @Nonnull final List contentFilters); + + /** + * Set the contentFilters of this {@link OpenAIResponse} instance. + * + * @param contentFilters The content filter results from RAI. + * @return The OpenAIResponse instance. + */ + default OpenAIResponse contentFilters( + @Nonnull final AzureContentFilterForResponsesAPI... contentFilters) { + return contentFilters(Arrays.asList(contentFilters)); + } + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java new file mode 100644 index 000000000..b0c95d869 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java @@ -0,0 +1,351 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when there is a partial audio response. */ +// CHECKSTYLE:OFF +public class OpenAIResponseAudioDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.audio.delta`. */ + public enum TypeEnum { + /** The RESPONSE_AUDIO_DELTA option of this OpenAIResponseAudioDeltaEvent */ + RESPONSE_AUDIO_DELTA("response.audio.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseAudioDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseAudioDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("delta") + private String delta; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseAudioDeltaEvent. */ + protected OpenAIResponseAudioDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseAudioDeltaEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.audio.delta`. + * @return The same instance of this {@link OpenAIResponseAudioDeltaEvent} class + */ + @Nonnull + public OpenAIResponseAudioDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.audio.delta`. + * + * @return type The type of this {@link OpenAIResponseAudioDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseAudioDeltaEvent} instance. + * + * @param type The type of the event. Always `response.audio.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} instance and return the + * same instance. + * + * @param sequenceNumber A sequence number for this chunk of the stream response. + * @return The same instance of this {@link OpenAIResponseAudioDeltaEvent} class + */ + @Nonnull + public OpenAIResponseAudioDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * A sequence number for this chunk of the stream response. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} instance. + * + * @param sequenceNumber A sequence number for this chunk of the stream response. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the delta of this {@link OpenAIResponseAudioDeltaEvent} instance and return the same + * instance. + * + * @param delta A chunk of Base64 encoded response audio bytes. + * @return The same instance of this {@link OpenAIResponseAudioDeltaEvent} class + */ + @Nonnull + public OpenAIResponseAudioDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * A chunk of Base64 encoded response audio bytes. + * + * @return delta The delta of this {@link OpenAIResponseAudioDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseAudioDeltaEvent} instance. + * + * @param delta A chunk of Base64 encoded response audio bytes. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseAudioDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseAudioDeltaEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseAudioDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseAudioDeltaEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (delta != null) declaredFields.put("delta", delta); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseAudioDeltaEvent} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseAudioDeltaEvent openAIResponseAudioDeltaEvent = + (OpenAIResponseAudioDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseAudioDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseAudioDeltaEvent.type) + && Objects.equals(this.sequenceNumber, openAIResponseAudioDeltaEvent.sequenceNumber) + && Objects.equals(this.delta, openAIResponseAudioDeltaEvent.delta); + } + + @Override + public int hashCode() { + return Objects.hash(type, sequenceNumber, delta, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseAudioDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseAudioDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (sequenceNumber) -> + (delta) -> + new OpenAIResponseAudioDeltaEvent() + .type(type) + .sequenceNumber(sequenceNumber) + .delta(delta); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseAudioDeltaEvent} instance. + * + * @param type The type of the event. Always `response.audio.delta`. + * @return The OpenAIResponseAudioDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} instance. + * + * @param sequenceNumber A sequence number for this chunk of the stream response. + * @return The OpenAIResponseAudioDeltaEvent builder. + */ + Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the delta of this {@link OpenAIResponseAudioDeltaEvent} instance. + * + * @param delta A chunk of Base64 encoded response audio bytes. + * @return The OpenAIResponseAudioDeltaEvent instance. + */ + OpenAIResponseAudioDeltaEvent delta(@Nonnull final String delta); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java new file mode 100644 index 000000000..724d6ee42 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java @@ -0,0 +1,356 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when there is a partial transcript of audio. */ +// CHECKSTYLE:OFF +public class OpenAIResponseAudioTranscriptDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.audio.transcript.delta`. */ + public enum TypeEnum { + /** + * The RESPONSE_AUDIO_TRANSCRIPT_DELTA option of this OpenAIResponseAudioTranscriptDeltaEvent + */ + RESPONSE_AUDIO_TRANSCRIPT_DELTA("response.audio.transcript.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseAudioTranscriptDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseAudioTranscriptDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseAudioTranscriptDeltaEvent. */ + protected OpenAIResponseAudioTranscriptDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always `response.audio.transcript.delta`. + * @return The same instance of this {@link OpenAIResponseAudioTranscriptDeltaEvent} class + */ + @Nonnull + public OpenAIResponseAudioTranscriptDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.audio.transcript.delta`. + * + * @return type The type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @param type The type of the event. Always `response.audio.transcript.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance and return the + * same instance. + * + * @param delta The partial transcript of the audio response. + * @return The same instance of this {@link OpenAIResponseAudioTranscriptDeltaEvent} class + */ + @Nonnull + public OpenAIResponseAudioTranscriptDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The partial transcript of the audio response. + * + * @return delta The delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @param delta The partial transcript of the audio response. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseAudioTranscriptDeltaEvent} class + */ + @Nonnull + public OpenAIResponseAudioTranscriptDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseAudioTranscriptDeltaEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseAudioTranscriptDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseAudioTranscriptDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseAudioTranscriptDeltaEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseAudioTranscriptDeltaEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseAudioTranscriptDeltaEvent openAIResponseAudioTranscriptDeltaEvent = + (OpenAIResponseAudioTranscriptDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseAudioTranscriptDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseAudioTranscriptDeltaEvent.type) + && Objects.equals(this.delta, openAIResponseAudioTranscriptDeltaEvent.delta) + && Objects.equals( + this.sequenceNumber, openAIResponseAudioTranscriptDeltaEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, delta, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseAudioTranscriptDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseAudioTranscriptDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (delta) -> + (sequenceNumber) -> + new OpenAIResponseAudioTranscriptDeltaEvent() + .type(type) + .delta(delta) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @param type The type of the event. Always `response.audio.transcript.delta`. + * @return The OpenAIResponseAudioTranscriptDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @param delta The partial transcript of the audio response. + * @return The OpenAIResponseAudioTranscriptDeltaEvent builder. + */ + Builder2 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseAudioTranscriptDeltaEvent instance. + */ + OpenAIResponseAudioTranscriptDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java new file mode 100644 index 000000000..60c80f61a --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java @@ -0,0 +1,477 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a partial code snippet is streamed by the code interpreter. */ +// CHECKSTYLE:OFF +public class OpenAIResponseCodeInterpreterCallCodeDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.code_interpreter_call_code.delta`. */ + public enum TypeEnum { + /** + * The RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA option of this + * OpenAIResponseCodeInterpreterCallCodeDeltaEvent + */ + RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA("response.code_interpreter_call_code.delta"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCodeInterpreterCallCodeDeltaEvent + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseCodeInterpreterCallCodeDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseCodeInterpreterCallCodeDeltaEvent. */ + protected OpenAIResponseCodeInterpreterCallCodeDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance and + * return the same instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call_code.delta`. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallCodeDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.code_interpreter_call_code.delta`. + * + * @return type The type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call_code.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance + * and return the same instance. + * + * @param outputIndex The index of the output item in the response for which the code is being + * streamed. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallCodeDeltaEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response for which the code is being streamed. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param outputIndex The index of the output item in the response for which the code is being + * streamed. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance and + * return the same instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallCodeDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the code interpreter tool call item. + * + * @return itemId The itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance and + * return the same instance. + * + * @param delta The partial code snippet being streamed by the code interpreter. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallCodeDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The partial code snippet being streamed by the code interpreter. + * + * @return delta The delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} + * instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param delta The partial code snippet being streamed by the code interpreter. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance + * and return the same instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallCodeDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event, used to order streaming events. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseCodeInterpreterCallCodeDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseCodeInterpreterCallCodeDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseCodeInterpreterCallCodeDeltaEvent + openAIResponseCodeInterpreterCallCodeDeltaEvent = + (OpenAIResponseCodeInterpreterCallCodeDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseCodeInterpreterCallCodeDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseCodeInterpreterCallCodeDeltaEvent.type) + && Objects.equals( + this.outputIndex, openAIResponseCodeInterpreterCallCodeDeltaEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseCodeInterpreterCallCodeDeltaEvent.itemId) + && Objects.equals(this.delta, openAIResponseCodeInterpreterCallCodeDeltaEvent.delta) + && Objects.equals( + this.sequenceNumber, openAIResponseCodeInterpreterCallCodeDeltaEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, delta, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseCodeInterpreterCallCodeDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (delta) -> + (sequenceNumber) -> + new OpenAIResponseCodeInterpreterCallCodeDeltaEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .delta(delta) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call_code.delta`. + * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param outputIndex The index of the output item in the response for which the code is being + * streamed. + * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. + * + * @param delta The partial code snippet being streamed by the code interpreter. + * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. + */ + Builder4 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent instance. + */ + OpenAIResponseCodeInterpreterCallCodeDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java new file mode 100644 index 000000000..92eef17b2 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java @@ -0,0 +1,434 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a code interpreter call is in progress. */ +// CHECKSTYLE:OFF +public class OpenAIResponseCodeInterpreterCallInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.code_interpreter_call.in_progress`. */ + public enum TypeEnum { + /** + * The RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS option of this + * OpenAIResponseCodeInterpreterCallInProgressEvent + */ + RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS("response.code_interpreter_call.in_progress"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCodeInterpreterCallInProgressEvent + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseCodeInterpreterCallInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseCodeInterpreterCallInProgressEvent. */ + protected OpenAIResponseCodeInterpreterCallInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance and + * return the same instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call.in_progress`. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.code_interpreter_call.in_progress`. + * + * @return type The type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call.in_progress`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance + * and return the same instance. + * + * @param outputIndex The index of the output item in the response for which the code interpreter + * call is in progress. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInProgressEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response for which the code interpreter call is in + * progress. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item in the response for which the code interpreter + * call is in progress. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance and + * return the same instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInProgressEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the code interpreter tool call item. + * + * @return itemId The itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance and return the same instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event, used to order streaming events. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseCodeInterpreterCallInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseCodeInterpreterCallInProgressEvent has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * OpenAIResponseCodeInterpreterCallInProgressEvent} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseCodeInterpreterCallInProgressEvent + openAIResponseCodeInterpreterCallInProgressEvent = + (OpenAIResponseCodeInterpreterCallInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseCodeInterpreterCallInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseCodeInterpreterCallInProgressEvent.type) + && Objects.equals( + this.outputIndex, openAIResponseCodeInterpreterCallInProgressEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseCodeInterpreterCallInProgressEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseCodeInterpreterCallInProgressEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseCodeInterpreterCallInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseCodeInterpreterCallInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseCodeInterpreterCallInProgressEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call.in_progress`. + * @return The OpenAIResponseCodeInterpreterCallInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance. + * + * @param outputIndex The index of the output item in the response for which the code + * interpreter call is in progress. + * @return The OpenAIResponseCodeInterpreterCallInProgressEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + * @return The OpenAIResponseCodeInterpreterCallInProgressEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + * @return The OpenAIResponseCodeInterpreterCallInProgressEvent instance. + */ + OpenAIResponseCodeInterpreterCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java new file mode 100644 index 000000000..0a7ae3698 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java @@ -0,0 +1,436 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when the code interpreter is actively interpreting the code snippet. */ +// CHECKSTYLE:OFF +public class OpenAIResponseCodeInterpreterCallInterpretingEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.code_interpreter_call.interpreting`. */ + public enum TypeEnum { + /** + * The RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING option of this + * OpenAIResponseCodeInterpreterCallInterpretingEvent + */ + RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING("response.code_interpreter_call.interpreting"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this + * OpenAIResponseCodeInterpreterCallInterpretingEvent + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseCodeInterpreterCallInterpretingEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseCodeInterpreterCallInterpretingEvent. */ + protected OpenAIResponseCodeInterpreterCallInterpretingEvent() {} + + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance and + * return the same instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call.interpreting`. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInterpretingEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.code_interpreter_call.interpreting`. + * + * @return type The type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call.interpreting`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance + * and return the same instance. + * + * @param outputIndex The index of the output item in the response for which the code interpreter + * is interpreting code. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInterpretingEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response for which the code interpreter is interpreting + * code. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance. + * + * @param outputIndex The index of the output item in the response for which the code interpreter + * is interpreting code. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance and + * return the same instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInterpretingEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the code interpreter tool call item. + * + * @return itemId The itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance and return the same instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * class + */ + @Nonnull + public OpenAIResponseCodeInterpreterCallInterpretingEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event, used to order streaming events. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseCodeInterpreterCallInterpretingEvent has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. If the map previously contained a + * mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseCodeInterpreterCallInterpretingEvent + openAIResponseCodeInterpreterCallInterpretingEvent = + (OpenAIResponseCodeInterpreterCallInterpretingEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseCodeInterpreterCallInterpretingEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseCodeInterpreterCallInterpretingEvent.type) + && Objects.equals( + this.outputIndex, openAIResponseCodeInterpreterCallInterpretingEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseCodeInterpreterCallInterpretingEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseCodeInterpreterCallInterpretingEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseCodeInterpreterCallInterpretingEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseCodeInterpreterCallInterpretingEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + * + * @param type The type of the event. Always + * `response.code_interpreter_call.interpreting`. + * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance. + * + * @param outputIndex The index of the output item in the response for which the code + * interpreter is interpreting code. + * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. + * + * @param itemId The unique identifier of the code interpreter tool call item. + * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event, used to order streaming events. + * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent instance. + */ + OpenAIResponseCodeInterpreterCallInterpretingEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java new file mode 100644 index 000000000..69508d822 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java @@ -0,0 +1,508 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a new content part is added. */ +// CHECKSTYLE:OFF +public class OpenAIResponseContentPartAddedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.content_part.added`. */ + public enum TypeEnum { + /** The RESPONSE_CONTENT_PART_ADDED option of this OpenAIResponseContentPartAddedEvent */ + RESPONSE_CONTENT_PART_ADDED("response.content_part.added"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseContentPartAddedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseContentPartAddedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("content_index") + private Integer contentIndex; + + @JsonProperty("part") + private OpenAIOutputContent part; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseContentPartAddedEvent. */ + protected OpenAIResponseContentPartAddedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseContentPartAddedEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.content_part.added`. + * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseContentPartAddedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.content_part.added`. + * + * @return type The type of this {@link OpenAIResponseContentPartAddedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param type The type of the event. Always `response.content_part.added`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseContentPartAddedEvent} instance and return the same + * instance. + * + * @param itemId The ID of the output item that the content part was added to. + * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseContentPartAddedEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the output item that the content part was added to. + * + * @return itemId The itemId of this {@link OpenAIResponseContentPartAddedEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param itemId The ID of the output item that the content part was added to. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseContentPartAddedEvent} instance and return the + * same instance. + * + * @param outputIndex The index of the output item that the content part was added to. + * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseContentPartAddedEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the content part was added to. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseContentPartAddedEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param outputIndex The index of the output item that the content part was added to. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseContentPartAddedEvent} instance and return + * the same instance. + * + * @param contentIndex The index of the content part that was added. + * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseContentPartAddedEvent contentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + return this; + } + + /** + * The index of the content part that was added. + * + * @return contentIndex The contentIndex of this {@link OpenAIResponseContentPartAddedEvent} + * instance. + */ + @Nonnull + public Integer getContentIndex() { + return contentIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param contentIndex The index of the content part that was added. + */ + public void setContentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + } + + /** + * Set the part of this {@link OpenAIResponseContentPartAddedEvent} instance and return the same + * instance. + * + * @param part The content part that was added. + * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseContentPartAddedEvent part(@Nonnull final OpenAIOutputContent part) { + this.part = part; + return this; + } + + /** + * The content part that was added. + * + * @return part The part of this {@link OpenAIResponseContentPartAddedEvent} instance. + */ + @Nonnull + public OpenAIOutputContent getPart() { + return part; + } + + /** + * Set the part of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param part The content part that was added. + */ + public void setPart(@Nonnull final OpenAIOutputContent part) { + this.part = part; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} instance and return + * the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseContentPartAddedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseContentPartAddedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseContentPartAddedEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseContentPartAddedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseContentPartAddedEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); + if (part != null) declaredFields.put("part", part); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseContentPartAddedEvent} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseContentPartAddedEvent openAIResponseContentPartAddedEvent = + (OpenAIResponseContentPartAddedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseContentPartAddedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseContentPartAddedEvent.type) + && Objects.equals(this.itemId, openAIResponseContentPartAddedEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseContentPartAddedEvent.outputIndex) + && Objects.equals(this.contentIndex, openAIResponseContentPartAddedEvent.contentIndex) + && Objects.equals(this.part, openAIResponseContentPartAddedEvent.part) + && Objects.equals(this.sequenceNumber, openAIResponseContentPartAddedEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + type, itemId, outputIndex, contentIndex, part, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseContentPartAddedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); + sb.append(" part: ").append(toIndentedString(part)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseContentPartAddedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (contentIndex) -> + (part) -> + (sequenceNumber) -> + new OpenAIResponseContentPartAddedEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .contentIndex(contentIndex) + .part(part) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param type The type of the event. Always `response.content_part.added`. + * @return The OpenAIResponseContentPartAddedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param itemId The ID of the output item that the content part was added to. + * @return The OpenAIResponseContentPartAddedEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param outputIndex The index of the output item that the content part was added to. + * @return The OpenAIResponseContentPartAddedEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the contentIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param contentIndex The index of the content part that was added. + * @return The OpenAIResponseContentPartAddedEvent builder. + */ + Builder4 contentIndex(@Nonnull final Integer contentIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the part of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param part The content part that was added. + * @return The OpenAIResponseContentPartAddedEvent builder. + */ + Builder5 part(@Nonnull final OpenAIOutputContent part); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseContentPartAddedEvent instance. + */ + OpenAIResponseContentPartAddedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java new file mode 100644 index 000000000..a53053733 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java @@ -0,0 +1,347 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** An event that is emitted when a response is created. */ +// CHECKSTYLE:OFF +public class OpenAIResponseCreatedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.created`. */ + public enum TypeEnum { + /** The RESPONSE_CREATED option of this OpenAIResponseCreatedEvent */ + RESPONSE_CREATED("response.created"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCreatedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseCreatedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("response") + private OpenAIResponse response; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseCreatedEvent. */ + protected OpenAIResponseCreatedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseCreatedEvent} instance and return the same instance. + * + * @param type The type of the event. Always `response.created`. + * @return The same instance of this {@link OpenAIResponseCreatedEvent} class + */ + @Nonnull + public OpenAIResponseCreatedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.created`. + * + * @return type The type of this {@link OpenAIResponseCreatedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseCreatedEvent} instance. + * + * @param type The type of the event. Always `response.created`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the response of this {@link OpenAIResponseCreatedEvent} instance and return the same + * instance. + * + * @param response The response that was created. + * @return The same instance of this {@link OpenAIResponseCreatedEvent} class + */ + @Nonnull + public OpenAIResponseCreatedEvent response(@Nonnull final OpenAIResponse response) { + this.response = response; + return this; + } + + /** + * The response that was created. + * + * @return response The response of this {@link OpenAIResponseCreatedEvent} instance. + */ + @Nonnull + public OpenAIResponse getResponse() { + return response; + } + + /** + * Set the response of this {@link OpenAIResponseCreatedEvent} instance. + * + * @param response The response that was created. + */ + public void setResponse(@Nonnull final OpenAIResponse response) { + this.response = response; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance and return the same + * instance. + * + * @param sequenceNumber The sequence number for this event. + * @return The same instance of this {@link OpenAIResponseCreatedEvent} class + */ + @Nonnull + public OpenAIResponseCreatedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number for this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance. + * + * @param sequenceNumber The sequence number for this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseCreatedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseCreatedEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseCreatedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseCreatedEvent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (response != null) declaredFields.put("response", response); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseCreatedEvent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseCreatedEvent openAIResponseCreatedEvent = (OpenAIResponseCreatedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseCreatedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseCreatedEvent.type) + && Objects.equals(this.response, openAIResponseCreatedEvent.response) + && Objects.equals(this.sequenceNumber, openAIResponseCreatedEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseCreatedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseCreatedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (response) -> + (sequenceNumber) -> + new OpenAIResponseCreatedEvent() + .type(type) + .response(response) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseCreatedEvent} instance. + * + * @param type The type of the event. Always `response.created`. + * @return The OpenAIResponseCreatedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the response of this {@link OpenAIResponseCreatedEvent} instance. + * + * @param response The response that was created. + * @return The OpenAIResponseCreatedEvent builder. + */ + Builder2 response(@Nonnull final OpenAIResponse response); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance. + * + * @param sequenceNumber The sequence number for this event. + * @return The OpenAIResponseCreatedEvent instance. + */ + OpenAIResponseCreatedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java new file mode 100644 index 000000000..b76d1fa43 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java @@ -0,0 +1,462 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Event representing a delta (partial update) to the input of a custom tool call. */ +// CHECKSTYLE:OFF +public class OpenAIResponseCustomToolCallInputDeltaEvent +// CHECKSTYLE:ON +{ + /** The event type identifier. */ + public enum TypeEnum { + /** + * The RESPONSE_CUSTOM_TOOL_CALL_INPUT_DELTA option of this + * OpenAIResponseCustomToolCallInputDeltaEvent + */ + RESPONSE_CUSTOM_TOOL_CALL_INPUT_DELTA("response.custom_tool_call_input.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCustomToolCallInputDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseCustomToolCallInputDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("delta") + private String delta; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseCustomToolCallInputDeltaEvent. */ + protected OpenAIResponseCustomToolCallInputDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and return + * the same instance. + * + * @param type The event type identifier. + * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCustomToolCallInputDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The event type identifier. + * + * @return type The type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param type The event type identifier. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCustomToolCallInputDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseCustomToolCallInputDeltaEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output this delta applies to. + * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCustomToolCallInputDeltaEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output this delta applies to. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param outputIndex The index of the output this delta applies to. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and return + * the same instance. + * + * @param itemId Unique identifier for the API item associated with this event. + * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCustomToolCallInputDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Unique identifier for the API item associated with this event. + * + * @return itemId The itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param itemId Unique identifier for the API item associated with this event. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and return + * the same instance. + * + * @param delta The incremental input data (delta) for the custom tool call. + * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class + */ + @Nonnull + public OpenAIResponseCustomToolCallInputDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The incremental input data (delta) for the custom tool call. + * + * @return delta The delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param delta The incremental input data (delta) for the custom tool call. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseCustomToolCallInputDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseCustomToolCallInputDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (delta != null) declaredFields.put("delta", delta); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseCustomToolCallInputDeltaEvent openAIResponseCustomToolCallInputDeltaEvent = + (OpenAIResponseCustomToolCallInputDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseCustomToolCallInputDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseCustomToolCallInputDeltaEvent.type) + && Objects.equals( + this.sequenceNumber, openAIResponseCustomToolCallInputDeltaEvent.sequenceNumber) + && Objects.equals(this.outputIndex, openAIResponseCustomToolCallInputDeltaEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseCustomToolCallInputDeltaEvent.itemId) + && Objects.equals(this.delta, openAIResponseCustomToolCallInputDeltaEvent.delta); + } + + @Override + public int hashCode() { + return Objects.hash(type, sequenceNumber, outputIndex, itemId, delta, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseCustomToolCallInputDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseCustomToolCallInputDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (sequenceNumber) -> + (outputIndex) -> + (itemId) -> + (delta) -> + new OpenAIResponseCustomToolCallInputDeltaEvent() + .type(type) + .sequenceNumber(sequenceNumber) + .outputIndex(outputIndex) + .itemId(itemId) + .delta(delta); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param type The event type identifier. + * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. + */ + Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param outputIndex The index of the output this delta applies to. + * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param itemId Unique identifier for the API item associated with this event. + * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. + */ + Builder4 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. + * + * @param delta The incremental input data (delta) for the custom tool call. + * @return The OpenAIResponseCustomToolCallInputDeltaEvent instance. + */ + OpenAIResponseCustomToolCallInputDeltaEvent delta(@Nonnull final String delta); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java new file mode 100644 index 000000000..d61535afb --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java @@ -0,0 +1,444 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when an error occurs. */ +// CHECKSTYLE:OFF +public class OpenAIResponseErrorEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `error`. */ + public enum TypeEnum { + /** The ERROR option of this OpenAIResponseErrorEvent */ + ERROR("error"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseErrorEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseErrorEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("code") + private String code; + + @JsonProperty("message") + private String message; + + @JsonProperty("param") + private String param; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseErrorEvent. */ + protected OpenAIResponseErrorEvent() {} + + /** + * Set the type of this {@link OpenAIResponseErrorEvent} instance and return the same instance. + * + * @param type The type of the event. Always `error`. + * @return The same instance of this {@link OpenAIResponseErrorEvent} class + */ + @Nonnull + public OpenAIResponseErrorEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `error`. + * + * @return type The type of this {@link OpenAIResponseErrorEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseErrorEvent} instance. + * + * @param type The type of the event. Always `error`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the code of this {@link OpenAIResponseErrorEvent} instance and return the same instance. + * + * @param code The code of this {@link OpenAIResponseErrorEvent} + * @return The same instance of this {@link OpenAIResponseErrorEvent} class + */ + @Nonnull + public OpenAIResponseErrorEvent code(@Nullable final String code) { + this.code = code; + return this; + } + + /** + * Get code + * + * @return code The code of this {@link OpenAIResponseErrorEvent} instance. + */ + @Nullable + public String getCode() { + return code; + } + + /** + * Set the code of this {@link OpenAIResponseErrorEvent} instance. + * + * @param code The code of this {@link OpenAIResponseErrorEvent} + */ + public void setCode(@Nullable final String code) { + this.code = code; + } + + /** + * Set the message of this {@link OpenAIResponseErrorEvent} instance and return the same instance. + * + * @param message The error message. + * @return The same instance of this {@link OpenAIResponseErrorEvent} class + */ + @Nonnull + public OpenAIResponseErrorEvent message(@Nonnull final String message) { + this.message = message; + return this; + } + + /** + * The error message. + * + * @return message The message of this {@link OpenAIResponseErrorEvent} instance. + */ + @Nonnull + public String getMessage() { + return message; + } + + /** + * Set the message of this {@link OpenAIResponseErrorEvent} instance. + * + * @param message The error message. + */ + public void setMessage(@Nonnull final String message) { + this.message = message; + } + + /** + * Set the param of this {@link OpenAIResponseErrorEvent} instance and return the same instance. + * + * @param param The param of this {@link OpenAIResponseErrorEvent} + * @return The same instance of this {@link OpenAIResponseErrorEvent} class + */ + @Nonnull + public OpenAIResponseErrorEvent param(@Nullable final String param) { + this.param = param; + return this; + } + + /** + * Get param + * + * @return param The param of this {@link OpenAIResponseErrorEvent} instance. + */ + @Nullable + public String getParam() { + return param; + } + + /** + * Set the param of this {@link OpenAIResponseErrorEvent} instance. + * + * @param param The param of this {@link OpenAIResponseErrorEvent} + */ + public void setParam(@Nullable final String param) { + this.param = param; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseErrorEvent} instance and return the same + * instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseErrorEvent} class + */ + @Nonnull + public OpenAIResponseErrorEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseErrorEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseErrorEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseErrorEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseErrorEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseErrorEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseErrorEvent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (code != null) declaredFields.put("code", code); + if (message != null) declaredFields.put("message", message); + if (param != null) declaredFields.put("param", param); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseErrorEvent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseErrorEvent openAIResponseErrorEvent = (OpenAIResponseErrorEvent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseErrorEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseErrorEvent.type) + && Objects.equals(this.code, openAIResponseErrorEvent.code) + && Objects.equals(this.message, openAIResponseErrorEvent.message) + && Objects.equals(this.param, openAIResponseErrorEvent.param) + && Objects.equals(this.sequenceNumber, openAIResponseErrorEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, code, message, param, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseErrorEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseErrorEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (code) -> + (message) -> + (param) -> + (sequenceNumber) -> + new OpenAIResponseErrorEvent() + .type(type) + .code(code) + .message(message) + .param(param) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseErrorEvent} instance. + * + * @param type The type of the event. Always `error`. + * @return The OpenAIResponseErrorEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the code of this {@link OpenAIResponseErrorEvent} instance. + * + * @param code The code of this {@link OpenAIResponseErrorEvent} + * @return The OpenAIResponseErrorEvent builder. + */ + Builder2 code(@Nullable final String code); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the message of this {@link OpenAIResponseErrorEvent} instance. + * + * @param message The error message. + * @return The OpenAIResponseErrorEvent builder. + */ + Builder3 message(@Nonnull final String message); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the param of this {@link OpenAIResponseErrorEvent} instance. + * + * @param param The param of this {@link OpenAIResponseErrorEvent} + * @return The OpenAIResponseErrorEvent builder. + */ + Builder4 param(@Nullable final String param); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseErrorEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseErrorEvent instance. + */ + OpenAIResponseErrorEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java new file mode 100644 index 000000000..1b09e8689 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java @@ -0,0 +1,345 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** An event that is emitted when a response fails. */ +// CHECKSTYLE:OFF +public class OpenAIResponseFailedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.failed`. */ + public enum TypeEnum { + /** The RESPONSE_FAILED option of this OpenAIResponseFailedEvent */ + RESPONSE_FAILED("response.failed"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFailedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseFailedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("response") + private OpenAIResponse response; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseFailedEvent. */ + protected OpenAIResponseFailedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseFailedEvent} instance and return the same instance. + * + * @param type The type of the event. Always `response.failed`. + * @return The same instance of this {@link OpenAIResponseFailedEvent} class + */ + @Nonnull + public OpenAIResponseFailedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.failed`. + * + * @return type The type of this {@link OpenAIResponseFailedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseFailedEvent} instance. + * + * @param type The type of the event. Always `response.failed`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFailedEvent} instance and return the same + * instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseFailedEvent} class + */ + @Nonnull + public OpenAIResponseFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseFailedEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFailedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the response of this {@link OpenAIResponseFailedEvent} instance and return the same + * instance. + * + * @param response The response that failed. + * @return The same instance of this {@link OpenAIResponseFailedEvent} class + */ + @Nonnull + public OpenAIResponseFailedEvent response(@Nonnull final OpenAIResponse response) { + this.response = response; + return this; + } + + /** + * The response that failed. + * + * @return response The response of this {@link OpenAIResponseFailedEvent} instance. + */ + @Nonnull + public OpenAIResponse getResponse() { + return response; + } + + /** + * Set the response of this {@link OpenAIResponseFailedEvent} instance. + * + * @param response The response that failed. + */ + public void setResponse(@Nonnull final OpenAIResponse response) { + this.response = response; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseFailedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseFailedEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseFailedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseFailedEvent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (response != null) declaredFields.put("response", response); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseFailedEvent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseFailedEvent openAIResponseFailedEvent = (OpenAIResponseFailedEvent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseFailedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseFailedEvent.type) + && Objects.equals(this.sequenceNumber, openAIResponseFailedEvent.sequenceNumber) + && Objects.equals(this.response, openAIResponseFailedEvent.response); + } + + @Override + public int hashCode() { + return Objects.hash(type, sequenceNumber, response, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseFailedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseFailedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (sequenceNumber) -> + (response) -> + new OpenAIResponseFailedEvent() + .type(type) + .sequenceNumber(sequenceNumber) + .response(response); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseFailedEvent} instance. + * + * @param type The type of the event. Always `response.failed`. + * @return The OpenAIResponseFailedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseFailedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseFailedEvent builder. + */ + Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the response of this {@link OpenAIResponseFailedEvent} instance. + * + * @param response The response that failed. + * @return The OpenAIResponseFailedEvent instance. + */ + OpenAIResponseFailedEvent response(@Nonnull final OpenAIResponse response); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java new file mode 100644 index 000000000..257ee0190 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java @@ -0,0 +1,412 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a file search call is initiated. */ +// CHECKSTYLE:OFF +public class OpenAIResponseFileSearchCallInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.file_search_call.in_progress`. */ + public enum TypeEnum { + /** + * The RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS option of this + * OpenAIResponseFileSearchCallInProgressEvent + */ + RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS("response.file_search_call.in_progress"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFileSearchCallInProgressEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseFileSearchCallInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseFileSearchCallInProgressEvent. */ + protected OpenAIResponseFileSearchCallInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and return + * the same instance. + * + * @param type The type of the event. Always `response.file_search_call.in_progress`. + * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.file_search_call.in_progress`. + * + * @return type The type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param type The type of the event. Always `response.file_search_call.in_progress`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item that the file search call is initiated. + * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallInProgressEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the file search call is initiated. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item that the file search call is initiated. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and return + * the same instance. + * + * @param itemId The ID of the output item that the file search call is initiated. + * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallInProgressEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the output item that the file search call is initiated. + * + * @return itemId The itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param itemId The ID of the output item that the file search call is initiated. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseFileSearchCallInProgressEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseFileSearchCallInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseFileSearchCallInProgressEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseFileSearchCallInProgressEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseFileSearchCallInProgressEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseFileSearchCallInProgressEvent openAIResponseFileSearchCallInProgressEvent = + (OpenAIResponseFileSearchCallInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseFileSearchCallInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseFileSearchCallInProgressEvent.type) + && Objects.equals(this.outputIndex, openAIResponseFileSearchCallInProgressEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseFileSearchCallInProgressEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseFileSearchCallInProgressEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseFileSearchCallInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseFileSearchCallInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseFileSearchCallInProgressEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param type The type of the event. Always `response.file_search_call.in_progress`. + * @return The OpenAIResponseFileSearchCallInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item that the file search call is initiated. + * @return The OpenAIResponseFileSearchCallInProgressEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param itemId The ID of the output item that the file search call is initiated. + * @return The OpenAIResponseFileSearchCallInProgressEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseFileSearchCallInProgressEvent instance. + */ + OpenAIResponseFileSearchCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java new file mode 100644 index 000000000..4df81087b --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java @@ -0,0 +1,412 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a file search is currently searching. */ +// CHECKSTYLE:OFF +public class OpenAIResponseFileSearchCallSearchingEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.file_search_call.searching`. */ + public enum TypeEnum { + /** + * The RESPONSE_FILE_SEARCH_CALL_SEARCHING option of this + * OpenAIResponseFileSearchCallSearchingEvent + */ + RESPONSE_FILE_SEARCH_CALL_SEARCHING("response.file_search_call.searching"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFileSearchCallSearchingEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseFileSearchCallSearchingEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseFileSearchCallSearchingEvent. */ + protected OpenAIResponseFileSearchCallSearchingEvent() {} + + /** + * Set the type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always `response.file_search_call.searching`. + * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallSearchingEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.file_search_call.searching`. + * + * @return type The type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param type The type of the event. Always `response.file_search_call.searching`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item that the file search call is searching. + * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallSearchingEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the file search call is searching. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param outputIndex The index of the output item that the file search call is searching. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and return + * the same instance. + * + * @param itemId The ID of the output item that the file search call is initiated. + * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallSearchingEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the output item that the file search call is initiated. + * + * @return itemId The itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param itemId The ID of the output item that the file search call is initiated. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseFileSearchCallSearchingEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseFileSearchCallSearchingEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseFileSearchCallSearchingEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseFileSearchCallSearchingEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseFileSearchCallSearchingEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseFileSearchCallSearchingEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseFileSearchCallSearchingEvent openAIResponseFileSearchCallSearchingEvent = + (OpenAIResponseFileSearchCallSearchingEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseFileSearchCallSearchingEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseFileSearchCallSearchingEvent.type) + && Objects.equals(this.outputIndex, openAIResponseFileSearchCallSearchingEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseFileSearchCallSearchingEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseFileSearchCallSearchingEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseFileSearchCallSearchingEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseFileSearchCallSearchingEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseFileSearchCallSearchingEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param type The type of the event. Always `response.file_search_call.searching`. + * @return The OpenAIResponseFileSearchCallSearchingEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param outputIndex The index of the output item that the file search call is searching. + * @return The OpenAIResponseFileSearchCallSearchingEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param itemId The ID of the output item that the file search call is initiated. + * @return The OpenAIResponseFileSearchCallSearchingEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseFileSearchCallSearchingEvent instance. + */ + OpenAIResponseFileSearchCallSearchingEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java new file mode 100644 index 000000000..64757f503 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java @@ -0,0 +1,469 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when there is a partial function-call arguments delta. */ +// CHECKSTYLE:OFF +public class OpenAIResponseFunctionCallArgumentsDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.function_call_arguments.delta`. */ + public enum TypeEnum { + /** + * The RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA option of this + * OpenAIResponseFunctionCallArgumentsDeltaEvent + */ + RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA("response.function_call_arguments.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFunctionCallArgumentsDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseFunctionCallArgumentsDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("delta") + private String delta; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseFunctionCallArgumentsDeltaEvent. */ + protected OpenAIResponseFunctionCallArgumentsDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and return + * the same instance. + * + * @param type The type of the event. Always `response.function_call_arguments.delta`. + * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseFunctionCallArgumentsDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.function_call_arguments.delta`. + * + * @return type The type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param type The type of the event. Always `response.function_call_arguments.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and + * return the same instance. + * + * @param itemId The ID of the output item that the function-call arguments delta is added to. + * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseFunctionCallArgumentsDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the output item that the function-call arguments delta is added to. + * + * @return itemId The itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param itemId The ID of the output item that the function-call arguments delta is added to. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item that the function-call arguments delta is added + * to. + * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseFunctionCallArgumentsDeltaEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the function-call arguments delta is added to. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param outputIndex The index of the output item that the function-call arguments delta is added + * to. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance + * and return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseFunctionCallArgumentsDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and return + * the same instance. + * + * @param delta The function-call arguments delta that is added. + * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseFunctionCallArgumentsDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The function-call arguments delta that is added. + * + * @return delta The delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param delta The function-call arguments delta that is added. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseFunctionCallArgumentsDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseFunctionCallArgumentsDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (delta != null) declaredFields.put("delta", delta); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseFunctionCallArgumentsDeltaEvent + openAIResponseFunctionCallArgumentsDeltaEvent = + (OpenAIResponseFunctionCallArgumentsDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseFunctionCallArgumentsDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseFunctionCallArgumentsDeltaEvent.type) + && Objects.equals(this.itemId, openAIResponseFunctionCallArgumentsDeltaEvent.itemId) + && Objects.equals( + this.outputIndex, openAIResponseFunctionCallArgumentsDeltaEvent.outputIndex) + && Objects.equals( + this.sequenceNumber, openAIResponseFunctionCallArgumentsDeltaEvent.sequenceNumber) + && Objects.equals(this.delta, openAIResponseFunctionCallArgumentsDeltaEvent.delta); + } + + @Override + public int hashCode() { + return Objects.hash(type, itemId, outputIndex, sequenceNumber, delta, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseFunctionCallArgumentsDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (sequenceNumber) -> + (delta) -> + new OpenAIResponseFunctionCallArgumentsDeltaEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .sequenceNumber(sequenceNumber) + .delta(delta); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param type The type of the event. Always `response.function_call_arguments.delta`. + * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param itemId The ID of the output item that the function-call arguments delta is added to. + * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param outputIndex The index of the output item that the function-call arguments delta is + * added to. + * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} + * instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. + */ + Builder4 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. + * + * @param delta The function-call arguments delta that is added. + * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent instance. + */ + OpenAIResponseFunctionCallArgumentsDeltaEvent delta(@Nonnull final String delta); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java new file mode 100644 index 000000000..71b831c5f --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java @@ -0,0 +1,413 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * Emitted when an image generation tool call is actively generating an image (intermediate state). + */ +// CHECKSTYLE:OFF +public class OpenAIResponseImageGenCallGeneratingEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.image_generation_call.generating'. */ + public enum TypeEnum { + /** + * The RESPONSE_IMAGE_GENERATION_CALL_GENERATING option of this + * OpenAIResponseImageGenCallGeneratingEvent + */ + RESPONSE_IMAGE_GENERATION_CALL_GENERATING("response.image_generation_call.generating"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseImageGenCallGeneratingEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseImageGenCallGeneratingEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseImageGenCallGeneratingEvent. */ + protected OpenAIResponseImageGenCallGeneratingEvent() {} + + /** + * Set the type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always 'response.image_generation_call.generating'. + * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallGeneratingEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.image_generation_call.generating'. + * + * @return type The type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param type The type of the event. Always 'response.image_generation_call.generating'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallGeneratingEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response's output array. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and return + * the same instance. + * + * @param itemId The unique identifier of the image generation item being processed. + * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallGeneratingEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the image generation item being processed. + * + * @return itemId The itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param itemId The unique identifier of the image generation item being processed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallGeneratingEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of the image generation item being processed. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseImageGenCallGeneratingEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseImageGenCallGeneratingEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseImageGenCallGeneratingEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseImageGenCallGeneratingEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseImageGenCallGeneratingEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseImageGenCallGeneratingEvent openAIResponseImageGenCallGeneratingEvent = + (OpenAIResponseImageGenCallGeneratingEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseImageGenCallGeneratingEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseImageGenCallGeneratingEvent.type) + && Objects.equals(this.outputIndex, openAIResponseImageGenCallGeneratingEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseImageGenCallGeneratingEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseImageGenCallGeneratingEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseImageGenCallGeneratingEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseImageGenCallGeneratingEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseImageGenCallGeneratingEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param type The type of the event. Always + * 'response.image_generation_call.generating'. + * @return The OpenAIResponseImageGenCallGeneratingEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The OpenAIResponseImageGenCallGeneratingEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param itemId The unique identifier of the image generation item being processed. + * @return The OpenAIResponseImageGenCallGeneratingEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + * @return The OpenAIResponseImageGenCallGeneratingEvent instance. + */ + OpenAIResponseImageGenCallGeneratingEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java new file mode 100644 index 000000000..d7330b646 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java @@ -0,0 +1,411 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when an image generation tool call is in progress. */ +// CHECKSTYLE:OFF +public class OpenAIResponseImageGenCallInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.image_generation_call.in_progress'. */ + public enum TypeEnum { + /** + * The RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS option of this + * OpenAIResponseImageGenCallInProgressEvent + */ + RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS("response.image_generation_call.in_progress"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseImageGenCallInProgressEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseImageGenCallInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseImageGenCallInProgressEvent. */ + protected OpenAIResponseImageGenCallInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always 'response.image_generation_call.in_progress'. + * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.image_generation_call.in_progress'. + * + * @return type The type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param type The type of the event. Always 'response.image_generation_call.in_progress'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallInProgressEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response's output array. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and return + * the same instance. + * + * @param itemId The unique identifier of the image generation item being processed. + * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallInProgressEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the image generation item being processed. + * + * @return itemId The itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param itemId The unique identifier of the image generation item being processed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of the image generation item being processed. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseImageGenCallInProgressEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseImageGenCallInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseImageGenCallInProgressEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseImageGenCallInProgressEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseImageGenCallInProgressEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseImageGenCallInProgressEvent openAIResponseImageGenCallInProgressEvent = + (OpenAIResponseImageGenCallInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseImageGenCallInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseImageGenCallInProgressEvent.type) + && Objects.equals(this.outputIndex, openAIResponseImageGenCallInProgressEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseImageGenCallInProgressEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseImageGenCallInProgressEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseImageGenCallInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseImageGenCallInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseImageGenCallInProgressEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param type The type of the event. Always + * 'response.image_generation_call.in_progress'. + * @return The OpenAIResponseImageGenCallInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The OpenAIResponseImageGenCallInProgressEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param itemId The unique identifier of the image generation item being processed. + * @return The OpenAIResponseImageGenCallInProgressEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + * @return The OpenAIResponseImageGenCallInProgressEvent instance. + */ + OpenAIResponseImageGenCallInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java new file mode 100644 index 000000000..3dcc2e6a4 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java @@ -0,0 +1,534 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a partial image is available during image generation streaming. */ +// CHECKSTYLE:OFF +public class OpenAIResponseImageGenCallPartialImageEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.image_generation_call.partial_image'. */ + public enum TypeEnum { + /** + * The RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE option of this + * OpenAIResponseImageGenCallPartialImageEvent + */ + RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE("response.image_generation_call.partial_image"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseImageGenCallPartialImageEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseImageGenCallPartialImageEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("partial_image_index") + private Integer partialImageIndex; + + @JsonProperty("partial_image_b64") + private String partialImageB64; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseImageGenCallPartialImageEvent. */ + protected OpenAIResponseImageGenCallPartialImageEvent() {} + + /** + * Set the type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and return + * the same instance. + * + * @param type The type of the event. Always + * 'response.image_generation_call.partial_image'. + * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallPartialImageEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.image_generation_call.partial_image'. + * + * @return type The type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param type The type of the event. Always + * 'response.image_generation_call.partial_image'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallPartialImageEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response's output array. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and return + * the same instance. + * + * @param itemId The unique identifier of the image generation item being processed. + * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallPartialImageEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the image generation item being processed. + * + * @return itemId The itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param itemId The unique identifier of the image generation item being processed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallPartialImageEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of the image generation item being processed. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseImageGenCallPartialImageEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the partialImageIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance + * and return the same instance. + * + * @param partialImageIndex 0-based index for the partial image (backend is 1-based, but this is + * 0-based for the user). + * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallPartialImageEvent partialImageIndex( + @Nonnull final Integer partialImageIndex) { + this.partialImageIndex = partialImageIndex; + return this; + } + + /** + * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + * + * @return partialImageIndex The partialImageIndex of this {@link + * OpenAIResponseImageGenCallPartialImageEvent} instance. + */ + @Nonnull + public Integer getPartialImageIndex() { + return partialImageIndex; + } + + /** + * Set the partialImageIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param partialImageIndex 0-based index for the partial image (backend is 1-based, but this is + * 0-based for the user). + */ + public void setPartialImageIndex(@Nonnull final Integer partialImageIndex) { + this.partialImageIndex = partialImageIndex; + } + + /** + * Set the partialImageB64 of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance + * and return the same instance. + * + * @param partialImageB64 Base64-encoded partial image data, suitable for rendering as an image. + * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class + */ + @Nonnull + public OpenAIResponseImageGenCallPartialImageEvent partialImageB64( + @Nonnull final String partialImageB64) { + this.partialImageB64 = partialImageB64; + return this; + } + + /** + * Base64-encoded partial image data, suitable for rendering as an image. + * + * @return partialImageB64 The partialImageB64 of this {@link + * OpenAIResponseImageGenCallPartialImageEvent} instance. + */ + @Nonnull + public String getPartialImageB64() { + return partialImageB64; + } + + /** + * Set the partialImageB64 of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param partialImageB64 Base64-encoded partial image data, suitable for rendering as an image. + */ + public void setPartialImageB64(@Nonnull final String partialImageB64) { + this.partialImageB64 = partialImageB64; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseImageGenCallPartialImageEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseImageGenCallPartialImageEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseImageGenCallPartialImageEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (partialImageIndex != null) declaredFields.put("partialImageIndex", partialImageIndex); + if (partialImageB64 != null) declaredFields.put("partialImageB64", partialImageB64); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseImageGenCallPartialImageEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseImageGenCallPartialImageEvent openAIResponseImageGenCallPartialImageEvent = + (OpenAIResponseImageGenCallPartialImageEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseImageGenCallPartialImageEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseImageGenCallPartialImageEvent.type) + && Objects.equals(this.outputIndex, openAIResponseImageGenCallPartialImageEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseImageGenCallPartialImageEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseImageGenCallPartialImageEvent.sequenceNumber) + && Objects.equals( + this.partialImageIndex, openAIResponseImageGenCallPartialImageEvent.partialImageIndex) + && Objects.equals( + this.partialImageB64, openAIResponseImageGenCallPartialImageEvent.partialImageB64); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + outputIndex, + itemId, + sequenceNumber, + partialImageIndex, + partialImageB64, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseImageGenCallPartialImageEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" partialImageIndex: ").append(toIndentedString(partialImageIndex)).append("\n"); + sb.append(" partialImageB64: ").append(toIndentedString(partialImageB64)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseImageGenCallPartialImageEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + (partialImageIndex) -> + (partialImageB64) -> + new OpenAIResponseImageGenCallPartialImageEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber) + .partialImageIndex(partialImageIndex) + .partialImageB64(partialImageB64); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param type The type of the event. Always + * 'response.image_generation_call.partial_image'. + * @return The OpenAIResponseImageGenCallPartialImageEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The OpenAIResponseImageGenCallPartialImageEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param itemId The unique identifier of the image generation item being processed. + * @return The OpenAIResponseImageGenCallPartialImageEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param sequenceNumber The sequence number of the image generation item being processed. + * @return The OpenAIResponseImageGenCallPartialImageEvent builder. + */ + Builder4 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the partialImageIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} + * instance. + * + * @param partialImageIndex 0-based index for the partial image (backend is 1-based, but this is + * 0-based for the user). + * @return The OpenAIResponseImageGenCallPartialImageEvent builder. + */ + Builder5 partialImageIndex(@Nonnull final Integer partialImageIndex); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the partialImageB64 of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. + * + * @param partialImageB64 Base64-encoded partial image data, suitable for rendering as an image. + * @return The OpenAIResponseImageGenCallPartialImageEvent instance. + */ + OpenAIResponseImageGenCallPartialImageEvent partialImageB64( + @Nonnull final String partialImageB64); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java new file mode 100644 index 000000000..4ce18a6a3 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java @@ -0,0 +1,351 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when the response is in progress. */ +// CHECKSTYLE:OFF +public class OpenAIResponseInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.in_progress`. */ + public enum TypeEnum { + /** The RESPONSE_IN_PROGRESS option of this OpenAIResponseInProgressEvent */ + RESPONSE_IN_PROGRESS("response.in_progress"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseInProgressEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("response") + private OpenAIResponse response; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseInProgressEvent. */ + protected OpenAIResponseInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseInProgressEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.in_progress`. + * @return The same instance of this {@link OpenAIResponseInProgressEvent} class + */ + @Nonnull + public OpenAIResponseInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.in_progress`. + * + * @return type The type of this {@link OpenAIResponseInProgressEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseInProgressEvent} instance. + * + * @param type The type of the event. Always `response.in_progress`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the response of this {@link OpenAIResponseInProgressEvent} instance and return the same + * instance. + * + * @param response The response that is in progress. + * @return The same instance of this {@link OpenAIResponseInProgressEvent} class + */ + @Nonnull + public OpenAIResponseInProgressEvent response(@Nonnull final OpenAIResponse response) { + this.response = response; + return this; + } + + /** + * The response that is in progress. + * + * @return response The response of this {@link OpenAIResponseInProgressEvent} instance. + */ + @Nonnull + public OpenAIResponse getResponse() { + return response; + } + + /** + * Set the response of this {@link OpenAIResponseInProgressEvent} instance. + * + * @param response The response that is in progress. + */ + public void setResponse(@Nonnull final OpenAIResponse response) { + this.response = response; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseInProgressEvent} instance and return the + * same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseInProgressEvent} class + */ + @Nonnull + public OpenAIResponseInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseInProgressEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseInProgressEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseInProgressEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseInProgressEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (response != null) declaredFields.put("response", response); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseInProgressEvent} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseInProgressEvent openAIResponseInProgressEvent = + (OpenAIResponseInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseInProgressEvent.type) + && Objects.equals(this.response, openAIResponseInProgressEvent.response) + && Objects.equals(this.sequenceNumber, openAIResponseInProgressEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (response) -> + (sequenceNumber) -> + new OpenAIResponseInProgressEvent() + .type(type) + .response(response) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseInProgressEvent} instance. + * + * @param type The type of the event. Always `response.in_progress`. + * @return The OpenAIResponseInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the response of this {@link OpenAIResponseInProgressEvent} instance. + * + * @param response The response that is in progress. + * @return The OpenAIResponseInProgressEvent builder. + */ + Builder2 response(@Nonnull final OpenAIResponse response); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseInProgressEvent instance. + */ + OpenAIResponseInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java new file mode 100644 index 000000000..967e45f1a --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java @@ -0,0 +1,351 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** An event that is emitted when a response finishes as incomplete. */ +// CHECKSTYLE:OFF +public class OpenAIResponseIncompleteEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.incomplete`. */ + public enum TypeEnum { + /** The RESPONSE_INCOMPLETE option of this OpenAIResponseIncompleteEvent */ + RESPONSE_INCOMPLETE("response.incomplete"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseIncompleteEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseIncompleteEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("response") + private OpenAIResponse response; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseIncompleteEvent. */ + protected OpenAIResponseIncompleteEvent() {} + + /** + * Set the type of this {@link OpenAIResponseIncompleteEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.incomplete`. + * @return The same instance of this {@link OpenAIResponseIncompleteEvent} class + */ + @Nonnull + public OpenAIResponseIncompleteEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.incomplete`. + * + * @return type The type of this {@link OpenAIResponseIncompleteEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseIncompleteEvent} instance. + * + * @param type The type of the event. Always `response.incomplete`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the response of this {@link OpenAIResponseIncompleteEvent} instance and return the same + * instance. + * + * @param response The response that was incomplete. + * @return The same instance of this {@link OpenAIResponseIncompleteEvent} class + */ + @Nonnull + public OpenAIResponseIncompleteEvent response(@Nonnull final OpenAIResponse response) { + this.response = response; + return this; + } + + /** + * The response that was incomplete. + * + * @return response The response of this {@link OpenAIResponseIncompleteEvent} instance. + */ + @Nonnull + public OpenAIResponse getResponse() { + return response; + } + + /** + * Set the response of this {@link OpenAIResponseIncompleteEvent} instance. + * + * @param response The response that was incomplete. + */ + public void setResponse(@Nonnull final OpenAIResponse response) { + this.response = response; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseIncompleteEvent} instance and return the + * same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseIncompleteEvent} class + */ + @Nonnull + public OpenAIResponseIncompleteEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseIncompleteEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseIncompleteEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseIncompleteEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseIncompleteEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseIncompleteEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseIncompleteEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (response != null) declaredFields.put("response", response); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseIncompleteEvent} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseIncompleteEvent openAIResponseIncompleteEvent = + (OpenAIResponseIncompleteEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseIncompleteEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseIncompleteEvent.type) + && Objects.equals(this.response, openAIResponseIncompleteEvent.response) + && Objects.equals(this.sequenceNumber, openAIResponseIncompleteEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseIncompleteEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseIncompleteEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (response) -> + (sequenceNumber) -> + new OpenAIResponseIncompleteEvent() + .type(type) + .response(response) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseIncompleteEvent} instance. + * + * @param type The type of the event. Always `response.incomplete`. + * @return The OpenAIResponseIncompleteEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the response of this {@link OpenAIResponseIncompleteEvent} instance. + * + * @param response The response that was incomplete. + * @return The OpenAIResponseIncompleteEvent builder. + */ + Builder2 response(@Nonnull final OpenAIResponse response); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseIncompleteEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseIncompleteEvent instance. + */ + OpenAIResponseIncompleteEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java new file mode 100644 index 000000000..651738624 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java @@ -0,0 +1,55 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import java.util.List; +import javax.annotation.Nonnull; + +/** OpenAIResponseInstructions */ +public interface OpenAIResponseInstructions { + /** + * Helper class to create {@code List } that implements {@link + * OpenAIResponseInstructions}. + */ + record ListOfOpenAIInputItems( + @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) + implements OpenAIResponseInstructions {} + + /** + * Creator to enable deserialization of {@code List }. + * + * @param val the value to use + * @return a new instance of {@link ListOfOpenAIInputItems}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static ListOfOpenAIInputItems createListOfOpenAIInputItems( + @Nonnull final List val) { + return new ListOfOpenAIInputItems(val); + } + + /** Helper class to create {@code String } that implements {@link OpenAIResponseInstructions}. */ + record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) + implements OpenAIResponseInstructions {} + + /** + * Creator to enable deserialization of {@code String }. + * + * @param val the value to use + * @return a new instance of {@link InnerString}. + */ + @com.fasterxml.jackson.annotation.JsonCreator + @Nonnull + static InnerString create(@Nonnull final String val) { + return new InnerString(val); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java new file mode 100644 index 000000000..7ecd9047c --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java @@ -0,0 +1,471 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** A list of Response items. */ +// CHECKSTYLE:OFF +public class OpenAIResponseItemList +// CHECKSTYLE:ON +{ + /** The type of object returned, must be `list`. */ + public enum ObjectEnum { + /** The LIST option of this OpenAIResponseItemList */ + LIST("list"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseItemList */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + ObjectEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseItemList + */ + @JsonCreator + @Nonnull + public static ObjectEnum fromValue(@Nonnull final String value) { + for (ObjectEnum b : ObjectEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("object") + private ObjectEnum _object; + + @JsonProperty("data") + private List data = new ArrayList<>(); + + @JsonProperty("has_more") + private Boolean hasMore; + + @JsonProperty("first_id") + private String firstId; + + @JsonProperty("last_id") + private String lastId; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseItemList. */ + protected OpenAIResponseItemList() {} + + /** + * Set the _object of this {@link OpenAIResponseItemList} instance and return the same instance. + * + * @param _object The type of object returned, must be `list`. + * @return The same instance of this {@link OpenAIResponseItemList} class + */ + @Nonnull + public OpenAIResponseItemList _object(@Nonnull final ObjectEnum _object) { + this._object = _object; + return this; + } + + /** + * The type of object returned, must be `list`. + * + * @return _object The _object of this {@link OpenAIResponseItemList} instance. + */ + @Nonnull + public ObjectEnum getObject() { + return _object; + } + + /** + * Set the _object of this {@link OpenAIResponseItemList} instance. + * + * @param _object The type of object returned, must be `list`. + */ + public void setObject(@Nonnull final ObjectEnum _object) { + this._object = _object; + } + + /** + * Set the data of this {@link OpenAIResponseItemList} instance and return the same instance. + * + * @param data A list of items used to generate this response. + * @return The same instance of this {@link OpenAIResponseItemList} class + */ + @Nonnull + public OpenAIResponseItemList data(@Nonnull final List data) { + this.data = data; + return this; + } + + /** + * Add one data instance to this {@link OpenAIResponseItemList}. + * + * @param dataItem The data that should be added + * @return The same instance of type {@link OpenAIResponseItemList} + */ + @Nonnull + public OpenAIResponseItemList addDataItem(@Nonnull final OpenAIItemResource dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * A list of items used to generate this response. + * + * @return data The data of this {@link OpenAIResponseItemList} instance. + */ + @Nonnull + public List getData() { + return data; + } + + /** + * Set the data of this {@link OpenAIResponseItemList} instance. + * + * @param data A list of items used to generate this response. + */ + public void setData(@Nonnull final List data) { + this.data = data; + } + + /** + * Set the hasMore of this {@link OpenAIResponseItemList} instance and return the same instance. + * + * @param hasMore Whether there are more items available. + * @return The same instance of this {@link OpenAIResponseItemList} class + */ + @Nonnull + public OpenAIResponseItemList hasMore(@Nonnull final Boolean hasMore) { + this.hasMore = hasMore; + return this; + } + + /** + * Whether there are more items available. + * + * @return hasMore The hasMore of this {@link OpenAIResponseItemList} instance. + */ + @Nonnull + public Boolean isHasMore() { + return hasMore; + } + + /** + * Set the hasMore of this {@link OpenAIResponseItemList} instance. + * + * @param hasMore Whether there are more items available. + */ + public void setHasMore(@Nonnull final Boolean hasMore) { + this.hasMore = hasMore; + } + + /** + * Set the firstId of this {@link OpenAIResponseItemList} instance and return the same instance. + * + * @param firstId The ID of the first item in the list. + * @return The same instance of this {@link OpenAIResponseItemList} class + */ + @Nonnull + public OpenAIResponseItemList firstId(@Nonnull final String firstId) { + this.firstId = firstId; + return this; + } + + /** + * The ID of the first item in the list. + * + * @return firstId The firstId of this {@link OpenAIResponseItemList} instance. + */ + @Nonnull + public String getFirstId() { + return firstId; + } + + /** + * Set the firstId of this {@link OpenAIResponseItemList} instance. + * + * @param firstId The ID of the first item in the list. + */ + public void setFirstId(@Nonnull final String firstId) { + this.firstId = firstId; + } + + /** + * Set the lastId of this {@link OpenAIResponseItemList} instance and return the same instance. + * + * @param lastId The ID of the last item in the list. + * @return The same instance of this {@link OpenAIResponseItemList} class + */ + @Nonnull + public OpenAIResponseItemList lastId(@Nonnull final String lastId) { + this.lastId = lastId; + return this; + } + + /** + * The ID of the last item in the list. + * + * @return lastId The lastId of this {@link OpenAIResponseItemList} instance. + */ + @Nonnull + public String getLastId() { + return lastId; + } + + /** + * Set the lastId of this {@link OpenAIResponseItemList} instance. + * + * @param lastId The ID of the last item in the list. + */ + public void setLastId(@Nonnull final String lastId) { + this.lastId = lastId; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseItemList}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseItemList} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseItemList has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseItemList} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (_object != null) declaredFields.put("_object", _object); + if (data != null) declaredFields.put("data", data); + if (hasMore != null) declaredFields.put("hasMore", hasMore); + if (firstId != null) declaredFields.put("firstId", firstId); + if (lastId != null) declaredFields.put("lastId", lastId); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseItemList} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseItemList openAIResponseItemList = (OpenAIResponseItemList) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseItemList.cloudSdkCustomFields) + && Objects.equals(this._object, openAIResponseItemList._object) + && Objects.equals(this.data, openAIResponseItemList.data) + && Objects.equals(this.hasMore, openAIResponseItemList.hasMore) + && Objects.equals(this.firstId, openAIResponseItemList.firstId) + && Objects.equals(this.lastId, openAIResponseItemList.lastId); + } + + @Override + public int hashCode() { + return Objects.hash(_object, data, hasMore, firstId, lastId, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseItemList {\n"); + sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); + sb.append(" firstId: ").append(toIndentedString(firstId)).append("\n"); + sb.append(" lastId: ").append(toIndentedString(lastId)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseItemList} + * instance with all required arguments. + */ + public static Builder create() { + return (_object) -> + (data) -> + (hasMore) -> + (firstId) -> + (lastId) -> + new OpenAIResponseItemList() + ._object(_object) + .data(data) + .hasMore(hasMore) + .firstId(firstId) + .lastId(lastId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the _object of this {@link OpenAIResponseItemList} instance. + * + * @param _object The type of object returned, must be `list`. + * @return The OpenAIResponseItemList builder. + */ + Builder1 _object(@Nonnull final ObjectEnum _object); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the data of this {@link OpenAIResponseItemList} instance. + * + * @param data A list of items used to generate this response. + * @return The OpenAIResponseItemList builder. + */ + Builder2 data(@Nonnull final List data); + + /** + * Set the data of this {@link OpenAIResponseItemList} instance. + * + * @param data A list of items used to generate this response. + * @return The OpenAIResponseItemList builder. + */ + default Builder2 data(@Nonnull final OpenAIItemResource... data) { + return data(Arrays.asList(data)); + } + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the hasMore of this {@link OpenAIResponseItemList} instance. + * + * @param hasMore Whether there are more items available. + * @return The OpenAIResponseItemList builder. + */ + Builder3 hasMore(@Nonnull final Boolean hasMore); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the firstId of this {@link OpenAIResponseItemList} instance. + * + * @param firstId The ID of the first item in the list. + * @return The OpenAIResponseItemList builder. + */ + Builder4 firstId(@Nonnull final String firstId); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the lastId of this {@link OpenAIResponseItemList} instance. + * + * @param lastId The ID of the last item in the list. + * @return The OpenAIResponseItemList instance. + */ + OpenAIResponseItemList lastId(@Nonnull final String lastId); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java new file mode 100644 index 000000000..31b0c7c52 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java @@ -0,0 +1,295 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** + * A logprob is the logarithmic probability that the model assigns to producing a particular token + * at a given position in the sequence. Less-negative (higher) logprob values indicate greater model + * confidence in that token choice. + */ +// CHECKSTYLE:OFF +public class OpenAIResponseLogProb +// CHECKSTYLE:ON +{ + @JsonProperty("token") + private String token; + + @JsonProperty("logprob") + private BigDecimal logprob; + + @JsonProperty("top_logprobs") + private List topLogprobs = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseLogProb. */ + protected OpenAIResponseLogProb() {} + + /** + * Set the token of this {@link OpenAIResponseLogProb} instance and return the same instance. + * + * @param token A possible text token. + * @return The same instance of this {@link OpenAIResponseLogProb} class + */ + @Nonnull + public OpenAIResponseLogProb token(@Nonnull final String token) { + this.token = token; + return this; + } + + /** + * A possible text token. + * + * @return token The token of this {@link OpenAIResponseLogProb} instance. + */ + @Nonnull + public String getToken() { + return token; + } + + /** + * Set the token of this {@link OpenAIResponseLogProb} instance. + * + * @param token A possible text token. + */ + public void setToken(@Nonnull final String token) { + this.token = token; + } + + /** + * Set the logprob of this {@link OpenAIResponseLogProb} instance and return the same instance. + * + * @param logprob The log probability of this token. + * @return The same instance of this {@link OpenAIResponseLogProb} class + */ + @Nonnull + public OpenAIResponseLogProb logprob(@Nonnull final BigDecimal logprob) { + this.logprob = logprob; + return this; + } + + /** + * The log probability of this token. + * + * @return logprob The logprob of this {@link OpenAIResponseLogProb} instance. + */ + @Nonnull + public BigDecimal getLogprob() { + return logprob; + } + + /** + * Set the logprob of this {@link OpenAIResponseLogProb} instance. + * + * @param logprob The log probability of this token. + */ + public void setLogprob(@Nonnull final BigDecimal logprob) { + this.logprob = logprob; + } + + /** + * Set the topLogprobs of this {@link OpenAIResponseLogProb} instance and return the same + * instance. + * + * @param topLogprobs The log probability of the top 20 most likely tokens. + * @return The same instance of this {@link OpenAIResponseLogProb} class + */ + @Nonnull + public OpenAIResponseLogProb topLogprobs( + @Nullable final List topLogprobs) { + this.topLogprobs = topLogprobs; + return this; + } + + /** + * Add one topLogprobs instance to this {@link OpenAIResponseLogProb}. + * + * @param topLogprobsItem The topLogprobs that should be added + * @return The same instance of type {@link OpenAIResponseLogProb} + */ + @Nonnull + public OpenAIResponseLogProb addTopLogprobsItem( + @Nonnull final OpenAIResponseLogProbTopLogprobs topLogprobsItem) { + if (this.topLogprobs == null) { + this.topLogprobs = new ArrayList<>(); + } + this.topLogprobs.add(topLogprobsItem); + return this; + } + + /** + * The log probability of the top 20 most likely tokens. + * + * @return topLogprobs The topLogprobs of this {@link OpenAIResponseLogProb} instance. + */ + @Nonnull + public List getTopLogprobs() { + return topLogprobs; + } + + /** + * Set the topLogprobs of this {@link OpenAIResponseLogProb} instance. + * + * @param topLogprobs The log probability of the top 20 most likely tokens. + */ + public void setTopLogprobs(@Nullable final List topLogprobs) { + this.topLogprobs = topLogprobs; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseLogProb}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseLogProb} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseLogProb has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseLogProb} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (token != null) declaredFields.put("token", token); + if (logprob != null) declaredFields.put("logprob", logprob); + if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseLogProb} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseLogProb openAIResponseLogProb = (OpenAIResponseLogProb) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseLogProb.cloudSdkCustomFields) + && Objects.equals(this.token, openAIResponseLogProb.token) + && Objects.equals(this.logprob, openAIResponseLogProb.logprob) + && Objects.equals(this.topLogprobs, openAIResponseLogProb.topLogprobs); + } + + @Override + public int hashCode() { + return Objects.hash(token, logprob, topLogprobs, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseLogProb {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" logprob: ").append(toIndentedString(logprob)).append("\n"); + sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseLogProb} + * instance with all required arguments. + */ + public static Builder create() { + return (token) -> (logprob) -> new OpenAIResponseLogProb().token(token).logprob(logprob); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the token of this {@link OpenAIResponseLogProb} instance. + * + * @param token A possible text token. + * @return The OpenAIResponseLogProb builder. + */ + Builder1 token(@Nonnull final String token); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the logprob of this {@link OpenAIResponseLogProb} instance. + * + * @param logprob The log probability of this token. + * @return The OpenAIResponseLogProb instance. + */ + OpenAIResponseLogProb logprob(@Nonnull final BigDecimal logprob); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java new file mode 100644 index 000000000..77e3aa350 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java @@ -0,0 +1,215 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIResponseLogProbTopLogprobs */ +// CHECKSTYLE:OFF +public class OpenAIResponseLogProbTopLogprobs +// CHECKSTYLE:ON +{ + @JsonProperty("token") + private String token; + + @JsonProperty("logprob") + private BigDecimal logprob; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseLogProbTopLogprobs. */ + protected OpenAIResponseLogProbTopLogprobs() {} + + /** + * Set the token of this {@link OpenAIResponseLogProbTopLogprobs} instance and return the same + * instance. + * + * @param token The token of this {@link OpenAIResponseLogProbTopLogprobs} + * @return The same instance of this {@link OpenAIResponseLogProbTopLogprobs} class + */ + @Nonnull + public OpenAIResponseLogProbTopLogprobs token(@Nullable final String token) { + this.token = token; + return this; + } + + /** + * Get token + * + * @return token The token of this {@link OpenAIResponseLogProbTopLogprobs} instance. + */ + @Nonnull + public String getToken() { + return token; + } + + /** + * Set the token of this {@link OpenAIResponseLogProbTopLogprobs} instance. + * + * @param token The token of this {@link OpenAIResponseLogProbTopLogprobs} + */ + public void setToken(@Nullable final String token) { + this.token = token; + } + + /** + * Set the logprob of this {@link OpenAIResponseLogProbTopLogprobs} instance and return the same + * instance. + * + * @param logprob The logprob of this {@link OpenAIResponseLogProbTopLogprobs} + * @return The same instance of this {@link OpenAIResponseLogProbTopLogprobs} class + */ + @Nonnull + public OpenAIResponseLogProbTopLogprobs logprob(@Nullable final BigDecimal logprob) { + this.logprob = logprob; + return this; + } + + /** + * Get logprob + * + * @return logprob The logprob of this {@link OpenAIResponseLogProbTopLogprobs} instance. + */ + @Nonnull + public BigDecimal getLogprob() { + return logprob; + } + + /** + * Set the logprob of this {@link OpenAIResponseLogProbTopLogprobs} instance. + * + * @param logprob The logprob of this {@link OpenAIResponseLogProbTopLogprobs} + */ + public void setLogprob(@Nullable final BigDecimal logprob) { + this.logprob = logprob; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseLogProbTopLogprobs}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseLogProbTopLogprobs} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseLogProbTopLogprobs has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseLogProbTopLogprobs} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (token != null) declaredFields.put("token", token); + if (logprob != null) declaredFields.put("logprob", logprob); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseLogProbTopLogprobs} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseLogProbTopLogprobs openAIResponseLogProbTopLogprobs = + (OpenAIResponseLogProbTopLogprobs) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseLogProbTopLogprobs.cloudSdkCustomFields) + && Objects.equals(this.token, openAIResponseLogProbTopLogprobs.token) + && Objects.equals(this.logprob, openAIResponseLogProbTopLogprobs.logprob); + } + + @Override + public int hashCode() { + return Objects.hash(token, logprob, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseLogProbTopLogprobs {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" logprob: ").append(toIndentedString(logprob)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link OpenAIResponseLogProbTopLogprobs} instance. No arguments are required. */ + public static OpenAIResponseLogProbTopLogprobs create() { + return new OpenAIResponseLogProbTopLogprobs(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java new file mode 100644 index 000000000..7bcf170b4 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java @@ -0,0 +1,463 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when there is a delta (partial update) to the arguments of an MCP tool call. */ +// CHECKSTYLE:OFF +public class OpenAIResponseMCPCallArgumentsDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.mcp_call_arguments.delta'. */ + public enum TypeEnum { + /** + * The RESPONSE_MCP_CALL_ARGUMENTS_DELTA option of this OpenAIResponseMCPCallArgumentsDeltaEvent + */ + RESPONSE_MCP_CALL_ARGUMENTS_DELTA("response.mcp_call_arguments.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPCallArgumentsDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseMCPCallArgumentsDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseMCPCallArgumentsDeltaEvent. */ + protected OpenAIResponseMCPCallArgumentsDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always 'response.mcp_call_arguments.delta'. + * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallArgumentsDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.mcp_call_arguments.delta'. + * + * @return type The type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_call_arguments.delta'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallArgumentsDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response's output array. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and return the + * same instance. + * + * @param itemId The unique identifier of the MCP tool call item being processed. + * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallArgumentsDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the MCP tool call item being processed. + * + * @return itemId The itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param itemId The unique identifier of the MCP tool call item being processed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and return the + * same instance. + * + * @param delta A JSON string containing the partial update to the arguments for the MCP tool + * call. + * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallArgumentsDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * A JSON string containing the partial update to the arguments for the MCP tool call. + * + * @return delta The delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param delta A JSON string containing the partial update to the arguments for the MCP tool + * call. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallArgumentsDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseMCPCallArgumentsDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseMCPCallArgumentsDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseMCPCallArgumentsDeltaEvent openAIResponseMCPCallArgumentsDeltaEvent = + (OpenAIResponseMCPCallArgumentsDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseMCPCallArgumentsDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseMCPCallArgumentsDeltaEvent.type) + && Objects.equals(this.outputIndex, openAIResponseMCPCallArgumentsDeltaEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseMCPCallArgumentsDeltaEvent.itemId) + && Objects.equals(this.delta, openAIResponseMCPCallArgumentsDeltaEvent.delta) + && Objects.equals( + this.sequenceNumber, openAIResponseMCPCallArgumentsDeltaEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, delta, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseMCPCallArgumentsDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseMCPCallArgumentsDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (delta) -> + (sequenceNumber) -> + new OpenAIResponseMCPCallArgumentsDeltaEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .delta(delta) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_call_arguments.delta'. + * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param itemId The unique identifier of the MCP tool call item being processed. + * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param delta A JSON string containing the partial update to the arguments for the MCP tool + * call. + * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. + */ + Builder4 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseMCPCallArgumentsDeltaEvent instance. + */ + OpenAIResponseMCPCallArgumentsDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java new file mode 100644 index 000000000..64f585d4e --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java @@ -0,0 +1,402 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when an MCP tool call has failed. */ +// CHECKSTYLE:OFF +public class OpenAIResponseMCPCallFailedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.mcp_call.failed'. */ + public enum TypeEnum { + /** The RESPONSE_MCP_CALL_FAILED option of this OpenAIResponseMCPCallFailedEvent */ + RESPONSE_MCP_CALL_FAILED("response.mcp_call.failed"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPCallFailedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseMCPCallFailedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseMCPCallFailedEvent. */ + protected OpenAIResponseMCPCallFailedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always 'response.mcp_call.failed'. + * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallFailedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.mcp_call.failed'. + * + * @return type The type of this {@link OpenAIResponseMCPCallFailedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_call.failed'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the same + * instance. + * + * @param itemId The ID of the MCP tool call item that failed. + * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallFailedEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the MCP tool call item that failed. + * + * @return itemId The itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param itemId The ID of the MCP tool call item that failed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the + * same instance. + * + * @param outputIndex The index of the output item that failed. + * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallFailedEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that failed. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param outputIndex The index of the output item that failed. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the + * same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseMCPCallFailedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseMCPCallFailedEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseMCPCallFailedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseMCPCallFailedEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseMCPCallFailedEvent} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseMCPCallFailedEvent openAIResponseMCPCallFailedEvent = + (OpenAIResponseMCPCallFailedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseMCPCallFailedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseMCPCallFailedEvent.type) + && Objects.equals(this.itemId, openAIResponseMCPCallFailedEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseMCPCallFailedEvent.outputIndex) + && Objects.equals(this.sequenceNumber, openAIResponseMCPCallFailedEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, itemId, outputIndex, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseMCPCallFailedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseMCPCallFailedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (sequenceNumber) -> + new OpenAIResponseMCPCallFailedEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_call.failed'. + * @return The OpenAIResponseMCPCallFailedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param itemId The ID of the MCP tool call item that failed. + * @return The OpenAIResponseMCPCallFailedEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param outputIndex The index of the output item that failed. + * @return The OpenAIResponseMCPCallFailedEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseMCPCallFailedEvent instance. + */ + OpenAIResponseMCPCallFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java new file mode 100644 index 000000000..ce306f6aa --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java @@ -0,0 +1,405 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when an MCP tool call is in progress. */ +// CHECKSTYLE:OFF +public class OpenAIResponseMCPCallInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.mcp_call.in_progress'. */ + public enum TypeEnum { + /** The RESPONSE_MCP_CALL_IN_PROGRESS option of this OpenAIResponseMCPCallInProgressEvent */ + RESPONSE_MCP_CALL_IN_PROGRESS("response.mcp_call.in_progress"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPCallInProgressEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseMCPCallInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseMCPCallInProgressEvent. */ + protected OpenAIResponseMCPCallInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always 'response.mcp_call.in_progress'. + * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.mcp_call.in_progress'. + * + * @return type The type of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_call.in_progress'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return + * the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return + * the same instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallInProgressEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response's output array. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return the + * same instance. + * + * @param itemId The unique identifier of the MCP tool call item being processed. + * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPCallInProgressEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the MCP tool call item being processed. + * + * @return itemId The itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param itemId The unique identifier of the MCP tool call item being processed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseMCPCallInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseMCPCallInProgressEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseMCPCallInProgressEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseMCPCallInProgressEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseMCPCallInProgressEvent openAIResponseMCPCallInProgressEvent = + (OpenAIResponseMCPCallInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseMCPCallInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseMCPCallInProgressEvent.type) + && Objects.equals(this.sequenceNumber, openAIResponseMCPCallInProgressEvent.sequenceNumber) + && Objects.equals(this.outputIndex, openAIResponseMCPCallInProgressEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseMCPCallInProgressEvent.itemId); + } + + @Override + public int hashCode() { + return Objects.hash(type, sequenceNumber, outputIndex, itemId, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseMCPCallInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseMCPCallInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (sequenceNumber) -> + (outputIndex) -> + (itemId) -> + new OpenAIResponseMCPCallInProgressEvent() + .type(type) + .sequenceNumber(sequenceNumber) + .outputIndex(outputIndex) + .itemId(itemId); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_call.in_progress'. + * @return The OpenAIResponseMCPCallInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseMCPCallInProgressEvent builder. + */ + Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The OpenAIResponseMCPCallInProgressEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance. + * + * @param itemId The unique identifier of the MCP tool call item being processed. + * @return The OpenAIResponseMCPCallInProgressEvent instance. + */ + OpenAIResponseMCPCallInProgressEvent itemId(@Nonnull final String itemId); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java new file mode 100644 index 000000000..210b1d701 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java @@ -0,0 +1,406 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when the attempt to list available MCP tools has failed. */ +// CHECKSTYLE:OFF +public class OpenAIResponseMCPListToolsFailedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.mcp_list_tools.failed'. */ + public enum TypeEnum { + /** The RESPONSE_MCP_LIST_TOOLS_FAILED option of this OpenAIResponseMCPListToolsFailedEvent */ + RESPONSE_MCP_LIST_TOOLS_FAILED("response.mcp_list_tools.failed"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPListToolsFailedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseMCPListToolsFailedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseMCPListToolsFailedEvent. */ + protected OpenAIResponseMCPListToolsFailedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always 'response.mcp_list_tools.failed'. + * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsFailedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.mcp_list_tools.failed'. + * + * @return type The type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_list_tools.failed'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and return the + * same instance. + * + * @param itemId The ID of the MCP tool call item that failed. + * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsFailedEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the MCP tool call item that failed. + * + * @return itemId The itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param itemId The ID of the MCP tool call item that failed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and return + * the same instance. + * + * @param outputIndex The index of the output item that failed. + * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsFailedEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that failed. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param outputIndex The index of the output item that failed. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsFailedEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseMCPListToolsFailedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseMCPListToolsFailedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseMCPListToolsFailedEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseMCPListToolsFailedEvent openAIResponseMCPListToolsFailedEvent = + (OpenAIResponseMCPListToolsFailedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseMCPListToolsFailedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseMCPListToolsFailedEvent.type) + && Objects.equals(this.itemId, openAIResponseMCPListToolsFailedEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseMCPListToolsFailedEvent.outputIndex) + && Objects.equals( + this.sequenceNumber, openAIResponseMCPListToolsFailedEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, itemId, outputIndex, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseMCPListToolsFailedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseMCPListToolsFailedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (sequenceNumber) -> + new OpenAIResponseMCPListToolsFailedEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_list_tools.failed'. + * @return The OpenAIResponseMCPListToolsFailedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param itemId The ID of the MCP tool call item that failed. + * @return The OpenAIResponseMCPListToolsFailedEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param outputIndex The index of the output item that failed. + * @return The OpenAIResponseMCPListToolsFailedEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseMCPListToolsFailedEvent instance. + */ + OpenAIResponseMCPListToolsFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java new file mode 100644 index 000000000..1020b0952 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java @@ -0,0 +1,410 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when the system is in the process of retrieving the list of available MCP tools. */ +// CHECKSTYLE:OFF +public class OpenAIResponseMCPListToolsInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.mcp_list_tools.in_progress'. */ + public enum TypeEnum { + /** + * The RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS option of this + * OpenAIResponseMCPListToolsInProgressEvent + */ + RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS("response.mcp_list_tools.in_progress"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPListToolsInProgressEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseMCPListToolsInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseMCPListToolsInProgressEvent. */ + protected OpenAIResponseMCPListToolsInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always 'response.mcp_list_tools.in_progress'. + * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.mcp_list_tools.in_progress'. + * + * @return type The type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_list_tools.in_progress'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and return + * the same instance. + * + * @param itemId The ID of the MCP tool call item that is being processed. + * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsInProgressEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the MCP tool call item that is being processed. + * + * @return itemId The itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param itemId The ID of the MCP tool call item that is being processed. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item that is being processed. + * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsInProgressEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that is being processed. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param outputIndex The index of the output item that is being processed. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class + */ + @Nonnull + public OpenAIResponseMCPListToolsInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseMCPListToolsInProgressEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseMCPListToolsInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseMCPListToolsInProgressEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseMCPListToolsInProgressEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseMCPListToolsInProgressEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseMCPListToolsInProgressEvent openAIResponseMCPListToolsInProgressEvent = + (OpenAIResponseMCPListToolsInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseMCPListToolsInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseMCPListToolsInProgressEvent.type) + && Objects.equals(this.itemId, openAIResponseMCPListToolsInProgressEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseMCPListToolsInProgressEvent.outputIndex) + && Objects.equals( + this.sequenceNumber, openAIResponseMCPListToolsInProgressEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, itemId, outputIndex, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseMCPListToolsInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseMCPListToolsInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (sequenceNumber) -> + new OpenAIResponseMCPListToolsInProgressEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param type The type of the event. Always 'response.mcp_list_tools.in_progress'. + * @return The OpenAIResponseMCPListToolsInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param itemId The ID of the MCP tool call item that is being processed. + * @return The OpenAIResponseMCPListToolsInProgressEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param outputIndex The index of the output item that is being processed. + * @return The OpenAIResponseMCPListToolsInProgressEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseMCPListToolsInProgressEvent instance. + */ + OpenAIResponseMCPListToolsInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java new file mode 100644 index 000000000..305194a24 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java @@ -0,0 +1,404 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a new output item is added. */ +// CHECKSTYLE:OFF +public class OpenAIResponseOutputItemAddedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.output_item.added`. */ + public enum TypeEnum { + /** The RESPONSE_OUTPUT_ITEM_ADDED option of this OpenAIResponseOutputItemAddedEvent */ + RESPONSE_OUTPUT_ITEM_ADDED("response.output_item.added"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseOutputItemAddedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseOutputItemAddedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("item") + private OpenAIOutputItem item; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseOutputItemAddedEvent. */ + protected OpenAIResponseOutputItemAddedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseOutputItemAddedEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.output_item.added`. + * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputItemAddedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.output_item.added`. + * + * @return type The type of this {@link OpenAIResponseOutputItemAddedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param type The type of the event. Always `response.output_item.added`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} instance and return the + * same instance. + * + * @param outputIndex The index of the output item that was added. + * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputItemAddedEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that was added. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param outputIndex The index of the output item that was added. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} instance and return + * the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputItemAddedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the item of this {@link OpenAIResponseOutputItemAddedEvent} instance and return the same + * instance. + * + * @param item The output item that was added. + * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputItemAddedEvent item(@Nonnull final OpenAIOutputItem item) { + this.item = item; + return this; + } + + /** + * The output item that was added. + * + * @return item The item of this {@link OpenAIResponseOutputItemAddedEvent} instance. + */ + @Nonnull + public OpenAIOutputItem getItem() { + return item; + } + + /** + * Set the item of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param item The output item that was added. + */ + public void setItem(@Nonnull final OpenAIOutputItem item) { + this.item = item; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseOutputItemAddedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseOutputItemAddedEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseOutputItemAddedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseOutputItemAddedEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (item != null) declaredFields.put("item", item); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseOutputItemAddedEvent} instance. If + * the map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseOutputItemAddedEvent openAIResponseOutputItemAddedEvent = + (OpenAIResponseOutputItemAddedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseOutputItemAddedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseOutputItemAddedEvent.type) + && Objects.equals(this.outputIndex, openAIResponseOutputItemAddedEvent.outputIndex) + && Objects.equals(this.sequenceNumber, openAIResponseOutputItemAddedEvent.sequenceNumber) + && Objects.equals(this.item, openAIResponseOutputItemAddedEvent.item); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, sequenceNumber, item, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseOutputItemAddedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" item: ").append(toIndentedString(item)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseOutputItemAddedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (sequenceNumber) -> + (item) -> + new OpenAIResponseOutputItemAddedEvent() + .type(type) + .outputIndex(outputIndex) + .sequenceNumber(sequenceNumber) + .item(item); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param type The type of the event. Always `response.output_item.added`. + * @return The OpenAIResponseOutputItemAddedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param outputIndex The index of the output item that was added. + * @return The OpenAIResponseOutputItemAddedEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseOutputItemAddedEvent builder. + */ + Builder3 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the item of this {@link OpenAIResponseOutputItemAddedEvent} instance. + * + * @param item The output item that was added. + * @return The OpenAIResponseOutputItemAddedEvent instance. + */ + OpenAIResponseOutputItemAddedEvent item(@Nonnull final OpenAIOutputItem item); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java new file mode 100644 index 000000000..0610919f6 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java @@ -0,0 +1,585 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when an annotation is added to output text content. */ +// CHECKSTYLE:OFF +public class OpenAIResponseOutputTextAnnotationAddedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.output_text.annotation.added'. */ + public enum TypeEnum { + /** + * The RESPONSE_OUTPUT_TEXT_ANNOTATION_ADDED option of this + * OpenAIResponseOutputTextAnnotationAddedEvent + */ + RESPONSE_OUTPUT_TEXT_ANNOTATION_ADDED("response.output_text.annotation.added"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseOutputTextAnnotationAddedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseOutputTextAnnotationAddedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("content_index") + private Integer contentIndex; + + @JsonProperty("annotation_index") + private Integer annotationIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("annotation") + private OpenAIAnnotation annotation; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseOutputTextAnnotationAddedEvent. */ + protected OpenAIResponseOutputTextAnnotationAddedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and return + * the same instance. + * + * @param type The type of the event. Always 'response.output_text.annotation.added'. + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.output_text.annotation.added'. + * + * @return type The type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param type The type of the event. Always 'response.output_text.annotation.added'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and return + * the same instance. + * + * @param itemId The unique identifier of the item to which the annotation is being added. + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The unique identifier of the item to which the annotation is being added. + * + * @return itemId The itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param itemId The unique identifier of the item to which the annotation is being added. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item in the response's output array. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseOutputTextAnnotationAddedEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and + * return the same instance. + * + * @param contentIndex The index of the content part within the output item. + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent contentIndex( + @Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + return this; + } + + /** + * The index of the content part within the output item. + * + * @return contentIndex The contentIndex of this {@link + * OpenAIResponseOutputTextAnnotationAddedEvent} instance. + */ + @Nonnull + public Integer getContentIndex() { + return contentIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param contentIndex The index of the content part within the output item. + */ + public void setContentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + } + + /** + * Set the annotationIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance + * and return the same instance. + * + * @param annotationIndex The index of the annotation within the content part. + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent annotationIndex( + @Nonnull final Integer annotationIndex) { + this.annotationIndex = annotationIndex; + return this; + } + + /** + * The index of the annotation within the content part. + * + * @return annotationIndex The annotationIndex of this {@link + * OpenAIResponseOutputTextAnnotationAddedEvent} instance. + */ + @Nonnull + public Integer getAnnotationIndex() { + return annotationIndex; + } + + /** + * Set the annotationIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param annotationIndex The index of the annotation within the content part. + */ + public void setAnnotationIndex(@Nonnull final Integer annotationIndex) { + this.annotationIndex = annotationIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance + * and return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseOutputTextAnnotationAddedEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and + * return the same instance. + * + * @param annotation The annotation object being added. (See annotation schema for details.) + * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class + */ + @Nonnull + public OpenAIResponseOutputTextAnnotationAddedEvent annotation( + @Nonnull final OpenAIAnnotation annotation) { + this.annotation = annotation; + return this; + } + + /** + * The annotation object being added. (See annotation schema for details.) + * + * @return annotation The annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} + * instance. + */ + @Nonnull + public OpenAIAnnotation getAnnotation() { + return annotation; + } + + /** + * Set the annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param annotation The annotation object being added. (See annotation schema for details.) + */ + public void setAnnotation(@Nonnull final OpenAIAnnotation annotation) { + this.annotation = annotation; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseOutputTextAnnotationAddedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseOutputTextAnnotationAddedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); + if (annotationIndex != null) declaredFields.put("annotationIndex", annotationIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (annotation != null) declaredFields.put("annotation", annotation); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseOutputTextAnnotationAddedEvent + openAIResponseOutputTextAnnotationAddedEvent = + (OpenAIResponseOutputTextAnnotationAddedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseOutputTextAnnotationAddedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseOutputTextAnnotationAddedEvent.type) + && Objects.equals(this.itemId, openAIResponseOutputTextAnnotationAddedEvent.itemId) + && Objects.equals( + this.outputIndex, openAIResponseOutputTextAnnotationAddedEvent.outputIndex) + && Objects.equals( + this.contentIndex, openAIResponseOutputTextAnnotationAddedEvent.contentIndex) + && Objects.equals( + this.annotationIndex, openAIResponseOutputTextAnnotationAddedEvent.annotationIndex) + && Objects.equals( + this.sequenceNumber, openAIResponseOutputTextAnnotationAddedEvent.sequenceNumber) + && Objects.equals(this.annotation, openAIResponseOutputTextAnnotationAddedEvent.annotation); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + itemId, + outputIndex, + contentIndex, + annotationIndex, + sequenceNumber, + annotation, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseOutputTextAnnotationAddedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); + sb.append(" annotationIndex: ").append(toIndentedString(annotationIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" annotation: ").append(toIndentedString(annotation)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseOutputTextAnnotationAddedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (contentIndex) -> + (annotationIndex) -> + (sequenceNumber) -> + (annotation) -> + new OpenAIResponseOutputTextAnnotationAddedEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .contentIndex(contentIndex) + .annotationIndex(annotationIndex) + .sequenceNumber(sequenceNumber) + .annotation(annotation); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param type The type of the event. Always 'response.output_text.annotation.added'. + * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param itemId The unique identifier of the item to which the annotation is being added. + * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param outputIndex The index of the output item in the response's output array. + * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the contentIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param contentIndex The index of the content part within the output item. + * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. + */ + Builder4 contentIndex(@Nonnull final Integer contentIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the annotationIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} + * instance. + * + * @param annotationIndex The index of the annotation within the content part. + * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. + */ + Builder5 annotationIndex(@Nonnull final Integer annotationIndex); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. + */ + Builder6 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder6 { + /** + * Set the annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. + * + * @param annotation The annotation object being added. (See annotation schema for details.) + * @return The OpenAIResponseOutputTextAnnotationAddedEvent instance. + */ + OpenAIResponseOutputTextAnnotationAddedEvent annotation( + @Nonnull final OpenAIAnnotation annotation); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java new file mode 100644 index 000000000..e7b27a864 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java @@ -0,0 +1,345 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a response is queued and waiting to be processed. */ +// CHECKSTYLE:OFF +public class OpenAIResponseQueuedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always 'response.queued'. */ + public enum TypeEnum { + /** The RESPONSE_QUEUED option of this OpenAIResponseQueuedEvent */ + RESPONSE_QUEUED("response.queued"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseQueuedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseQueuedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("response") + private OpenAIResponse response; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseQueuedEvent. */ + protected OpenAIResponseQueuedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseQueuedEvent} instance and return the same instance. + * + * @param type The type of the event. Always 'response.queued'. + * @return The same instance of this {@link OpenAIResponseQueuedEvent} class + */ + @Nonnull + public OpenAIResponseQueuedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always 'response.queued'. + * + * @return type The type of this {@link OpenAIResponseQueuedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseQueuedEvent} instance. + * + * @param type The type of the event. Always 'response.queued'. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the response of this {@link OpenAIResponseQueuedEvent} instance and return the same + * instance. + * + * @param response The full response object that is queued. + * @return The same instance of this {@link OpenAIResponseQueuedEvent} class + */ + @Nonnull + public OpenAIResponseQueuedEvent response(@Nonnull final OpenAIResponse response) { + this.response = response; + return this; + } + + /** + * The full response object that is queued. + * + * @return response The response of this {@link OpenAIResponseQueuedEvent} instance. + */ + @Nonnull + public OpenAIResponse getResponse() { + return response; + } + + /** + * Set the response of this {@link OpenAIResponseQueuedEvent} instance. + * + * @param response The full response object that is queued. + */ + public void setResponse(@Nonnull final OpenAIResponse response) { + this.response = response; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance and return the same + * instance. + * + * @param sequenceNumber The sequence number for this event. + * @return The same instance of this {@link OpenAIResponseQueuedEvent} class + */ + @Nonnull + public OpenAIResponseQueuedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number for this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance. + * + * @param sequenceNumber The sequence number for this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseQueuedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseQueuedEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseQueuedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseQueuedEvent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (response != null) declaredFields.put("response", response); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseQueuedEvent} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseQueuedEvent openAIResponseQueuedEvent = (OpenAIResponseQueuedEvent) o; + return Objects.equals(this.cloudSdkCustomFields, openAIResponseQueuedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseQueuedEvent.type) + && Objects.equals(this.response, openAIResponseQueuedEvent.response) + && Objects.equals(this.sequenceNumber, openAIResponseQueuedEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseQueuedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseQueuedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (response) -> + (sequenceNumber) -> + new OpenAIResponseQueuedEvent() + .type(type) + .response(response) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseQueuedEvent} instance. + * + * @param type The type of the event. Always 'response.queued'. + * @return The OpenAIResponseQueuedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the response of this {@link OpenAIResponseQueuedEvent} instance. + * + * @param response The full response object that is queued. + * @return The OpenAIResponseQueuedEvent builder. + */ + Builder2 response(@Nonnull final OpenAIResponse response); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance. + * + * @param sequenceNumber The sequence number for this event. + * @return The OpenAIResponseQueuedEvent instance. + */ + OpenAIResponseQueuedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java new file mode 100644 index 000000000..da1251412 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java @@ -0,0 +1,522 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a new reasoning summary part is added. */ +// CHECKSTYLE:OFF +public class OpenAIResponseReasoningSummaryPartAddedEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.reasoning_summary_part.added`. */ + public enum TypeEnum { + /** + * The RESPONSE_REASONING_SUMMARY_PART_ADDED option of this + * OpenAIResponseReasoningSummaryPartAddedEvent + */ + RESPONSE_REASONING_SUMMARY_PART_ADDED("response.reasoning_summary_part.added"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningSummaryPartAddedEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseReasoningSummaryPartAddedEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("summary_index") + private Integer summaryIndex; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("part") + private OpenAIResponseReasoningSummaryPartAddedEventPart part; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseReasoningSummaryPartAddedEvent. */ + protected OpenAIResponseReasoningSummaryPartAddedEvent() {} + + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and return + * the same instance. + * + * @param type The type of the event. Always `response.reasoning_summary_part.added`. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.reasoning_summary_part.added`. + * + * @return type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param type The type of the event. Always `response.reasoning_summary_part.added`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and return + * the same instance. + * + * @param itemId The ID of the item this summary part is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the item this summary part is associated with. + * + * @return itemId The itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param itemId The ID of the item this summary part is associated with. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item this summary part is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item this summary part is associated with. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseReasoningSummaryPartAddedEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param outputIndex The index of the output item this summary part is associated with. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and + * return the same instance. + * + * @param summaryIndex The index of the summary part within the reasoning summary. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEvent summaryIndex( + @Nonnull final Integer summaryIndex) { + this.summaryIndex = summaryIndex; + return this; + } + + /** + * The index of the summary part within the reasoning summary. + * + * @return summaryIndex The summaryIndex of this {@link + * OpenAIResponseReasoningSummaryPartAddedEvent} instance. + */ + @Nonnull + public Integer getSummaryIndex() { + return summaryIndex; + } + + /** + * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param summaryIndex The index of the summary part within the reasoning summary. + */ + public void setSummaryIndex(@Nonnull final Integer summaryIndex) { + this.summaryIndex = summaryIndex; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance + * and return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseReasoningSummaryPartAddedEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and return + * the same instance. + * + * @param part The summary part that was added. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEvent part( + @Nonnull final OpenAIResponseReasoningSummaryPartAddedEventPart part) { + this.part = part; + return this; + } + + /** + * The summary part that was added. + * + * @return part The part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEventPart getPart() { + return part; + } + + /** + * Set the part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param part The summary part that was added. + */ + public void setPart(@Nonnull final OpenAIResponseReasoningSummaryPartAddedEventPart part) { + this.part = part; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseReasoningSummaryPartAddedEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseReasoningSummaryPartAddedEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (summaryIndex != null) declaredFields.put("summaryIndex", summaryIndex); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (part != null) declaredFields.put("part", part); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseReasoningSummaryPartAddedEvent + openAIResponseReasoningSummaryPartAddedEvent = + (OpenAIResponseReasoningSummaryPartAddedEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseReasoningSummaryPartAddedEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseReasoningSummaryPartAddedEvent.type) + && Objects.equals(this.itemId, openAIResponseReasoningSummaryPartAddedEvent.itemId) + && Objects.equals( + this.outputIndex, openAIResponseReasoningSummaryPartAddedEvent.outputIndex) + && Objects.equals( + this.summaryIndex, openAIResponseReasoningSummaryPartAddedEvent.summaryIndex) + && Objects.equals( + this.sequenceNumber, openAIResponseReasoningSummaryPartAddedEvent.sequenceNumber) + && Objects.equals(this.part, openAIResponseReasoningSummaryPartAddedEvent.part); + } + + @Override + public int hashCode() { + return Objects.hash( + type, itemId, outputIndex, summaryIndex, sequenceNumber, part, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseReasoningSummaryPartAddedEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" summaryIndex: ").append(toIndentedString(summaryIndex)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" part: ").append(toIndentedString(part)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseReasoningSummaryPartAddedEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (summaryIndex) -> + (sequenceNumber) -> + (part) -> + new OpenAIResponseReasoningSummaryPartAddedEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .summaryIndex(summaryIndex) + .sequenceNumber(sequenceNumber) + .part(part); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param type The type of the event. Always `response.reasoning_summary_part.added`. + * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param itemId The ID of the item this summary part is associated with. + * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param outputIndex The index of the output item this summary part is associated with. + * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param summaryIndex The index of the summary part within the reasoning summary. + * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. + */ + Builder4 summaryIndex(@Nonnull final Integer summaryIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. + */ + Builder5 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. + * + * @param part The summary part that was added. + * @return The OpenAIResponseReasoningSummaryPartAddedEvent instance. + */ + OpenAIResponseReasoningSummaryPartAddedEvent part( + @Nonnull final OpenAIResponseReasoningSummaryPartAddedEventPart part); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java new file mode 100644 index 000000000..577233967 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java @@ -0,0 +1,307 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** OpenAIResponseReasoningSummaryPartAddedEventPart */ +// CHECKSTYLE:OFF +public class OpenAIResponseReasoningSummaryPartAddedEventPart +// CHECKSTYLE:ON +{ + /** Gets or Sets type */ + public enum TypeEnum { + /** The SUMMARY_TEXT option of this OpenAIResponseReasoningSummaryPartAddedEventPart */ + SUMMARY_TEXT("summary_text"), + + /** + * The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningSummaryPartAddedEventPart + */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseReasoningSummaryPartAddedEventPart + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("text") + private String text; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseReasoningSummaryPartAddedEventPart. */ + protected OpenAIResponseReasoningSummaryPartAddedEventPart() {} + + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance and + * return the same instance. + * + * @param type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEventPart type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. + * + * @param type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance and + * return the same instance. + * + * @param text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * class + */ + @Nonnull + public OpenAIResponseReasoningSummaryPartAddedEventPart text(@Nonnull final String text) { + this.text = text; + return this; + } + + /** + * Get text + * + * @return text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * instance. + */ + @Nonnull + public String getText() { + return text; + } + + /** + * Set the text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. + * + * @param text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + */ + public void setText(@Nonnull final String text) { + this.text = text; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseReasoningSummaryPartAddedEventPart}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseReasoningSummaryPartAddedEventPart} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseReasoningSummaryPartAddedEventPart has no field with name '" + + name + + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link + * OpenAIResponseReasoningSummaryPartAddedEventPart} instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (text != null) declaredFields.put("text", text); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseReasoningSummaryPartAddedEventPart + openAIResponseReasoningSummaryPartAddedEventPart = + (OpenAIResponseReasoningSummaryPartAddedEventPart) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseReasoningSummaryPartAddedEventPart.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseReasoningSummaryPartAddedEventPart.type) + && Objects.equals(this.text, openAIResponseReasoningSummaryPartAddedEventPart.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseReasoningSummaryPartAddedEventPart {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseReasoningSummaryPartAddedEventPart} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (text) -> new OpenAIResponseReasoningSummaryPartAddedEventPart().type(type).text(text); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. + * + * @param type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * @return The OpenAIResponseReasoningSummaryPartAddedEventPart builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. + * + * @param text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} + * @return The OpenAIResponseReasoningSummaryPartAddedEventPart instance. + */ + OpenAIResponseReasoningSummaryPartAddedEventPart text(@Nonnull final String text); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java new file mode 100644 index 000000000..db5255a80 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java @@ -0,0 +1,521 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a delta is added to a reasoning summary text. */ +// CHECKSTYLE:OFF +public class OpenAIResponseReasoningSummaryTextDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.reasoning_summary_text.delta`. */ + public enum TypeEnum { + /** + * The RESPONSE_REASONING_SUMMARY_TEXT_DELTA option of this + * OpenAIResponseReasoningSummaryTextDeltaEvent + */ + RESPONSE_REASONING_SUMMARY_TEXT_DELTA("response.reasoning_summary_text.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningSummaryTextDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseReasoningSummaryTextDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("summary_index") + private Integer summaryIndex; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseReasoningSummaryTextDeltaEvent. */ + protected OpenAIResponseReasoningSummaryTextDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and return + * the same instance. + * + * @param type The type of the event. Always `response.reasoning_summary_text.delta`. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryTextDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.reasoning_summary_text.delta`. + * + * @return type The type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param type The type of the event. Always `response.reasoning_summary_text.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and return + * the same instance. + * + * @param itemId The ID of the item this summary text delta is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryTextDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the item this summary text delta is associated with. + * + * @return itemId The itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} + * instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param itemId The ID of the item this summary text delta is associated with. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item this summary text delta is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryTextDeltaEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item this summary text delta is associated with. + * + * @return outputIndex The outputIndex of this {@link + * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param outputIndex The index of the output item this summary text delta is associated with. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and + * return the same instance. + * + * @param summaryIndex The index of the summary part within the reasoning summary. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryTextDeltaEvent summaryIndex( + @Nonnull final Integer summaryIndex) { + this.summaryIndex = summaryIndex; + return this; + } + + /** + * The index of the summary part within the reasoning summary. + * + * @return summaryIndex The summaryIndex of this {@link + * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + */ + @Nonnull + public Integer getSummaryIndex() { + return summaryIndex; + } + + /** + * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param summaryIndex The index of the summary part within the reasoning summary. + */ + public void setSummaryIndex(@Nonnull final Integer summaryIndex) { + this.summaryIndex = summaryIndex; + } + + /** + * Set the delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and return + * the same instance. + * + * @param delta The text delta that was added to the summary. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryTextDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The text delta that was added to the summary. + * + * @return delta The delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param delta The text delta that was added to the summary. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance + * and return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningSummaryTextDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseReasoningSummaryTextDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseReasoningSummaryTextDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (summaryIndex != null) declaredFields.put("summaryIndex", summaryIndex); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseReasoningSummaryTextDeltaEvent + openAIResponseReasoningSummaryTextDeltaEvent = + (OpenAIResponseReasoningSummaryTextDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseReasoningSummaryTextDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseReasoningSummaryTextDeltaEvent.type) + && Objects.equals(this.itemId, openAIResponseReasoningSummaryTextDeltaEvent.itemId) + && Objects.equals( + this.outputIndex, openAIResponseReasoningSummaryTextDeltaEvent.outputIndex) + && Objects.equals( + this.summaryIndex, openAIResponseReasoningSummaryTextDeltaEvent.summaryIndex) + && Objects.equals(this.delta, openAIResponseReasoningSummaryTextDeltaEvent.delta) + && Objects.equals( + this.sequenceNumber, openAIResponseReasoningSummaryTextDeltaEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + type, itemId, outputIndex, summaryIndex, delta, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseReasoningSummaryTextDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" summaryIndex: ").append(toIndentedString(summaryIndex)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseReasoningSummaryTextDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (summaryIndex) -> + (delta) -> + (sequenceNumber) -> + new OpenAIResponseReasoningSummaryTextDeltaEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .summaryIndex(summaryIndex) + .delta(delta) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param type The type of the event. Always `response.reasoning_summary_text.delta`. + * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param itemId The ID of the item this summary text delta is associated with. + * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param outputIndex The index of the output item this summary text delta is associated with. + * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param summaryIndex The index of the summary part within the reasoning summary. + * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. + */ + Builder4 summaryIndex(@Nonnull final Integer summaryIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param delta The text delta that was added to the summary. + * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. + */ + Builder5 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseReasoningSummaryTextDeltaEvent instance. + */ + OpenAIResponseReasoningSummaryTextDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java new file mode 100644 index 000000000..3993e406a --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java @@ -0,0 +1,510 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when a delta is added to a reasoning text. */ +// CHECKSTYLE:OFF +public class OpenAIResponseReasoningTextDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.reasoning_text.delta`. */ + public enum TypeEnum { + /** The RESPONSE_REASONING_TEXT_DELTA option of this OpenAIResponseReasoningTextDeltaEvent */ + RESPONSE_REASONING_TEXT_DELTA("response.reasoning_text.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningTextDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseReasoningTextDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("content_index") + private Integer contentIndex; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseReasoningTextDeltaEvent. */ + protected OpenAIResponseReasoningTextDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.reasoning_text.delta`. + * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningTextDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.reasoning_text.delta`. + * + * @return type The type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param type The type of the event. Always `response.reasoning_text.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return the + * same instance. + * + * @param itemId The ID of the item this reasoning text delta is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningTextDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the item this reasoning text delta is associated with. + * + * @return itemId The itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param itemId The ID of the item this reasoning text delta is associated with. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return + * the same instance. + * + * @param outputIndex The index of the output item this reasoning text delta is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningTextDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item this reasoning text delta is associated with. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param outputIndex The index of the output item this reasoning text delta is associated with. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return + * the same instance. + * + * @param contentIndex The index of the reasoning content part this delta is associated with. + * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningTextDeltaEvent contentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + return this; + } + + /** + * The index of the reasoning content part this delta is associated with. + * + * @return contentIndex The contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} + * instance. + */ + @Nonnull + public Integer getContentIndex() { + return contentIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param contentIndex The index of the reasoning content part this delta is associated with. + */ + public void setContentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + } + + /** + * Set the delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return the + * same instance. + * + * @param delta The text delta that was added to the reasoning content. + * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningTextDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The text delta that was added to the reasoning content. + * + * @return delta The delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param delta The text delta that was added to the reasoning content. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseReasoningTextDeltaEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseReasoningTextDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseReasoningTextDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseReasoningTextDeltaEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * If the map previously contained a mapping for the key, the old value is replaced by the + * specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseReasoningTextDeltaEvent openAIResponseReasoningTextDeltaEvent = + (OpenAIResponseReasoningTextDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseReasoningTextDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseReasoningTextDeltaEvent.type) + && Objects.equals(this.itemId, openAIResponseReasoningTextDeltaEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseReasoningTextDeltaEvent.outputIndex) + && Objects.equals(this.contentIndex, openAIResponseReasoningTextDeltaEvent.contentIndex) + && Objects.equals(this.delta, openAIResponseReasoningTextDeltaEvent.delta) + && Objects.equals( + this.sequenceNumber, openAIResponseReasoningTextDeltaEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + type, itemId, outputIndex, contentIndex, delta, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseReasoningTextDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseReasoningTextDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (contentIndex) -> + (delta) -> + (sequenceNumber) -> + new OpenAIResponseReasoningTextDeltaEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .contentIndex(contentIndex) + .delta(delta) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param type The type of the event. Always `response.reasoning_text.delta`. + * @return The OpenAIResponseReasoningTextDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param itemId The ID of the item this reasoning text delta is associated with. + * @return The OpenAIResponseReasoningTextDeltaEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param outputIndex The index of the output item this reasoning text delta is associated with. + * @return The OpenAIResponseReasoningTextDeltaEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param contentIndex The index of the reasoning content part this delta is associated with. + * @return The OpenAIResponseReasoningTextDeltaEvent builder. + */ + Builder4 contentIndex(@Nonnull final Integer contentIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param delta The text delta that was added to the reasoning content. + * @return The OpenAIResponseReasoningTextDeltaEvent builder. + */ + Builder5 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseReasoningTextDeltaEvent instance. + */ + OpenAIResponseReasoningTextDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java new file mode 100644 index 000000000..8a1acab6f --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java @@ -0,0 +1,505 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when there is a partial refusal text. */ +// CHECKSTYLE:OFF +public class OpenAIResponseRefusalDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.refusal.delta`. */ + public enum TypeEnum { + /** The RESPONSE_REFUSAL_DELTA option of this OpenAIResponseRefusalDeltaEvent */ + RESPONSE_REFUSAL_DELTA("response.refusal.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseRefusalDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseRefusalDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("content_index") + private Integer contentIndex; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseRefusalDeltaEvent. */ + protected OpenAIResponseRefusalDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.refusal.delta`. + * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class + */ + @Nonnull + public OpenAIResponseRefusalDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.refusal.delta`. + * + * @return type The type of this {@link OpenAIResponseRefusalDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param type The type of the event. Always `response.refusal.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the same + * instance. + * + * @param itemId The ID of the output item that the refusal text is added to. + * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class + */ + @Nonnull + public OpenAIResponseRefusalDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the output item that the refusal text is added to. + * + * @return itemId The itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param itemId The ID of the output item that the refusal text is added to. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the + * same instance. + * + * @param outputIndex The index of the output item that the refusal text is added to. + * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class + */ + @Nonnull + public OpenAIResponseRefusalDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the refusal text is added to. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param outputIndex The index of the output item that the refusal text is added to. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the + * same instance. + * + * @param contentIndex The index of the content part that the refusal text is added to. + * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class + */ + @Nonnull + public OpenAIResponseRefusalDeltaEvent contentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + return this; + } + + /** + * The index of the content part that the refusal text is added to. + * + * @return contentIndex The contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. + */ + @Nonnull + public Integer getContentIndex() { + return contentIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param contentIndex The index of the content part that the refusal text is added to. + */ + public void setContentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + } + + /** + * Set the delta of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the same + * instance. + * + * @param delta The refusal text that is added. + * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class + */ + @Nonnull + public OpenAIResponseRefusalDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The refusal text that is added. + * + * @return delta The delta of this {@link OpenAIResponseRefusalDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param delta The refusal text that is added. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the + * same instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class + */ + @Nonnull + public OpenAIResponseRefusalDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseRefusalDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseRefusalDeltaEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseRefusalDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseRefusalDeltaEvent} instance + * including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseRefusalDeltaEvent} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseRefusalDeltaEvent openAIResponseRefusalDeltaEvent = + (OpenAIResponseRefusalDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseRefusalDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseRefusalDeltaEvent.type) + && Objects.equals(this.itemId, openAIResponseRefusalDeltaEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseRefusalDeltaEvent.outputIndex) + && Objects.equals(this.contentIndex, openAIResponseRefusalDeltaEvent.contentIndex) + && Objects.equals(this.delta, openAIResponseRefusalDeltaEvent.delta) + && Objects.equals(this.sequenceNumber, openAIResponseRefusalDeltaEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash( + type, itemId, outputIndex, contentIndex, delta, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseRefusalDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseRefusalDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (contentIndex) -> + (delta) -> + (sequenceNumber) -> + new OpenAIResponseRefusalDeltaEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .contentIndex(contentIndex) + .delta(delta) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param type The type of the event. Always `response.refusal.delta`. + * @return The OpenAIResponseRefusalDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param itemId The ID of the output item that the refusal text is added to. + * @return The OpenAIResponseRefusalDeltaEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param outputIndex The index of the output item that the refusal text is added to. + * @return The OpenAIResponseRefusalDeltaEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param contentIndex The index of the content part that the refusal text is added to. + * @return The OpenAIResponseRefusalDeltaEvent builder. + */ + Builder4 contentIndex(@Nonnull final Integer contentIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the delta of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param delta The refusal text that is added. + * @return The OpenAIResponseRefusalDeltaEvent builder. + */ + Builder5 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} instance. + * + * @param sequenceNumber The sequence number of this event. + * @return The OpenAIResponseRefusalDeltaEvent instance. + */ + OpenAIResponseRefusalDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java new file mode 100644 index 000000000..d88131a4b --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java @@ -0,0 +1,191 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Options for streaming responses. Only set this when you set `stream: true`. */ +// CHECKSTYLE:OFF +public class OpenAIResponseStreamOptions +// CHECKSTYLE:ON +{ + @JsonProperty("include_obfuscation") + private Boolean includeObfuscation; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseStreamOptions. */ + protected OpenAIResponseStreamOptions() {} + + /** + * Set the includeObfuscation of this {@link OpenAIResponseStreamOptions} instance and return the + * same instance. + * + * @param includeObfuscation When true, stream obfuscation will be enabled. Stream obfuscation + * adds random characters to an `obfuscation` field on streaming delta events to + * normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation + * fields are included by default, but add a small amount of overhead to the data stream. You + * can set `include_obfuscation` to false to optimize for bandwidth if you trust the + * network links between your application and the OpenAI API. + * @return The same instance of this {@link OpenAIResponseStreamOptions} class + */ + @Nonnull + public OpenAIResponseStreamOptions includeObfuscation( + @Nullable final Boolean includeObfuscation) { + this.includeObfuscation = includeObfuscation; + return this; + } + + /** + * When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an + * `obfuscation` field on streaming delta events to normalize payload sizes as a + * mitigation to certain side-channel attacks. These obfuscation fields are included by default, + * but add a small amount of overhead to the data stream. You can set + * `include_obfuscation` to false to optimize for bandwidth if you trust the network + * links between your application and the OpenAI API. + * + * @return includeObfuscation The includeObfuscation of this {@link OpenAIResponseStreamOptions} + * instance. + */ + @Nonnull + public Boolean isIncludeObfuscation() { + return includeObfuscation; + } + + /** + * Set the includeObfuscation of this {@link OpenAIResponseStreamOptions} instance. + * + * @param includeObfuscation When true, stream obfuscation will be enabled. Stream obfuscation + * adds random characters to an `obfuscation` field on streaming delta events to + * normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation + * fields are included by default, but add a small amount of overhead to the data stream. You + * can set `include_obfuscation` to false to optimize for bandwidth if you trust the + * network links between your application and the OpenAI API. + */ + public void setIncludeObfuscation(@Nullable final Boolean includeObfuscation) { + this.includeObfuscation = includeObfuscation; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseStreamOptions}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseStreamOptions} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseStreamOptions has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseStreamOptions} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (includeObfuscation != null) declaredFields.put("includeObfuscation", includeObfuscation); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseStreamOptions} instance. If the map + * previously contained a mapping for the key, the old value is replaced by the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseStreamOptions openAIResponseStreamOptions = (OpenAIResponseStreamOptions) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseStreamOptions.cloudSdkCustomFields) + && Objects.equals(this.includeObfuscation, openAIResponseStreamOptions.includeObfuscation); + } + + @Override + public int hashCode() { + return Objects.hash(includeObfuscation, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseStreamOptions {\n"); + sb.append(" includeObfuscation: ").append(toIndentedString(includeObfuscation)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Create a new {@link OpenAIResponseStreamOptions} instance. No arguments are required. */ + public static OpenAIResponseStreamOptions create() { + return new OpenAIResponseStreamOptions(); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java new file mode 100644 index 000000000..2f9d8b3bd --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java @@ -0,0 +1,594 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Emitted when there is an additional text delta. */ +// CHECKSTYLE:OFF +public class OpenAIResponseTextDeltaEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.output_text.delta`. */ + public enum TypeEnum { + /** The RESPONSE_OUTPUT_TEXT_DELTA option of this OpenAIResponseTextDeltaEvent */ + RESPONSE_OUTPUT_TEXT_DELTA("response.output_text.delta"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseTextDeltaEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseTextDeltaEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("content_index") + private Integer contentIndex; + + @JsonProperty("delta") + private String delta; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonProperty("logprobs") + private List logprobs = new ArrayList<>(); + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseTextDeltaEvent. */ + protected OpenAIResponseTextDeltaEvent() {} + + /** + * Set the type of this {@link OpenAIResponseTextDeltaEvent} instance and return the same + * instance. + * + * @param type The type of the event. Always `response.output_text.delta`. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.output_text.delta`. + * + * @return type The type of this {@link OpenAIResponseTextDeltaEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param type The type of the event. Always `response.output_text.delta`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the itemId of this {@link OpenAIResponseTextDeltaEvent} instance and return the same + * instance. + * + * @param itemId The ID of the output item that the text delta was added to. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * The ID of the output item that the text delta was added to. + * + * @return itemId The itemId of this {@link OpenAIResponseTextDeltaEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param itemId The ID of the output item that the text delta was added to. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance and return the same + * instance. + * + * @param outputIndex The index of the output item that the text delta was added to. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the text delta was added to. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param outputIndex The index of the output item that the text delta was added to. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance and return the same + * instance. + * + * @param contentIndex The index of the content part that the text delta was added to. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent contentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + return this; + } + + /** + * The index of the content part that the text delta was added to. + * + * @return contentIndex The contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance. + */ + @Nonnull + public Integer getContentIndex() { + return contentIndex; + } + + /** + * Set the contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param contentIndex The index of the content part that the text delta was added to. + */ + public void setContentIndex(@Nonnull final Integer contentIndex) { + this.contentIndex = contentIndex; + } + + /** + * Set the delta of this {@link OpenAIResponseTextDeltaEvent} instance and return the same + * instance. + * + * @param delta The text delta that was added. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent delta(@Nonnull final String delta) { + this.delta = delta; + return this; + } + + /** + * The text delta that was added. + * + * @return delta The delta of this {@link OpenAIResponseTextDeltaEvent} instance. + */ + @Nonnull + public String getDelta() { + return delta; + } + + /** + * Set the delta of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param delta The text delta that was added. + */ + public void setDelta(@Nonnull final String delta) { + this.delta = delta; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} instance and return the + * same instance. + * + * @param sequenceNumber The sequence number for this event. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number for this event. + * + * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} + * instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param sequenceNumber The sequence number for this event. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance and return the same + * instance. + * + * @param logprobs The log probabilities of the tokens in the delta. + * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class + */ + @Nonnull + public OpenAIResponseTextDeltaEvent logprobs( + @Nonnull final List logprobs) { + this.logprobs = logprobs; + return this; + } + + /** + * Add one logprobs instance to this {@link OpenAIResponseTextDeltaEvent}. + * + * @param logprobsItem The logprobs that should be added + * @return The same instance of type {@link OpenAIResponseTextDeltaEvent} + */ + @Nonnull + public OpenAIResponseTextDeltaEvent addLogprobsItem( + @Nonnull final OpenAIResponseLogProb logprobsItem) { + if (this.logprobs == null) { + this.logprobs = new ArrayList<>(); + } + this.logprobs.add(logprobsItem); + return this; + } + + /** + * The log probabilities of the tokens in the delta. + * + * @return logprobs The logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. + */ + @Nonnull + public List getLogprobs() { + return logprobs; + } + + /** + * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param logprobs The log probabilities of the tokens in the delta. + */ + public void setLogprobs(@Nonnull final List logprobs) { + this.logprobs = logprobs; + } + + /** + * Get the names of the unrecognizable properties of the {@link OpenAIResponseTextDeltaEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link OpenAIResponseTextDeltaEvent} + * instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseTextDeltaEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseTextDeltaEvent} instance including + * unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (itemId != null) declaredFields.put("itemId", itemId); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); + if (delta != null) declaredFields.put("delta", delta); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + if (logprobs != null) declaredFields.put("logprobs", logprobs); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseTextDeltaEvent} instance. If the + * map previously contained a mapping for the key, the old value is replaced by the specified + * value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseTextDeltaEvent openAIResponseTextDeltaEvent = + (OpenAIResponseTextDeltaEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, openAIResponseTextDeltaEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseTextDeltaEvent.type) + && Objects.equals(this.itemId, openAIResponseTextDeltaEvent.itemId) + && Objects.equals(this.outputIndex, openAIResponseTextDeltaEvent.outputIndex) + && Objects.equals(this.contentIndex, openAIResponseTextDeltaEvent.contentIndex) + && Objects.equals(this.delta, openAIResponseTextDeltaEvent.delta) + && Objects.equals(this.sequenceNumber, openAIResponseTextDeltaEvent.sequenceNumber) + && Objects.equals(this.logprobs, openAIResponseTextDeltaEvent.logprobs); + } + + @Override + public int hashCode() { + return Objects.hash( + type, + itemId, + outputIndex, + contentIndex, + delta, + sequenceNumber, + logprobs, + cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseTextDeltaEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + sb.append(" logprobs: ").append(toIndentedString(logprobs)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseTextDeltaEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (itemId) -> + (outputIndex) -> + (contentIndex) -> + (delta) -> + (sequenceNumber) -> + (logprobs) -> + new OpenAIResponseTextDeltaEvent() + .type(type) + .itemId(itemId) + .outputIndex(outputIndex) + .contentIndex(contentIndex) + .delta(delta) + .sequenceNumber(sequenceNumber) + .logprobs(logprobs); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param type The type of the event. Always `response.output_text.delta`. + * @return The OpenAIResponseTextDeltaEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the itemId of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param itemId The ID of the output item that the text delta was added to. + * @return The OpenAIResponseTextDeltaEvent builder. + */ + Builder2 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param outputIndex The index of the output item that the text delta was added to. + * @return The OpenAIResponseTextDeltaEvent builder. + */ + Builder3 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param contentIndex The index of the content part that the text delta was added to. + * @return The OpenAIResponseTextDeltaEvent builder. + */ + Builder4 contentIndex(@Nonnull final Integer contentIndex); + } + + /** Builder helper class. */ + public interface Builder4 { + /** + * Set the delta of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param delta The text delta that was added. + * @return The OpenAIResponseTextDeltaEvent builder. + */ + Builder5 delta(@Nonnull final String delta); + } + + /** Builder helper class. */ + public interface Builder5 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param sequenceNumber The sequence number for this event. + * @return The OpenAIResponseTextDeltaEvent builder. + */ + Builder6 sequenceNumber(@Nonnull final Integer sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder6 { + /** + * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param logprobs The log probabilities of the tokens in the delta. + * @return The OpenAIResponseTextDeltaEvent instance. + */ + OpenAIResponseTextDeltaEvent logprobs(@Nonnull final List logprobs); + + /** + * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. + * + * @param logprobs The log probabilities of the tokens in the delta. + * @return The OpenAIResponseTextDeltaEvent instance. + */ + default OpenAIResponseTextDeltaEvent logprobs( + @Nonnull final OpenAIResponseLogProb... logprobs) { + return logprobs(Arrays.asList(logprobs)); + } + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java index 9326932a8..2643b77dd 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java @@ -45,7 +45,7 @@ protected OpenAIResponseUsageInputTokensDetails() {} * @return The same instance of this {@link OpenAIResponseUsageInputTokensDetails} class */ @Nonnull - public OpenAIResponseUsageInputTokensDetails cachedTokens(@Nullable final Integer cachedTokens) { + public OpenAIResponseUsageInputTokensDetails cachedTokens(@Nonnull final Integer cachedTokens) { this.cachedTokens = cachedTokens; return this; } @@ -56,7 +56,7 @@ public OpenAIResponseUsageInputTokensDetails cachedTokens(@Nullable final Intege * @return cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} * instance. */ - @Nullable + @Nonnull public Integer getCachedTokens() { return cachedTokens; } @@ -66,7 +66,7 @@ public Integer getCachedTokens() { * * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} */ - public void setCachedTokens(@Nullable final Integer cachedTokens) { + public void setCachedTokens(@Nonnull final Integer cachedTokens) { this.cachedTokens = cachedTokens; } @@ -187,6 +187,6 @@ public interface Builder { * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} * @return The OpenAIResponseUsageInputTokensDetails instance. */ - OpenAIResponseUsageInputTokensDetails cachedTokens(@Nullable final Integer cachedTokens); + OpenAIResponseUsageInputTokensDetails cachedTokens(@Nonnull final Integer cachedTokens); } } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java index 2e53b2f51..0883b622c 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java @@ -47,7 +47,7 @@ protected OpenAIResponseUsageOutputTokensDetails() {} */ @Nonnull public OpenAIResponseUsageOutputTokensDetails reasoningTokens( - @Nullable final Integer reasoningTokens) { + @Nonnull final Integer reasoningTokens) { this.reasoningTokens = reasoningTokens; return this; } @@ -58,7 +58,7 @@ public OpenAIResponseUsageOutputTokensDetails reasoningTokens( * @return reasoningTokens The reasoningTokens of this {@link * OpenAIResponseUsageOutputTokensDetails} instance. */ - @Nullable + @Nonnull public Integer getReasoningTokens() { return reasoningTokens; } @@ -69,7 +69,7 @@ public Integer getReasoningTokens() { * @param reasoningTokens The reasoningTokens of this {@link * OpenAIResponseUsageOutputTokensDetails} */ - public void setReasoningTokens(@Nullable final Integer reasoningTokens) { + public void setReasoningTokens(@Nonnull final Integer reasoningTokens) { this.reasoningTokens = reasoningTokens; } @@ -193,6 +193,6 @@ public interface Builder { * OpenAIResponseUsageOutputTokensDetails} * @return The OpenAIResponseUsageOutputTokensDetails instance. */ - OpenAIResponseUsageOutputTokensDetails reasoningTokens(@Nullable final Integer reasoningTokens); + OpenAIResponseUsageOutputTokensDetails reasoningTokens(@Nonnull final Integer reasoningTokens); } } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java new file mode 100644 index 000000000..81dcdfa36 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java @@ -0,0 +1,412 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Note: web_search is not yet available via Azure OpenAI. */ +// CHECKSTYLE:OFF +public class OpenAIResponseWebSearchCallInProgressEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.web_search_call.in_progress`. */ + public enum TypeEnum { + /** + * The RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS option of this + * OpenAIResponseWebSearchCallInProgressEvent + */ + RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS("response.web_search_call.in_progress"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseWebSearchCallInProgressEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseWebSearchCallInProgressEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseWebSearchCallInProgressEvent. */ + protected OpenAIResponseWebSearchCallInProgressEvent() {} + + /** + * Set the type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always `response.web_search_call.in_progress`. + * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallInProgressEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.web_search_call.in_progress`. + * + * @return type The type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param type The type of the event. Always `response.web_search_call.in_progress`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item that the web search call is associated with. + * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallInProgressEvent outputIndex( + @Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the web search call is associated with. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item that the web search call is associated with. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and return + * the same instance. + * + * @param itemId Unique ID for the output item associated with the web search call. + * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallInProgressEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Unique ID for the output item associated with the web search call. + * + * @return itemId The itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param itemId Unique ID for the output item associated with the web search call. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of the web search call being processed. + * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of the web search call being processed. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseWebSearchCallInProgressEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of the web search call being processed. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseWebSearchCallInProgressEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseWebSearchCallInProgressEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseWebSearchCallInProgressEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseWebSearchCallInProgressEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseWebSearchCallInProgressEvent openAIResponseWebSearchCallInProgressEvent = + (OpenAIResponseWebSearchCallInProgressEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseWebSearchCallInProgressEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseWebSearchCallInProgressEvent.type) + && Objects.equals(this.outputIndex, openAIResponseWebSearchCallInProgressEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseWebSearchCallInProgressEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseWebSearchCallInProgressEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseWebSearchCallInProgressEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseWebSearchCallInProgressEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseWebSearchCallInProgressEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param type The type of the event. Always `response.web_search_call.in_progress`. + * @return The OpenAIResponseWebSearchCallInProgressEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param outputIndex The index of the output item that the web search call is associated with. + * @return The OpenAIResponseWebSearchCallInProgressEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param itemId Unique ID for the output item associated with the web search call. + * @return The OpenAIResponseWebSearchCallInProgressEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. + * + * @param sequenceNumber The sequence number of the web search call being processed. + * @return The OpenAIResponseWebSearchCallInProgressEvent instance. + */ + OpenAIResponseWebSearchCallInProgressEvent sequenceNumber( + @Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java new file mode 100644 index 000000000..99cf4b92d --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java @@ -0,0 +1,410 @@ +/* + * Azure AI Foundry Models Service + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +/** Note: web_search is not yet available via Azure OpenAI. */ +// CHECKSTYLE:OFF +public class OpenAIResponseWebSearchCallSearchingEvent +// CHECKSTYLE:ON +{ + /** The type of the event. Always `response.web_search_call.searching`. */ + public enum TypeEnum { + /** + * The RESPONSE_WEB_SEARCH_CALL_SEARCHING option of this + * OpenAIResponseWebSearchCallSearchingEvent + */ + RESPONSE_WEB_SEARCH_CALL_SEARCHING("response.web_search_call.searching"), + + /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseWebSearchCallSearchingEvent */ + UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + /** + * Get the value of the enum + * + * @return The enum value + */ + @JsonValue + @Nonnull + public String getValue() { + return value; + } + + /** + * Get the String value of the enum value. + * + * @return The enum value as String + */ + @Override + @Nonnull + public String toString() { + return String.valueOf(value); + } + + /** + * Get the enum value from a String value + * + * @param value The String value + * @return The enum value of type OpenAIResponseWebSearchCallSearchingEvent + */ + @JsonCreator + @Nonnull + public static TypeEnum fromValue(@Nonnull final String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return UNKNOWN_DEFAULT_OPEN_API; + } + } + + @JsonProperty("type") + private TypeEnum type; + + @JsonProperty("output_index") + private Integer outputIndex; + + @JsonProperty("item_id") + private String itemId; + + @JsonProperty("sequence_number") + private Integer sequenceNumber; + + @JsonAnySetter @JsonAnyGetter + private final Map cloudSdkCustomFields = new LinkedHashMap<>(); + + /** Default constructor for OpenAIResponseWebSearchCallSearchingEvent. */ + protected OpenAIResponseWebSearchCallSearchingEvent() {} + + /** + * Set the type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and return the + * same instance. + * + * @param type The type of the event. Always `response.web_search_call.searching`. + * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallSearchingEvent type(@Nonnull final TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the event. Always `response.web_search_call.searching`. + * + * @return type The type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + */ + @Nonnull + public TypeEnum getType() { + return type; + } + + /** + * Set the type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param type The type of the event. Always `response.web_search_call.searching`. + */ + public void setType(@Nonnull final TypeEnum type) { + this.type = type; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and + * return the same instance. + * + * @param outputIndex The index of the output item that the web search call is associated with. + * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallSearchingEvent outputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + return this; + } + + /** + * The index of the output item that the web search call is associated with. + * + * @return outputIndex The outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} + * instance. + */ + @Nonnull + public Integer getOutputIndex() { + return outputIndex; + } + + /** + * Set the outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param outputIndex The index of the output item that the web search call is associated with. + */ + public void setOutputIndex(@Nonnull final Integer outputIndex) { + this.outputIndex = outputIndex; + } + + /** + * Set the itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and return + * the same instance. + * + * @param itemId Unique ID for the output item associated with the web search call. + * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallSearchingEvent itemId(@Nonnull final String itemId) { + this.itemId = itemId; + return this; + } + + /** + * Unique ID for the output item associated with the web search call. + * + * @return itemId The itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + */ + @Nonnull + public String getItemId() { + return itemId; + } + + /** + * Set the itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param itemId Unique ID for the output item associated with the web search call. + */ + public void setItemId(@Nonnull final String itemId) { + this.itemId = itemId; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and + * return the same instance. + * + * @param sequenceNumber The sequence number of the web search call being processed. + * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class + */ + @Nonnull + public OpenAIResponseWebSearchCallSearchingEvent sequenceNumber( + @Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + return this; + } + + /** + * The sequence number of the web search call being processed. + * + * @return sequenceNumber The sequenceNumber of this {@link + * OpenAIResponseWebSearchCallSearchingEvent} instance. + */ + @Nonnull + public Integer getSequenceNumber() { + return sequenceNumber; + } + + /** + * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param sequenceNumber The sequence number of the web search call being processed. + */ + public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + /** + * Get the names of the unrecognizable properties of the {@link + * OpenAIResponseWebSearchCallSearchingEvent}. + * + * @return The set of properties names + */ + @JsonIgnore + @Nonnull + public Set getCustomFieldNames() { + return cloudSdkCustomFields.keySet(); + } + + /** + * Get the value of an unrecognizable property of this {@link + * OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @deprecated Use {@link #toMap()} instead. + * @param name The name of the property + * @return The value of the property + * @throws NoSuchElementException If no property with the given name could be found. + */ + @Nullable + @Deprecated + public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { + if (!cloudSdkCustomFields.containsKey(name)) { + throw new NoSuchElementException( + "OpenAIResponseWebSearchCallSearchingEvent has no field with name '" + name + "'."); + } + return cloudSdkCustomFields.get(name); + } + + /** + * Get the value of all properties of this {@link OpenAIResponseWebSearchCallSearchingEvent} + * instance including unrecognized properties. + * + * @return The map of all properties + */ + @JsonIgnore + @Nonnull + public Map toMap() { + final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); + if (type != null) declaredFields.put("type", type); + if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); + if (itemId != null) declaredFields.put("itemId", itemId); + if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); + return declaredFields; + } + + /** + * Set an unrecognizable property of this {@link OpenAIResponseWebSearchCallSearchingEvent} + * instance. If the map previously contained a mapping for the key, the old value is replaced by + * the specified value. + * + * @param customFieldName The name of the property + * @param customFieldValue The value of the property + */ + @JsonIgnore + public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { + cloudSdkCustomFields.put(customFieldName, customFieldValue); + } + + @Override + public boolean equals(@Nullable final java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + final OpenAIResponseWebSearchCallSearchingEvent openAIResponseWebSearchCallSearchingEvent = + (OpenAIResponseWebSearchCallSearchingEvent) o; + return Objects.equals( + this.cloudSdkCustomFields, + openAIResponseWebSearchCallSearchingEvent.cloudSdkCustomFields) + && Objects.equals(this.type, openAIResponseWebSearchCallSearchingEvent.type) + && Objects.equals(this.outputIndex, openAIResponseWebSearchCallSearchingEvent.outputIndex) + && Objects.equals(this.itemId, openAIResponseWebSearchCallSearchingEvent.itemId) + && Objects.equals( + this.sequenceNumber, openAIResponseWebSearchCallSearchingEvent.sequenceNumber); + } + + @Override + public int hashCode() { + return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); + } + + @Override + @Nonnull + public String toString() { + final StringBuilder sb = new StringBuilder(); + sb.append("class OpenAIResponseWebSearchCallSearchingEvent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); + sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); + sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); + cloudSdkCustomFields.forEach( + (k, v) -> + sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(final java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Create a type-safe, fluent-api builder object to construct a new {@link + * OpenAIResponseWebSearchCallSearchingEvent} instance with all required arguments. + */ + public static Builder create() { + return (type) -> + (outputIndex) -> + (itemId) -> + (sequenceNumber) -> + new OpenAIResponseWebSearchCallSearchingEvent() + .type(type) + .outputIndex(outputIndex) + .itemId(itemId) + .sequenceNumber(sequenceNumber); + } + + /** Builder helper class. */ + public interface Builder { + /** + * Set the type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param type The type of the event. Always `response.web_search_call.searching`. + * @return The OpenAIResponseWebSearchCallSearchingEvent builder. + */ + Builder1 type(@Nonnull final TypeEnum type); + } + + /** Builder helper class. */ + public interface Builder1 { + /** + * Set the outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param outputIndex The index of the output item that the web search call is associated with. + * @return The OpenAIResponseWebSearchCallSearchingEvent builder. + */ + Builder2 outputIndex(@Nonnull final Integer outputIndex); + } + + /** Builder helper class. */ + public interface Builder2 { + /** + * Set the itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param itemId Unique ID for the output item associated with the web search call. + * @return The OpenAIResponseWebSearchCallSearchingEvent builder. + */ + Builder3 itemId(@Nonnull final String itemId); + } + + /** Builder helper class. */ + public interface Builder3 { + /** + * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. + * + * @param sequenceNumber The sequence number of the web search call being processed. + * @return The OpenAIResponseWebSearchCallSearchingEvent instance. + */ + OpenAIResponseWebSearchCallSearchingEvent sequenceNumber(@Nonnull final Integer sequenceNumber); + } +} diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml b/foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml new file mode 100644 index 000000000..28905b482 --- /dev/null +++ b/foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml @@ -0,0 +1,3972 @@ +openapi: 3.1.0 +info: + title: Azure AI Foundry Models Service + license: + name: MIT + url: 'https://github.com/openai/openai-openapi/blob/master/LICENSE' + version: v1 +tags: + - name: Batch + - name: Chat + - name: Completions + - name: Containers + - name: Conversations + - name: Evals + - name: Files + - name: Embeddings + - name: Fine-tuning + - name: Models + - name: Realtime + - name: Responses + - name: Threads + - name: Vector Stores +paths: + /responses: + post: + operationId: createResponse + description: Creates a model response. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + text/event-stream: + itemSchema: + type: object + properties: + event: + type: string + data: + type: string + required: + - event + oneOf: + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent' + event: + const: response.audio.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent' + event: + const: response.audio.transcript.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent' + event: + const: response.code_interpreter_call_code.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent' + event: + const: response.code_interpreter_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent' + event: + const: response.code_interpreter_call.interpreting + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent' + event: + const: response.content_part.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent' + event: + const: response.created + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseErrorEvent' + event: + const: error + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent' + event: + const: response.file_search_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent' + event: + const: response.file_search_call.searching + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent' + event: + const: response.function_call_arguments.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent' + event: + const: response.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseFailedEvent' + event: + const: response.failed + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent' + event: + const: response.incomplete + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent' + event: + const: response.output_item.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent' + event: + const: response.reasoning_summary_part.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent' + event: + const: response.reasoning_summary_text.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent' + event: + const: response.reasoning_text.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent' + event: + const: response.refusal.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent' + event: + const: response.output_text.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent' + event: + const: response.web_search_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent' + event: + const: response.web_search_call.searching + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent' + event: + const: response.image_generation_call.generating + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent' + event: + const: response.image_generation_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent' + event: + const: response.image_generation_call.partial_image + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent' + event: + const: response.mcp_call_arguments.delta + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent' + event: + const: response.mcp_call.failed + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent' + event: + const: response.mcp_call.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent' + event: + const: response.mcp_list_tools.failed + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent' + event: + const: response.mcp_list_tools.in_progress + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent' + event: + const: response.output_text.annotation.added + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent' + event: + const: response.queued + - properties: + data: + contentMediaType: application/json + contentSchema: + $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent' + event: + const: response.custom_tool_call_input.delta + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + - properties: + data: + contentMediaType: application/json + x-ms-sse-terminal-event: true + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + required: + - code + - message + - param + - type + tags: + - Responses + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.CreateResponse' + '/responses/{response_id}': + get: + operationId: getResponse + description: Retrieves a model response with the given ID. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + - name: 'include[]' + in: query + required: false + description: Additional fields to include in the response. See the include parameter for Response creation above for more information. + schema: + type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + default: [] + - name: stream + in: query + required: false + description: 'If set to true, the model response data will be streamed to the client as it is generated using server-sent events.' + schema: + type: boolean + explode: false + - name: starting_after + in: query + required: false + description: The sequence number of the event after which to start streaming. + schema: + type: integer + format: int32 + explode: false + - name: include_obfuscation + in: query + required: false + description: 'When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.' + schema: + type: boolean + default: true + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + required: + - code + - message + - param + - type + tags: + - Responses + '/responses/{response_id}/cancel': + post: + operationId: cancelResponse + description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + required: + - code + - message + - param + - type + tags: + - Responses + '/responses/{response_id}/input_items': + get: + operationId: listInputItems + description: Returns a list of input items for a given response. + parameters: + - name: api-version + in: query + required: false + description: |- + The explicit Azure AI Foundry Models API version to use for this request. + `v1` if not otherwise specified. + schema: + $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' + default: v1 + - name: response_id + in: path + required: true + schema: + type: string + - name: limit + in: query + required: false + description: |- + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + default is 20. + schema: + type: integer + format: int32 + default: 20 + explode: false + - name: order + in: query + required: false + description: |- + Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + for descending order. + schema: + type: string + enum: + - asc + - desc + explode: false + - name: after + in: query + required: false + description: |- + A cursor for use in pagination. `after` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the list. + schema: + type: string + explode: false + - name: before + in: query + required: false + description: |- + A cursor for use in pagination. `before` is an object ID that defines your place in the list. + For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page of the list. + schema: + type: string + explode: false + responses: + '200': + description: The request has succeeded. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAI.ResponseItemList' + default: + description: An unexpected error response. + headers: + apim-request-id: + required: false + description: A request ID used for troubleshooting purposes. + schema: + type: string + content: + application/json: + schema: + type: object + properties: + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + param: + anyOf: + - type: string + - type: 'null' + type: + type: string + required: + - code + - message + - param + - type + tags: + - Responses +security: + - ApiKeyAuth: [] + - ApiKeyAuth_: [] + - OAuth2Auth: + - 'https://cognitiveservices.azure.com/.default' +components: + schemas: + AzureAIFoundryModelsApiVersion: + type: string + enum: + - v1 + - preview + AzureContentFilterBlocklistResult: + type: object + required: + - filtered + properties: + filtered: + type: boolean + description: A value indicating whether any of the detailed blocklists resulted in a filtering action. + details: + type: array + items: + type: object + properties: + filtered: + type: boolean + description: A value indicating whether the blocklist produced a filtering action. + id: + type: string + description: The ID of the custom blocklist evaluated. + required: + - filtered + - id + description: The pairs of individual blocklist IDs and whether they resulted in a filtering action. + description: A collection of true/false filtering results for configured custom blocklists. + AzureContentFilterCompletionTextSpan: + type: object + required: + - completion_start_offset + - completion_end_offset + properties: + completion_start_offset: + type: integer + format: int32 + description: Offset of the UTF32 code point which begins the span. + completion_end_offset: + type: integer + format: int32 + description: Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. + description: A representation of a span of completion text as used by Azure OpenAI content filter results. + AzureContentFilterCompletionTextSpanDetectionResult: + type: object + required: + - filtered + - detected + - details + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + details: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan' + description: Detailed information about the detected completion text spans. + AzureContentFilterCustomTopicResult: + type: object + required: + - filtered + properties: + filtered: + type: boolean + description: A value indicating whether any of the detailed topics resulted in a filtering action. + details: + type: array + items: + type: object + properties: + detected: + type: boolean + description: A value indicating whether the topic is detected. + id: + type: string + description: The ID of the custom topic evaluated. + required: + - detected + - id + description: The pairs of individual topic IDs and whether they are detected. + description: A collection of true/false filtering results for configured custom topics. + AzureContentFilterDetectionResult: + type: object + required: + - filtered + - detected + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + description: |- + A labeled content filter result item that indicates whether the content was detected and whether the content was + filtered. + AzureContentFilterForResponsesAPI: + type: object + required: + - blocked + - source_type + - content_filter_results + - content_filter_offsets + properties: + blocked: + type: boolean + description: Indicate if the response is blocked. + source_type: + type: string + description: The name of the source type of the message. + content_filter_results: + allOf: + - $ref: '#/components/schemas/AzureContentFilterResultsForResponsesAPI' + description: A content filter result for a single response item produced by a generative AI system. + content_filter_offsets: + $ref: '#/components/schemas/AzureContentFilterResultOffsets' + AzureContentFilterPersonallyIdentifiableInformationResult: + type: object + properties: + redacted_text: + type: string + description: The redacted text with PII information removed or masked. + sub_categories: + type: array + items: + $ref: '#/components/schemas/AzurePiiSubCategoryResult' + description: Detailed results for individual PIIHarmSubCategory(s). + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A content filter detection result for Personally Identifiable Information that includes harm extensions. + AzureContentFilterResultOffsets: + type: object + required: + - start_offset + - end_offset + - check_offset + properties: + start_offset: + type: integer + format: int32 + end_offset: + type: integer + format: int32 + check_offset: + type: integer + format: int32 + AzureContentFilterResultsForResponsesAPI: + type: object + required: + - jailbreak + - task_adherence + properties: + sexual: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to anatomical organs and genitals, romantic relationships, acts + portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an + assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. + hate: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that can refer to any content that attacks or uses pejorative or discriminatory + language with reference to a person or identity group based on certain differentiating attributes of these groups + including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, + religion, immigration status, ability status, personal appearance, and body size. + violence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category for language related to physical actions intended to hurt, injure, damage, or kill + someone or something; describes weapons, guns and related entities, such as manufactures, associations, + legislation, and so on. + self_harm: + allOf: + - $ref: '#/components/schemas/AzureContentFilterSeverityResult' + description: |- + A content filter category that describes language related to physical actions intended to purposely hurt, injure, + damage one's body or kill oneself. + profanity: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the + content. + custom_blocklists: + allOf: + - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' + description: A collection of binary filtering outcomes for configured custom blocklists. + custom_topics: + allOf: + - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' + description: A collection of binary filtering outcomes for configured custom topics. + error: + type: object + properties: + code: + type: integer + format: int32 + description: 'A distinct, machine-readable code associated with the error.' + message: + type: string + description: A human-readable message associated with the error. + required: + - code + - message + description: 'If present, details about an error that prevented content filtering from completing its evaluation.' + jailbreak: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes user prompt injection attacks, where malicious users deliberately exploit + system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content + generation or violations of system-imposed restrictions. + task_adherence: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A detection result that indicates if the execution flow still sticks the plan. + protected_material_text: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: A detection result that describes a match against text protected under copyright or other status. + protected_material_code: + type: object + properties: + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action. + detected: + type: boolean + description: Whether the labeled content category was detected in the content. + citation: + type: object + properties: + license: + type: string + description: The name or identifier of the license associated with the detection. + URL: + type: string + format: uri + description: The URL associated with the license. + description: 'If available, the citation details describing the associated license and its location.' + required: + - filtered + - detected + description: A detection result that describes a match against licensed code or other protected source material. + ungrounded_material: + $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult' + personally_identifiable_information: + allOf: + - $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult' + description: A detection result that describes matches against Personal Identifiable Information with configurable subcategories. + indirect_attack: + allOf: + - $ref: '#/components/schemas/AzureContentFilterDetectionResult' + description: |- + A detection result that describes attacks on systems powered by Generative AI models that can happen every time + an application processes information that wasn’t directly authored by either the developer of the application or + the user. + AzureContentFilterSeverityResult: + type: object + required: + - filtered + - severity + properties: + filtered: + type: boolean + description: Whether the content severity resulted in a content filtering action. + severity: + type: string + enum: + - safe + - low + - medium + - high + description: The labeled severity of the content. + description: |- + A labeled content filter result item that indicates whether the content was filtered and what the qualitative + severity level of the content was, as evaluated against content filter configuration for the category. + AzurePiiSubCategoryResult: + type: object + required: + - sub_category + - filtered + - detected + - redacted + properties: + sub_category: + type: string + description: The PIIHarmSubCategory that was evaluated. + filtered: + type: boolean + description: Whether the content detection resulted in a content filtering action for this subcategory. + detected: + type: boolean + description: Whether the labeled content subcategory was detected in the content. + redacted: + type: boolean + description: Whether the content was redacted for this subcategory. + description: Result details for individual PIIHarmSubCategory(s). + OpenAI.Annotation: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.AnnotationType' + discriminator: + propertyName: type + mapping: + file_citation: '#/components/schemas/OpenAI.FileCitationBody' + url_citation: '#/components/schemas/OpenAI.UrlCitationBody' + container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody' + file_path: '#/components/schemas/OpenAI.FilePath' + description: An annotation that applies to a span of output text. + OpenAI.AnnotationType: + anyOf: + - type: string + - type: string + enum: + - file_citation + - url_citation + - container_file_citation + - file_path + OpenAI.ConversationParam: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAI.ConversationParam-2' + description: |- + The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. + Input items and output items from this response are automatically added to this conversation after this response completes. + OpenAI.ConversationParam-2: + type: object + required: + - id + properties: + id: + type: string + description: The unique ID of the conversation. + description: The conversation that this response belongs to. + title: Conversation object + OpenAI.ConversationReference: + type: object + required: + - id + properties: + id: + type: string + description: The unique ID of the conversation that this response was associated with. + description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. + title: Conversation + OpenAI.CreateResponse: + type: object + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + description: |- + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + + The two categories of tools you can provide the model are: + + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like file search. + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code. + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + input: + $ref: '#/components/schemas/OpenAI.InputParam' + include: + anyOf: + - type: array + items: + $ref: '#/components/schemas/OpenAI.IncludeEnum' + - type: 'null' + parallel_tool_calls: + anyOf: + - type: boolean + - type: 'null' + default: true + store: + anyOf: + - type: boolean + - type: 'null' + default: true + instructions: + anyOf: + - type: string + - type: 'null' + stream: + anyOf: + - type: boolean + - type: 'null' + stream_options: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseStreamOptions' + - type: 'null' + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationParam' + - type: 'null' + OpenAI.ImageDetail: + type: string + enum: + - low + - high + - auto + OpenAI.IncludeEnum: + anyOf: + - type: string + - type: string + enum: + - file_search_call.results + - web_search_call.results + - web_search_call.action.sources + - message.input_image.image_url + - computer_call_output.output.image_url + - code_interpreter_call.outputs + - reasoning.encrypted_content + - message.output_text.logprobs + description: |- + Specify additional output data to include in the model response. Currently supported values are: + - `web_search_call.action.sources`: Include the sources of the web search tool call. + - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + - `computer_call_output.output.image_url`: Include image urls from the computer call output. + - `file_search_call.results`: Include the search results of the file search tool call. + - `message.input_image.image_url`: Include image urls from the input message. + - `message.output_text.logprobs`: Include logprobs with assistant messages. + - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + OpenAI.InputFileContent: + type: object + required: + - type + properties: + type: + type: string + enum: + - input_file + description: The type of the input item. Always `input_file`. + x-stainless-const: true + default: input_file + file_id: + anyOf: + - type: string + - type: 'null' + filename: + type: string + description: The name of the file to be sent to the model. + file_url: + type: string + format: uri + description: The URL of the file to be sent to the model. + file_data: + type: string + description: The content of the file to be sent to the model. + description: A file input to the model. + title: Input file + OpenAI.InputImageContent: + type: object + required: + - type + - detail + properties: + type: + type: string + enum: + - input_image + description: The type of the input item. Always `input_image`. + x-stainless-const: true + default: input_image + image_url: + anyOf: + - type: string + format: uri + - type: 'null' + file_id: + anyOf: + - type: string + - type: 'null' + detail: + allOf: + - $ref: '#/components/schemas/OpenAI.ImageDetail' + description: 'The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.' + description: 'An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).' + title: Input image + OpenAI.InputItem: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.InputItemType' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAI.EasyInputMessage' + item_reference: '#/components/schemas/OpenAI.ItemReferenceParam' + OpenAI.InputItemType: + anyOf: + - type: string + - type: string + enum: + - message + - item_reference + OpenAI.InputParam: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + description: |- + Text, image, or file inputs to the model, used to generate a response. + Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Image inputs](https://platform.openai.com/docs/guides/images) + - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + - [Function calling](https://platform.openai.com/docs/guides/function-calling) + OpenAI.InputTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - input_text + description: The type of the input item. Always `input_text`. + x-stainless-const: true + default: input_text + text: + type: string + description: The text input to the model. + description: A text input to the model. + title: Input text + OpenAI.ItemResource: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ItemResourceType' + discriminator: + propertyName: type + mapping: + message: '#/components/schemas/OpenAI.InputMessageResource' + output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage' + file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall' + computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall' + computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutputResource' + web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall' + function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallResource' + function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutputResource' + image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall' + code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall' + local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall' + local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput' + shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall' + shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput' + apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall' + apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput' + mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools' + mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest' + mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource' + mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall' + description: Content item used to generate a response. + OpenAI.ItemResourceType: + anyOf: + - type: string + - type: string + enum: + - message + - output_message + - file_search_call + - computer_call + - computer_call_output + - web_search_call + - function_call + - function_call_output + - image_generation_call + - code_interpreter_call + - local_shell_call + - local_shell_call_output + - shell_call + - shell_call_output + - apply_patch_call + - apply_patch_call_output + - mcp_list_tools + - mcp_approval_request + - mcp_approval_response + - mcp_call + OpenAI.Metadata: + type: object + unevaluatedProperties: + type: string + description: |- + Set of 16 key-value pairs that can be attached to an object. This can be + useful for storing additional information about the object in a structured + format, and querying for objects via API or the dashboard. + Keys are strings with a maximum length of 64 characters. Values are strings + with a maximum length of 512 characters. + x-oaiTypeLabel: map + OpenAI.OutputContent: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.OutputContentType' + discriminator: + propertyName: type + mapping: + output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent' + refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent' + OpenAI.OutputContentType: + anyOf: + - type: string + - type: string + enum: + - output_text + - refusal + - reasoning_text + OpenAI.OutputItem: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.OutputItemType' + discriminator: + propertyName: type + mapping: + output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage' + file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall' + function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall' + web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall' + computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall' + reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem' + compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody' + image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall' + code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall' + local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall' + shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall' + shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput' + apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall' + apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput' + mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall' + mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools' + mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest' + custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCall' + OpenAI.OutputItemType: + anyOf: + - type: string + - type: string + enum: + - output_message + - file_search_call + - function_call + - web_search_call + - computer_call + - reasoning + - compaction + - image_generation_call + - code_interpreter_call + - local_shell_call + - shell_call + - shell_call_output + - apply_patch_call + - apply_patch_call_output + - mcp_call + - mcp_list_tools + - mcp_approval_request + - custom_tool_call + OpenAI.Prompt: + type: object + required: + - id + properties: + id: + type: string + description: The unique identifier of the prompt template to use. + version: + anyOf: + - type: string + - type: 'null' + variables: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables' + - type: 'null' + description: |- + Reference to a prompt template and its variables. + [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). + OpenAI.Reasoning: + type: object + properties: + effort: + $ref: '#/components/schemas/OpenAI.ReasoningEffort' + summary: + anyOf: + - type: string + enum: + - auto + - concise + - detailed + - type: 'null' + generate_summary: + anyOf: + - type: string + enum: + - auto + - concise + - detailed + - type: 'null' + description: |- + **gpt-5 and o-series models only** + Configuration options for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + title: Reasoning + OpenAI.ReasoningEffort: + anyOf: + - type: string + enum: + - none + - minimal + - low + - medium + - high + - xhigh + - type: 'null' + description: |- + Constrains effort on reasoning for + [reasoning models](https://platform.openai.com/docs/guides/reasoning). + Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing + reasoning effort can result in faster responses and fewer tokens used + on reasoning in a response. + - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. + - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. + - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. + - `xhigh` is supported for all models after `gpt-5.1-codex-max`. + OpenAI.Response: + type: object + required: + - id + - object + - created_at + - error + - incomplete_details + - output + - instructions + - parallel_tool_calls + - content_filters + properties: + metadata: + anyOf: + - $ref: '#/components/schemas/OpenAI.Metadata' + - type: 'null' + top_logprobs: + anyOf: + - type: integer + - type: 'null' + temperature: + anyOf: + - type: number + - type: 'null' + default: 1 + top_p: + anyOf: + - type: number + - type: 'null' + default: 1 + user: + type: string + description: |- + This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + A stable identifier for your end-users. + Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + deprecated: true + safety_identifier: + type: string + description: |- + A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + prompt_cache_key: + type: string + description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' + prompt_cache_retention: + anyOf: + - type: string + enum: + - in-memory + - 24h + - type: 'null' + previous_response_id: + anyOf: + - type: string + - type: 'null' + model: + type: string + description: |- + Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + offers a wide range of models with different capabilities, performance + characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + to browse and compare available models. + reasoning: + anyOf: + - $ref: '#/components/schemas/OpenAI.Reasoning' + - type: 'null' + background: + anyOf: + - type: boolean + - type: 'null' + max_output_tokens: + anyOf: + - type: integer + - type: 'null' + max_tool_calls: + anyOf: + - type: integer + - type: 'null' + text: + $ref: '#/components/schemas/OpenAI.ResponseTextParam' + tools: + $ref: '#/components/schemas/OpenAI.ToolsArray' + tool_choice: + $ref: '#/components/schemas/OpenAI.ToolChoiceParam' + prompt: + $ref: '#/components/schemas/OpenAI.Prompt' + truncation: + anyOf: + - type: string + enum: + - auto + - disabled + - type: 'null' + default: disabled + id: + type: string + description: Unique identifier for this Response. + object: + type: string + enum: + - response + description: The object type of this resource - always set to `response`. + x-stainless-const: true + status: + type: string + enum: + - completed + - failed + - in_progress + - cancelled + - queued + - incomplete + description: |- + The status of the response generation. One of `completed`, `failed`, + `in_progress`, `cancelled`, `queued`, or `incomplete`. + created_at: + type: integer + format: unixtime + description: Unix timestamp (in seconds) of when this Response was created. + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + type: integer + format: unixTimestamp + error: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseError' + - type: 'null' + incomplete_details: + anyOf: + - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' + - type: 'null' + output: + type: array + items: + $ref: '#/components/schemas/OpenAI.OutputItem' + description: |- + An array of content items generated by the model. + - The length and order of items in the `output` array is dependent + on the model's response. + - Rather than accessing the first item in the `output` array and + assuming it's an `assistant` message with the content generated by + the model, you might consider using the `output_text` property where + supported in SDKs. + instructions: + anyOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAI.InputItem' + - type: 'null' + output_text: + anyOf: + - type: string + - type: 'null' + x-stainless-skip: true + usage: + $ref: '#/components/schemas/OpenAI.ResponseUsage' + parallel_tool_calls: + type: boolean + description: Whether to allow the model to run tool calls in parallel. + default: true + conversation: + anyOf: + - $ref: '#/components/schemas/OpenAI.ConversationReference' + - type: 'null' + content_filters: + type: array + items: + $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' + description: The content filter results from RAI. + title: The response object + OpenAI.ResponseAudioDeltaEvent: + type: object + required: + - type + - sequence_number + - delta + properties: + type: + type: string + enum: + - response.audio.delta + description: The type of the event. Always `response.audio.delta`. + x-stainless-const: true + sequence_number: + type: integer + description: A sequence number for this chunk of the stream response. + delta: + type: string + contentEncoding: base64 + description: A chunk of Base64 encoded response audio bytes. + description: Emitted when there is a partial audio response. + x-oaiMeta: + name: response.audio.delta + group: responses + example: | + { + "type": "response.audio.delta", + "response_id": "resp_123", + "delta": "base64encoded...", + "sequence_number": 1 + } + OpenAI.ResponseAudioTranscriptDeltaEvent: + type: object + required: + - type + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.audio.transcript.delta + description: The type of the event. Always `response.audio.transcript.delta`. + x-stainless-const: true + delta: + type: string + description: The partial transcript of the audio response. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when there is a partial transcript of audio. + x-oaiMeta: + name: response.audio.transcript.delta + group: responses + example: | + { + "type": "response.audio.transcript.delta", + "response_id": "resp_123", + "delta": " ... partial transcript ... ", + "sequence_number": 1 + } + OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent: + type: object + required: + - type + - output_index + - item_id + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.code_interpreter_call_code.delta + description: The type of the event. Always `response.code_interpreter_call_code.delta`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response for which the code is being streamed. + item_id: + type: string + description: The unique identifier of the code interpreter tool call item. + delta: + type: string + description: The partial code snippet being streamed by the code interpreter. + sequence_number: + type: integer + description: 'The sequence number of this event, used to order streaming events.' + description: Emitted when a partial code snippet is streamed by the code interpreter. + x-oaiMeta: + name: response.code_interpreter_call_code.delta + group: responses + example: | + { + "type": "response.code_interpreter_call_code.delta", + "output_index": 0, + "item_id": "ci_12345", + "delta": "print('Hello, world')", + "sequence_number": 1 + } + OpenAI.ResponseCodeInterpreterCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.code_interpreter_call.in_progress + description: The type of the event. Always `response.code_interpreter_call.in_progress`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response for which the code interpreter call is in progress. + item_id: + type: string + description: The unique identifier of the code interpreter tool call item. + sequence_number: + type: integer + description: 'The sequence number of this event, used to order streaming events.' + description: Emitted when a code interpreter call is in progress. + x-oaiMeta: + name: response.code_interpreter_call.in_progress + group: responses + example: | + { + "type": "response.code_interpreter_call.in_progress", + "output_index": 0, + "item_id": "ci_12345", + "sequence_number": 1 + } + OpenAI.ResponseCodeInterpreterCallInterpretingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.code_interpreter_call.interpreting + description: The type of the event. Always `response.code_interpreter_call.interpreting`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response for which the code interpreter is interpreting code. + item_id: + type: string + description: The unique identifier of the code interpreter tool call item. + sequence_number: + type: integer + description: 'The sequence number of this event, used to order streaming events.' + description: Emitted when the code interpreter is actively interpreting the code snippet. + x-oaiMeta: + name: response.code_interpreter_call.interpreting + group: responses + example: | + { + "type": "response.code_interpreter_call.interpreting", + "output_index": 4, + "item_id": "ci_12345", + "sequence_number": 1 + } + OpenAI.ResponseContentPartAddedEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - part + - sequence_number + properties: + type: + type: string + enum: + - response.content_part.added + description: The type of the event. Always `response.content_part.added`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the content part was added to. + output_index: + type: integer + description: The index of the output item that the content part was added to. + content_index: + type: integer + description: The index of the content part that was added. + part: + allOf: + - $ref: '#/components/schemas/OpenAI.OutputContent' + description: The content part that was added. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a new content part is added. + x-oaiMeta: + name: response.content_part.added + group: responses + example: | + { + "type": "response.content_part.added", + "item_id": "msg_123", + "output_index": 0, + "content_index": 0, + "part": { + "type": "output_text", + "text": "", + "annotations": [] + }, + "sequence_number": 1 + } + OpenAI.ResponseCreatedEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.created + description: The type of the event. Always `response.created`. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that was created. + sequence_number: + type: integer + description: The sequence number for this event. + description: An event that is emitted when a response is created. + x-oaiMeta: + name: response.created + group: responses + example: | + { + "type": "response.created", + "response": { + "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", + "object": "response", + "created_at": 1741487325, + "status": "in_progress", + "completed_at": null, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-2024-08-06", + "output": [], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + }, + "sequence_number": 1 + } + OpenAI.ResponseCustomToolCallInputDeltaEvent: + type: object + required: + - type + - sequence_number + - output_index + - item_id + - delta + properties: + type: + type: string + enum: + - response.custom_tool_call_input.delta + description: The event type identifier. + x-stainless-const: true + sequence_number: + type: integer + description: The sequence number of this event. + output_index: + type: integer + description: The index of the output this delta applies to. + item_id: + type: string + description: Unique identifier for the API item associated with this event. + delta: + type: string + description: The incremental input data (delta) for the custom tool call. + description: Event representing a delta (partial update) to the input of a custom tool call. + title: ResponseCustomToolCallInputDelta + x-oaiMeta: + name: response.custom_tool_call_input.delta + group: responses + example: | + { + "type": "response.custom_tool_call_input.delta", + "output_index": 0, + "item_id": "ctc_1234567890abcdef", + "delta": "partial input text" + } + OpenAI.ResponseError: + type: object + required: + - code + - message + properties: + code: + $ref: '#/components/schemas/OpenAI.ResponseErrorCode' + message: + type: string + description: A human-readable description of the error. + description: An error object returned when the model fails to generate a Response. + OpenAI.ResponseErrorCode: + type: string + enum: + - server_error + - rate_limit_exceeded + - invalid_prompt + - vector_store_timeout + - invalid_image + - invalid_image_format + - invalid_base64_image + - invalid_image_url + - image_too_large + - image_too_small + - image_parse_error + - image_content_policy_violation + - invalid_image_mode + - image_file_too_large + - unsupported_image_media_type + - empty_image_file + - failed_to_download_image + - image_file_not_found + description: The error code for the response. + OpenAI.ResponseErrorEvent: + type: object + required: + - type + - code + - message + - param + - sequence_number + properties: + type: + type: string + enum: + - error + description: The type of the event. Always `error`. + x-stainless-const: true + code: + anyOf: + - type: string + - type: 'null' + message: + type: string + description: The error message. + param: + anyOf: + - type: string + - type: 'null' + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when an error occurs. + x-oaiMeta: + name: error + group: responses + example: | + { + "type": "error", + "code": "ERR_SOMETHING", + "message": "Something went wrong", + "param": null, + "sequence_number": 1 + } + OpenAI.ResponseFailedEvent: + type: object + required: + - type + - sequence_number + - response + properties: + type: + type: string + enum: + - response.failed + description: The type of the event. Always `response.failed`. + x-stainless-const: true + sequence_number: + type: integer + description: The sequence number of this event. + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that failed. + description: An event that is emitted when a response fails. + x-oaiMeta: + name: response.failed + group: responses + example: | + { + "type": "response.failed", + "response": { + "id": "resp_123", + "object": "response", + "created_at": 1740855869, + "status": "failed", + "completed_at": null, + "error": { + "code": "server_error", + "message": "The model failed to generate a response." + }, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [], + "previous_response_id": null, + "reasoning_effort": null, + "store": false, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + } + } + OpenAI.ResponseFileSearchCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.file_search_call.in_progress + description: The type of the event. Always `response.file_search_call.in_progress`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the file search call is initiated. + item_id: + type: string + description: The ID of the output item that the file search call is initiated. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a file search call is initiated. + x-oaiMeta: + name: response.file_search_call.in_progress + group: responses + example: | + { + "type": "response.file_search_call.in_progress", + "output_index": 0, + "item_id": "fs_123", + "sequence_number": 1 + } + OpenAI.ResponseFileSearchCallSearchingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.file_search_call.searching + description: The type of the event. Always `response.file_search_call.searching`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the file search call is searching. + item_id: + type: string + description: The ID of the output item that the file search call is initiated. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a file search is currently searching. + x-oaiMeta: + name: response.file_search_call.searching + group: responses + example: | + { + "type": "response.file_search_call.searching", + "output_index": 0, + "item_id": "fs_123", + "sequence_number": 1 + } + OpenAI.ResponseFunctionCallArgumentsDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + - delta + properties: + type: + type: string + enum: + - response.function_call_arguments.delta + description: The type of the event. Always `response.function_call_arguments.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the function-call arguments delta is added to. + output_index: + type: integer + description: The index of the output item that the function-call arguments delta is added to. + sequence_number: + type: integer + description: The sequence number of this event. + delta: + type: string + description: The function-call arguments delta that is added. + description: Emitted when there is a partial function-call arguments delta. + x-oaiMeta: + name: response.function_call_arguments.delta + group: responses + example: | + { + "type": "response.function_call_arguments.delta", + "item_id": "item-abc", + "output_index": 0, + "delta": "{ "arg":" + "sequence_number": 1 + } + OpenAI.ResponseImageGenCallGeneratingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.image_generation_call.generating + description: The type of the event. Always 'response.image_generation_call.generating'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the image generation item being processed. + sequence_number: + type: integer + description: The sequence number of the image generation item being processed. + description: Emitted when an image generation tool call is actively generating an image (intermediate state). + title: ResponseImageGenCallGeneratingEvent + x-oaiMeta: + name: response.image_generation_call.generating + group: responses + example: | + { + "type": "response.image_generation_call.generating", + "output_index": 0, + "item_id": "item-123", + "sequence_number": 0 + } + OpenAI.ResponseImageGenCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.image_generation_call.in_progress + description: The type of the event. Always 'response.image_generation_call.in_progress'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the image generation item being processed. + sequence_number: + type: integer + description: The sequence number of the image generation item being processed. + description: Emitted when an image generation tool call is in progress. + title: ResponseImageGenCallInProgressEvent + x-oaiMeta: + name: response.image_generation_call.in_progress + group: responses + example: | + { + "type": "response.image_generation_call.in_progress", + "output_index": 0, + "item_id": "item-123", + "sequence_number": 0 + } + OpenAI.ResponseImageGenCallPartialImageEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + - partial_image_index + - partial_image_b64 + properties: + type: + type: string + enum: + - response.image_generation_call.partial_image + description: The type of the event. Always 'response.image_generation_call.partial_image'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the image generation item being processed. + sequence_number: + type: integer + description: The sequence number of the image generation item being processed. + partial_image_index: + type: integer + description: '0-based index for the partial image (backend is 1-based, but this is 0-based for the user).' + partial_image_b64: + type: string + description: 'Base64-encoded partial image data, suitable for rendering as an image.' + description: Emitted when a partial image is available during image generation streaming. + title: ResponseImageGenCallPartialImageEvent + x-oaiMeta: + name: response.image_generation_call.partial_image + group: responses + example: | + { + "type": "response.image_generation_call.partial_image", + "output_index": 0, + "item_id": "item-123", + "sequence_number": 0, + "partial_image_index": 0, + "partial_image_b64": "..." + } + OpenAI.ResponseInProgressEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.in_progress + description: The type of the event. Always `response.in_progress`. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that is in progress. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when the response is in progress. + x-oaiMeta: + name: response.in_progress + group: responses + example: | + { + "type": "response.in_progress", + "response": { + "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", + "object": "response", + "created_at": 1741487325, + "status": "in_progress", + "completed_at": null, + "error": null, + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-2024-08-06", + "output": [], + "parallel_tool_calls": true, + "previous_response_id": null, + "reasoning": { + "effort": null, + "summary": null + }, + "store": true, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + }, + "sequence_number": 1 + } + OpenAI.ResponseIncompleteDetails: + type: object + properties: + reason: + type: string + enum: + - max_output_tokens + - content_filter + OpenAI.ResponseIncompleteEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.incomplete + description: The type of the event. Always `response.incomplete`. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The response that was incomplete. + sequence_number: + type: integer + description: The sequence number of this event. + description: An event that is emitted when a response finishes as incomplete. + x-oaiMeta: + name: response.incomplete + group: responses + example: | + { + "type": "response.incomplete", + "response": { + "id": "resp_123", + "object": "response", + "created_at": 1740855869, + "status": "incomplete", + "completed_at": null, + "error": null, + "incomplete_details": { + "reason": "max_tokens" + }, + "instructions": null, + "max_output_tokens": null, + "model": "gpt-4o-mini-2024-07-18", + "output": [], + "previous_response_id": null, + "reasoning_effort": null, + "store": false, + "temperature": 1, + "text": { + "format": { + "type": "text" + } + }, + "tool_choice": "auto", + "tools": [], + "top_p": 1, + "truncation": "disabled", + "usage": null, + "user": null, + "metadata": {} + }, + "sequence_number": 1 + } + OpenAI.ResponseItemList: + type: object + required: + - object + - data + - has_more + - first_id + - last_id + properties: + object: + type: string + enum: + - list + description: 'The type of object returned, must be `list`.' + x-stainless-const: true + data: + type: array + items: + $ref: '#/components/schemas/OpenAI.ItemResource' + description: A list of items used to generate this response. + has_more: + type: boolean + description: Whether there are more items available. + first_id: + type: string + description: The ID of the first item in the list. + last_id: + type: string + description: The ID of the last item in the list. + description: A list of Response items. + x-oaiMeta: + name: The input item list + group: responses + example: | + { + "object": "list", + "data": [ + { + "id": "msg_abc123", + "type": "message", + "role": "user", + "content": [ + { + "type": "input_text", + "text": "Tell me a three sentence bedtime story about a unicorn." + } + ] + } + ], + "first_id": "msg_abc123", + "last_id": "msg_abc123", + "has_more": false + } + OpenAI.ResponseLogProb: + type: object + required: + - token + - logprob + properties: + token: + type: string + description: A possible text token. + logprob: + type: number + description: The log probability of this token. + top_logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs' + description: The log probability of the top 20 most likely tokens. + description: |- + A logprob is the logarithmic probability that the model assigns to producing + a particular token at a given position in the sequence. Less-negative (higher) + logprob values indicate greater model confidence in that token choice. + OpenAI.ResponseLogProbTopLogprobs: + type: object + properties: + token: + type: string + logprob: + type: number + OpenAI.ResponseMCPCallArgumentsDeltaEvent: + type: object + required: + - type + - output_index + - item_id + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_call_arguments.delta + description: The type of the event. Always 'response.mcp_call_arguments.delta'. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the MCP tool call item being processed. + delta: + type: string + description: A JSON string containing the partial update to the arguments for the MCP tool call. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call. + title: ResponseMCPCallArgumentsDeltaEvent + x-oaiMeta: + name: response.mcp_call_arguments.delta + group: responses + example: | + { + "type": "response.mcp_call_arguments.delta", + "output_index": 0, + "item_id": "item-abc", + "delta": "{", + "sequence_number": 1 + } + OpenAI.ResponseMCPCallFailedEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_call.failed + description: The type of the event. Always 'response.mcp_call.failed'. + x-stainless-const: true + item_id: + type: string + description: The ID of the MCP tool call item that failed. + output_index: + type: integer + description: The index of the output item that failed. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when an MCP tool call has failed. + title: ResponseMCPCallFailedEvent + x-oaiMeta: + name: response.mcp_call.failed + group: responses + example: | + { + "type": "response.mcp_call.failed", + "sequence_number": 1, + "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90", + "output_index": 0 + } + OpenAI.ResponseMCPCallInProgressEvent: + type: object + required: + - type + - sequence_number + - output_index + - item_id + properties: + type: + type: string + enum: + - response.mcp_call.in_progress + description: The type of the event. Always 'response.mcp_call.in_progress'. + x-stainless-const: true + sequence_number: + type: integer + description: The sequence number of this event. + output_index: + type: integer + description: The index of the output item in the response's output array. + item_id: + type: string + description: The unique identifier of the MCP tool call item being processed. + description: Emitted when an MCP tool call is in progress. + title: ResponseMCPCallInProgressEvent + x-oaiMeta: + name: response.mcp_call.in_progress + group: responses + example: | + { + "type": "response.mcp_call.in_progress", + "sequence_number": 1, + "output_index": 0, + "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90" + } + OpenAI.ResponseMCPListToolsFailedEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_list_tools.failed + description: The type of the event. Always 'response.mcp_list_tools.failed'. + x-stainless-const: true + item_id: + type: string + description: The ID of the MCP tool call item that failed. + output_index: + type: integer + description: The index of the output item that failed. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when the attempt to list available MCP tools has failed. + title: ResponseMCPListToolsFailedEvent + x-oaiMeta: + name: response.mcp_list_tools.failed + group: responses + example: | + { + "type": "response.mcp_list_tools.failed", + "sequence_number": 1, + "output_index": 0, + "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" + } + OpenAI.ResponseMCPListToolsInProgressEvent: + type: object + required: + - type + - item_id + - output_index + - sequence_number + properties: + type: + type: string + enum: + - response.mcp_list_tools.in_progress + description: The type of the event. Always 'response.mcp_list_tools.in_progress'. + x-stainless-const: true + item_id: + type: string + description: The ID of the MCP tool call item that is being processed. + output_index: + type: integer + description: The index of the output item that is being processed. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when the system is in the process of retrieving the list of available MCP tools. + title: ResponseMCPListToolsInProgressEvent + x-oaiMeta: + name: response.mcp_list_tools.in_progress + group: responses + example: | + { + "type": "response.mcp_list_tools.in_progress", + "sequence_number": 1, + "output_index": 0, + "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" + } + OpenAI.ResponseOutputItemAddedEvent: + type: object + required: + - type + - output_index + - sequence_number + - item + properties: + type: + type: string + enum: + - response.output_item.added + description: The type of the event. Always `response.output_item.added`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that was added. + sequence_number: + type: integer + description: The sequence number of this event. + item: + allOf: + - $ref: '#/components/schemas/OpenAI.OutputItem' + description: The output item that was added. + description: Emitted when a new output item is added. + x-oaiMeta: + name: response.output_item.added + group: responses + example: | + { + "type": "response.output_item.added", + "output_index": 0, + "item": { + "id": "msg_123", + "status": "in_progress", + "type": "message", + "role": "assistant", + "content": [] + }, + "sequence_number": 1 + } + OpenAI.ResponseOutputTextAnnotationAddedEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - annotation_index + - sequence_number + - annotation + properties: + type: + type: string + enum: + - response.output_text.annotation.added + description: The type of the event. Always 'response.output_text.annotation.added'. + x-stainless-const: true + item_id: + type: string + description: The unique identifier of the item to which the annotation is being added. + output_index: + type: integer + description: The index of the output item in the response's output array. + content_index: + type: integer + description: The index of the content part within the output item. + annotation_index: + type: integer + description: The index of the annotation within the content part. + sequence_number: + type: integer + description: The sequence number of this event. + annotation: + allOf: + - $ref: '#/components/schemas/OpenAI.Annotation' + description: The annotation object being added. (See annotation schema for details.) + description: Emitted when an annotation is added to output text content. + title: ResponseOutputTextAnnotationAddedEvent + x-oaiMeta: + name: response.output_text.annotation.added + group: responses + example: | + { + "type": "response.output_text.annotation.added", + "item_id": "item-abc", + "output_index": 0, + "content_index": 0, + "annotation_index": 0, + "annotation": { + "type": "text_annotation", + "text": "This is a test annotation", + "start": 0, + "end": 10 + }, + "sequence_number": 1 + } + OpenAI.ResponsePromptVariables: + type: object + unevaluatedProperties: + anyOf: + - type: string + - $ref: '#/components/schemas/OpenAI.InputTextContent' + - $ref: '#/components/schemas/OpenAI.InputImageContent' + - $ref: '#/components/schemas/OpenAI.InputFileContent' + description: |- + Optional map of values to substitute in for variables in your + prompt. The substitution values can either be strings, or other + Response input types like images or files. + title: Prompt Variables + x-oaiExpandable: true + x-oaiTypeLabel: map + OpenAI.ResponseQueuedEvent: + type: object + required: + - type + - response + - sequence_number + properties: + type: + type: string + enum: + - response.queued + description: The type of the event. Always 'response.queued'. + x-stainless-const: true + response: + allOf: + - $ref: '#/components/schemas/OpenAI.Response' + description: The full response object that is queued. + sequence_number: + type: integer + description: The sequence number for this event. + description: Emitted when a response is queued and waiting to be processed. + title: ResponseQueuedEvent + x-oaiMeta: + name: response.queued + group: responses + example: | + { + "type": "response.queued", + "response": { + "id": "res_123", + "status": "queued", + "created_at": "2021-01-01T00:00:00Z", + "updated_at": "2021-01-01T00:00:00Z" + }, + "sequence_number": 1 + } + OpenAI.ResponseReasoningSummaryPartAddedEvent: + type: object + required: + - type + - item_id + - output_index + - summary_index + - sequence_number + - part + properties: + type: + type: string + enum: + - response.reasoning_summary_part.added + description: The type of the event. Always `response.reasoning_summary_part.added`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item this summary part is associated with. + output_index: + type: integer + description: The index of the output item this summary part is associated with. + summary_index: + type: integer + description: The index of the summary part within the reasoning summary. + sequence_number: + type: integer + description: The sequence number of this event. + part: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart' + description: The summary part that was added. + description: Emitted when a new reasoning summary part is added. + x-oaiMeta: + name: response.reasoning_summary_part.added + group: responses + example: | + { + "type": "response.reasoning_summary_part.added", + "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", + "output_index": 0, + "summary_index": 0, + "part": { + "type": "summary_text", + "text": "" + }, + "sequence_number": 1 + } + OpenAI.ResponseReasoningSummaryPartAddedEventPart: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - summary_text + x-stainless-const: true + text: + type: string + OpenAI.ResponseReasoningSummaryTextDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - summary_index + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.reasoning_summary_text.delta + description: The type of the event. Always `response.reasoning_summary_text.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item this summary text delta is associated with. + output_index: + type: integer + description: The index of the output item this summary text delta is associated with. + summary_index: + type: integer + description: The index of the summary part within the reasoning summary. + delta: + type: string + description: The text delta that was added to the summary. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a delta is added to a reasoning summary text. + x-oaiMeta: + name: response.reasoning_summary_text.delta + group: responses + example: | + { + "type": "response.reasoning_summary_text.delta", + "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", + "output_index": 0, + "summary_index": 0, + "delta": "**Responding to a greeting** + + The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!", + "sequence_number": 1 + } + OpenAI.ResponseReasoningTextDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.reasoning_text.delta + description: The type of the event. Always `response.reasoning_text.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the item this reasoning text delta is associated with. + output_index: + type: integer + description: The index of the output item this reasoning text delta is associated with. + content_index: + type: integer + description: The index of the reasoning content part this delta is associated with. + delta: + type: string + description: The text delta that was added to the reasoning content. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when a delta is added to a reasoning text. + x-oaiMeta: + name: response.reasoning_text.delta + group: responses + example: | + { + "type": "response.reasoning_text.delta", + "item_id": "rs_123", + "output_index": 0, + "content_index": 0, + "delta": "The", + "sequence_number": 1 + } + OpenAI.ResponseRefusalDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - delta + - sequence_number + properties: + type: + type: string + enum: + - response.refusal.delta + description: The type of the event. Always `response.refusal.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the refusal text is added to. + output_index: + type: integer + description: The index of the output item that the refusal text is added to. + content_index: + type: integer + description: The index of the content part that the refusal text is added to. + delta: + type: string + description: The refusal text that is added. + sequence_number: + type: integer + description: The sequence number of this event. + description: Emitted when there is a partial refusal text. + x-oaiMeta: + name: response.refusal.delta + group: responses + example: | + { + "type": "response.refusal.delta", + "item_id": "msg_123", + "output_index": 0, + "content_index": 0, + "delta": "refusal text so far", + "sequence_number": 1 + } + OpenAI.ResponseStreamOptions: + type: object + properties: + include_obfuscation: + type: boolean + description: |- + When true, stream obfuscation will be enabled. Stream obfuscation adds + random characters to an `obfuscation` field on streaming delta events to + normalize payload sizes as a mitigation to certain side-channel attacks. + These obfuscation fields are included by default, but add a small amount + of overhead to the data stream. You can set `include_obfuscation` to + false to optimize for bandwidth if you trust the network links between + your application and the OpenAI API. + description: 'Options for streaming responses. Only set this when you set `stream: true`.' + OpenAI.ResponseTextDeltaEvent: + type: object + required: + - type + - item_id + - output_index + - content_index + - delta + - sequence_number + - logprobs + properties: + type: + type: string + enum: + - response.output_text.delta + description: The type of the event. Always `response.output_text.delta`. + x-stainless-const: true + item_id: + type: string + description: The ID of the output item that the text delta was added to. + output_index: + type: integer + description: The index of the output item that the text delta was added to. + content_index: + type: integer + description: The index of the content part that the text delta was added to. + delta: + type: string + description: The text delta that was added. + sequence_number: + type: integer + description: The sequence number for this event. + logprobs: + type: array + items: + $ref: '#/components/schemas/OpenAI.ResponseLogProb' + description: The log probabilities of the tokens in the delta. + description: Emitted when there is an additional text delta. + x-oaiMeta: + name: response.output_text.delta + group: responses + example: | + { + "type": "response.output_text.delta", + "item_id": "msg_123", + "output_index": 0, + "content_index": 0, + "delta": "In", + "sequence_number": 1 + } + OpenAI.ResponseTextParam: + type: object + properties: + format: + $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' + verbosity: + $ref: '#/components/schemas/OpenAI.Verbosity' + description: |- + Configuration options for a text response from the model. Can be plain + text or structured JSON data. Learn more: + - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + OpenAI.ResponseUsage: + type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + properties: + input_tokens: + type: integer + description: The number of input tokens. + input_tokens_details: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails' + description: A detailed breakdown of the input tokens. + output_tokens: + type: integer + description: The number of output tokens. + output_tokens_details: + allOf: + - $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails' + description: A detailed breakdown of the output tokens. + total_tokens: + type: integer + description: The total number of tokens used. + description: |- + Represents token usage details including input tokens, output tokens, + a breakdown of output tokens, and the total tokens used. + OpenAI.ResponseUsageInputTokensDetails: + type: object + required: + - cached_tokens + properties: + cached_tokens: + type: integer + OpenAI.ResponseUsageOutputTokensDetails: + type: object + required: + - reasoning_tokens + properties: + reasoning_tokens: + type: integer + OpenAI.ResponseWebSearchCallInProgressEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.web_search_call.in_progress + description: The type of the event. Always `response.web_search_call.in_progress`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the web search call is associated with. + item_id: + type: string + description: Unique ID for the output item associated with the web search call. + sequence_number: + type: integer + description: The sequence number of the web search call being processed. + description: 'Note: web_search is not yet available via Azure OpenAI.' + x-oaiMeta: + name: response.web_search_call.in_progress + group: responses + example: | + { + "type": "response.web_search_call.in_progress", + "output_index": 0, + "item_id": "ws_123", + "sequence_number": 0 + } + OpenAI.ResponseWebSearchCallSearchingEvent: + type: object + required: + - type + - output_index + - item_id + - sequence_number + properties: + type: + type: string + enum: + - response.web_search_call.searching + description: The type of the event. Always `response.web_search_call.searching`. + x-stainless-const: true + output_index: + type: integer + description: The index of the output item that the web search call is associated with. + item_id: + type: string + description: Unique ID for the output item associated with the web search call. + sequence_number: + type: integer + description: The sequence number of the web search call being processed. + description: 'Note: web_search is not yet available via Azure OpenAI.' + x-oaiMeta: + name: response.web_search_call.searching + group: responses + example: | + { + "type": "response.web_search_call.searching", + "output_index": 0, + "item_id": "ws_123", + "sequence_number": 0 + } + OpenAI.TextResponseFormatConfiguration: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType' + discriminator: + propertyName: type + mapping: + json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema' + text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText' + json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject' + description: |- + An object specifying the format that the model must output. + Configuring `{ "type": "json_schema" }` enables Structured Outputs, + which ensures the model will match your supplied JSON schema. Learn more in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + The default format is `{ "type": "text" }` with no additional options. + *Not recommended for gpt-4o and newer models:** + Setting to `{ "type": "json_object" }` enables the older JSON mode, which + ensures the message the model generates is valid JSON. Using `json_schema` + is preferred for models that support it. + OpenAI.TextResponseFormatConfigurationType: + anyOf: + - type: string + - type: string + enum: + - text + - json_schema + - json_object + OpenAI.Tool: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ToolType' + discriminator: + propertyName: type + mapping: + code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool' + function: '#/components/schemas/OpenAI.FunctionTool' + file_search: '#/components/schemas/OpenAI.FileSearchTool' + computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool' + web_search: '#/components/schemas/OpenAI.WebSearchTool' + mcp: '#/components/schemas/OpenAI.MCPTool' + image_generation: '#/components/schemas/OpenAI.ImageGenTool' + local_shell: '#/components/schemas/OpenAI.LocalShellToolParam' + shell: '#/components/schemas/OpenAI.FunctionShellToolParam' + custom: '#/components/schemas/OpenAI.CustomToolParam' + web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool' + apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam' + description: A tool that can be used to generate a response. + OpenAI.ToolChoiceParam: + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/OpenAI.ToolChoiceParamType' + discriminator: + propertyName: type + mapping: + allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed' + mcp: '#/components/schemas/OpenAI.ToolChoiceMCP' + custom: '#/components/schemas/OpenAI.ToolChoiceCustom' + apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam' + shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam' + file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch' + web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview' + computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview' + web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311' + image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration' + code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter' + description: |- + How the model should select which tool (or tools) to use when generating + a response. See the `tools` parameter to see how to specify which tools + the model can call. + OpenAI.ToolChoiceParamType: + anyOf: + - type: string + - type: string + enum: + - allowed_tools + - function + - mcp + - custom + - apply_patch + - shell + - file_search + - web_search_preview + - computer_use_preview + - web_search_preview_2025_03_11 + - image_generation + - code_interpreter + OpenAI.ToolType: + anyOf: + - type: string + - type: string + enum: + - function + - file_search + - computer_use_preview + - web_search + - mcp + - code_interpreter + - image_generation + - local_shell + - shell + - custom + - web_search_preview + - apply_patch + OpenAI.ToolsArray: + type: array + items: + $ref: '#/components/schemas/OpenAI.Tool' + description: |- + An array of tools the model may call while generating a response. You + can specify which tool to use by setting the `tool_choice` parameter. + We support the following categories of tools: + - **Built-in tools**: Tools that are provided by OpenAI that extend the + model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + [built-in tools](https://platform.openai.com/docs/guides/tools). + - **MCP Tools**: Integrations with third-party systems via custom MCP servers + or predefined connectors such as Google Drive and SharePoint. Learn more about + [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). + - **Function calls (custom tools)**: Functions that are defined by you, + enabling the model to call your own code with strongly typed arguments + and outputs. Learn more about + [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + custom tools to call your own code. + OpenAI.Verbosity: + anyOf: + - type: string + enum: + - low + - medium + - high + - type: 'null' + description: |- + Constrains the verbosity of the model's response. Lower values will result in + more concise responses, while higher values will result in more verbose responses. + Currently supported values are `low`, `medium`, and `high`. + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: api-key + ApiKeyAuth_: + type: apiKey + in: header + name: authorization + OAuth2Auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize' + scopes: + 'https://cognitiveservices.azure.com/.default': '' +servers: + - url: '{endpoint}/openai/v1' + description: Azure AI Foundry Models APIs + variables: + endpoint: + default: '' + description: |- + A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname. + For example: + https://westus.api.cognitive.microsoft.com). diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json deleted file mode 100644 index d80ee4bf8..000000000 --- a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.json +++ /dev/null @@ -1,40850 +0,0 @@ -{ - "openapi": "3.1.0", - "info": { - "title": "Azure AI Foundry Models Service", - "license": { - "name": "MIT", - "url": "https://github.com/openai/openai-openapi/blob/master/LICENSE" - }, - "version": "preview" - }, - "tags": [ - { - "name": "Audio" - }, - { - "name": "Batch" - }, - { - "name": "Chat" - }, - { - "name": "Completions" - }, - { - "name": "Containers" - }, - { - "name": "Conversations" - }, - { - "name": "Evals" - }, - { - "name": "Files" - }, - { - "name": "Embeddings" - }, - { - "name": "Fine-tuning" - }, - { - "name": "Images" - }, - { - "name": "Models" - }, - { - "name": "Realtime" - }, - { - "name": "Responses" - }, - { - "name": "Threads" - }, - { - "name": "Vector Stores" - }, - { - "name": "Videos" - } - ], - "paths": { - "/audio/speech": { - "post": { - "operationId": "createSpeech", - "summary": "Generates text-to-speech audio from the input text.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/octet-stream": { - "schema": { - "contentMediaType": "application/octet-stream" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Audio" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The model to use for this text-to-speech request.", - "x-oaiTypeLabel": "string" - }, - "input": { - "type": "string", - "maxLength": 4096, - "description": "The text to generate audio for. The maximum length is 4096 characters." - }, - "instructions": { - "type": "string", - "maxLength": 4096, - "description": "Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`." - }, - "stream_format": { - "type": "string", - "enum": [ - "sse", - "audio" - ], - "description": "The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`.", - "default": "audio" - }, - "response_format": { - "allOf": [ - { - "$ref": "#/components/schemas/SpeechGenerationResponseFormat" - } - ], - "description": "The audio output format for the spoken text. By default, the MP3 format will be used." - }, - "speed": { - "type": "number", - "format": "float", - "minimum": 0.25, - "maximum": 4, - "description": "The speed of speech for generated audio. Values are valid in the range from 0.25 to 4.0, with 1.0 the default and higher values corresponding to faster speech.", - "default": 1 - }, - "voice": { - "allOf": [ - { - "$ref": "#/components/schemas/SpeechVoice" - } - ], - "description": "The voice to use when generating the audio. Supported voices are `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`." - } - }, - "required": [ - "model", - "input", - "voice" - ] - } - } - } - }, - "x-ms-examples": { - "Create a speech request": { - "$ref": "./examples/audio_speech.yaml" - } - } - } - }, - "/audio/transcriptions": { - "post": { - "operationId": "createTranscription", - "summary": "Transcribes audio into the input language.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureAudioTranscriptionResponse" - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Audio" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "object", - "description": "The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.", - "x-oaiTypeLabel": "file", - "x-oaiMeta": { - "exampleFilePath": "speech.mp3" - } - }, - "model": { - "type": "string", - "description": "The model to use for this transcription request.", - "x-oaiTypeLabel": "string" - }, - "language": { - "type": "object", - "description": "The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency." - }, - "prompt": { - "type": "object", - "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. This field is not supported when using `gpt-4o-transcribe-diarize`." - }, - "response_format": { - "type": "object" - }, - "temperature": { - "type": "object", - "description": "The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit." - }, - "include": { - "type": "object", - "description": "Additional information to include in the transcription response.\n `logprobs` will return the log probabilities of the tokens in the\n response to understand the model's confidence in the transcription.\n `logprobs` only works with response_format set to `json` and only with\n the models `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `gpt-4o-mini-transcribe-2025-12-15`. This field is not supported when using `gpt-4o-transcribe-diarize`." - }, - "timestamp_granularities": { - "type": "object", - "description": "The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency.\n This option is not available for `gpt-4o-transcribe-diarize`." - }, - "stream": { - "type": "object" - }, - "chunking_strategy": { - "type": "object" - }, - "known_speaker_names": { - "type": "object" - }, - "known_speaker_references": { - "type": "object" - }, - "filename": { - "type": "string", - "description": "The optional filename or descriptive identifier to associate with with the audio data." - } - }, - "required": [ - "file", - "model" - ] - } - } - } - }, - "x-ms-examples": { - "Create a transcription request": { - "$ref": "./examples/audio_transcription.yaml" - } - } - } - }, - "/audio/translations": { - "post": { - "operationId": "createTranslation", - "summary": "Gets English language transcribed text and associated metadata from provided spoken audio data.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureAudioTranslationResponse" - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Audio" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "file": { - "type": "object", - "description": "The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm.", - "x-oaiTypeLabel": "file", - "x-oaiMeta": { - "exampleFilePath": "speech.mp3" - } - }, - "model": { - "type": "string", - "description": "The model to use for this transcription request.", - "x-oaiTypeLabel": "string" - }, - "prompt": { - "type": "object", - "description": "An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English." - }, - "response_format": { - "type": "object", - "description": "The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`." - }, - "temperature": { - "type": "object", - "description": "The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit." - }, - "filename": { - "type": "string", - "description": "The optional filename or descriptive identifier to associate with with the audio data" - } - }, - "required": [ - "file", - "model" - ] - } - } - } - }, - "x-ms-examples": { - "Create an audio translation request": { - "$ref": "./examples/audio_translation.yaml" - } - } - } - }, - "/batches": { - "post": { - "operationId": "createBatch", - "summary": "Creates and executes a batch from an uploaded file of requests", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - }, - "deployment-enqueued-tokens": { - "required": true, - "description": "Sum of enqueued tokens of all jobs that target to the deployment.", - "schema": { - "type": "integer", - "format": "int64" - } - }, - "deployment-maximum-enqueued-tokens": { - "required": true, - "description": "Maximum enqueued tokens of the deployment.", - "schema": { - "type": "integer", - "format": "int64" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "object", - "endpoint", - "completion_window", - "status", - "created_at", - "input_blob", - "output_blob", - "error_blob" - ], - "properties": { - "id": { - "type": "string" - }, - "object": { - "type": "string", - "enum": [ - "batch" - ], - "description": "The object type, which is always `batch`.", - "x-stainless-const": true - }, - "endpoint": { - "type": "string", - "description": "The OpenAI API endpoint used by the batch." - }, - "model": { - "type": "string", - "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." - }, - "errors": { - "$ref": "#/components/schemas/OpenAI.BatchErrors" - }, - "completion_window": { - "type": "string", - "description": "The time frame within which the batch should be processed." - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "description": "The current status of the batch." - }, - "output_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of successfully executed requests." - }, - "error_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of requests with errors." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was created." - }, - "in_progress_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started processing." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch will expire." - }, - "finalizing_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started finalizing." - }, - "completed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was completed." - }, - "failed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch failed." - }, - "expired_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch expired." - }, - "cancelling_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started cancelling." - }, - "cancelled_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was cancelled." - }, - "request_counts": { - "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" - }, - "usage": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.BatchUsage" - } - ], - "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "input_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing the input file for the batch." - }, - "output_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of successfully executed requests." - }, - "error_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of requests with errors." - }, - "input_file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Batch" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "input_file_id": { - "type": "string", - "description": "The ID of an uploaded file that contains requests for the new batch.\n\nSee [upload file](/docs/api-reference/files/create) for how to upload a file.\n\nYour input file must be formatted as a [JSONL file](/docs/api-reference/batch/requestInput),\nand must be uploaded with the purpose `batch`." - }, - "input_blob": { - "type": "string", - "description": "The url of an Azure Storage blob to use as input for the batch." - }, - "output_folder": { - "type": "object", - "properties": { - "url": { - "type": "string", - "format": "uri", - "description": "The url of the Azure Storage folder where the batch output would be saved." - }, - "delimiter": { - "type": "string", - "description": "Optional. The delimiter used in the folder path, by default /." - } - }, - "required": [ - "url" - ] - }, - "endpoint": { - "type": "string", - "enum": [ - "/v1/chat/completions", - "/v1/embeddings" - ], - "description": "The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions` is supported." - }, - "completion_window": { - "type": "string", - "enum": [ - "24h" - ], - "description": "The time frame within which the batch should be processed. Currently only `24h` is supported." - }, - "output_expires_after": { - "$ref": "#/components/schemas/FileExpiresAfter" - } - }, - "required": [ - "endpoint", - "completion_window" - ], - "unevaluatedProperties": { - "type": "string" - } - } - } - } - } - }, - "get": { - "operationId": "listBatches", - "summary": "List your organization's batches.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "$filter", - "in": "query", - "required": false, - "description": "The OData expression to describe the filtering conditions.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "$orderby", - "in": "query", - "required": false, - "description": "The OData expression to describe the sorting order.", - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListBatchesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Batch" - ] - } - }, - "/batches/{batch_id}": { - "get": { - "operationId": "retrieveBatch", - "summary": "Retrieves a batch.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "description": "The ID of the batch to retrieve.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "object", - "endpoint", - "completion_window", - "status", - "created_at", - "input_blob", - "output_blob", - "error_blob" - ], - "properties": { - "id": { - "type": "string" - }, - "object": { - "type": "string", - "enum": [ - "batch" - ], - "description": "The object type, which is always `batch`.", - "x-stainless-const": true - }, - "endpoint": { - "type": "string", - "description": "The OpenAI API endpoint used by the batch." - }, - "model": { - "type": "string", - "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." - }, - "errors": { - "$ref": "#/components/schemas/OpenAI.BatchErrors" - }, - "completion_window": { - "type": "string", - "description": "The time frame within which the batch should be processed." - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "description": "The current status of the batch." - }, - "output_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of successfully executed requests." - }, - "error_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of requests with errors." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was created." - }, - "in_progress_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started processing." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch will expire." - }, - "finalizing_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started finalizing." - }, - "completed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was completed." - }, - "failed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch failed." - }, - "expired_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch expired." - }, - "cancelling_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started cancelling." - }, - "cancelled_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was cancelled." - }, - "request_counts": { - "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" - }, - "usage": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.BatchUsage" - } - ], - "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "input_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing the input file for the batch." - }, - "output_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of successfully executed requests." - }, - "error_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of requests with errors." - }, - "input_file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Batch" - ] - } - }, - "/batches/{batch_id}/cancel": { - "post": { - "operationId": "cancelBatch", - "summary": "Cancels an in-progress batch.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "description": "The ID of the batch to cancel.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "object", - "endpoint", - "completion_window", - "status", - "created_at", - "input_blob", - "output_blob", - "error_blob" - ], - "properties": { - "id": { - "type": "string" - }, - "object": { - "type": "string", - "enum": [ - "batch" - ], - "description": "The object type, which is always `batch`.", - "x-stainless-const": true - }, - "endpoint": { - "type": "string", - "description": "The OpenAI API endpoint used by the batch." - }, - "model": { - "type": "string", - "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." - }, - "errors": { - "$ref": "#/components/schemas/OpenAI.BatchErrors" - }, - "completion_window": { - "type": "string", - "description": "The time frame within which the batch should be processed." - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "description": "The current status of the batch." - }, - "output_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of successfully executed requests." - }, - "error_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of requests with errors." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was created." - }, - "in_progress_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started processing." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch will expire." - }, - "finalizing_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started finalizing." - }, - "completed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was completed." - }, - "failed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch failed." - }, - "expired_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch expired." - }, - "cancelling_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started cancelling." - }, - "cancelled_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was cancelled." - }, - "request_counts": { - "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" - }, - "usage": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.BatchUsage" - } - ], - "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "input_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing the input file for the batch." - }, - "output_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of successfully executed requests." - }, - "error_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of requests with errors." - }, - "input_file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Batch" - ] - } - }, - "/chat/completions": { - "post": { - "operationId": "createChatCompletion", - "description": "Creates a chat completion.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "anyOf": [ - { - "type": "object", - "required": [ - "id", - "choices", - "created", - "model", - "object" - ], - "properties": { - "id": { - "type": "string", - "description": "A unique identifier for the chat completion." - }, - "choices": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoices" - }, - "description": "A list of chat completion choices. Can be more than one if `n` is greater than 1." - }, - "created": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) of when the chat completion was created." - }, - "model": { - "type": "string", - "description": "The model used for the chat completion." - }, - "system_fingerprint": { - "type": "string", - "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", - "deprecated": true - }, - "object": { - "type": "string", - "enum": [ - "chat.completion" - ], - "description": "The object type, which is always `chat.completion`.", - "x-stainless-const": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.CompletionUsage" - }, - "prompt_filter_results": { - "type": "array", - "items": { - "type": "object", - "properties": { - "prompt_index": { - "type": "integer", - "format": "int32", - "description": "The index of the input prompt that this content filter result corresponds to." - }, - "content_filter_results": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterResultForPrompt" - } - ], - "description": "The content filter results associated with the indexed input prompt." - } - }, - "required": [ - "prompt_index", - "content_filter_results" - ] - } - } - } - }, - { - "type": "object", - "required": [ - "id", - "choices", - "created", - "model", - "object" - ], - "properties": { - "id": { - "type": "string", - "description": "A unique identifier for the chat completion. Each chunk has the same ID." - }, - "choices": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoices" - }, - "description": "A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the\n last chunk if you set `stream_options: {\"include_usage\": true}`." - }, - "created": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp." - }, - "model": { - "type": "string", - "description": "The model to generate the completion." - }, - "system_fingerprint": { - "type": "string", - "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism.", - "deprecated": true - }, - "object": { - "type": "string", - "enum": [ - "chat.completion.chunk" - ], - "description": "The object type, which is always `chat.completion.chunk`.", - "x-stainless-const": true - }, - "usage": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CompletionUsage" - } - ], - "description": "An optional field that will only be present when you set\n `stream_options: {\"include_usage\": true}` in your request. When present, it\n contains a null value **except for the last chunk** which contains the\n token usage statistics for the entire request.\n*NOTE:** If the stream is interrupted or cancelled, you may not\n receive the final usage chunk which contains the total token usage for\n the request." - }, - "delta": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta" - }, - "content_filter_results": { - "$ref": "#/components/schemas/AzureContentFilterResultForChoice" - } - } - } - ] - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Chat" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "user": { - "type": "string", - "description": "A unique identifier representing your end-user, which can help to\nmonitor and detect abuse.", - "deprecated": true - }, - "safety_identifier": { - "type": "string", - "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." - }, - "prompt_cache_key": { - "type": "string", - "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." - }, - "prompt_cache_retention": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in-memory", - "24h" - ] - }, - { - "type": "null" - } - ] - }, - "messages": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - }, - "minItems": 1, - "description": "A list of messages comprising the conversation so far. Depending on the\nmodel you use, different message types (modalities) are supported,\nlike text, images, and audio." - }, - "model": { - "type": "string", - "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." - }, - "modalities": { - "$ref": "#/components/schemas/OpenAI.ResponseModalities" - }, - "verbosity": { - "$ref": "#/components/schemas/OpenAI.Verbosity" - }, - "reasoning_effort": { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - }, - "max_completion_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "An upper bound for the number of tokens that can be generated for a\ncompletion, including visible output tokens and reasoning tokens." - }, - "frequency_penalty": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": -2, - "maximum": 2, - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n their existing frequency in the text so far, decreasing the model's\n likelihood to repeat the same line verbatim." - }, - "presence_penalty": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": -2, - "maximum": 2, - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on\n whether they appear in the text so far, increasing the model's likelihood\n to talk about new topics." - }, - "response_format": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" - } - ], - "description": "An object specifying the format that the model must output.\n\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema.\n\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures\nthe message the model generates is valid JSON.\n\n**Important:** when using JSON mode, you **must** also instruct the model\nto produce JSON yourself via a system or user message. Without this, the\nmodel may generate an unending stream of whitespace until the generation\nreaches the token limit, resulting in a long-running and seemingly \"stuck\"\nrequest. Also note that the message content may be partially cut off if\n`finish_reason=\"length\"`, which indicates the generation exceeded\n`max_tokens` or the conversation exceeded the max context length." - }, - "audio": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestAudio" - }, - { - "type": "null" - } - ], - "description": "Parameters for audio output. Required when audio output is requested with\n`modalities: [\"audio\"]`." - }, - "store": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether or not to store the output of this chat completion request for\nuse in model distillation or evals products." - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "If set to true, the model response data will be streamed to the client\nas it is generated using server-sent events." - }, - "stop": { - "$ref": "#/components/schemas/OpenAI.StopConfiguration" - }, - "logit_bias": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": { - "type": "integer" - } - }, - { - "type": "null" - } - ], - "description": "Modify the likelihood of specified tokens appearing in the completion.\n Accepts a JSON object that maps tokens (specified by their token ID in the\n tokenizer) to an associated bias value from -100 to 100. Mathematically,\n the bias is added to the logits generated by the model prior to sampling.\n The exact effect will vary per model, but values between -1 and 1 should\n decrease or increase likelihood of selection; values like -100 or 100\n should result in a ban or exclusive selection of the relevant token.", - "x-oaiTypeLabel": "map" - }, - "logprobs": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether to return log probabilities of the output tokens or not. If true,\n returns the log probabilities of each output token returned in the\n `content` of `message`." - }, - "max_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The maximum number of tokens that can be generated in the chat completion.\nThis value can be used to control costs for text generated via API.\n\nThis value is now deprecated in favor of `max_completion_tokens`, and is\nnot compatible with o1 series models.", - "deprecated": true - }, - "n": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 1, - "maximum": 128, - "description": "How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs.", - "default": 1 - }, - "prediction": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.PredictionContent" - } - ], - "description": "Configuration for a predicted output, which can greatly improve\nresponse times when large parts of the model response are known\nahead of time. This is most common when you are regenerating a\nfile with only minor changes to most of the content." - }, - "seed": { - "anyOf": [ - { - "type": "integer", - "format": "int64" - }, - { - "type": "null" - } - ], - "description": "This feature is in Beta.\n If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend.", - "deprecated": true, - "x-oaiMeta": { - "beta": true - } - }, - "stream_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions" - }, - { - "type": "null" - } - ] - }, - "tools": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTool" - }, - { - "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletions" - } - ] - }, - "description": "A list of tools the model may call. You can provide either\n [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or\n [function tools](https://platform.openai.com/docs/guides/function-calling)." - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionToolChoiceOption" - }, - "parallel_tool_calls": { - "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" - }, - "function_call": { - "anyOf": [ - { - "type": "string", - "enum": [ - "none", - "auto" - ] - }, - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctionCallOption" - } - ], - "description": "Deprecated in favor of `tool_choice`.\n Controls which (if any) function is called by the model.\n `none` means the model will not call a function and instead generates a\n message.\n `auto` means the model can pick between generating a message or calling a\n function.\n Specifying a particular function via `{\"name\": \"my_function\"}` forces the\n model to call that function.\n `none` is the default when no functions are present. `auto` is the default\n if functions are present.", - "deprecated": true - }, - "functions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionFunctions" - }, - "minItems": 1, - "maxItems": 128, - "description": "Deprecated in favor of `tools`.\n A list of functions the model may generate JSON inputs for.", - "deprecated": true - }, - "user_security_context": { - "$ref": "#/components/schemas/AzureUserSecurityContext" - } - }, - "required": [ - "messages", - "model" - ] - } - } - } - }, - "x-ms-examples": { - "Create a chat completion": { - "$ref": "./examples/chat_completions.yaml" - } - } - } - }, - "/completions": { - "post": { - "operationId": "createCompletion", - "description": "Creates a completion.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "choices", - "created", - "model", - "object" - ], - "properties": { - "id": { - "type": "string", - "description": "A unique identifier for the completion." - }, - "choices": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoices" - }, - "description": "The list of completion choices the model generated for the input prompt." - }, - "created": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) of when the completion was created." - }, - "model": { - "type": "string", - "description": "The model used for completion." - }, - "system_fingerprint": { - "type": "string", - "description": "This fingerprint represents the backend configuration that the model runs with.\n Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism." - }, - "object": { - "type": "string", - "enum": [ - "text_completion" - ], - "description": "The object type, which is always \"text_completion\"", - "x-stainless-const": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.CompletionUsage" - }, - "prompt_filter_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzureContentFilterResultForPrompt" - } - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Completions" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.", - "x-oaiTypeLabel": "string" - }, - "best_of": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 20, - "description": "Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed.\n When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`.\n*Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.", - "default": 1 - }, - "echo": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Echo back the prompt in addition to the completion" - }, - "frequency_penalty": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": -2, - "maximum": 2, - "description": "Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.\n [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)" - }, - "logit_bias": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": { - "type": "integer" - } - }, - { - "type": "null" - } - ], - "description": "Modify the likelihood of specified tokens appearing in the completion.\n Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.\n As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated.", - "x-oaiTypeLabel": "map" - }, - "logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 5, - "description": "Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response.\n The maximum value for `logprobs` is 5." - }, - "max_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 0, - "description": "The maximum number of [tokens](/tokenizer) that can be generated in the completion.\n The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens.", - "default": 16 - }, - "n": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 1, - "maximum": 128, - "description": "How many completions to generate for each prompt.\n*Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.", - "default": 1 - }, - "presence_penalty": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": -2, - "maximum": 2, - "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.\n [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)" - }, - "seed": { - "anyOf": [ - { - "type": "integer", - "format": "int64" - }, - { - "type": "null" - } - ], - "description": "If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result.\n Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend." - }, - "stop": { - "$ref": "#/components/schemas/OpenAI.StopConfiguration" - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions)." - }, - "stream_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamOptions" - }, - { - "type": "null" - } - ] - }, - "suffix": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The suffix that comes after a completion of inserted text.\n This parameter is only supported for `gpt-3.5-turbo-instruct`." - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 2, - "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.\n We generally recommend altering this or `top_p` but not both.", - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 1, - "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or `temperature` but not both.", - "default": 1 - }, - "user": { - "type": "string", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." - }, - "prompt": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ], - "default": "<|endoftext|>" - } - }, - "required": [ - "model" - ] - } - } - } - }, - "x-ms-examples": { - "Create a chat completion": { - "$ref": "./examples/completions.yaml" - } - } - } - }, - "/containers": { - "get": { - "operationId": "listContainers", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ContainerListResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - }, - "post": { - "operationId": "createContainer", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ContainerResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateContainerBody" - } - } - } - } - } - }, - "/containers/{container_id}": { - "get": { - "operationId": "retrieveContainer", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container to retrieve.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ContainerResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - }, - "delete": { - "operationId": "deleteContainer", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - } - }, - "/containers/{container_id}/files": { - "get": { - "operationId": "listContainerFiles", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container to list files from.", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ContainerFileListResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - }, - "post": { - "operationId": "createContainerFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container to create a file in.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ContainerFileResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ], - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateContainerFileBody" - } - } - } - } - } - }, - "/containers/{container_id}/files/{file_id}": { - "get": { - "operationId": "retrieveContainerFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container.", - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to retrieve.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ContainerFileResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - }, - "delete": { - "operationId": "deleteContainerFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container.", - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - } - }, - "/containers/{container_id}/files/{file_id}/content": { - "get": { - "operationId": "retrieveContainerFileContent", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "container_id", - "in": "path", - "required": true, - "description": "The ID of the container.", - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to retrieve content from.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/octet-stream": { - "schema": { - "contentMediaType": "application/octet-stream" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Containers" - ] - } - }, - "/conversations": { - "post": { - "operationId": "createConversation", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateConversationBody" - } - } - } - } - } - }, - "/conversations/{conversation_id}": { - "get": { - "operationId": "retrieveConversation", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation to retrieve.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ] - }, - "post": { - "operationId": "updateConversation", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation to update.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.UpdateConversationBody" - } - } - } - } - }, - "delete": { - "operationId": "deleteConversation", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeletedConversationResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ] - } - }, - "/conversations/{conversation_id}/items": { - "get": { - "operationId": "listConversationItems", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation to list items for.", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "The order to return the input items in. Default is `desc`.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "An item ID to list items after, used in pagination.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "include", - "in": "query", - "required": false, - "description": "Specify additional output data to include in the model response.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.IncludeEnum" - } - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationItemList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ] - }, - "post": { - "operationId": "createConversationItems", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation to add the item to.", - "schema": { - "type": "string" - } - }, - { - "name": "include", - "in": "query", - "required": false, - "description": "Additional fields to include in the response.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.IncludeEnum" - } - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationItemList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateConversationItemsParametersBody" - } - } - } - } - } - }, - "/conversations/{conversation_id}/items/{item_id}": { - "get": { - "operationId": "retrieveConversationItem", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation that contains the item.", - "schema": { - "type": "string" - } - }, - { - "name": "item_id", - "in": "path", - "required": true, - "description": "The ID of the item to retrieve.", - "schema": { - "type": "string" - } - }, - { - "name": "include", - "in": "query", - "required": false, - "description": "Additional fields to include in the response.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.IncludeEnum" - } - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ] - }, - "delete": { - "operationId": "deleteConversationItem", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "conversation_id", - "in": "path", - "required": true, - "description": "The ID of the conversation that contains the item.", - "schema": { - "type": "string" - } - }, - { - "name": "item_id", - "in": "path", - "required": true, - "description": "The ID of the item to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ConversationResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Conversations" - ] - } - }, - "/embeddings": { - "post": { - "operationId": "createEmbedding", - "summary": "Creates an embedding vector representing the input text.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Embeddings" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateEmbeddingRequest" - } - } - } - }, - "x-ms-examples": { - "Create an embedding request": { - "$ref": "./examples/embeddings.yaml" - } - } - } - }, - "/evals": { - "get": { - "operationId": "listEvals", - "summary": "List evaluations for a project.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last eval from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of evals to be returned in a single pagination response.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order for evals by timestamp. Use `asc` for ascending order or\n`desc` for descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - }, - "explode": false - }, - { - "name": "order_by", - "in": "query", - "required": false, - "description": "Evals can be ordered by creation time or last updated time. Use\n`created_at` for creation time or `updated_at` for last updated\ntime.", - "schema": { - "type": "string", - "enum": [ - "created_at", - "updated_at" - ], - "default": "created_at" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - }, - "post": { - "operationId": "createEval", - "description": "Create the structure of an evaluation that can be used to test a model's\nperformance.\n\nAn evaluation is a set of testing criteria and a datasource. After\ncreating an evaluation, you can run it on different models and model\nparameters. We support several types of graders and datasources.\n\nFor more information, see the [Evals guide](/docs/guides/evals).", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.Eval" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "statusCode": { - "type": "number", - "enum": [ - 201 - ] - }, - "name": { - "type": "string", - "description": "The name of the evaluation." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "data_source_config": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig" - } - ], - "description": "The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation." - }, - "testing_criteria": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalLabelModelGrader" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderPython" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel" - }, - { - "$ref": "#/components/schemas/EvalGraderEndpoint" - } - ] - }, - "description": "A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`)." - } - }, - "required": [ - "statusCode", - "data_source_config", - "testing_criteria" - ] - } - } - } - } - } - }, - "/evals/{eval_id}": { - "get": { - "operationId": "getEval", - "summary": "Retrieve an evaluation by its ID.", - "description": "Retrieves an evaluation by its ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.Eval" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - }, - "post": { - "operationId": "updateEval", - "description": "Update select, mutable properties of a specified evaluation.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.Eval" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "metadata": { - "$ref": "#/components/schemas/OpenAI.Metadata" - } - } - } - } - } - } - }, - "delete": { - "operationId": "deleteEval", - "description": "Delete a specified evaluation.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "object", - "deleted", - "eval_id" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "eval.deleted" - ] - }, - "deleted": { - "type": "boolean" - }, - "eval_id": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - } - }, - "/evals/{eval_id}/runs": { - "get": { - "operationId": "getEvalRuns", - "summary": "", - "description": "Retrieve a list of runs for a specified evaluation.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - }, - "explode": false - }, - { - "name": "status", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "queued", - "in_progress", - "completed", - "canceled", - "failed" - ] - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalRunList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - }, - "post": { - "operationId": "createEvalRun", - "description": "Create a new evaluation run, beginning the grading process.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalRun" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateEvalRunRequest" - } - } - } - } - } - }, - "/evals/{eval_id}/runs/{run_id}": { - "get": { - "operationId": "getEvalRun", - "description": "Retrieve a specific evaluation run by its ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalRun" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - }, - "post": { - "operationId": "cancelEvalRun", - "description": "Cancel a specific evaluation run by its ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalRun" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - }, - "delete": { - "operationId": "deleteEvalRun", - "description": "Delete a specific evaluation run by its ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "object", - "deleted", - "eval_run_id" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "eval_run.deleted" - ] - }, - "deleted": { - "type": "boolean" - }, - "eval_run_id": { - "type": "string" - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - } - }, - "/evals/{eval_id}/runs/{run_id}/output_items": { - "get": { - "operationId": "getEvalRunOutputItems", - "description": "Get a list of output items for a specified evaluation run.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "status", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "fail", - "pass" - ] - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "asc" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - } - }, - "/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}": { - "get": { - "operationId": "getEvalRunOutputItem", - "description": "Retrieve a specific output item from an evaluation run by its ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "eval_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "output_item_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItem" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Evals" - ] - } - }, - "/files": { - "post": { - "operationId": "createFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "bytes", - "created_at", - "filename", - "object", - "purpose", - "status" - ], - "properties": { - "id": { - "type": "string", - "description": "The file identifier, which can be referenced in the API endpoints." - }, - "bytes": { - "type": "integer", - "description": "The size of the file, in bytes." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the file was created." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the file will expire." - }, - "filename": { - "type": "string", - "description": "The name of the file." - }, - "object": { - "type": "string", - "enum": [ - "file" - ], - "description": "The object type, which is always `file`.", - "x-stainless-const": true - }, - "status_details": { - "type": "string", - "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", - "deprecated": true - }, - "purpose": { - "type": "string", - "enum": [ - "assistants", - "assistants_output", - "batch", - "batch_output", - "fine-tune", - "fine-tune-results", - "evals" - ], - "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`." - }, - "status": { - "type": "string", - "enum": [ - "uploaded", - "pending", - "running", - "processed", - "error", - "deleting", - "deleted" - ] - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Files" - ], - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateFileRequest" - } - } - } - }, - "x-ms-examples": { - "Create a file request": { - "$ref": "./examples/files.yaml" - } - } - }, - "get": { - "operationId": "listFiles", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "purpose", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer" - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListFilesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Files" - ] - } - }, - "/files/{file_id}": { - "get": { - "operationId": "retrieveFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to use for this request.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "bytes", - "created_at", - "filename", - "object", - "purpose", - "status" - ], - "properties": { - "id": { - "type": "string", - "description": "The file identifier, which can be referenced in the API endpoints." - }, - "bytes": { - "type": "integer", - "description": "The size of the file, in bytes." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the file was created." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the file will expire." - }, - "filename": { - "type": "string", - "description": "The name of the file." - }, - "object": { - "type": "string", - "enum": [ - "file" - ], - "description": "The object type, which is always `file`.", - "x-stainless-const": true - }, - "status_details": { - "type": "string", - "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", - "deprecated": true - }, - "purpose": { - "type": "string", - "enum": [ - "assistants", - "assistants_output", - "batch", - "batch_output", - "fine-tune", - "fine-tune-results", - "evals" - ], - "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`." - }, - "status": { - "type": "string", - "enum": [ - "uploaded", - "pending", - "running", - "processed", - "error", - "deleting", - "deleted" - ] - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Files" - ] - }, - "delete": { - "operationId": "deleteFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to use for this request.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteFileResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Files" - ] - } - }, - "/files/{file_id}/content": { - "get": { - "operationId": "downloadFile", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to use for this request.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/octet-stream": { - "schema": { - "contentMediaType": "application/octet-stream" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Files" - ] - } - }, - "/fine_tuning/alpha/graders/run": { - "post": { - "operationId": "runGrader", - "summary": "Run a grader.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunGraderResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunGraderRequest" - } - } - } - } - } - }, - "/fine_tuning/alpha/graders/validate": { - "post": { - "operationId": "validateGrader", - "summary": "Validate a grader.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ValidateGraderResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "grader": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.GraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderPython" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderScoreModel" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderMulti" - }, - { - "$ref": "#/components/schemas/GraderEndpoint" - } - ] - } - } - } - } - } - } - } - }, - "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions": { - "get": { - "operationId": "listFineTuningCheckpointPermissions", - "summary": "List checkpoint permissions", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuned_model_checkpoint", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint to get permissions for.", - "schema": { - "type": "string" - } - }, - { - "name": "project_id", - "in": "query", - "required": false, - "description": "The ID of the project to get permissions for.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last permission ID from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Number of permissions to retrieve.", - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "The order in which to retrieve permissions.", - "schema": { - "type": "string", - "enum": [ - "ascending", - "descending" - ], - "default": "descending" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - }, - "post": { - "operationId": "createFineTuningCheckpointPermission", - "summary": "Create checkpoint permissions", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuned_model_checkpoint", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint to create a permission for.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest" - } - } - } - } - } - }, - "/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}": { - "delete": { - "operationId": "deleteFineTuningCheckpointPermission", - "summary": "Delete checkpoint permission", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuned_model_checkpoint", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint to delete a permission for.", - "schema": { - "type": "string" - } - }, - { - "name": "permission_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuned model checkpoint permission to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs": { - "post": { - "operationId": "createFineTuningJob", - "summary": "Creates a fine-tuning job which begins the process of creating a new model from a given dataset.\n\nResponse includes details of the enqueued job including job status and the name of the fine-tuned models once complete.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequest" - } - } - } - } - }, - "get": { - "operationId": "listPaginatedFineTuningJobs", - "summary": "List your organization's fine-tuning jobs", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last job from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Number of fine-tuning jobs to retrieve.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}": { - "get": { - "operationId": "retrieveFineTuningJob", - "summary": "Get info about a fine-tuning job.\n\n[Learn more about fine-tuning](/docs/guides/fine-tuning)", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/cancel": { - "post": { - "operationId": "cancelFineTuningJob", - "summary": "Immediately cancel a fine-tune job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to cancel.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints": { - "get": { - "operationId": "listFineTuningJobCheckpoints", - "summary": "List the checkpoints for a fine-tuning job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to get checkpoints for.", - "schema": { - "type": "string" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last checkpoint ID from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Number of checkpoints to retrieve.", - "schema": { - "type": "integer", - "format": "int32", - "default": 10 - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy": { - "post": { - "operationId": "FineTuning_CopyCheckpoint", - "description": "Creates a copy of a fine-tuning checkpoint at the given destination account and region.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "aoai-copy-ft-checkpoints", - "in": "header", - "required": true, - "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", - "schema": { - "type": "string", - "enum": [ - "preview" - ] - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fine_tuning_checkpoint_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CopyModelResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CopyModelRequest" - } - } - } - } - }, - "get": { - "operationId": "FineTuning_GetCheckpoint", - "description": "Gets the status of a fine-tuning checkpoint copy.\n\nNOTE: This Azure OpenAI API is in preview and subject to change.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "aoai-copy-ft-checkpoints", - "in": "header", - "required": true, - "description": "Enables access to checkpoint copy operations for models, an AOAI preview feature.\nThis feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'.", - "schema": { - "type": "string", - "enum": [ - "preview" - ] - } - }, - { - "name": "accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "enum": [ - "application/json" - ] - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "fine_tuning_checkpoint_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CopyModelResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/events": { - "get": { - "operationId": "listFineTuningEvents", - "summary": "Get status updates for a fine-tuning job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to get events for.", - "schema": { - "type": "string" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "Identifier for the last event from the previous pagination request.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "Number of events to retrieve.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListFineTuningJobEventsResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/pause": { - "post": { - "operationId": "pauseFineTuningJob", - "summary": "Pause a fine-tune job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to pause.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/fine_tuning/jobs/{fine_tuning_job_id}/resume": { - "post": { - "operationId": "resumeFineTuningJob", - "summary": "Resume a paused fine-tune job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "fine_tuning_job_id", - "in": "path", - "required": true, - "description": "The ID of the fine-tuning job to resume.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Fine-tuning" - ] - } - }, - "/images/edits": { - "post": { - "operationId": "createImageEdit", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ImagesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Images" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateImageEditRequest" - } - } - } - } - } - }, - "/images/generations": { - "post": { - "operationId": "createImage", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ImagesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Images" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateImageRequest" - } - } - } - }, - "x-ms-examples": { - "Create an image request": { - "$ref": "./examples/images.yaml" - } - } - } - }, - "/images/variations": { - "post": { - "operationId": "createImageVariation", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ImagesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Images" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateImageVariationRequest" - } - } - } - } - } - }, - "/models": { - "get": { - "operationId": "listModels", - "summary": "Lists the currently available models, and provides basic information about each one such as the\nowner and availability.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListModelsResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Models" - ] - } - }, - "/models/{model}": { - "get": { - "operationId": "retrieveModel", - "summary": "Retrieves a model instance, providing basic information about the model such as the owner and\npermissioning.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "model", - "in": "path", - "required": true, - "description": "The ID of the model to use for this request.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.Model" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Models" - ] - }, - "delete": { - "operationId": "deleteModel", - "summary": "Deletes a model instance.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "model", - "in": "path", - "required": true, - "description": "The ID of the model to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteModelResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Models" - ] - } - }, - "/realtime/calls": { - "post": { - "operationId": "createRealtimeCall", - "summary": "Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "headers": { - "location": { - "required": false, - "description": "Relative URL containing the call ID for subsequent control requests.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/sdp": { - "schema": { - "type": "string" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeCallCreateRequest" - }, - "encoding": { - "session": { - "contentType": "application/json" - } - } - } - } - } - } - }, - "/realtime/calls/{call_id}/accept": { - "post": { - "operationId": "acceptRealtimeCall", - "summary": "Accept an incoming SIP call and configure the realtime session that will handle it.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "call_id", - "in": "path", - "required": true, - "description": "The identifier for the call provided in the realtime.call.incoming webhook.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA" - } - } - }, - "description": "Session configuration to apply before the caller is bridged to the model." - } - } - }, - "/realtime/calls/{call_id}/hangup": { - "post": { - "operationId": "hangupRealtimeCall", - "summary": "End an active Realtime API call, whether it was initiated over SIP or WebRTC.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "call_id", - "in": "path", - "required": true, - "description": "The identifier for the call.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ] - } - }, - "/realtime/calls/{call_id}/refer": { - "post": { - "operationId": "referRealtimeCall", - "summary": "Transfer an active SIP call to a new destination using the SIP REFER verb.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "call_id", - "in": "path", - "required": true, - "description": "The identifier for the call provided in the realtime.call.incoming webhook.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeCallReferRequest" - } - } - }, - "description": "Destination URI for the REFER request." - } - } - }, - "/realtime/calls/{call_id}/reject": { - "post": { - "operationId": "rejectRealtimeCall", - "summary": "Decline an incoming SIP call by returning a SIP status code to the caller.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "call_id", - "in": "path", - "required": true, - "description": "The identifier for the call provided in the realtime.call.incoming webhook.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded." - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeCallRejectRequest" - } - } - }, - "description": "Provide an optional SIP status code. When omitted the API responds with 603 Decline." - } - } - }, - "/realtime/client_secrets": { - "post": { - "operationId": "createRealtimeClientSecret", - "summary": "Create a Realtime client secret with an associated session configuration.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretRequest" - } - } - }, - "description": "Create a client secret with the given session configuration." - } - } - }, - "/realtime/sessions": { - "post": { - "operationId": "createRealtimeSession", - "summary": "Create an ephemeral API token for use in client-side applications with the Realtime API.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequest" - } - } - }, - "description": "Create an ephemeral API key with the given session configuration." - } - } - }, - "/realtime/transcription_sessions": { - "post": { - "operationId": "createRealtimeTranscriptionSession", - "summary": "Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Realtime" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest" - } - } - }, - "description": "Create an ephemeral API key with the given session configuration." - } - } - }, - "/responses": { - "post": { - "operationId": "createResponse", - "description": "Creates a model response.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "error", - "incomplete_details", - "output", - "instructions", - "parallel_tool_calls", - "content_filters" - ], - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "user": { - "type": "string", - "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", - "deprecated": true - }, - "safety_identifier": { - "type": "string", - "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." - }, - "prompt_cache_key": { - "type": "string", - "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." - }, - "prompt_cache_retention": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in-memory", - "24h" - ] - }, - { - "type": "null" - } - ] - }, - "previous_response_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "type": "string", - "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." - }, - "reasoning": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Reasoning" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "max_tool_calls": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "text": { - "$ref": "#/components/schemas/OpenAI.ResponseTextParam" - }, - "tools": { - "$ref": "#/components/schemas/OpenAI.ToolsArray" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - }, - "truncation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "disabled" - ] - }, - { - "type": "null" - } - ], - "default": "disabled" - }, - "id": { - "type": "string", - "description": "Unique identifier for this Response." - }, - "object": { - "type": "string", - "enum": [ - "response" - ], - "description": "The object type of this resource - always set to `response`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "completed", - "failed", - "in_progress", - "cancelled", - "queued", - "incomplete" - ], - "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) of when this Response was created." - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseError" - }, - { - "type": "null" - } - ] - }, - "incomplete_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" - }, - { - "type": "null" - } - ] - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OutputItem" - }, - "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - }, - { - "type": "null" - } - ] - }, - "output_text": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "x-stainless-skip": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.ResponseUsage" - }, - "parallel_tool_calls": { - "type": "boolean", - "description": "Whether to allow the model to run tool calls in parallel.", - "default": true - }, - "conversation": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationReference" - }, - { - "type": "null" - } - ] - }, - "content_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" - }, - "description": "The content filter results from RAI." - } - } - } - }, - "text/event-stream": { - "itemSchema": { - "type": "object", - "properties": { - "event": { - "type": "string" - }, - "data": { - "type": "string" - } - }, - "required": [ - "event" - ], - "oneOf": [ - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseAudioDeltaEvent" - } - }, - "event": { - "const": "response.audio.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent" - } - }, - "event": { - "const": "response.audio.transcript.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent" - } - }, - "event": { - "const": "response.code_interpreter_call_code.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent" - } - }, - "event": { - "const": "response.code_interpreter_call.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent" - } - }, - "event": { - "const": "response.code_interpreter_call.interpreting" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseContentPartAddedEvent" - } - }, - "event": { - "const": "response.content_part.added" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseCreatedEvent" - } - }, - "event": { - "const": "response.created" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseErrorEvent" - } - }, - "event": { - "const": "error" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent" - } - }, - "event": { - "const": "response.file_search_call.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent" - } - }, - "event": { - "const": "response.file_search_call.searching" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent" - } - }, - "event": { - "const": "response.function_call_arguments.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseInProgressEvent" - } - }, - "event": { - "const": "response.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseFailedEvent" - } - }, - "event": { - "const": "response.failed" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseIncompleteEvent" - } - }, - "event": { - "const": "response.incomplete" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseOutputItemAddedEvent" - } - }, - "event": { - "const": "response.output_item.added" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent" - } - }, - "event": { - "const": "response.reasoning_summary_part.added" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent" - } - }, - "event": { - "const": "response.reasoning_summary_text.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent" - } - }, - "event": { - "const": "response.reasoning_text.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseRefusalDeltaEvent" - } - }, - "event": { - "const": "response.refusal.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseTextDeltaEvent" - } - }, - "event": { - "const": "response.output_text.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent" - } - }, - "event": { - "const": "response.web_search_call.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent" - } - }, - "event": { - "const": "response.web_search_call.searching" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent" - } - }, - "event": { - "const": "response.image_generation_call.generating" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent" - } - }, - "event": { - "const": "response.image_generation_call.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent" - } - }, - "event": { - "const": "response.image_generation_call.partial_image" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent" - } - }, - "event": { - "const": "response.mcp_call_arguments.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseMCPCallFailedEvent" - } - }, - "event": { - "const": "response.mcp_call.failed" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent" - } - }, - "event": { - "const": "response.mcp_call.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent" - } - }, - "event": { - "const": "response.mcp_list_tools.failed" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent" - } - }, - "event": { - "const": "response.mcp_list_tools.in_progress" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent" - } - }, - "event": { - "const": "response.output_text.annotation.added" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseQueuedEvent" - } - }, - "event": { - "const": "response.queued" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json", - "contentSchema": { - "$ref": "#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent" - } - }, - "event": { - "const": "response.custom_tool_call_input.delta" - } - } - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - }, - { - "properties": { - "data": { - "contentMediaType": "application/json" - } - }, - "x-ms-sse-terminal-event": true - } - ] - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Responses" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateResponse" - } - } - } - }, - "x-ms-examples": { - "Create a response request": { - "$ref": "./examples/responses.yaml" - } - } - } - }, - "/responses/{response_id}": { - "get": { - "operationId": "getResponse", - "description": "Retrieves a model response with the given ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "include[]", - "in": "query", - "required": false, - "description": "Additional fields to include in the response. See the include parameter for Response creation above for more information.", - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.IncludeEnum" - }, - "default": [] - } - }, - { - "name": "stream", - "in": "query", - "required": false, - "description": "If set to true, the model response data will be streamed to the client as it is generated using server-sent events.", - "schema": { - "type": "boolean" - }, - "explode": false - }, - { - "name": "starting_after", - "in": "query", - "required": false, - "description": "The sequence number of the event after which to start streaming.", - "schema": { - "type": "integer", - "format": "int32" - }, - "explode": false - }, - { - "name": "include_obfuscation", - "in": "query", - "required": false, - "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.", - "schema": { - "type": "boolean", - "default": true - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "error", - "incomplete_details", - "output", - "instructions", - "parallel_tool_calls", - "content_filters" - ], - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "user": { - "type": "string", - "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", - "deprecated": true - }, - "safety_identifier": { - "type": "string", - "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." - }, - "prompt_cache_key": { - "type": "string", - "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." - }, - "prompt_cache_retention": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in-memory", - "24h" - ] - }, - { - "type": "null" - } - ] - }, - "previous_response_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "type": "string", - "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." - }, - "reasoning": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Reasoning" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "max_tool_calls": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "text": { - "$ref": "#/components/schemas/OpenAI.ResponseTextParam" - }, - "tools": { - "$ref": "#/components/schemas/OpenAI.ToolsArray" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - }, - "truncation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "disabled" - ] - }, - { - "type": "null" - } - ], - "default": "disabled" - }, - "id": { - "type": "string", - "description": "Unique identifier for this Response." - }, - "object": { - "type": "string", - "enum": [ - "response" - ], - "description": "The object type of this resource - always set to `response`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "completed", - "failed", - "in_progress", - "cancelled", - "queued", - "incomplete" - ], - "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) of when this Response was created." - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseError" - }, - { - "type": "null" - } - ] - }, - "incomplete_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" - }, - { - "type": "null" - } - ] - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OutputItem" - }, - "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - }, - { - "type": "null" - } - ] - }, - "output_text": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "x-stainless-skip": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.ResponseUsage" - }, - "parallel_tool_calls": { - "type": "boolean", - "description": "Whether to allow the model to run tool calls in parallel.", - "default": true - }, - "conversation": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationReference" - }, - { - "type": "null" - } - ] - }, - "content_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" - }, - "description": "The content filter results from RAI." - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Responses" - ] - }, - "delete": { - "operationId": "deleteResponse", - "description": "Deletes a response by ID.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "object", - "id", - "deleted" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "response.deleted" - ] - }, - "id": { - "type": "string" - }, - "deleted": { - "type": "boolean", - "enum": [ - true - ] - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Responses" - ] - } - }, - "/responses/{response_id}/cancel": { - "post": { - "operationId": "cancelResponse", - "description": "Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "error", - "incomplete_details", - "output", - "instructions", - "parallel_tool_calls", - "content_filters" - ], - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "user": { - "type": "string", - "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", - "deprecated": true - }, - "safety_identifier": { - "type": "string", - "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." - }, - "prompt_cache_key": { - "type": "string", - "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." - }, - "prompt_cache_retention": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in-memory", - "24h" - ] - }, - { - "type": "null" - } - ] - }, - "previous_response_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "type": "string", - "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." - }, - "reasoning": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Reasoning" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "max_tool_calls": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "text": { - "$ref": "#/components/schemas/OpenAI.ResponseTextParam" - }, - "tools": { - "$ref": "#/components/schemas/OpenAI.ToolsArray" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - }, - "truncation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "disabled" - ] - }, - { - "type": "null" - } - ], - "default": "disabled" - }, - "id": { - "type": "string", - "description": "Unique identifier for this Response." - }, - "object": { - "type": "string", - "enum": [ - "response" - ], - "description": "The object type of this resource - always set to `response`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "completed", - "failed", - "in_progress", - "cancelled", - "queued", - "incomplete" - ], - "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) of when this Response was created." - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseError" - }, - { - "type": "null" - } - ] - }, - "incomplete_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" - }, - { - "type": "null" - } - ] - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OutputItem" - }, - "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - }, - { - "type": "null" - } - ] - }, - "output_text": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "x-stainless-skip": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.ResponseUsage" - }, - "parallel_tool_calls": { - "type": "boolean", - "description": "Whether to allow the model to run tool calls in parallel.", - "default": true - }, - "conversation": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationReference" - }, - { - "type": "null" - } - ] - }, - "content_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" - }, - "description": "The content filter results from RAI." - } - } - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Responses" - ] - } - }, - "/responses/{response_id}/input_items": { - "get": { - "operationId": "listInputItems", - "description": "Returns a list of input items for a given response.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "response_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ResponseItemList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Responses" - ] - } - }, - "/threads": { - "post": { - "operationId": "createThread", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ThreadObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateThreadRequest" - } - } - } - } - } - }, - "/threads/runs": { - "post": { - "operationId": "createThreadAndRun", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequest" - } - } - } - } - } - }, - "/threads/{thread_id}": { - "delete": { - "operationId": "deleteThread", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteThreadResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - }, - "get": { - "operationId": "retrieveThread", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ThreadObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - }, - "post": { - "operationId": "modifyThread", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ThreadObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ModifyThreadRequest" - } - } - } - } - } - }, - "/threads/{thread_id}/messages": { - "get": { - "operationId": "listMessages", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "desc" - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "run_id", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListMessagesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - }, - "post": { - "operationId": "createMessage", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.MessageObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateMessageRequest" - } - } - } - } - } - }, - "/threads/{thread_id}/messages/{message_id}": { - "delete": { - "operationId": "deleteMessage", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "message_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteMessageResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - }, - "get": { - "operationId": "retrieveMessage", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "message_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.MessageObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - }, - "post": { - "operationId": "modifyMessage", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "message_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.MessageObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ModifyMessageRequest" - } - } - } - } - } - }, - "/threads/{thread_id}/runs": { - "post": { - "operationId": "createRun", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateRunRequest" - } - } - } - } - }, - "get": { - "operationId": "listRuns", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "desc" - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListRunsResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - } - }, - "/threads/{thread_id}/runs/{run_id}": { - "get": { - "operationId": "retrieveRun", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - }, - "post": { - "operationId": "modifyRun", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ModifyRunRequest" - } - } - } - } - } - }, - "/threads/{thread_id}/runs/{run_id}/cancel": { - "post": { - "operationId": "cancelRun", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - } - }, - "/threads/{thread_id}/runs/{run_id}/steps": { - "get": { - "operationId": "listRunSteps", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "default": "desc" - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListRunStepsResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - } - }, - "/threads/{thread_id}/runs/{run_id}/steps/{step_id}": { - "get": { - "operationId": "getRunStep", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "step_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunStepObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ] - } - }, - "/threads/{thread_id}/runs/{run_id}/submit_tool_outputs": { - "post": { - "operationId": "submitToolOutputsToRun", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "thread_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "run_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Threads" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequest" - } - } - } - } - } - }, - "/vector_stores": { - "get": { - "operationId": "listVectorStores", - "summary": "Returns a list of vector stores.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", - "schema": { - "type": "string" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListVectorStoresResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - }, - "post": { - "operationId": "createVectorStore", - "summary": "Creates a vector store.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateVectorStoreRequest" - } - } - } - }, - "x-ms-examples": { - "Create a vector store request": { - "$ref": "./examples/vector_stores.yaml" - } - } - } - }, - "/vector_stores/{vector_store_id}": { - "get": { - "operationId": "getVectorStore", - "summary": "Retrieves a vector store.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to retrieve.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - }, - "post": { - "operationId": "modifyVectorStore", - "summary": "Modifies a vector store.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to modify.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreRequest" - } - } - } - } - }, - "delete": { - "operationId": "deleteVectorStore", - "summary": "Delete a vector store.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - } - }, - "/vector_stores/{vector_store_id}/file_batches": { - "post": { - "operationId": "createVectorStoreFileBatch", - "summary": "Create a vector store file batch.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store for which to create a file batch.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest" - } - } - } - } - } - }, - "/vector_stores/{vector_store_id}/file_batches/{batch_id}": { - "get": { - "operationId": "getVectorStoreFileBatch", - "summary": "Retrieves a vector store file batch.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store that the file batch belongs to.", - "schema": { - "type": "string" - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "description": "The ID of the file batch being retrieved.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - } - }, - "/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel": { - "post": { - "operationId": "cancelVectorStoreFileBatch", - "summary": "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store that the file batch belongs to.", - "schema": { - "type": "string" - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "description": "The ID of the file batch to cancel.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - } - }, - "/vector_stores/{vector_store_id}/file_batches/{batch_id}/files": { - "get": { - "operationId": "listFilesInVectorStoreBatch", - "summary": "Returns a list of vector store files in a batch.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store that the file batch belongs to.", - "schema": { - "type": "string" - } - }, - { - "name": "batch_id", - "in": "path", - "required": true, - "description": "The ID of the file batch that the files belong to.", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "filter", - "in": "query", - "required": false, - "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.", - "schema": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "failed", - "cancelled" - ] - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - } - }, - "/vector_stores/{vector_store_id}/files": { - "get": { - "operationId": "listVectorStoreFiles", - "summary": "Returns a list of vector store files.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store that the files belong to.", - "schema": { - "type": "string" - } - }, - { - "name": "limit", - "in": "query", - "required": false, - "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the\ndefault is 20.", - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "description": "Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`\nfor descending order.", - "schema": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "explode": false - }, - { - "name": "after", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `after` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include after=obj_foo in order to fetch the next page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "before", - "in": "query", - "required": false, - "description": "A cursor for use in pagination. `before` is an object ID that defines your place in the list.\nFor instance, if you make a list request and receive 100 objects, ending with obj_foo, your\nsubsequent call can include before=obj_foo in order to fetch the previous page of the list.", - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "filter", - "in": "query", - "required": false, - "description": "Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`.", - "schema": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "failed", - "cancelled" - ] - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.ListVectorStoreFilesResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - }, - "post": { - "operationId": "createVectorStoreFile", - "summary": "Create a vector store file by attaching a [File](/docs/api-reference/files) to a [vector store](/docs/api-reference/vector-stores/object).", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store for which to create a File.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest" - } - } - } - } - } - }, - "/vector_stores/{vector_store_id}/files/{file_id}": { - "get": { - "operationId": "getVectorStoreFile", - "summary": "Retrieves a vector store file.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store that the file belongs to.", - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file being retrieved.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - }, - "post": { - "operationId": "updateVectorStoreFileAttributes", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest" - } - } - } - } - }, - "delete": { - "operationId": "deleteVectorStoreFile", - "summary": "Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store that the file belongs to.", - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to delete.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.DeleteVectorStoreFileResponse" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - } - }, - "/vector_stores/{vector_store_id}/files/{file_id}/content": { - "get": { - "operationId": "retrieveVectorStoreFileContent", - "summary": "Retrieve vector store file content", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to search.", - "schema": { - "type": "string" - } - }, - { - "name": "file_id", - "in": "path", - "required": true, - "description": "The ID of the file to retrieve content for.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ] - } - }, - "/vector_stores/{vector_store_id}/search": { - "post": { - "operationId": "searchVectorStore", - "summary": "Search vector store", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "vector_store_id", - "in": "path", - "required": true, - "description": "The ID of the vector store to search.", - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultsPage" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "type": { - "type": "string" - }, - "inner_error": {} - }, - "required": [ - "code", - "message", - "param", - "type" - ] - } - } - } - } - }, - "tags": [ - "Vector Stores" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequest" - } - } - } - } - } - }, - "/videos": { - "post": { - "operationId": "Videos_Create", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - } - ], - "description": "Creates a new video generation job.", - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VideoResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" - } - } - } - } - }, - "tags": [ - "Videos" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateVideoBody" - } - }, - "multipart/form-data": { - "schema": { - "$ref": "#/components/schemas/CreateVideoBodyWithInputReference" - }, - "encoding": { - "seconds": { - "contentType": "text/plain" - }, - "size": { - "contentType": "text/plain" - }, - "input_reference": { - "contentType": "*/*" - } - } - } - } - } - }, - "get": { - "operationId": "Videos_List", - "description": "Lists video generation jobs.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "name": "after", - "in": "query", - "required": false, - "schema": { - "type": "string" - }, - "explode": false - }, - { - "name": "limit", - "in": "query", - "required": false, - "schema": { - "type": "integer", - "format": "int32", - "default": 20 - }, - "explode": false - }, - { - "name": "order", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/Order", - "default": "desc" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VideoList" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" - } - } - } - } - }, - "tags": [ - "Videos" - ] - } - }, - "/videos/{video-id}": { - "get": { - "operationId": "Videos_Get", - "description": "Retrieves properties of a video generation job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "$ref": "#/components/parameters/VideoIdParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VideoResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" - } - } - } - } - }, - "tags": [ - "Videos" - ] - }, - "delete": { - "operationId": "Videos_Delete", - "description": "Deletes a video generation job.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "$ref": "#/components/parameters/VideoIdParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeletedVideoResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" - } - } - } - } - }, - "tags": [ - "Videos" - ] - } - }, - "/videos/{video-id}/content": { - "get": { - "operationId": "Videos_RetrieveContent", - "description": "Retrieves a thumbnail of the generated video content.", - "parameters": [ - { - "name": "api-version", - "in": "query", - "required": false, - "description": "The explicit Azure AI Foundry Models API version to use for this request.\n`v1` if not otherwise specified.", - "schema": { - "$ref": "#/components/schemas/AzureAIFoundryModelsApiVersion", - "default": "v1" - } - }, - { - "$ref": "#/components/parameters/VideoIdParameter" - }, - { - "name": "variant", - "in": "query", - "required": false, - "schema": { - "$ref": "#/components/schemas/VideoContentVariant", - "default": "video" - }, - "explode": false - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - }, - "content-length": { - "required": true, - "schema": { - "type": "integer" - } - } - }, - "content": { - "image/jpg": { - "schema": { - "contentMediaType": "image/jpg" - } - }, - "image/webp": { - "schema": { - "contentMediaType": "image/webp" - } - }, - "video/mp4": { - "schema": { - "contentMediaType": "video/mp4" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" - } - } - } - } - }, - "tags": [ - "Videos" - ] - } - }, - "/videos/{video-id}/remix": { - "post": { - "operationId": "Videos_Remix", - "description": "Use an existing generated video and change it with a prompt.", - "parameters": [ - { - "$ref": "#/components/parameters/VideoIdParameter" - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "headers": { - "apim-request-id": { - "required": false, - "description": "A request ID used for troubleshooting purposes.", - "schema": { - "type": "string" - } - } - }, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/VideoResource" - } - } - } - }, - "default": { - "description": "An unexpected error response.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/AzureOpenAIVideoGenerationErrorResponse" - } - } - } - } - }, - "tags": [ - "Videos" - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "prompt": { - "type": "string", - "minLength": 1 - } - }, - "required": [ - "prompt" - ] - } - } - } - } - } - } - }, - "security": [ - { - "ApiKeyAuth": [] - }, - { - "ApiKeyAuth_": [] - }, - { - "OAuth2Auth": [ - "https://cognitiveservices.azure.com/.default" - ] - } - ], - "components": { - "parameters": { - "VideoIdParameter": { - "name": "video-id", - "in": "path", - "required": true, - "description": "The ID of the video to use for the Azure OpenAI request.", - "schema": { - "type": "string" - } - } - }, - "schemas": { - "AudioSegment": { - "type": "object", - "required": [ - "id", - "start", - "end", - "text", - "temperature", - "avg_logprob", - "compression_ratio", - "no_speech_prob", - "tokens", - "seek" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32", - "description": "The 0-based index of this segment within a translation." - }, - "start": { - "type": "number", - "format": "float", - "description": "The time at which this segment started relative to the beginning of the translated audio." - }, - "end": { - "type": "number", - "format": "float", - "description": "The time at which this segment ended relative to the beginning of the translated audio." - }, - "text": { - "type": "string", - "description": "The translated text that was part of this audio segment." - }, - "temperature": { - "type": "number", - "format": "float", - "description": "The temperature score associated with this audio segment." - }, - "avg_logprob": { - "type": "number", - "format": "float", - "description": "The average log probability associated with this audio segment." - }, - "compression_ratio": { - "type": "number", - "format": "float", - "description": "The compression ratio of this audio segment." - }, - "no_speech_prob": { - "type": "number", - "format": "float", - "description": "The probability of no speech detection within this audio segment." - }, - "tokens": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "description": "The token IDs matching the translated text in this audio segment." - }, - "seek": { - "type": "integer", - "format": "int32", - "description": "The seek position associated with the processing of this audio segment.\nSeek positions are expressed as hundredths of seconds.\nThe model may process several segments from a single seek position, so while the seek position will never represent\na later time than the segment's start, the segment's start may represent a significantly later time than the\nsegment's associated seek position." - } - } - }, - "AudioTaskLabel": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "transcribe", - "translate" - ] - } - ], - "description": "Defines the possible descriptors for available audio operation responses." - }, - "AudioTranslationSegment": { - "type": "object", - "required": [ - "id", - "start", - "end", - "text", - "temperature", - "avg_logprob", - "compression_ratio", - "no_speech_prob", - "tokens", - "seek" - ], - "properties": { - "id": { - "type": "integer", - "format": "int32", - "description": "The 0-based index of this segment within a translation." - }, - "start": { - "type": "number", - "format": "float", - "description": "The time at which this segment started relative to the beginning of the translated audio." - }, - "end": { - "type": "number", - "format": "float", - "description": "The time at which this segment ended relative to the beginning of the translated audio." - }, - "text": { - "type": "string", - "description": "The translated text that was part of this audio segment." - }, - "temperature": { - "type": "number", - "format": "float", - "description": "The temperature score associated with this audio segment." - }, - "avg_logprob": { - "type": "number", - "format": "float", - "description": "The average log probability associated with this audio segment." - }, - "compression_ratio": { - "type": "number", - "format": "float", - "description": "The compression ratio of this audio segment." - }, - "no_speech_prob": { - "type": "number", - "format": "float", - "description": "The probability of no speech detection within this audio segment." - }, - "tokens": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - }, - "description": "The token IDs matching the translated text in this audio segment." - }, - "seek": { - "type": "integer", - "format": "int32", - "description": "The seek position associated with the processing of this audio segment.\nSeek positions are expressed as hundredths of seconds.\nThe model may process several segments from a single seek position, so while the seek position will never represent\na later time than the segment's start, the segment's start may represent a significantly later time than the\nsegment's associated seek position." - } - }, - "description": "Extended information about a single segment of translated audio data.\nSegments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not\nnecessarily sentences." - }, - "AzureAIFoundryModelsApiVersion": { - "type": "string", - "enum": [ - "v1", - "preview" - ] - }, - "AzureAudioTranscriptionResponse": { - "type": "object", - "required": [ - "text" - ], - "properties": { - "text": { - "type": "string", - "description": "The transcribed text for the provided audio data." - }, - "task": { - "allOf": [ - { - "$ref": "#/components/schemas/AudioTaskLabel" - } - ], - "description": "The label that describes which operation type generated the accompanying response data." - }, - "language": { - "type": "string", - "description": "The spoken language that was detected in the transcribed audio data.\nThis is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'." - }, - "duration": { - "type": "number", - "format": "float", - "description": "The total duration of the audio processed to produce accompanying transcription information." - }, - "segments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.TranscriptionSegment" - }, - "description": "A collection of information about the timing, probabilities, and other detail of each processed audio segment." - }, - "words": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.TranscriptionWord" - }, - "description": "A collection of information about the timing of each processed word." - } - }, - "description": "Result information for an operation that transcribed spoken audio into written text." - }, - "AzureAudioTranslationResponse": { - "type": "object", - "required": [ - "text" - ], - "properties": { - "text": { - "type": "string", - "description": "The translated text for the provided audio data." - }, - "task": { - "allOf": [ - { - "$ref": "#/components/schemas/AudioTaskLabel" - } - ], - "description": "The label that describes which operation type generated the accompanying response data." - }, - "language": { - "type": "string", - "description": "The spoken language that was detected in the translated audio data.\nThis is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'." - }, - "duration": { - "type": "number", - "format": "float", - "description": "The total duration of the audio processed to produce accompanying translation information." - }, - "segments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AudioTranslationSegment" - }, - "description": "A collection of information about the timing, probabilities, and other detail of each processed audio segment." - } - }, - "description": "Result information for an operation that translated spoken audio into written text." - }, - "AzureCompletionsSamplingParams": { - "type": "object", - "properties": { - "max_tokens": { - "type": "integer", - "format": "int32", - "description": "The maximum number of tokens in the generated output." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams" - } - ], - "description": "Sampling parameters for controlling the behavior of completions." - }, - "AzureContentFilterBlocklistIdResult": { - "type": "object", - "required": [ - "id", - "filtered" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the custom blocklist associated with the filtered status." - }, - "filtered": { - "type": "boolean", - "description": "Whether the associated blocklist resulted in the content being filtered." - } - }, - "description": "A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not\nthe corresponding blocklist resulted in content being filtered." - }, - "AzureContentFilterBlocklistResult": { - "type": "object", - "required": [ - "filtered" - ], - "properties": { - "filtered": { - "type": "boolean", - "description": "A value indicating whether any of the detailed blocklists resulted in a filtering action." - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "filtered": { - "type": "boolean", - "description": "A value indicating whether the blocklist produced a filtering action." - }, - "id": { - "type": "string", - "description": "The ID of the custom blocklist evaluated." - } - }, - "required": [ - "filtered", - "id" - ] - }, - "description": "The pairs of individual blocklist IDs and whether they resulted in a filtering action." - } - }, - "description": "A collection of true/false filtering results for configured custom blocklists." - }, - "AzureContentFilterCompletionTextSpan": { - "type": "object", - "required": [ - "completion_start_offset", - "completion_end_offset" - ], - "properties": { - "completion_start_offset": { - "type": "integer", - "format": "int32", - "description": "Offset of the UTF32 code point which begins the span." - }, - "completion_end_offset": { - "type": "integer", - "format": "int32", - "description": "Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans." - } - }, - "description": "A representation of a span of completion text as used by Azure OpenAI content filter results." - }, - "AzureContentFilterCompletionTextSpanDetectionResult": { - "type": "object", - "required": [ - "filtered", - "detected", - "details" - ], - "properties": { - "filtered": { - "type": "boolean", - "description": "Whether the content detection resulted in a content filtering action." - }, - "detected": { - "type": "boolean", - "description": "Whether the labeled content category was detected in the content." - }, - "details": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpan" - }, - "description": "Detailed information about the detected completion text spans." - } - } - }, - "AzureContentFilterCustomTopicIdResult": { - "type": "object", - "required": [ - "id", - "detected" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the custom topic associated with the detected status." - }, - "detected": { - "type": "boolean", - "description": "Whether the associated custom topic resulted in the content being detected." - } - }, - "description": "A content filter result item that associates an existing custom topic ID with a value indicating whether or not\nthe corresponding topic resulted in content being detected." - }, - "AzureContentFilterCustomTopicResult": { - "type": "object", - "required": [ - "filtered" - ], - "properties": { - "filtered": { - "type": "boolean", - "description": "A value indicating whether any of the detailed topics resulted in a filtering action." - }, - "details": { - "type": "array", - "items": { - "type": "object", - "properties": { - "detected": { - "type": "boolean", - "description": "A value indicating whether the topic is detected." - }, - "id": { - "type": "string", - "description": "The ID of the custom topic evaluated." - } - }, - "required": [ - "detected", - "id" - ] - }, - "description": "The pairs of individual topic IDs and whether they are detected." - } - }, - "description": "A collection of true/false filtering results for configured custom topics." - }, - "AzureContentFilterDetectionResult": { - "type": "object", - "required": [ - "filtered", - "detected" - ], - "properties": { - "filtered": { - "type": "boolean", - "description": "Whether the content detection resulted in a content filtering action." - }, - "detected": { - "type": "boolean", - "description": "Whether the labeled content category was detected in the content." - } - }, - "description": "A labeled content filter result item that indicates whether the content was detected and whether the content was\nfiltered." - }, - "AzureContentFilterForResponsesAPI": { - "type": "object", - "required": [ - "blocked", - "source_type", - "content_filter_results", - "content_filter_offsets" - ], - "properties": { - "blocked": { - "type": "boolean", - "description": "Indicate if the response is blocked." - }, - "source_type": { - "type": "string", - "description": "The name of the source type of the message." - }, - "content_filter_results": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterResultsForResponsesAPI" - } - ], - "description": "A content filter result for a single response item produced by a generative AI system." - }, - "content_filter_offsets": { - "$ref": "#/components/schemas/AzureContentFilterResultOffsets" - } - } - }, - "AzureContentFilterHarmExtensions": { - "type": "object", - "properties": { - "pii_sub_categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzurePiiSubCategory" - }, - "description": "Configuration for PIIHarmSubCategory(s)." - } - }, - "description": "Extensions for harm categories, providing additional configuration options." - }, - "AzureContentFilterImagePromptResults": { - "type": "object", - "required": [ - "jailbreak" - ], - "properties": { - "profanity": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." - }, - "custom_blocklists": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom blocklists." - }, - "custom_topics": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom topics." - }, - "jailbreak": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterImageResponseResults" - } - ], - "description": "A content filter result for an image generation operation's input request content." - }, - "AzureContentFilterImageResponseResults": { - "type": "object", - "properties": { - "sexual": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." - }, - "violence": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." - }, - "hate": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." - }, - "self_harm": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." - } - }, - "description": "A content filter result for an image generation operation's output response content." - }, - "AzureContentFilterPersonallyIdentifiableInformationResult": { - "type": "object", - "properties": { - "redacted_text": { - "type": "string", - "description": "The redacted text with PII information removed or masked." - }, - "sub_categories": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzurePiiSubCategoryResult" - }, - "description": "Detailed results for individual PIIHarmSubCategory(s)." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A content filter detection result for Personally Identifiable Information that includes harm extensions." - }, - "AzureContentFilterResultForChoice": { - "type": "object", - "properties": { - "sexual": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." - }, - "hate": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." - }, - "violence": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." - }, - "self_harm": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." - }, - "profanity": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." - }, - "custom_blocklists": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom blocklists." - }, - "custom_topics": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom topics." - }, - "error": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "A distinct, machine-readable code associated with the error." - }, - "message": { - "type": "string", - "description": "A human-readable message associated with the error." - } - }, - "required": [ - "code", - "message" - ], - "description": "If present, details about an error that prevented content filtering from completing its evaluation." - }, - "protected_material_text": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes a match against text protected under copyright or other status." - }, - "protected_material_code": { - "type": "object", - "properties": { - "filtered": { - "type": "boolean", - "description": "Whether the content detection resulted in a content filtering action." - }, - "detected": { - "type": "boolean", - "description": "Whether the labeled content category was detected in the content." - }, - "citation": { - "type": "object", - "properties": { - "license": { - "type": "string", - "description": "The name or identifier of the license associated with the detection." - }, - "URL": { - "type": "string", - "format": "uri", - "description": "The URL associated with the license." - } - }, - "description": "If available, the citation details describing the associated license and its location." - } - }, - "required": [ - "filtered", - "detected" - ], - "description": "A detection result that describes a match against licensed code or other protected source material." - }, - "ungrounded_material": { - "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult" - }, - "personally_identifiable_information": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult" - } - ], - "description": "A detection result that describes matches against Personal Identifiable Information with configurable subcategories." - } - }, - "description": "A content filter result for a single response item produced by a generative AI system." - }, - "AzureContentFilterResultForPrompt": { - "type": "object", - "properties": { - "prompt_index": { - "type": "integer", - "format": "int32", - "description": "The index of the input prompt associated with the accompanying content filter result categories." - }, - "content_filter_results": { - "type": "object", - "properties": { - "sexual": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." - }, - "hate": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." - }, - "violence": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." - }, - "self_harm": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." - }, - "profanity": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." - }, - "custom_blocklists": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom blocklists." - }, - "custom_topics": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom topics." - }, - "error": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "A distinct, machine-readable code associated with the error." - }, - "message": { - "type": "string", - "description": "A human-readable message associated with the error." - } - }, - "required": [ - "code", - "message" - ], - "description": "If present, details about an error that prevented content filtering from completing its evaluation." - }, - "jailbreak": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions." - }, - "indirect_attack": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user." - } - }, - "required": [ - "jailbreak", - "indirect_attack" - ], - "description": "The content filter category details for the result." - } - }, - "description": "A content filter result associated with a single input prompt item into a generative AI system." - }, - "AzureContentFilterResultOffsets": { - "type": "object", - "required": [ - "start_offset", - "end_offset", - "check_offset" - ], - "properties": { - "start_offset": { - "type": "integer", - "format": "int32" - }, - "end_offset": { - "type": "integer", - "format": "int32" - }, - "check_offset": { - "type": "integer", - "format": "int32" - } - } - }, - "AzureContentFilterResultsForResponsesAPI": { - "type": "object", - "required": [ - "jailbreak", - "task_adherence" - ], - "properties": { - "sexual": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to anatomical organs and genitals, romantic relationships, acts\nportrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an\nassault or a forced sexual violent act against one's will, prostitution, pornography, and abuse." - }, - "hate": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that can refer to any content that attacks or uses pejorative or discriminatory\nlanguage with reference to a person or identity group based on certain differentiating attributes of these groups\nincluding but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation,\nreligion, immigration status, ability status, personal appearance, and body size." - }, - "violence": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category for language related to physical actions intended to hurt, injure, damage, or kill\nsomeone or something; describes weapons, guns and related entities, such as manufactures, associations,\nlegislation, and so on." - }, - "self_harm": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterSeverityResult" - } - ], - "description": "A content filter category that describes language related to physical actions intended to purposely hurt, injure,\ndamage one's body or kill oneself." - }, - "profanity": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the\ncontent." - }, - "custom_blocklists": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterBlocklistResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom blocklists." - }, - "custom_topics": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterCustomTopicResult" - } - ], - "description": "A collection of binary filtering outcomes for configured custom topics." - }, - "error": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32", - "description": "A distinct, machine-readable code associated with the error." - }, - "message": { - "type": "string", - "description": "A human-readable message associated with the error." - } - }, - "required": [ - "code", - "message" - ], - "description": "If present, details about an error that prevented content filtering from completing its evaluation." - }, - "jailbreak": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes user prompt injection attacks, where malicious users deliberately exploit\nsystem vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content\ngeneration or violations of system-imposed restrictions." - }, - "task_adherence": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that indicates if the execution flow still sticks the plan." - }, - "protected_material_text": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes a match against text protected under copyright or other status." - }, - "protected_material_code": { - "type": "object", - "properties": { - "filtered": { - "type": "boolean", - "description": "Whether the content detection resulted in a content filtering action." - }, - "detected": { - "type": "boolean", - "description": "Whether the labeled content category was detected in the content." - }, - "citation": { - "type": "object", - "properties": { - "license": { - "type": "string", - "description": "The name or identifier of the license associated with the detection." - }, - "URL": { - "type": "string", - "format": "uri", - "description": "The URL associated with the license." - } - }, - "description": "If available, the citation details describing the associated license and its location." - } - }, - "required": [ - "filtered", - "detected" - ], - "description": "A detection result that describes a match against licensed code or other protected source material." - }, - "ungrounded_material": { - "$ref": "#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult" - }, - "personally_identifiable_information": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult" - } - ], - "description": "A detection result that describes matches against Personal Identifiable Information with configurable subcategories." - }, - "indirect_attack": { - "allOf": [ - { - "$ref": "#/components/schemas/AzureContentFilterDetectionResult" - } - ], - "description": "A detection result that describes attacks on systems powered by Generative AI models that can happen every time\nan application processes information that wasn’t directly authored by either the developer of the application or\nthe user." - } - } - }, - "AzureContentFilterSeverityResult": { - "type": "object", - "required": [ - "filtered", - "severity" - ], - "properties": { - "filtered": { - "type": "boolean", - "description": "Whether the content severity resulted in a content filtering action." - }, - "severity": { - "type": "string", - "enum": [ - "safe", - "low", - "medium", - "high" - ], - "description": "The labeled severity of the content." - } - }, - "description": "A labeled content filter result item that indicates whether the content was filtered and what the qualitative\nseverity level of the content was, as evaluated against content filter configuration for the category." - }, - "AzureFileExpiryAnchor": { - "type": "string", - "enum": [ - "created_at" - ] - }, - "AzureFineTuneReinforcementMethod": { - "type": "object", - "required": [ - "grader" - ], - "properties": { - "grader": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.GraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderScoreModel" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderMulti" - }, - { - "$ref": "#/components/schemas/GraderEndpoint" - } - ] - }, - "response_format": { - "allOf": [ - { - "$ref": "#/components/schemas/ResponseFormatJSONSchemaRequest" - } - ], - "description": "Response format to be used while sampling during RFT training" - }, - "hyperparameters": { - "$ref": "#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters" - } - } - }, - "AzureOpenAIVideoGenerationErrorResponse": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "The distinct, machine-generated identifier for the error." - }, - "message": { - "type": "string", - "description": "A human-readable message associated with the error." - }, - "param": { - "type": "string", - "description": "If applicable, the request input parameter associated with the error" - }, - "type": { - "type": "string", - "description": "If applicable, the input line number associated with the error." - }, - "inner_error": { - "type": "object", - "properties": { - "code": { - "type": "string", - "enum": [ - "ResponsibleAIPolicyViolation" - ], - "description": "The code associated with the inner error." - }, - "revised_prompt": { - "type": "string", - "description": "If applicable, the modified prompt used for generation." - }, - "error_details": { - "description": "The content filter result details associated with the inner error." - } - }, - "description": "If applicable, an upstream error that originated this error." - } - } - }, - "AzurePiiSubCategory": { - "type": "object", - "required": [ - "sub_category", - "detect", - "redact", - "filter" - ], - "properties": { - "sub_category": { - "type": "string", - "description": "The PIIHarmSubCategory being configured." - }, - "detect": { - "type": "boolean", - "description": "Whether detection is enabled for this subcategory." - }, - "redact": { - "type": "boolean", - "description": "Whether content containing this subcategory should be redacted." - }, - "filter": { - "type": "boolean", - "description": "Whether content containing this subcategory should be blocked." - } - }, - "description": "Configuration for individual PIIHarmSubCategory(s) within the harm extensions framework." - }, - "AzurePiiSubCategoryResult": { - "type": "object", - "required": [ - "sub_category", - "filtered", - "detected", - "redacted" - ], - "properties": { - "sub_category": { - "type": "string", - "description": "The PIIHarmSubCategory that was evaluated." - }, - "filtered": { - "type": "boolean", - "description": "Whether the content detection resulted in a content filtering action for this subcategory." - }, - "detected": { - "type": "boolean", - "description": "Whether the labeled content subcategory was detected in the content." - }, - "redacted": { - "type": "boolean", - "description": "Whether the content was redacted for this subcategory." - } - }, - "description": "Result details for individual PIIHarmSubCategory(s)." - }, - "AzureResponsesSamplingParams": { - "type": "object", - "properties": { - "max_tokens": { - "type": "integer", - "format": "int32", - "description": "The maximum number of tokens in the generated output." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams" - } - ], - "description": "Sampling parameters for controlling the behavior of responses." - }, - "AzureUserSecurityContext": { - "type": "object", - "properties": { - "application_name": { - "type": "string", - "description": "The name of the application. Sensitive personal information should not be included in this field." - }, - "end_user_id": { - "type": "string", - "description": "This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field." - }, - "end_user_tenant_id": { - "type": "string", - "description": "The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant." - }, - "source_ip": { - "type": "string", - "description": "Captures the original client's IP address." - } - }, - "description": "User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud." - }, - "CopiedAccountDetails": { - "type": "object", - "required": [ - "destinationResourceId", - "region", - "status" - ], - "properties": { - "destinationResourceId": { - "type": "string", - "description": "The ID of the destination resource where the model was copied to." - }, - "region": { - "type": "string", - "description": "The region where the model was copied to." - }, - "status": { - "type": "string", - "enum": [ - "Completed", - "Failed", - "InProgress" - ], - "description": "The status of the copy operation." - } - } - }, - "CopyModelRequest": { - "type": "object", - "required": [ - "destinationResourceId", - "region" - ], - "properties": { - "destinationResourceId": { - "type": "string", - "description": "The ID of the destination Resource to copy." - }, - "region": { - "type": "string", - "description": "The region to copy the model to." - } - } - }, - "CopyModelResponse": { - "type": "object", - "required": [ - "checkpointedModelName", - "fineTuningJobId", - "copiedAccountDetails" - ], - "properties": { - "checkpointedModelName": { - "type": "string", - "description": "The ID of the copied model." - }, - "fineTuningJobId": { - "type": "string", - "description": "The ID of the fine-tuning job that the checkpoint was copied from." - }, - "copiedAccountDetails": { - "type": "array", - "items": { - "$ref": "#/components/schemas/CopiedAccountDetails" - }, - "description": "The ID of the destination resource id where it was copied" - } - } - }, - "CreateVideoBody": { - "type": "object", - "required": [ - "model", - "prompt" - ], - "properties": { - "model": { - "type": "string", - "description": "The name of the deployment to use for this request." - }, - "prompt": { - "type": "string", - "minLength": 1, - "description": "Text prompt that describes the video to generate." - }, - "seconds": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoSeconds" - } - ], - "description": "Clip duration in seconds. Defaults to 4 seconds.", - "default": "4" - }, - "size": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoSize" - } - ], - "description": "Output resolution formatted as width x height. Defaults to 720x1280.", - "default": "720x1280" - } - } - }, - "CreateVideoBodyWithInputReference": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The name of the deployment to use for this request." - }, - "prompt": { - "type": "string", - "description": "Text prompt that describes the video to generate." - }, - "seconds": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoSeconds" - } - ], - "description": "Clip duration in seconds. Defaults to 4 seconds." - }, - "size": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoSize" - } - ], - "description": "Output resolution formatted as width x height. Defaults to 720x1280." - }, - "input_reference": { - "description": "Optional image reference that guides generation.", - "x-oaiTypeLabel": "file" - } - }, - "required": [ - "model", - "prompt", - "input_reference" - ] - }, - "CreateVideoRemixBody": { - "type": "object", - "required": [ - "prompt" - ], - "properties": { - "prompt": { - "type": "string", - "minLength": 1, - "description": "Updated text prompt that directs the remix generation." - } - }, - "description": "Parameters for remixing an existing generated video." - }, - "DeletedVideoResource": { - "type": "object", - "required": [ - "object", - "deleted", - "id" - ], - "properties": { - "object": { - "type": "string", - "description": "The object type that signals the deletion response.", - "default": "video.deleted" - }, - "deleted": { - "type": "boolean", - "description": "Indicates that the video resource was deleted.", - "default": true - }, - "id": { - "type": "string", - "description": "Identifier of the deleted video." - } - }, - "description": "Confirmation payload returned after deleting a video." - }, - "Error": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - } - } - }, - "EvalGraderEndpoint": { - "type": "object", - "required": [ - "type", - "name", - "url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "endpoint" - ], - "default": "endpoint" - }, - "name": { - "type": "string", - "description": "The name of the grader" - }, - "url": { - "type": "string", - "pattern": "^https://", - "description": "The HTTPS URL of the endpoint to call for grading" - }, - "headers": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": { - "type": "string" - } - }, - { - "type": "null" - } - ], - "description": "Optional HTTP headers to include in requests to the endpoint" - }, - "rate_limit": { - "anyOf": [ - { - "type": "integer", - "format": "int32" - }, - { - "type": "null" - } - ], - "description": "Optional rate limit for requests per second to the endpoint\nMust be a positive integer" - }, - "pass_threshold": { - "anyOf": [ - { - "type": "number", - "format": "decimal" - }, - { - "type": "null" - } - ], - "description": "Optional threshold score above which the grade is considered passing\nIf not specified, all scores are considered valid" - } - } - }, - "FileExpiresAfter": { - "type": "object", - "required": [ - "anchor", - "seconds" - ], - "properties": { - "anchor": { - "type": "string", - "enum": [ - "created_at" - ], - "description": "Defines the anchor relative to what time the absolute expiration should be generated from." - }, - "seconds": { - "type": "integer", - "format": "int64", - "minimum": 1209600, - "maximum": 2592000, - "description": "\"The relative expiration time in seconds.\\r\\nRange: [1209600 - 2592000]." - } - }, - "description": "Defines a expiration for the file." - }, - "GraderEndpoint": { - "type": "object", - "required": [ - "type", - "name", - "url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "endpoint" - ], - "default": "endpoint" - }, - "name": { - "type": "string", - "description": "The name of the grader" - }, - "url": { - "type": "string", - "pattern": "^https://", - "description": "The HTTPS URL of the endpoint to call for grading" - }, - "headers": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": { - "type": "string" - } - }, - { - "type": "null" - } - ], - "description": "Optional HTTP headers to include in requests to the endpoint" - }, - "rate_limit": { - "anyOf": [ - { - "type": "integer", - "format": "int32" - }, - { - "type": "null" - } - ], - "description": "Optional rate limit for requests per second to the endpoint\nMust be a positive integer" - }, - "pass_threshold": { - "anyOf": [ - { - "type": "number", - "format": "decimal" - }, - { - "type": "null" - } - ], - "description": "Optional threshold score above which the grade is considered passing\nIf not specified, all scores are considered valid" - } - }, - "description": "Endpoint grader configuration for external HTTP endpoint evaluation" - }, - "OpenAI.Annotation": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.AnnotationType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "file_citation": "#/components/schemas/OpenAI.FileCitationBody", - "url_citation": "#/components/schemas/OpenAI.UrlCitationBody", - "container_file_citation": "#/components/schemas/OpenAI.ContainerFileCitationBody", - "file_path": "#/components/schemas/OpenAI.FilePath" - } - }, - "description": "An annotation that applies to a span of output text." - }, - "OpenAI.AnnotationType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "file_citation", - "url_citation", - "container_file_citation", - "file_path" - ] - } - ] - }, - "OpenAI.ApplyPatchCallOutputStatus": { - "type": "string", - "enum": [ - "completed", - "failed" - ] - }, - "OpenAI.ApplyPatchCallStatus": { - "type": "string", - "enum": [ - "in_progress", - "completed" - ] - }, - "OpenAI.ApplyPatchCreateFileOperation": { - "type": "object", - "required": [ - "type", - "path", - "diff" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "create_file" - ], - "description": "Create a new file with the provided diff.", - "x-stainless-const": true, - "default": "create_file" - }, - "path": { - "type": "string", - "description": "Path of the file to create." - }, - "diff": { - "type": "string", - "description": "Diff to apply." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" - } - ], - "description": "Instruction describing how to create a file via the apply_patch tool.", - "title": "Apply patch create file operation" - }, - "OpenAI.ApplyPatchDeleteFileOperation": { - "type": "object", - "required": [ - "type", - "path" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "delete_file" - ], - "description": "Delete the specified file.", - "x-stainless-const": true, - "default": "delete_file" - }, - "path": { - "type": "string", - "description": "Path of the file to delete." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" - } - ], - "description": "Instruction describing how to delete a file via the apply_patch tool.", - "title": "Apply patch delete file operation" - }, - "OpenAI.ApplyPatchFileOperation": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperationType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "create_file": "#/components/schemas/OpenAI.ApplyPatchCreateFileOperation", - "delete_file": "#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation", - "update_file": "#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation" - } - }, - "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch.", - "title": "Apply patch operation" - }, - "OpenAI.ApplyPatchFileOperationType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "create_file", - "delete_file", - "update_file" - ] - } - ] - }, - "OpenAI.ApplyPatchToolParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch" - ], - "description": "The type of the tool. Always `apply_patch`.", - "x-stainless-const": true, - "default": "apply_patch" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "Allows the assistant to create, delete, or update files using unified diffs.", - "title": "Apply patch tool" - }, - "OpenAI.ApplyPatchUpdateFileOperation": { - "type": "object", - "required": [ - "type", - "path", - "diff" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "update_file" - ], - "description": "Update an existing file with the provided diff.", - "x-stainless-const": true, - "default": "update_file" - }, - "path": { - "type": "string", - "description": "Path of the file to update." - }, - "diff": { - "type": "string", - "description": "Diff to apply." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" - } - ], - "description": "Instruction describing how to update a file via the apply_patch tool.", - "title": "Apply patch update file operation" - }, - "OpenAI.ApproximateLocation": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "approximate" - ], - "description": "The type of location approximation. Always `approximate`.", - "x-stainless-const": true, - "default": "approximate" - }, - "country": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "region": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "city": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "timezone": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.AssistantTool": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.AssistantToolType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "code_interpreter": "#/components/schemas/OpenAI.AssistantToolsCode", - "file_search": "#/components/schemas/OpenAI.AssistantToolsFileSearch", - "function": "#/components/schemas/OpenAI.AssistantToolsFunction" - } - } - }, - "OpenAI.AssistantToolType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "code_interpreter", - "file_search", - "function" - ] - } - ] - }, - "OpenAI.AssistantToolsCode": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "code_interpreter" - ], - "description": "The type of tool being defined: `code_interpreter`", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.AssistantTool" - } - ], - "title": "Code interpreter tool" - }, - "OpenAI.AssistantToolsFileSearch": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_search" - ], - "description": "The type of tool being defined: `file_search`", - "x-stainless-const": true - }, - "file_search": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch" - } - ], - "description": "Overrides for the file search tool." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.AssistantTool" - } - ], - "title": "FileSearch tool" - }, - "OpenAI.AssistantToolsFileSearchFileSearch": { - "type": "object", - "properties": { - "max_num_results": { - "type": "integer", - "minimum": 1, - "maximum": 50 - }, - "ranking_options": { - "$ref": "#/components/schemas/OpenAI.FileSearchRankingOptions" - } - } - }, - "OpenAI.AssistantToolsFileSearchTypeOnly": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_search" - ], - "description": "The type of tool being defined: `file_search`", - "x-stainless-const": true - } - }, - "title": "AssistantToolsFileSearchTypeOnly" - }, - "OpenAI.AssistantToolsFunction": { - "type": "object", - "required": [ - "type", - "function" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of tool being defined: `function`", - "x-stainless-const": true - }, - "function": { - "$ref": "#/components/schemas/OpenAI.FunctionObject" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.AssistantTool" - } - ], - "title": "Function tool" - }, - "OpenAI.AssistantsApiResponseFormatOption": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatText" - }, - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject" - }, - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema" - } - ], - "description": "Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables JSON mode, which ensures the message the model generates is valid JSON.\n*Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly \"stuck\" request. Also note that the message content may be partially cut off if `finish_reason=\"length\"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length." - }, - "OpenAI.AssistantsApiToolChoiceOption": { - "anyOf": [ - { - "type": "string", - "enum": [ - "none", - "auto", - "required" - ] - }, - { - "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoice" - } - ], - "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tools and instead generates a message.\n`auto` is the default value and means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools before responding to the user.\nSpecifying a particular tool like `{\"type\": \"file_search\"}` or `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool." - }, - "OpenAI.AssistantsNamedToolChoice": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "function", - "code_interpreter", - "file_search" - ], - "description": "The type of the tool. If type is `function`, the function name must be set" - }, - "function": { - "$ref": "#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction" - } - }, - "description": "Specifies a tool the model should use. Use to force the model to call a specific tool." - }, - "OpenAI.AssistantsNamedToolChoiceFunction": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - }, - "OpenAI.AudioTranscription": { - "type": "object", - "properties": { - "model": { - "type": "string", - "description": "The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels." - }, - "language": { - "type": "string", - "description": "The language of the input audio. Supplying the input language in\n [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format\n will improve accuracy and latency." - }, - "prompt": { - "type": "string", - "description": "An optional text to guide the model's style or continue a previous audio\n segment.\n For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting).\n For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example \"expect words related to technology\"." - } - } - }, - "OpenAI.AutoChunkingStrategyRequestParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "auto" - ], - "description": "Always `auto`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" - } - ], - "description": "The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`.", - "title": "Auto Chunking Strategy" - }, - "OpenAI.Batch": { - "type": "object", - "required": [ - "id", - "object", - "endpoint", - "completion_window", - "status", - "created_at", - "input_blob", - "output_blob", - "error_blob" - ], - "properties": { - "id": { - "type": "string" - }, - "object": { - "type": "string", - "enum": [ - "batch" - ], - "description": "The object type, which is always `batch`.", - "x-stainless-const": true - }, - "endpoint": { - "type": "string", - "description": "The OpenAI API endpoint used by the batch." - }, - "model": { - "type": "string", - "description": "Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model\n guide](https://platform.openai.com/docs/models) to browse and compare available models." - }, - "errors": { - "$ref": "#/components/schemas/OpenAI.BatchErrors" - }, - "completion_window": { - "type": "string", - "description": "The time frame within which the batch should be processed." - }, - "status": { - "type": "string", - "enum": [ - "validating", - "failed", - "in_progress", - "finalizing", - "completed", - "expired", - "cancelling", - "cancelled" - ], - "description": "The current status of the batch." - }, - "output_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of successfully executed requests." - }, - "error_file_id": { - "type": "string", - "description": "The ID of the file containing the outputs of requests with errors." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was created." - }, - "in_progress_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started processing." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch will expire." - }, - "finalizing_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started finalizing." - }, - "completed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was completed." - }, - "failed_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch failed." - }, - "expired_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch expired." - }, - "cancelling_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch started cancelling." - }, - "cancelled_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the batch was cancelled." - }, - "request_counts": { - "$ref": "#/components/schemas/OpenAI.BatchRequestCounts" - }, - "usage": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.BatchUsage" - } - ], - "description": "Represents token usage details including input tokens, output tokens, a\n breakdown of output tokens, and the total tokens used. Only populated on\n batches created after September 7, 2025." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "input_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing the input file for the batch." - }, - "output_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of successfully executed requests." - }, - "error_blob": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The blob url containing outputs of requests with errors." - }, - "input_file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "x-oaiMeta": { - "name": "The batch object", - "example": "{\n \"id\": \"batch_abc123\",\n \"object\": \"batch\",\n \"endpoint\": \"/v1/completions\",\n \"model\": \"gpt-5-2025-08-07\",\n \"errors\": null,\n \"input_file_id\": \"file-abc123\",\n \"completion_window\": \"24h\",\n \"status\": \"completed\",\n \"output_file_id\": \"file-cvaTdG\",\n \"error_file_id\": \"file-HOWS94\",\n \"created_at\": 1711471533,\n \"in_progress_at\": 1711471538,\n \"expires_at\": 1711557933,\n \"finalizing_at\": 1711493133,\n \"completed_at\": 1711493163,\n \"failed_at\": null,\n \"expired_at\": null,\n \"cancelling_at\": null,\n \"cancelled_at\": null,\n \"request_counts\": {\n \"total\": 100,\n \"completed\": 95,\n \"failed\": 5\n },\n \"usage\": {\n \"input_tokens\": 1500,\n \"input_tokens_details\": {\n \"cached_tokens\": 1024\n },\n \"output_tokens\": 500,\n \"output_tokens_details\": {\n \"reasoning_tokens\": 300\n },\n \"total_tokens\": 2000\n },\n \"metadata\": {\n \"customer_id\": \"user_123456789\",\n \"batch_description\": \"Nightly eval job\",\n }\n}\n" - } - }, - "OpenAI.BatchError": { - "type": "object", - "properties": { - "code": { - "type": "string", - "description": "An error code identifying the error type." - }, - "message": { - "type": "string", - "description": "A human-readable message providing more details about the error." - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "line": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.BatchErrors": { - "type": "object", - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.BatchError" - } - } - } - }, - "OpenAI.BatchRequestCounts": { - "type": "object", - "required": [ - "total", - "completed", - "failed" - ], - "properties": { - "total": { - "type": "integer", - "description": "Total number of requests in the batch." - }, - "completed": { - "type": "integer", - "description": "Number of requests that have been completed successfully." - }, - "failed": { - "type": "integer", - "description": "Number of requests that have failed." - } - }, - "description": "The request counts for different statuses within the batch." - }, - "OpenAI.BatchUsage": { - "type": "object", - "required": [ - "input_tokens", - "input_tokens_details", - "output_tokens", - "output_tokens_details", - "total_tokens" - ], - "properties": { - "input_tokens": { - "type": "integer" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/OpenAI.BatchUsageInputTokensDetails" - }, - "output_tokens": { - "type": "integer" - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OpenAI.BatchUsageOutputTokensDetails" - }, - "total_tokens": { - "type": "integer" - } - } - }, - "OpenAI.BatchUsageInputTokensDetails": { - "type": "object", - "required": [ - "cached_tokens" - ], - "properties": { - "cached_tokens": { - "type": "integer" - } - } - }, - "OpenAI.BatchUsageOutputTokensDetails": { - "type": "object", - "required": [ - "reasoning_tokens" - ], - "properties": { - "reasoning_tokens": { - "type": "integer" - } - } - }, - "OpenAI.ChatCompletionAllowedTools": { - "type": "object", - "required": [ - "mode", - "tools" - ], - "properties": { - "mode": { - "type": "string", - "enum": [ - "auto", - "required" - ], - "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools." - }, - "tools": { - "type": "array", - "items": { - "type": "object", - "unevaluatedProperties": {} - }, - "description": "A list of tool definitions that the model should be allowed to call.\n For the Chat Completions API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"function\": { \"name\": \"get_weather\" } },\n { \"type\": \"function\", \"function\": { \"name\": \"get_time\" } }\n ]\n ```" - } - }, - "description": "Constrains the tools available to the model to a pre-defined set.", - "title": "Allowed tools" - }, - "OpenAI.ChatCompletionAllowedToolsChoice": { - "type": "object", - "required": [ - "type", - "allowed_tools" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "allowed_tools" - ], - "description": "Allowed tool configuration type. Always `allowed_tools`.", - "x-stainless-const": true - }, - "allowed_tools": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedTools" - } - }, - "description": "Constrains the tools available to the model to a pre-defined set.", - "title": "Allowed tools" - }, - "OpenAI.ChatCompletionFunctionCallOption": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the function to call." - } - }, - "description": "Specifying a particular function via `{\"name\": \"my_function\"}` forces the model to call that function.", - "x-stainless-variantName": "function_call_option" - }, - "OpenAI.ChatCompletionFunctions": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "description": { - "type": "string", - "description": "A description of what the function does, used by the model to choose when and how to call the function." - }, - "name": { - "type": "string", - "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." - }, - "parameters": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionParameters" - } - ], - "description": "The parameters the functions accepts, described as a JSON Schema object.\nSee the [JSON Schema reference](https://json-schema.org/understanding-json-schema/)\nfor documentation about the format.\n\nOmitting `parameters` defines a function with an empty parameter list." - } - }, - "deprecated": true - }, - "OpenAI.ChatCompletionMessageCustomToolCall": { - "type": "object", - "required": [ - "id", - "type", - "custom" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the tool call." - }, - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "The type of the tool. Always `custom`.", - "x-stainless-const": true - }, - "custom": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom" - } - ], - "description": "The custom tool that the model called." - } - }, - "description": "A call to a custom tool created by the model.", - "title": "Custom tool call" - }, - "OpenAI.ChatCompletionMessageCustomToolCallCustom": { - "type": "object", - "required": [ - "name", - "input" - ], - "properties": { - "name": { - "type": "string" - }, - "input": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionMessageToolCall": { - "type": "object", - "required": [ - "id", - "type", - "function" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the tool call." - }, - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of the tool. Currently, only `function` is supported.", - "x-stainless-const": true - }, - "function": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction" - } - ], - "description": "The function that the model called." - } - }, - "description": "A call to a function tool created by the model.", - "title": "Function tool call" - }, - "OpenAI.ChatCompletionMessageToolCallChunk": { - "type": "object", - "required": [ - "index" - ], - "properties": { - "index": { - "type": "integer" - }, - "id": { - "type": "string", - "description": "The ID of the tool call." - }, - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of the tool. Currently, only `function` is supported.", - "x-stainless-const": true - }, - "function": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunkFunction" - } - } - }, - "OpenAI.ChatCompletionMessageToolCallChunkFunction": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionMessageToolCallFunction": { - "type": "object", - "required": [ - "name", - "arguments" - ], - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionMessageToolCalls": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall" - }, - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall" - } - ] - }, - "description": "The tool calls generated by the model, such as function calls." - }, - "OpenAI.ChatCompletionMessageToolCallsItem": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCall" - }, - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall" - } - ] - }, - "description": "The tool calls generated by the model, such as function calls." - }, - "OpenAI.ChatCompletionNamedToolChoice": { - "type": "object", - "required": [ - "type", - "function" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "For function calling, the type is always `function`.", - "x-stainless-const": true - }, - "function": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction" - } - }, - "description": "Specifies a tool the model should use. Use to force the model to call a specific function.", - "title": "Function tool choice" - }, - "OpenAI.ChatCompletionNamedToolChoiceCustom": { - "type": "object", - "required": [ - "type", - "custom" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "For custom tool calling, the type is always `custom`.", - "x-stainless-const": true - }, - "custom": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom" - } - }, - "description": "Specifies a tool the model should use. Use to force the model to call a specific custom tool.", - "title": "Custom tool choice" - }, - "OpenAI.ChatCompletionNamedToolChoiceCustomCustom": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionNamedToolChoiceFunction": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionRequestAssistantMessage": { - "type": "object", - "required": [ - "role" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart" - } - }, - { - "type": "null" - } - ] - }, - "refusal": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "role": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "The role of the messages author, in this case `assistant`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." - }, - "audio": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio" - }, - { - "type": "null" - } - ], - "description": "Data about a previous audio response from the model." - }, - "tool_calls": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCalls" - }, - "function_call": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - } - ], - "description": "Messages sent by the model in response to user messages.", - "title": "Assistant message", - "x-stainless-soft-required": [ - "content" - ] - }, - "OpenAI.ChatCompletionRequestAssistantMessageAudio": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionRequestAssistantMessageContentPart": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "refusal": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal", - "text": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText" - } - } - }, - "OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of the content part.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "The text content." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart" - } - ], - "description": "Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation).", - "title": "Text content part", - "x-stainless-naming": { - "go": { - "variant_constructor": "TextContentPart" - } - } - }, - "OpenAI.ChatCompletionRequestAssistantMessageContentPartType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "text", - "refusal" - ] - } - ] - }, - "OpenAI.ChatCompletionRequestAssistantMessageFunctionCall": { - "type": "object", - "required": [ - "arguments", - "name" - ], - "properties": { - "arguments": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionRequestDeveloperMessage": { - "type": "object", - "required": [ - "content", - "role" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" - } - } - ], - "description": "The contents of the developer message." - }, - "role": { - "type": "string", - "enum": [ - "developer" - ], - "description": "The role of the messages author, in this case `developer`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - } - ], - "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, `developer` messages\nreplace the previous `system` messages.", - "title": "Developer message", - "x-stainless-naming": { - "go": { - "variant_constructor": "DeveloperMessage" - } - } - }, - "OpenAI.ChatCompletionRequestFunctionMessage": { - "type": "object", - "required": [ - "role", - "content", - "name" - ], - "properties": { - "role": { - "type": "string", - "enum": [ - "function" - ], - "description": "The role of the messages author, in this case `function`.", - "x-stainless-const": true - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "name": { - "type": "string", - "description": "The name of the function to call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - } - ], - "title": "Function message", - "deprecated": true - }, - "OpenAI.ChatCompletionRequestMessage": { - "type": "object", - "required": [ - "role" - ], - "properties": { - "role": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageType" - } - }, - "discriminator": { - "propertyName": "role", - "mapping": { - "assistant": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage", - "developer": "#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage", - "function": "#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage", - "system": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage", - "user": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessage", - "tool": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessage" - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartAudio": { - "type": "object", - "required": [ - "type", - "input_audio" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_audio" - ], - "description": "The type of the content part. Always `input_audio`.", - "x-stainless-const": true - }, - "input_audio": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" - } - ], - "description": "", - "title": "Audio content part", - "x-stainless-naming": { - "go": { - "variant_constructor": "InputAudioContentPart" - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio": { - "type": "object", - "required": [ - "data", - "format" - ], - "properties": { - "data": { - "type": "string" - }, - "format": { - "type": "string", - "enum": [ - "wav", - "mp3" - ] - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartFile": { - "type": "object", - "required": [ - "type", - "file" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file" - ], - "description": "The type of the content part. Always `file`.", - "x-stainless-const": true - }, - "file": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile" - } - ], - "x-stainless-naming": { - "java": { - "type_name": "FileObject" - }, - "kotlin": { - "type_name": "FileObject" - } - } - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" - } - ], - "description": "Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text generation.", - "title": "File content part", - "x-stainless-naming": { - "go": { - "variant_constructor": "FileContentPart" - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartFileFile": { - "type": "object", - "properties": { - "filename": { - "type": "string" - }, - "file_data": { - "type": "string" - }, - "file_id": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartImage": { - "type": "object", - "required": [ - "type", - "image_url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_url" - ], - "description": "The type of the content part.", - "x-stainless-const": true - }, - "image_url": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" - } - ], - "description": "", - "title": "Image content part", - "x-stainless-naming": { - "go": { - "variant_constructor": "ImageContentPart" - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl": { - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "type": "string", - "format": "uri" - }, - "detail": { - "type": "string", - "enum": [ - "auto", - "low", - "high" - ], - "default": "auto" - } - } - }, - "OpenAI.ChatCompletionRequestMessageContentPartRefusal": { - "type": "object", - "required": [ - "type", - "refusal" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "refusal" - ], - "description": "The type of the content part.", - "x-stainless-const": true - }, - "refusal": { - "type": "string", - "description": "The refusal message generated by the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart" - } - ], - "title": "Refusal content part" - }, - "OpenAI.ChatCompletionRequestMessageContentPartText": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of the content part.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "The text content." - } - }, - "description": "", - "title": "Text content part", - "x-stainless-naming": { - "go": { - "variant_constructor": "TextContentPart" - } - } - }, - "OpenAI.ChatCompletionRequestMessageType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "developer", - "system", - "user", - "assistant", - "tool", - "function" - ] - } - ] - }, - "OpenAI.ChatCompletionRequestSystemMessage": { - "type": "object", - "required": [ - "content", - "role" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart" - } - } - ], - "description": "The contents of the system message." - }, - "role": { - "type": "string", - "enum": [ - "system" - ], - "description": "The role of the messages author, in this case `system`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - } - ], - "description": "Developer-provided instructions that the model should follow, regardless of\nmessages sent by the user. With o1 models and newer, use `developer` messages\nfor this purpose instead.", - "title": "System message", - "x-stainless-naming": { - "go": { - "variant_constructor": "SystemMessage" - } - } - }, - "OpenAI.ChatCompletionRequestSystemMessageContentPart": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" - }, - "OpenAI.ChatCompletionRequestToolMessage": { - "type": "object", - "required": [ - "role", - "content", - "tool_call_id" - ], - "properties": { - "role": { - "type": "string", - "enum": [ - "tool" - ], - "description": "The role of the messages author, in this case `tool`.", - "x-stainless-const": true - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart" - } - } - ], - "description": "The contents of the tool message." - }, - "tool_call_id": { - "type": "string", - "description": "Tool call that this message is responding to." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - } - ], - "title": "Tool message", - "x-stainless-naming": { - "go": { - "variant_constructor": "ToolMessage" - } - } - }, - "OpenAI.ChatCompletionRequestToolMessageContentPart": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" - }, - "OpenAI.ChatCompletionRequestUserMessage": { - "type": "object", - "required": [ - "content", - "role" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" - } - } - ], - "description": "The contents of the user message." - }, - "role": { - "type": "string", - "enum": [ - "user" - ], - "description": "The role of the messages author, in this case `user`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "An optional name for the participant. Provides the model information to differentiate between participants of the same role." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessage" - } - ], - "description": "Messages sent by an end user, containing prompts or additional context\ninformation.", - "title": "User message", - "x-stainless-naming": { - "go": { - "variant_constructor": "UserMessage" - } - } - }, - "OpenAI.ChatCompletionRequestUserMessageContentPart": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "image_url": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage", - "input_audio": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio", - "file": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile", - "text": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText" - } - } - }, - "OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of the content part.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "The text content." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart" - } - ], - "description": "Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation).", - "title": "Text content part", - "x-stainless-naming": { - "go": { - "variant_constructor": "TextContentPart" - } - } - }, - "OpenAI.ChatCompletionRequestUserMessageContentPartType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "text", - "image_url", - "input_audio", - "file" - ] - } - ] - }, - "OpenAI.ChatCompletionResponseMessage": { - "type": "object", - "required": [ - "content", - "refusal", - "role" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "refusal": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tool_calls": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem" - }, - "annotations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations" - }, - "description": "Annotations for the message, when applicable, as when using the\n [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat)." - }, - "role": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "The role of the author of this message.", - "x-stainless-const": true - }, - "function_call": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall" - } - ], - "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", - "deprecated": true - }, - "audio": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio" - }, - { - "type": "null" - } - ] - }, - "reasoning_content": { - "type": "string", - "description": "An Azure-specific extension property containing generated reasoning content from supported models." - } - }, - "description": "If the audio output modality is requested, this object contains data\nabout the audio response from the model." - }, - "OpenAI.ChatCompletionResponseMessageAnnotations": { - "type": "object", - "required": [ - "type", - "url_citation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "url_citation" - ], - "x-stainless-const": true - }, - "url_citation": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation" - } - } - }, - "OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation": { - "type": "object", - "required": [ - "end_index", - "start_index", - "url", - "title" - ], - "properties": { - "end_index": { - "type": "integer" - }, - "start_index": { - "type": "integer" - }, - "url": { - "type": "string" - }, - "title": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionResponseMessageAudio": { - "type": "object", - "required": [ - "id", - "expires_at", - "data", - "transcript" - ], - "properties": { - "id": { - "type": "string" - }, - "expires_at": { - "type": "integer", - "format": "unixtime" - }, - "data": { - "type": "string" - }, - "transcript": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionResponseMessageFunctionCall": { - "type": "object", - "required": [ - "arguments", - "name" - ], - "properties": { - "arguments": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionStreamOptions": { - "type": "object", - "properties": { - "include_usage": { - "type": "boolean", - "description": "If set, an additional chunk will be streamed before the `data: [DONE]`\n message. The `usage` field on this chunk shows the token usage statistics\n for the entire request, and the `choices` field will always be an empty\n array.\n All other chunks will also include a `usage` field, but with a null\n value. **NOTE:** If the stream is interrupted, you may not receive the\n final usage chunk which contains the total token usage for the request." - }, - "include_obfuscation": { - "type": "boolean", - "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API." - } - }, - "description": "Options for streaming response. Only set this when you set `stream: true`." - }, - "OpenAI.ChatCompletionStreamResponseDelta": { - "type": "object", - "properties": { - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "function_call": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamResponseDeltaFunctionCall" - } - ], - "description": "Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.", - "deprecated": true - }, - "tool_calls": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunk" - } - }, - "role": { - "type": "string", - "enum": [ - "developer", - "system", - "user", - "assistant", - "tool" - ], - "description": "The role of the author of this message." - }, - "refusal": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "reasoning_content": { - "type": "string", - "description": "An Azure-specific extension property containing generated reasoning content from supported models." - } - }, - "description": "A chat completion delta generated by streamed model responses." - }, - "OpenAI.ChatCompletionStreamResponseDeltaFunctionCall": { - "type": "object", - "properties": { - "arguments": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "OpenAI.ChatCompletionTokenLogprob": { - "type": "object", - "required": [ - "token", - "logprob", - "bytes", - "top_logprobs" - ], - "properties": { - "token": { - "type": "string", - "description": "The token." - }, - "logprob": { - "type": "number", - "description": "The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely." - }, - "bytes": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "integer" - } - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs" - }, - "description": "List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned." - } - } - }, - "OpenAI.ChatCompletionTokenLogprobTopLogprobs": { - "type": "object", - "required": [ - "token", - "logprob", - "bytes" - ], - "properties": { - "token": { - "type": "string" - }, - "logprob": { - "type": "number" - }, - "bytes": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "integer" - } - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.ChatCompletionTool": { - "type": "object", - "required": [ - "type", - "function" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of the tool. Currently, only `function` is supported.", - "x-stainless-const": true - }, - "function": { - "$ref": "#/components/schemas/OpenAI.FunctionObject" - } - }, - "description": "A function tool that can be used to generate a response.", - "title": "Function tool" - }, - "OpenAI.ChatCompletionToolChoiceOption": { - "anyOf": [ - { - "type": "string", - "enum": [ - "none", - "auto", - "required" - ] - }, - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice" - }, - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoice" - }, - { - "$ref": "#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom" - } - ], - "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or more tools.\n`required` means the model must call one or more tools.\nSpecifying a particular tool via `{\"type\": \"function\", \"function\": {\"name\": \"my_function\"}}` forces the model to call that tool.\n`none` is the default when no tools are present. `auto` is the default if tools are present.", - "x-stainless-go-variant-constructor": { - "naming": "tool_choice_option_{variant}" - } - }, - "OpenAI.ChunkingStrategyRequestParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParamType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam", - "static": "#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam" - } - }, - "description": "The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty." - }, - "OpenAI.ChunkingStrategyRequestParamType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "auto", - "static" - ] - } - ] - }, - "OpenAI.ChunkingStrategyResponse": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponseType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "static": "#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam", - "other": "#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam" - } - }, - "description": "The strategy used to chunk the file." - }, - "OpenAI.ChunkingStrategyResponseType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "static", - "other" - ] - } - ] - }, - "OpenAI.ClickButtonType": { - "type": "string", - "enum": [ - "left", - "right", - "wheel", - "back", - "forward" - ] - }, - "OpenAI.ClickParam": { - "type": "object", - "required": [ - "type", - "button", - "x", - "y" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "click" - ], - "description": "Specifies the event type. For a click action, this property is always `click`.", - "x-stainless-const": true, - "default": "click" - }, - "button": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ClickButtonType" - } - ], - "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`." - }, - "x": { - "type": "integer", - "description": "The x-coordinate where the click occurred." - }, - "y": { - "type": "integer", - "description": "The y-coordinate where the click occurred." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A click action.", - "title": "Click" - }, - "OpenAI.CodeInterpreterContainerAuto": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "auto" - ], - "description": "Always `auto`.", - "x-stainless-const": true, - "default": "auto" - }, - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 50, - "description": "An optional list of uploaded files to make available to your code." - }, - "memory_limit": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ContainerMemoryLimit" - }, - { - "type": "null" - } - ] - } - }, - "description": "Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on.", - "title": "CodeInterpreterToolAuto", - "x-stainless-naming": { - "go": { - "type_name": "ToolCodeInterpreterContainerCodeInterpreterContainerAuto" - } - } - }, - "OpenAI.CodeInterpreterOutputImage": { - "type": "object", - "required": [ - "type", - "url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image" - ], - "description": "The type of the output. Always `image`.", - "x-stainless-const": true, - "default": "image" - }, - "url": { - "type": "string", - "format": "uri", - "description": "The URL of the image output from the code interpreter." - } - }, - "description": "The image output from the code interpreter.", - "title": "Code interpreter output image" - }, - "OpenAI.CodeInterpreterOutputLogs": { - "type": "object", - "required": [ - "type", - "logs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "logs" - ], - "description": "The type of the output. Always `logs`.", - "x-stainless-const": true, - "default": "logs" - }, - "logs": { - "type": "string", - "description": "The logs output from the code interpreter." - } - }, - "description": "The logs output from the code interpreter.", - "title": "Code interpreter output logs" - }, - "OpenAI.CodeInterpreterTool": { - "type": "object", - "required": [ - "type", - "container" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "code_interpreter" - ], - "description": "The type of the code interpreter tool. Always `code_interpreter`.", - "x-stainless-const": true - }, - "container": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterContainerAuto" - } - ], - "description": "The code interpreter container. Can be a container ID or an object that\n specifies uploaded file IDs to make available to your code, along with an\n optional `memory_limit` setting." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A tool that runs Python code to help generate a response to a prompt.", - "title": "Code interpreter" - }, - "OpenAI.ComparisonFilter": { - "type": "object", - "required": [ - "type", - "key", - "value" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "eq", - "ne", - "gt", - "gte", - "lt", - "lte" - ], - "description": "Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`.\n - `eq`: equals\n - `ne`: not equal\n - `gt`: greater than\n - `gte`: greater than or equal\n - `lt`: less than\n - `lte`: less than or equal\n - `in`: in\n - `nin`: not in", - "default": "eq" - }, - "key": { - "type": "string", - "description": "The key to compare against the value." - }, - "value": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ComparisonFilterValueItems" - } - } - ], - "description": "The value to compare against the attribute key; supports string, number, or boolean types." - } - }, - "description": "A filter used to compare a specified attribute key to a given value using a defined comparison operation.", - "title": "Comparison Filter", - "x-oaiMeta": { - "name": "ComparisonFilter" - } - }, - "OpenAI.ComparisonFilterValueItems": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - } - ] - }, - "OpenAI.CompletionUsage": { - "type": "object", - "required": [ - "completion_tokens", - "prompt_tokens", - "total_tokens" - ], - "properties": { - "completion_tokens": { - "type": "integer", - "description": "Number of tokens in the generated completion." - }, - "prompt_tokens": { - "type": "integer", - "description": "Number of tokens in the prompt." - }, - "total_tokens": { - "type": "integer", - "description": "Total number of tokens used in the request (prompt + completion)." - }, - "completion_tokens_details": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails" - } - ], - "description": "Breakdown of tokens used in a completion." - }, - "prompt_tokens_details": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails" - } - ], - "description": "Breakdown of tokens used in the prompt." - } - }, - "description": "Usage statistics for the completion request." - }, - "OpenAI.CompletionUsageCompletionTokensDetails": { - "type": "object", - "properties": { - "accepted_prediction_tokens": { - "type": "integer" - }, - "audio_tokens": { - "type": "integer" - }, - "reasoning_tokens": { - "type": "integer" - }, - "rejected_prediction_tokens": { - "type": "integer" - } - } - }, - "OpenAI.CompletionUsagePromptTokensDetails": { - "type": "object", - "properties": { - "audio_tokens": { - "type": "integer" - }, - "cached_tokens": { - "type": "integer" - } - } - }, - "OpenAI.CompoundFilter": { - "type": "object", - "required": [ - "type", - "filters" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "and", - "or" - ], - "description": "Type of operation: `and` or `or`." - }, - "filters": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComparisonFilter" - }, - {} - ] - }, - "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`." - } - }, - "description": "Combine multiple filters using `and` or `or`.", - "title": "Compound Filter", - "x-oaiMeta": { - "name": "CompoundFilter" - } - }, - "OpenAI.ComputerAction": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ComputerActionType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "click": "#/components/schemas/OpenAI.ClickParam", - "double_click": "#/components/schemas/OpenAI.DoubleClickAction", - "drag": "#/components/schemas/OpenAI.Drag", - "keypress": "#/components/schemas/OpenAI.KeyPressAction", - "move": "#/components/schemas/OpenAI.Move", - "screenshot": "#/components/schemas/OpenAI.Screenshot", - "scroll": "#/components/schemas/OpenAI.Scroll", - "type": "#/components/schemas/OpenAI.Type", - "wait": "#/components/schemas/OpenAI.Wait" - } - } - }, - "OpenAI.ComputerActionType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "click", - "double_click", - "drag", - "keypress", - "move", - "screenshot", - "scroll", - "type", - "wait" - ] - } - ] - }, - "OpenAI.ComputerCallSafetyCheckParam": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the pending safety check." - }, - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "description": "A pending safety check for the computer call." - }, - "OpenAI.ComputerEnvironment": { - "type": "string", - "enum": [ - "windows", - "mac", - "linux", - "ubuntu", - "browser" - ] - }, - "OpenAI.ComputerScreenshotContent": { - "type": "object", - "required": [ - "type", - "image_url", - "file_id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_screenshot" - ], - "description": "Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`.", - "x-stainless-const": true, - "default": "computer_screenshot" - }, - "image_url": { - "anyOf": [ - { - "type": "string", - "format": "uri" - }, - { - "type": "null" - } - ] - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "description": "A screenshot of a computer.", - "title": "Computer screenshot" - }, - "OpenAI.ComputerScreenshotImage": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_screenshot" - ], - "description": "Specifies the event type. For a computer screenshot, this property is\n always set to `computer_screenshot`.", - "x-stainless-const": true, - "default": "computer_screenshot" - }, - "image_url": { - "type": "string", - "format": "uri", - "description": "The URL of the screenshot image." - }, - "file_id": { - "type": "string", - "description": "The identifier of an uploaded file that contains the screenshot." - } - }, - "description": "A computer screenshot image used with the computer use tool." - }, - "OpenAI.ComputerUsePreviewTool": { - "type": "object", - "required": [ - "type", - "environment", - "display_width", - "display_height" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_use_preview" - ], - "description": "The type of the computer use tool. Always `computer_use_preview`.", - "x-stainless-const": true, - "default": "computer_use_preview" - }, - "environment": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerEnvironment" - } - ], - "description": "The type of computer environment to control." - }, - "display_width": { - "type": "integer", - "description": "The width of the computer display." - }, - "display_height": { - "type": "integer", - "description": "The height of the computer display." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use).", - "title": "Computer use preview" - }, - "OpenAI.ContainerFileCitationBody": { - "type": "object", - "required": [ - "type", - "container_id", - "file_id", - "start_index", - "end_index", - "filename" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "container_file_citation" - ], - "description": "The type of the container file citation. Always `container_file_citation`.", - "x-stainless-const": true, - "default": "container_file_citation" - }, - "container_id": { - "type": "string", - "description": "The ID of the container file." - }, - "file_id": { - "type": "string", - "description": "The ID of the file." - }, - "start_index": { - "type": "integer", - "description": "The index of the first character of the container file citation in the message." - }, - "end_index": { - "type": "integer", - "description": "The index of the last character of the container file citation in the message." - }, - "filename": { - "type": "string", - "description": "The filename of the container file cited." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Annotation" - } - ], - "description": "A citation for a container file used to generate a model response.", - "title": "Container file citation" - }, - "OpenAI.ContainerFileListResource": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object returned, must be 'list'." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ContainerFileResource" - }, - "description": "A list of container files." - }, - "first_id": { - "type": "string", - "description": "The ID of the first file in the list." - }, - "last_id": { - "type": "string", - "description": "The ID of the last file in the list." - }, - "has_more": { - "type": "boolean", - "description": "Whether there are more files available." - } - } - }, - "OpenAI.ContainerFileResource": { - "type": "object", - "required": [ - "id", - "object", - "container_id", - "created_at", - "bytes", - "path", - "source" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the file." - }, - "object": { - "type": "string", - "enum": [ - "container.file" - ], - "description": "The type of this object (`container.file`)." - }, - "container_id": { - "type": "string", - "description": "The container this file belongs to." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) when the file was created." - }, - "bytes": { - "type": "integer", - "description": "Size of the file in bytes." - }, - "path": { - "type": "string", - "description": "Path of the file in the container." - }, - "source": { - "type": "string", - "description": "Source of the file (e.g., `user`, `assistant`)." - } - }, - "title": "The container file object", - "x-oaiMeta": { - "name": "The container file object", - "example": "{\n \"id\": \"cfile_682e0e8a43c88191a7978f477a09bdf5\",\n \"object\": \"container.file\",\n \"created_at\": 1747848842,\n \"bytes\": 880,\n \"container_id\": \"cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04\",\n \"path\": \"/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json\",\n \"source\": \"user\"\n}\n" - } - }, - "OpenAI.ContainerListResource": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object returned, must be 'list'." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ContainerResource" - }, - "description": "A list of containers." - }, - "first_id": { - "type": "string", - "description": "The ID of the first container in the list." - }, - "last_id": { - "type": "string", - "description": "The ID of the last container in the list." - }, - "has_more": { - "type": "boolean", - "description": "Whether there are more containers available." - } - } - }, - "OpenAI.ContainerMemoryLimit": { - "type": "string", - "enum": [ - "1g", - "4g", - "16g", - "64g" - ] - }, - "OpenAI.ContainerResource": { - "type": "object", - "required": [ - "id", - "object", - "name", - "created_at", - "status" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the container." - }, - "object": { - "type": "string", - "description": "The type of this object." - }, - "name": { - "type": "string", - "description": "Name of the container." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) when the container was created." - }, - "status": { - "type": "string", - "description": "Status of the container (e.g., active, deleted)." - }, - "last_active_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) when the container was last active." - }, - "expires_after": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ContainerResourceExpiresAfter" - } - ], - "description": "The container will expire after this time period.\n The anchor is the reference point for the expiration.\n The minutes is the number of minutes after the anchor before the container expires." - }, - "memory_limit": { - "type": "string", - "enum": [ - "1g", - "4g", - "16g", - "64g" - ], - "description": "The memory limit configured for the container." - } - }, - "title": "The container object", - "x-oaiMeta": { - "name": "The container object", - "example": "{\n \"id\": \"cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863\",\n \"object\": \"container\",\n \"created_at\": 1747844794,\n \"status\": \"running\",\n \"expires_after\": {\n \"anchor\": \"last_active_at\",\n \"minutes\": 20\n },\n \"last_active_at\": 1747844794,\n \"memory_limit\": \"1g\",\n \"name\": \"My Container\"\n}\n" - } - }, - "OpenAI.ContainerResourceExpiresAfter": { - "type": "object", - "properties": { - "anchor": { - "type": "string", - "enum": [ - "last_active_at" - ] - }, - "minutes": { - "type": "integer" - } - } - }, - "OpenAI.ConversationItem": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ConversationItemType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "message": "#/components/schemas/OpenAI.ConversationItemMessage", - "function_call": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallResource", - "function_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutputResource", - "file_search_call": "#/components/schemas/OpenAI.ConversationItemFileSearchToolCall", - "web_search_call": "#/components/schemas/OpenAI.ConversationItemWebSearchToolCall", - "image_generation_call": "#/components/schemas/OpenAI.ConversationItemImageGenToolCall", - "computer_call": "#/components/schemas/OpenAI.ConversationItemComputerToolCall", - "computer_call_output": "#/components/schemas/OpenAI.ConversationItemComputerToolCallOutputResource", - "reasoning": "#/components/schemas/OpenAI.ConversationItemReasoningItem", - "code_interpreter_call": "#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall", - "local_shell_call": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCall", - "local_shell_call_output": "#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput", - "shell_call": "#/components/schemas/OpenAI.ConversationItemFunctionShellCall", - "shell_call_output": "#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput", - "apply_patch_call": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall", - "apply_patch_call_output": "#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput", - "mcp_list_tools": "#/components/schemas/OpenAI.ConversationItemMcpListTools", - "mcp_approval_request": "#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource", - "mcp_call": "#/components/schemas/OpenAI.ConversationItemMcpToolCall", - "custom_tool_call": "#/components/schemas/OpenAI.ConversationItemCustomToolCall", - "custom_tool_call_output": "#/components/schemas/OpenAI.ConversationItemCustomToolCallOutput" - } - }, - "description": "A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output).", - "title": "Conversation item" - }, - "OpenAI.ConversationItemApplyPatchToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "status", - "operation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch_call" - ], - "description": "The type of the item. Always `apply_patch_call`.", - "x-stainless-const": true, - "default": "apply_patch_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the apply patch tool call generated by the model." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus" - } - ], - "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." - }, - "operation": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" - } - ], - "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A tool call that applies file diffs by creating, deleting, or updating files.", - "title": "Apply patch tool call" - }, - "OpenAI.ConversationItemApplyPatchToolCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch_call_output" - ], - "description": "The type of the item. Always `apply_patch_call_output`.", - "x-stainless-const": true, - "default": "apply_patch_call_output" - }, - "id": { - "type": "string", - "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the apply patch tool call generated by the model." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus" - } - ], - "description": "The status of the apply patch tool call output. One of `completed` or `failed`." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call output." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "The output emitted by an apply patch tool call.", - "title": "Apply patch tool call output" - }, - "OpenAI.ConversationItemCodeInterpreterToolCall": { - "type": "object", - "required": [ - "type", - "id", - "status", - "container_id", - "code", - "outputs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "code_interpreter_call" - ], - "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.", - "x-stainless-const": true, - "default": "code_interpreter_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the code interpreter tool call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete", - "interpreting", - "failed" - ], - "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." - }, - "container_id": { - "type": "string", - "description": "The ID of the container used to run the code." - }, - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "outputs": { - "anyOf": [ - { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs" - }, - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage" - } - ] - } - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A tool call to run code.", - "title": "Code interpreter tool call" - }, - "OpenAI.ConversationItemComputerToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "pending_safety_checks", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_call" - ], - "description": "The type of the computer call. Always `computer_call`.", - "default": "computer_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the computer call." - }, - "call_id": { - "type": "string", - "description": "An identifier used when responding to the tool call with output." - }, - "action": { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - }, - "pending_safety_checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" - }, - "description": "The pending safety checks for the computer call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.", - "title": "Computer tool call" - }, - "OpenAI.ConversationItemComputerToolCallOutputResource": { - "type": "object", - "required": [ - "type", - "call_id", - "output" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_call_output" - ], - "description": "The type of the computer tool call output. Always `computer_call_output`.", - "x-stainless-const": true, - "default": "computer_call_output" - }, - "id": { - "type": "string", - "description": "The ID of the computer tool call output." - }, - "call_id": { - "type": "string", - "description": "The ID of the computer tool call that produced the output." - }, - "acknowledged_safety_checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" - }, - "description": "The safety checks reported by the API that have been acknowledged by the\n developer." - }, - "output": { - "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage" - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ] - }, - "OpenAI.ConversationItemCustomToolCall": { - "type": "object", - "required": [ - "type", - "call_id", - "name", - "input" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom_tool_call" - ], - "description": "The type of the custom tool call. Always `custom_tool_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the custom tool call in the OpenAI platform." - }, - "call_id": { - "type": "string", - "description": "An identifier used to map this custom tool call to a tool call output." - }, - "name": { - "type": "string", - "description": "The name of the custom tool being called." - }, - "input": { - "type": "string", - "description": "The input for the custom tool call generated by the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A call to a custom tool created by the model.", - "title": "Custom tool call" - }, - "OpenAI.ConversationItemCustomToolCallOutput": { - "type": "object", - "required": [ - "type", - "call_id", - "output" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom_tool_call_output" - ], - "description": "The type of the custom tool call output. Always `custom_tool_call_output`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the custom tool call output in the OpenAI platform." - }, - "call_id": { - "type": "string", - "description": "The call ID, used to map this custom tool call output to a custom tool call." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" - } - } - ], - "description": "The output from the custom tool call generated by your code.\n Can be a string or an list of output content." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "The output of a custom tool call from your code, being sent back to the model.", - "title": "Custom tool call output" - }, - "OpenAI.ConversationItemFileSearchToolCall": { - "type": "object", - "required": [ - "id", - "type", - "status", - "queries" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the file search tool call." - }, - "type": { - "type": "string", - "enum": [ - "file_search_call" - ], - "description": "The type of the file search tool call. Always `file_search_call`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "searching", - "completed", - "incomplete", - "failed" - ], - "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`," - }, - "queries": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The queries used to search for files." - }, - "results": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults" - } - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.", - "title": "File search tool call" - }, - "OpenAI.ConversationItemFunctionShellCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell_call" - ], - "description": "The type of the item. Always `shell_call`.", - "x-stainless-const": true, - "default": "shell_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the shell tool call. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the shell tool call generated by the model." - }, - "action": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionShellAction" - } - ], - "description": "The shell commands and limits that describe how to run the tool call." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.LocalShellCallStatus" - } - ], - "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A tool call that executes one or more shell commands in a managed environment.", - "title": "Shell tool call" - }, - "OpenAI.ConversationItemFunctionShellCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "output", - "max_output_length" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell_call_output" - ], - "description": "The type of the shell call output. Always `shell_call_output`.", - "x-stainless-const": true, - "default": "shell_call_output" - }, - "id": { - "type": "string", - "description": "The unique ID of the shell call output. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the shell tool call generated by the model." - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent" - }, - "description": "An array of shell call output contents" - }, - "max_output_length": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "created_by": { - "type": "string", - "description": "The identifier of the actor that created the item." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "The output of a shell tool call that was emitted.", - "title": "Shell call output" - }, - "OpenAI.ConversationItemFunctionToolCallOutputResource": { - "type": "object", - "required": [ - "type", - "call_id", - "output" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API." - }, - "type": { - "type": "string", - "enum": [ - "function_call_output" - ], - "description": "The type of the function tool call output. Always `function_call_output`.", - "x-stainless-const": true - }, - "call_id": { - "type": "string", - "description": "The unique ID of the function tool call generated by the model." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" - } - } - ], - "description": "The output from the function call generated by your code.\n Can be a string or an list of output content." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ] - }, - "OpenAI.ConversationItemFunctionToolCallResource": { - "type": "object", - "required": [ - "type", - "call_id", - "name", - "arguments" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the function tool call." - }, - "type": { - "type": "string", - "enum": [ - "function_call" - ], - "description": "The type of the function tool call. Always `function_call`.", - "x-stainless-const": true - }, - "call_id": { - "type": "string", - "description": "The unique ID of the function tool call generated by the model." - }, - "name": { - "type": "string", - "description": "The name of the function to run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of the arguments to pass to the function." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ] - }, - "OpenAI.ConversationItemImageGenToolCall": { - "type": "object", - "required": [ - "type", - "id", - "status", - "result" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_generation_call" - ], - "description": "The type of the image generation call. Always `image_generation_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the image generation call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "generating", - "failed" - ], - "description": "The status of the image generation call." - }, - "result": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "An image generation request made by the model.", - "title": "Image generation call" - }, - "OpenAI.ConversationItemList": { - "type": "object", - "required": [ - "object", - "data", - "has_more", - "first_id", - "last_id" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object returned, must be `list`.", - "x-stainless-const": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - }, - "description": "A list of conversation items." - }, - "has_more": { - "type": "boolean", - "description": "Whether there are more items available." - }, - "first_id": { - "type": "string", - "description": "The ID of the first item in the list." - }, - "last_id": { - "type": "string", - "description": "The ID of the last item in the list." - } - }, - "description": "A list of Conversation items.", - "title": "The conversation item list", - "x-oaiMeta": { - "name": "The item list", - "group": "conversations" - } - }, - "OpenAI.ConversationItemLocalShellToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local_shell_call" - ], - "description": "The type of the local shell call. Always `local_shell_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the local shell call." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the local shell tool call generated by the model." - }, - "action": { - "$ref": "#/components/schemas/OpenAI.LocalShellExecAction" - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the local shell call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A tool call to run a command on the local shell.", - "title": "Local shell call" - }, - "OpenAI.ConversationItemLocalShellToolCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "output" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local_shell_call_output" - ], - "description": "The type of the local shell tool call output. Always `local_shell_call_output`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the local shell tool call generated by the model." - }, - "output": { - "type": "string", - "description": "A JSON string of the output of the local shell tool call." - }, - "status": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ] - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "The output of a local shell tool call.", - "title": "Local shell call output" - }, - "OpenAI.ConversationItemMcpApprovalRequest": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "name", - "arguments" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_approval_request" - ], - "description": "The type of the item. Always `mcp_approval_request`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the approval request." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server making the request." - }, - "name": { - "type": "string", - "description": "The name of the tool to run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of arguments for the tool." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A request for human approval of a tool invocation.", - "title": "MCP approval request" - }, - "OpenAI.ConversationItemMcpApprovalResponseResource": { - "type": "object", - "required": [ - "type", - "id", - "approval_request_id", - "approve" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_approval_response" - ], - "description": "The type of the item. Always `mcp_approval_response`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the approval response" - }, - "approval_request_id": { - "type": "string", - "description": "The ID of the approval request being answered." - }, - "approve": { - "type": "boolean", - "description": "Whether the request was approved." - }, - "reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A response to an MCP approval request.", - "title": "MCP approval response" - }, - "OpenAI.ConversationItemMcpListTools": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "tools" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_list_tools" - ], - "description": "The type of the item. Always `mcp_list_tools`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the list." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.MCPListToolsTool" - }, - "description": "The tools available on the server." - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A list of tools available on an MCP server.", - "title": "MCP list tools" - }, - "OpenAI.ConversationItemMcpToolCall": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "name", - "arguments" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_call" - ], - "description": "The type of the item. Always `mcp_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the tool call." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server running the tool." - }, - "name": { - "type": "string", - "description": "The name of the tool that was run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of the arguments passed to the tool." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus" - } - ], - "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`." - }, - "approval_request_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "An invocation of a tool on an MCP server.", - "title": "MCP tool call" - }, - "OpenAI.ConversationItemMessage": { - "type": "object", - "required": [ - "type", - "id", - "status", - "role", - "content" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "message" - ], - "description": "The type of the message. Always set to `message`.", - "x-stainless-const": true, - "default": "message" - }, - "id": { - "type": "string", - "description": "The unique ID of the message." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageStatus" - } - ], - "description": "The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API." - }, - "role": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageRole" - } - ], - "description": "The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`." - }, - "content": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputTextContent" - }, - { - "$ref": "#/components/schemas/OpenAI.OutputTextContent" - }, - { - "$ref": "#/components/schemas/OpenAI.TextContent" - }, - { - "$ref": "#/components/schemas/OpenAI.SummaryTextContent" - }, - { - "$ref": "#/components/schemas/OpenAI.ReasoningTextContent" - }, - { - "$ref": "#/components/schemas/OpenAI.RefusalContent" - }, - { - "$ref": "#/components/schemas/OpenAI.InputImageContent" - }, - { - "$ref": "#/components/schemas/OpenAI.ComputerScreenshotContent" - }, - { - "$ref": "#/components/schemas/OpenAI.InputFileContent" - } - ] - }, - "description": "The content of the message" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A message to or from the model.", - "title": "Message" - }, - "OpenAI.ConversationItemReasoningItem": { - "type": "object", - "required": [ - "type", - "id", - "summary" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "reasoning" - ], - "description": "The type of the object. Always `reasoning`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique identifier of the reasoning content." - }, - "encrypted_content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "summary": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Summary" - }, - "description": "Reasoning summary content." - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ReasoningTextContent" - }, - "description": "Reasoning text content." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state).", - "title": "Reasoning" - }, - "OpenAI.ConversationItemType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "message", - "function_call", - "function_call_output", - "file_search_call", - "web_search_call", - "image_generation_call", - "computer_call", - "computer_call_output", - "reasoning", - "code_interpreter_call", - "local_shell_call", - "local_shell_call_output", - "shell_call", - "shell_call_output", - "apply_patch_call", - "apply_patch_call_output", - "mcp_list_tools", - "mcp_approval_request", - "mcp_approval_response", - "mcp_call", - "custom_tool_call", - "custom_tool_call_output" - ] - } - ] - }, - "OpenAI.ConversationItemWebSearchToolCall": { - "type": "object", - "required": [ - "id", - "type", - "status", - "action" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the web search tool call." - }, - "type": { - "type": "string", - "enum": [ - "web_search_call" - ], - "description": "The type of the web search tool call. Always `web_search_call`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "searching", - "completed", - "failed" - ], - "description": "The status of the web search tool call." - }, - "action": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch" - }, - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage" - }, - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionFind" - } - ], - "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find)." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationItem" - } - ], - "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.", - "title": "Web search tool call" - }, - "OpenAI.ConversationParam": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/OpenAI.ConversationParam-2" - } - ], - "description": "The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request.\nInput items and output items from this response are automatically added to this conversation after this response completes." - }, - "OpenAI.ConversationParam-2": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the conversation." - } - }, - "description": "The conversation that this response belongs to.", - "title": "Conversation object" - }, - "OpenAI.ConversationReference": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the conversation that this response was associated with." - } - }, - "description": "The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation.", - "title": "Conversation" - }, - "OpenAI.ConversationResource": { - "type": "object", - "required": [ - "id", - "object", - "metadata", - "created_at" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the conversation." - }, - "object": { - "type": "string", - "enum": [ - "conversation" - ], - "description": "The object type, which is always `conversation`.", - "x-stainless-const": true, - "default": "conversation" - }, - "metadata": { - "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The time at which the conversation was created, measured in seconds since the Unix epoch." - } - } - }, - "OpenAI.CreateChatCompletionRequestAudio": { - "type": "object", - "required": [ - "voice", - "format" - ], - "properties": { - "voice": { - "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" - }, - "format": { - "type": "string", - "enum": [ - "wav", - "aac", - "mp3", - "flac", - "opus", - "pcm16" - ] - } - } - }, - "OpenAI.CreateChatCompletionRequestResponseFormat": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "json_schema": "#/components/schemas/OpenAI.ResponseFormatJsonSchema", - "text": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText", - "json_object": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject" - } - }, - "description": "An object specifying the format that the model must output.\nSetting to `{ \"type\": \"json_schema\", \"json_schema\": {...} }` enables\nStructured Outputs which ensures the model will match your supplied JSON\nschema. Learn more in the [Structured Outputs\nguide](https://platform.openai.com/docs/guides/structured-outputs).\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it." - }, - "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "json_object" - ], - "description": "The type of response format being defined. Always `json_object`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" - } - ], - "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.", - "title": "JSON object" - }, - "OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of response format being defined. Always `text`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" - } - ], - "description": "Default response format. Used to generate text responses.", - "title": "Text" - }, - "OpenAI.CreateChatCompletionRequestResponseFormatType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "text", - "json_schema", - "json_object" - ] - } - ] - }, - "OpenAI.CreateChatCompletionResponseChoices": { - "type": "object", - "required": [ - "finish_reason", - "index", - "message", - "logprobs" - ], - "properties": { - "finish_reason": { - "type": "string", - "enum": [ - "stop", - "length", - "tool_calls", - "content_filter", - "function_call" - ] - }, - "index": { - "type": "integer" - }, - "message": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionResponseMessage" - }, - "logprobs": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs" - }, - { - "type": "null" - } - ] - }, - "content_filter_results": { - "$ref": "#/components/schemas/AzureContentFilterResultForChoice" - } - } - }, - "OpenAI.CreateChatCompletionResponseChoicesLogprobs": { - "type": "object", - "required": [ - "content", - "refusal" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" - } - }, - { - "type": "null" - } - ] - }, - "refusal": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" - } - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateChatCompletionStreamResponseChoices": { - "type": "object", - "required": [ - "delta", - "finish_reason", - "index" - ], - "properties": { - "delta": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta" - }, - "logprobs": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs" - }, - { - "type": "null" - } - ] - }, - "finish_reason": { - "anyOf": [ - { - "type": "string", - "enum": [ - "stop", - "length", - "tool_calls", - "content_filter", - "function_call" - ] - }, - { - "type": "null" - } - ] - }, - "index": { - "type": "integer" - } - } - }, - "OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs": { - "type": "object", - "required": [ - "content", - "refusal" - ], - "properties": { - "content": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" - } - }, - { - "type": "null" - } - ] - }, - "refusal": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTokenLogprob" - } - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateCompletionResponseChoices": { - "type": "object", - "required": [ - "finish_reason", - "index", - "logprobs", - "text" - ], - "properties": { - "finish_reason": { - "type": "string", - "enum": [ - "stop", - "length", - "content_filter" - ] - }, - "index": { - "type": "integer", - "format": "int32" - }, - "logprobs": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs" - }, - { - "type": "null" - } - ] - }, - "text": { - "type": "string" - }, - "content_filter_results": { - "$ref": "#/components/schemas/AzureContentFilterResultForChoice" - } - } - }, - "OpenAI.CreateCompletionResponseChoicesLogprobs": { - "type": "object", - "properties": { - "text_offset": { - "type": "array", - "items": { - "type": "integer", - "format": "int32" - } - }, - "token_logprobs": { - "type": "array", - "items": { - "type": "number", - "format": "float" - } - }, - "tokens": { - "type": "array", - "items": { - "type": "string" - } - }, - "top_logprobs": { - "type": "array", - "items": { - "type": "object", - "unevaluatedProperties": { - "type": "number", - "format": "float" - } - } - } - } - }, - "OpenAI.CreateContainerBody": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string", - "description": "Name of the container to create." - }, - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "IDs of files to copy to the container." - }, - "expires_after": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter" - } - ], - "description": "Container expiration time in seconds relative to the 'anchor' time." - }, - "memory_limit": { - "type": "string", - "enum": [ - "1g", - "4g", - "16g", - "64g" - ], - "description": "Optional memory limit for the container. Defaults to \"1g\"." - } - } - }, - "OpenAI.CreateContainerBodyExpiresAfter": { - "type": "object", - "required": [ - "anchor", - "minutes" - ], - "properties": { - "anchor": { - "type": "string", - "enum": [ - "last_active_at" - ] - }, - "minutes": { - "type": "integer" - } - } - }, - "OpenAI.CreateContainerFileBody": { - "type": "object", - "properties": { - "file_id": { - "type": "string", - "description": "Name of the file to create." - }, - "file": { - "description": "The File object (not file name) to be uploaded." - } - }, - "required": [] - }, - "OpenAI.CreateConversationBody": { - "type": "object", - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "items": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateConversationItemsParametersBody": { - "type": "object", - "required": [ - "items" - ], - "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - }, - "maxItems": 20 - } - } - }, - "OpenAI.CreateEmbeddingRequest": { - "type": "object", - "required": [ - "input", - "model" - ], - "properties": { - "input": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "array", - "items": { - "type": "integer" - } - }, - { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "integer" - } - } - } - ], - "description": "Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request." - }, - "model": { - "type": "string", - "description": "ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them.", - "x-oaiTypeLabel": "string" - }, - "encoding_format": { - "type": "string", - "enum": [ - "float", - "base64" - ], - "description": "The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/).", - "default": "float" - }, - "dimensions": { - "type": "integer", - "minimum": 1, - "description": "The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models." - }, - "user": { - "type": "string", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." - } - } - }, - "OpenAI.CreateEmbeddingResponse": { - "type": "object", - "required": [ - "data", - "model", - "object", - "usage" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Embedding" - }, - "description": "The list of embeddings generated by the model." - }, - "model": { - "type": "string", - "description": "The name of the model used to generate the embedding." - }, - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The object type, which is always \"list\".", - "x-stainless-const": true - }, - "usage": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEmbeddingResponseUsage" - } - ], - "description": "The usage information for the request." - } - } - }, - "OpenAI.CreateEmbeddingResponseUsage": { - "type": "object", - "required": [ - "prompt_tokens", - "total_tokens" - ], - "properties": { - "prompt_tokens": { - "type": "integer" - }, - "total_tokens": { - "type": "integer" - } - } - }, - "OpenAI.CreateEvalCompletionsRunDataSource": { - "type": "object", - "required": [ - "type", - "source" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "completions" - ], - "description": "The type of run data source. Always `completions`.", - "default": "completions" - }, - "input_messages": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference" - } - ], - "description": "Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace." - }, - "sampling_params": { - "$ref": "#/components/schemas/AzureCompletionsSamplingParams" - }, - "model": { - "type": "string", - "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")." - }, - "source": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsSource" - } - ], - "description": "Determines what populates the `item` namespace in this run's data source." - } - }, - "description": "A CompletionsRunDataSource object describing a model sampling configuration.", - "title": "CompletionsRunDataSource", - "x-oaiMeta": { - "name": "The completions data source object used to configure an individual run", - "group": "eval runs", - "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"completions\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n" - } - }, - "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference": { - "type": "object", - "required": [ - "type", - "item_reference" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "item_reference" - ] - }, - "item_reference": { - "type": "string" - } - } - }, - "OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate": { - "type": "object", - "required": [ - "type", - "template" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "template" - ] - }, - "template": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EasyInputMessage" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalItem" - } - ] - } - } - } - }, - "OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams": { - "type": "object", - "properties": { - "reasoning_effort": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - } - ], - "description": "Controls the level of reasoning effort applied during generation." - }, - "temperature": { - "type": "number", - "description": "A higher temperature increases randomness in the outputs.", - "default": 1 - }, - "max_completion_tokens": { - "type": "integer" - }, - "top_p": { - "type": "number", - "description": "An alternative to temperature for nucleus sampling; 1.0 includes all tokens.", - "default": 1 - }, - "seed": { - "type": "integer", - "description": "A seed value initializes the randomness during sampling.", - "default": 42 - }, - "response_format": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatText" - }, - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchema" - }, - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonObject" - } - ] - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionTool" - } - } - } - }, - "OpenAI.CreateEvalCustomDataSourceConfig": { - "type": "object", - "required": [ - "type", - "item_schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "The type of data source. Always `custom`.", - "x-stainless-const": true, - "default": "custom" - }, - "item_schema": { - "type": "object", - "unevaluatedProperties": {}, - "description": "The json schema for each row in the data source." - }, - "include_sample_schema": { - "type": "boolean", - "description": "Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source)" - } - }, - "description": "A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs.\nThis schema is used to define the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run", - "title": "CustomDataSourceConfig", - "x-oaiMeta": { - "name": "The eval file data source config object", - "group": "evals", - "example": "{\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\"type\": \"string\"},\n \"age\": {\"type\": \"integer\"}\n },\n \"required\": [\"name\", \"age\"]\n },\n \"include_sample_schema\": true\n}\n" - } - }, - "OpenAI.CreateEvalItem": { - "type": "object", - "required": [ - "role", - "content" - ], - "properties": { - "role": { - "type": "string", - "description": "The role of the message (e.g. \"system\", \"assistant\", \"user\")." - }, - "content": { - "type": "string", - "description": "The content of the message." - } - }, - "description": "A chat message that makes up the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}.", - "title": "SimpleInputMessage", - "x-oaiMeta": { - "name": "The chat message object used to configure an individual run" - } - }, - "OpenAI.CreateEvalJsonlRunDataSource": { - "type": "object", - "required": [ - "type", - "source" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "jsonl" - ], - "description": "The type of data source. Always `jsonl`.", - "x-stainless-const": true, - "default": "jsonl" - }, - "source": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource" - } - ], - "description": "Determines what populates the `item` namespace in the data source." - } - }, - "description": "A JsonlRunDataSource object with that specifies a JSONL file that matches the eval", - "title": "JsonlRunDataSource", - "x-oaiMeta": { - "name": "The file data source object for the eval run configuration", - "group": "evals", - "example": "{\n \"type\": \"jsonl\",\n \"source\": {\n \"type\": \"file_id\",\n \"id\": \"file-9GYS6xbkWgWhmE7VoLUWFg\"\n }\n}\n" - } - }, - "OpenAI.CreateEvalLabelModelGrader": { - "type": "object", - "required": [ - "type", - "name", - "model", - "input", - "labels", - "passing_labels" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "label_model" - ], - "description": "The object type, which is always `label_model`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "model": { - "type": "string", - "description": "The model to use for the evaluation. Must support structured outputs." - }, - "input": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateEvalItem" - }, - "description": "A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}." - }, - "labels": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The labels to classify to each item in the evaluation." - }, - "passing_labels": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The labels that indicate a passing result. Must be a subset of labels." - } - }, - "description": "A LabelModelGrader object which uses a model to assign labels to each item\nin the evaluation.", - "title": "LabelModelGrader", - "x-oaiMeta": { - "name": "The eval label model grader object", - "group": "evals", - "example": "{\n \"type\": \"label_model\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'\"\n },\n {\n \"role\": \"user\",\n \"content\": \"Statement: {{item.response}}\"\n }\n ],\n \"passing_labels\": [\"positive\"],\n \"labels\": [\"positive\", \"neutral\", \"negative\"],\n \"name\": \"Sentiment label grader\"\n}\n" - } - }, - "OpenAI.CreateEvalLogsDataSourceConfig": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "logs" - ], - "description": "The type of data source. Always `logs`.", - "x-stainless-const": true, - "default": "logs" - }, - "metadata": { - "type": "object", - "unevaluatedProperties": {}, - "description": "Metadata filters for the logs data source." - } - }, - "description": "A data source config which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.", - "title": "LogsDataSourceConfig", - "x-oaiMeta": { - "name": "The logs data source object for evals", - "group": "evals", - "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n" - } - }, - "OpenAI.CreateEvalResponsesRunDataSource": { - "type": "object", - "required": [ - "type", - "source" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "responses" - ], - "description": "The type of run data source. Always `responses`.", - "default": "responses" - }, - "input_messages": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference" - } - ], - "description": "Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace." - }, - "sampling_params": { - "$ref": "#/components/schemas/AzureResponsesSamplingParams" - }, - "model": { - "type": "string", - "description": "The name of the model to use for generating completions (e.g. \"o3-mini\")." - }, - "source": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSource" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileIdSource" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalResponsesSource" - } - ], - "description": "Determines what populates the `item` namespace in this run's data source." - } - }, - "description": "A ResponsesRunDataSource object describing a model sampling configuration.", - "title": "CreateEvalResponsesRunDataSource", - "x-oaiMeta": { - "name": "The completions data source object used to configure an individual run", - "group": "eval runs", - "example": "{\n \"name\": \"gpt-4o-mini-2024-07-18\",\n \"data_source\": {\n \"type\": \"responses\",\n \"input_messages\": {\n \"type\": \"item_reference\",\n \"item_reference\": \"item.input\"\n },\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"source\": {\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\"\n }\n }\n}\n" - } - }, - "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference": { - "type": "object", - "required": [ - "type", - "item_reference" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "item_reference" - ] - }, - "item_reference": { - "type": "string" - } - } - }, - "OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate": { - "type": "object", - "required": [ - "type", - "template" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "template" - ] - }, - "template": { - "type": "array", - "items": { - "anyOf": [ - { - "type": "object", - "properties": { - "role": { - "type": "string" - }, - "content": { - "type": "string" - } - }, - "required": [ - "role", - "content" - ] - }, - { - "$ref": "#/components/schemas/OpenAI.EvalItem" - } - ] - } - } - } - }, - "OpenAI.CreateEvalResponsesRunDataSourceSamplingParams": { - "type": "object", - "properties": { - "reasoning_effort": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - } - ], - "description": "Controls the level of reasoning effort applied during generation." - }, - "temperature": { - "type": "number", - "description": "A higher temperature increases randomness in the outputs.", - "default": 1 - }, - "top_p": { - "type": "number", - "description": "An alternative to temperature for nucleus sampling; 1.0 includes all tokens.", - "default": 1 - }, - "seed": { - "type": "integer", - "description": "A seed value initializes the randomness during sampling.", - "default": 42 - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Tool" - } - }, - "text": { - "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText" - } - } - }, - "OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText": { - "type": "object", - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" - } - } - }, - "OpenAI.CreateEvalRunRequest": { - "type": "object", - "required": [ - "data_source" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the run." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "data_source": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource" - } - ], - "description": "Details about the run's data source." - } - }, - "title": "CreateEvalRunRequest" - }, - "OpenAI.CreateEvalStoredCompletionsDataSourceConfig": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "stored_completions" - ], - "description": "The type of data source. Always `stored_completions`.", - "x-stainless-const": true, - "default": "stored_completions" - }, - "metadata": { - "type": "object", - "unevaluatedProperties": {}, - "description": "Metadata filters for the stored completions data source." - } - }, - "description": "Deprecated in favor of LogsDataSourceConfig.", - "title": "StoredCompletionsDataSourceConfig", - "deprecated": true, - "x-oaiMeta": { - "name": "The stored completions data source object for evals", - "group": "evals", - "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"use_case\": \"customer_support_agent\"\n }\n}\n" - } - }, - "OpenAI.CreateFileRequest": { - "type": "object", - "properties": { - "file": { - "description": "The File object (not file name) to be uploaded.", - "x-oaiMeta": { - "exampleFilePath": "fine-tune.jsonl" - } - }, - "expires_after": { - "type": "object", - "properties": { - "seconds": { - "type": "integer", - "format": "int32" - }, - "anchor": { - "$ref": "#/components/schemas/AzureFileExpiryAnchor" - } - }, - "required": [ - "seconds", - "anchor" - ] - }, - "purpose": { - "type": "string", - "enum": [ - "assistants", - "batch", - "fine-tune", - "evals" - ], - "description": "The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `evals`: Used for eval data sets" - } - }, - "required": [ - "file", - "expires_after", - "purpose" - ] - }, - "OpenAI.CreateFineTuningCheckpointPermissionRequest": { - "type": "object", - "required": [ - "project_ids" - ], - "properties": { - "project_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The project identifiers to grant access to." - } - } - }, - "OpenAI.CreateFineTuningJobRequest": { - "type": "object", - "required": [ - "model", - "training_file" - ], - "properties": { - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "babbage-002", - "davinci-002", - "gpt-3.5-turbo", - "gpt-4o-mini" - ] - } - ], - "description": "The name of the model to fine-tune. You can select one of the\n [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned).", - "x-oaiTypeLabel": "string" - }, - "training_file": { - "type": "string", - "description": "The ID of an uploaded file that contains training data.\n See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file.\n Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`.\n The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format.\n See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details." - }, - "hyperparameters": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters" - } - ], - "description": "The hyperparameters used for the fine-tuning job.\n This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter.", - "deprecated": true - }, - "suffix": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "minLength": 1, - "maxLength": 64, - "description": "A string of up to 64 characters that will be added to your fine-tuned model name.\n For example, a `suffix` of \"custom-model-name\" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`." - }, - "validation_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The ID of an uploaded file that contains validation data.\n If you provide this file, the data is used to generate validation\n metrics periodically during fine-tuning. These metrics can be viewed in\n the fine-tuning results file.\n The same data should not be present in both train and validation files.\n Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`.\n See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details." - }, - "integrations": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations" - } - }, - { - "type": "null" - } - ], - "description": "A list of integrations to enable for your fine-tuning job." - }, - "seed": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 2147483647, - "description": "The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases.\n If a seed is not specified, one will be generated for you." - }, - "method": { - "$ref": "#/components/schemas/OpenAI.FineTuneMethod" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateFineTuningJobRequestHyperparameters": { - "type": "object", - "properties": { - "batch_size": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "default": "auto" - }, - "learning_rate_multiplier": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ] - }, - "n_epochs": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "default": "auto" - } - } - }, - "OpenAI.CreateFineTuningJobRequestIntegrations": { - "type": "object", - "required": [ - "type", - "wandb" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "wandb" - ], - "x-stainless-const": true - }, - "wandb": { - "$ref": "#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb" - } - } - }, - "OpenAI.CreateFineTuningJobRequestIntegrationsWandb": { - "type": "object", - "required": [ - "project" - ], - "properties": { - "project": { - "type": "string" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "entity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "OpenAI.CreateImageEditRequest": { - "type": "object", - "required": [ - "image", - "prompt" - ], - "properties": { - "image": { - "type": "object", - "description": "The image(s) to edit. Must be a supported image file or an array of images.\n For the GPT image models (`gpt-image-1`, `gpt-image-1-mini`, and `gpt-image-1.5`), each image should be a `png`, `webp`, or `jpg`\n file less than 50MB. You can provide up to 16 images.\n For `dall-e-2`, you can only provide one image, and it should be a square\n `png` file less than 4MB.", - "x-oaiMeta": { - "exampleFilePath": "otter.png" - } - }, - "prompt": { - "type": "object", - "description": "A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for the GPT image models." - }, - "mask": { - "type": "object", - "description": "An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`.", - "x-oaiMeta": { - "exampleFilePath": "mask.png" - } - }, - "background": { - "type": "object", - "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`." - }, - "model": { - "type": "string", - "description": "The model to use for image generation. Only `dall-e-2` and the GPT image models are supported. Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.", - "x-oaiTypeLabel": "string" - }, - "n": { - "type": "object", - "description": "The number of images to generate. Must be between 1 and 10." - }, - "size": { - "type": "object", - "description": "The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`." - }, - "response_format": { - "type": "object", - "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as the GPT image models always return base64-encoded images." - }, - "output_format": { - "type": "object", - "description": "The format in which the generated images are returned. This parameter is\n only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.\n The default value is `png`." - }, - "output_compression": { - "type": "object", - "description": "The compression level (0-100%) for the generated images. This parameter\n is only supported for the GPT image models with the `webp` or `jpeg` output\n formats, and defaults to 100." - }, - "user": { - "type": "object", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." - }, - "input_fidelity": { - "type": "object" - }, - "stream": { - "type": "object", - "description": "Edit the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information." - }, - "partial_images": { - "type": "object" - }, - "quality": { - "type": "object", - "description": "The quality of the image that will be generated. `high`, `medium` and `low` are only supported for the GPT image models. `dall-e-2` only supports `standard` quality. Defaults to `auto`." - } - } - }, - "OpenAI.CreateImageRequest": { - "type": "object", - "required": [ - "prompt" - ], - "properties": { - "prompt": { - "type": "string", - "description": "A text description of the desired image(s). The maximum length is 32000 characters for the GPT image models, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`." - }, - "model": { - "type": "string", - "description": "The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or a GPT image model (`gpt-image-1`, `gpt-image-1-mini`, `gpt-image-1.5`). Defaults to `dall-e-2` unless a parameter specific to the GPT image models is used.", - "x-oaiTypeLabel": "string" - }, - "n": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 1, - "maximum": 10, - "description": "The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported.", - "default": 1 - }, - "quality": { - "anyOf": [ - { - "type": "string", - "enum": [ - "standard", - "hd", - "low", - "medium", - "high", - "auto" - ] - }, - { - "type": "null" - } - ], - "description": "The quality of the image that will be generated.\n - `auto` (default value) will automatically select the best quality for the given model.\n - `high`, `medium` and `low` are supported for the GPT image models.\n - `hd` and `standard` are supported for `dall-e-3`.\n - `standard` is the only option for `dall-e-2`.", - "default": "auto" - }, - "response_format": { - "anyOf": [ - { - "type": "string", - "enum": [ - "url", - "b64_json" - ] - }, - { - "type": "null" - } - ], - "description": "The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for the GPT image models, which always return base64-encoded images.", - "default": "url" - }, - "output_format": { - "anyOf": [ - { - "type": "string", - "enum": [ - "png", - "jpeg", - "webp" - ] - }, - { - "type": "null" - } - ], - "description": "The format in which the generated images are returned. This parameter is only supported for the GPT image models. Must be one of `png`, `jpeg`, or `webp`.", - "default": "png" - }, - "output_compression": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "description": "The compression level (0-100%) for the generated images. This parameter is only supported for the GPT image models with the `webp` or `jpeg` output formats, and defaults to 100.", - "default": 100 - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "Generate the image in streaming mode. Defaults to `false`. See the\n [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information.\n This parameter is only supported for the GPT image models." - }, - "partial_images": { - "$ref": "#/components/schemas/OpenAI.PartialImages" - }, - "size": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "1024x1024", - "1536x1024", - "1024x1536", - "256x256", - "512x512", - "1792x1024", - "1024x1792" - ] - }, - { - "type": "null" - } - ], - "description": "The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for the GPT image models, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`.", - "default": "auto" - }, - "moderation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "auto" - ] - }, - { - "type": "null" - } - ], - "description": "Control the content-moderation level for images generated by the GPT image models. Must be either `low` for less restrictive filtering or `auto` (default value).", - "default": "auto" - }, - "background": { - "anyOf": [ - { - "type": "string", - "enum": [ - "transparent", - "opaque", - "auto" - ] - }, - { - "type": "null" - } - ], - "description": "Allows to set transparency for the background of the generated image(s).\n This parameter is only supported for the GPT image models. Must be one of\n `transparent`, `opaque` or `auto` (default value). When `auto` is used, the\n model will automatically determine the best background for the image.\n If `transparent`, the output format needs to support transparency, so it\n should be set to either `png` (default value) or `webp`.", - "default": "auto" - }, - "style": { - "anyOf": [ - { - "type": "string", - "enum": [ - "vivid", - "natural" - ] - }, - { - "type": "null" - } - ], - "description": "The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images.", - "default": "vivid" - }, - "user": { - "type": "string", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." - } - } - }, - "OpenAI.CreateImageVariationRequest": { - "type": "object", - "required": [ - "image" - ], - "properties": { - "image": { - "type": "object", - "description": "The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square.", - "x-oaiMeta": { - "exampleFilePath": "otter.png" - } - }, - "model": { - "type": "string", - "description": "The model to use for image generation. Only `dall-e-2` is supported at this time.", - "x-oaiTypeLabel": "string" - }, - "n": { - "type": "object", - "description": "The number of images to generate. Must be between 1 and 10." - }, - "response_format": { - "type": "object", - "description": "The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated." - }, - "size": { - "type": "object", - "description": "The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`." - }, - "user": { - "type": "object", - "description": "A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids)." - } - } - }, - "OpenAI.CreateMessageRequest": { - "type": "object", - "required": [ - "role", - "content" - ], - "properties": { - "role": { - "type": "string", - "enum": [ - "user", - "assistant" - ], - "description": "The role of the entity that is creating the message. Allowed values include:\n - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.\n - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation." - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObject" - }, - { - "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObject" - }, - { - "$ref": "#/components/schemas/OpenAI.MessageRequestContentTextObject" - } - ] - } - } - ] - }, - "attachments": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateMessageRequestAttachments" - } - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateMessageRequestAttachments": { - "type": "object", - "properties": { - "file_id": { - "type": "string" - }, - "tools": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.AssistantToolsCode" - }, - { - "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly" - } - ] - } - } - } - }, - "OpenAI.CreateResponse": { - "type": "object", - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "user": { - "type": "string", - "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", - "deprecated": true - }, - "safety_identifier": { - "type": "string", - "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." - }, - "prompt_cache_key": { - "type": "string", - "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." - }, - "prompt_cache_retention": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in-memory", - "24h" - ] - }, - { - "type": "null" - } - ] - }, - "previous_response_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "type": "string", - "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." - }, - "reasoning": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Reasoning" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "max_tool_calls": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "text": { - "$ref": "#/components/schemas/OpenAI.ResponseTextParam" - }, - "tools": { - "$ref": "#/components/schemas/OpenAI.ToolsArray", - "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\n\nThe two categories of tools you can provide the model are:\n\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\n model's capabilities, like file search.\n- **Function calls (custom tools)**: Functions that are defined by you,\n enabling the model to call your own code." - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - }, - "truncation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "disabled" - ] - }, - { - "type": "null" - } - ], - "default": "disabled" - }, - "input": { - "$ref": "#/components/schemas/OpenAI.InputParam" - }, - "include": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.IncludeEnum" - } - }, - { - "type": "null" - } - ] - }, - "parallel_tool_calls": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": true - }, - "store": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "default": true - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "stream_options": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseStreamOptions" - }, - { - "type": "null" - } - ] - }, - "conversation": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationParam" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateRunRequest": { - "type": "object", - "required": [ - "assistant_id" - ], - "properties": { - "assistant_id": { - "type": "string", - "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run." - }, - "model": { - "type": "string", - "description": "The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.", - "x-oaiTypeLabel": "string" - }, - "reasoning_effort": { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis." - }, - "additional_instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions." - }, - "additional_messages": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateMessageRequest" - } - }, - { - "type": "null" - } - ], - "description": "Adds additional messages to the thread before creating the run." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.AssistantTool" - }, - "maxItems": 20, - "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 2, - "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 1, - "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or temperature but not both.", - "default": 1 - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message." - }, - "max_prompt_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 256, - "description": "The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." - }, - "max_completion_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 256, - "description": "The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." - }, - "truncation_strategy": { - "$ref": "#/components/schemas/OpenAI.TruncationObject" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption" - }, - "parallel_tool_calls": { - "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" - }, - "response_format": { - "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption" - } - } - }, - "OpenAI.CreateThreadAndRunRequest": { - "type": "object", - "required": [ - "assistant_id" - ], - "properties": { - "assistant_id": { - "type": "string", - "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run." - }, - "thread": { - "$ref": "#/components/schemas/OpenAI.CreateThreadRequest" - }, - "model": { - "type": "string", - "description": "The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used.", - "x-oaiTypeLabel": "string" - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.AssistantTool" - }, - "maxItems": 20, - "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis." - }, - "tool_resources": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources" - }, - { - "type": "null" - } - ], - "description": "A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 2, - "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.", - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 1, - "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.\n We generally recommend altering this or temperature but not both.", - "default": 1 - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "description": "If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message." - }, - "max_prompt_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 256, - "description": "The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." - }, - "max_completion_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 256, - "description": "The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info." - }, - "truncation_strategy": { - "$ref": "#/components/schemas/OpenAI.TruncationObject" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption" - }, - "parallel_tool_calls": { - "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" - }, - "response_format": { - "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption" - } - } - }, - "OpenAI.CreateThreadAndRunRequestToolResources": { - "type": "object", - "properties": { - "code_interpreter": { - "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter" - }, - "file_search": { - "$ref": "#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch" - } - } - }, - "OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter": { - "type": "object", - "properties": { - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 20, - "default": [] - } - } - }, - "OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch": { - "type": "object", - "properties": { - "vector_store_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 1 - } - } - }, - "OpenAI.CreateThreadRequest": { - "type": "object", - "properties": { - "messages": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateMessageRequest" - }, - "description": "A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with." - }, - "tool_resources": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResources" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - }, - "description": "Options to create a new thread. If no thread is provided when running a\nrequest, an empty thread will be created." - }, - "OpenAI.CreateThreadRequestToolResources": { - "type": "object", - "properties": { - "code_interpreter": { - "$ref": "#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter" - }, - "file_search": { - "anyOf": [ - {}, - {} - ] - } - } - }, - "OpenAI.CreateThreadRequestToolResourcesCodeInterpreter": { - "type": "object", - "properties": { - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 20 - } - } - }, - "OpenAI.CreateVectorStoreFileBatchRequest": { - "type": "object", - "properties": { - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "maxItems": 500, - "description": "A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. Mutually exclusive with `files`." - }, - "files": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.CreateVectorStoreFileRequest" - }, - "minItems": 1, - "maxItems": 500, - "description": "A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. Mutually exclusive with `file_ids`." - }, - "chunking_strategy": { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" - }, - "attributes": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateVectorStoreFileRequest": { - "type": "object", - "required": [ - "file_id" - ], - "properties": { - "file_id": { - "type": "string", - "description": "A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files." - }, - "chunking_strategy": { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" - }, - "attributes": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CreateVectorStoreRequest": { - "type": "object", - "properties": { - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 500, - "description": "A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files." - }, - "name": { - "type": "string", - "description": "The name of the vector store." - }, - "description": { - "type": "string", - "description": "A description for the vector store. Can be used to describe the vector store's purpose." - }, - "expires_after": { - "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter" - }, - "chunking_strategy": { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.CustomGrammarFormatParam": { - "type": "object", - "required": [ - "type", - "syntax", - "definition" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "grammar" - ], - "description": "Grammar format. Always `grammar`.", - "x-stainless-const": true, - "default": "grammar" - }, - "syntax": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.GrammarSyntax1" - } - ], - "description": "The syntax of the grammar definition. One of `lark` or `regex`." - }, - "definition": { - "type": "string", - "description": "The grammar definition." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat" - } - ], - "description": "A grammar defined by the user.", - "title": "Grammar format" - }, - "OpenAI.CustomTextFormatParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "Unconstrained text format. Always `text`.", - "x-stainless-const": true, - "default": "text" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat" - } - ], - "description": "Unconstrained free-form text.", - "title": "Text format" - }, - "OpenAI.CustomToolChatCompletions": { - "type": "object", - "required": [ - "type", - "custom" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "The type of the custom tool. Always `custom`.", - "x-stainless-const": true - }, - "custom": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustom" - } - ], - "description": "Properties of the custom tool.", - "title": "Custom tool properties" - } - }, - "description": "A custom tool that processes input using a specified format.", - "title": "Custom tool" - }, - "OpenAI.CustomToolChatCompletionsCustom": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "format": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText" - }, - { - "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar" - } - ] - } - } - }, - "OpenAI.CustomToolChatCompletionsCustomFormatGrammar": { - "type": "object", - "required": [ - "type", - "grammar" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "grammar" - ], - "x-stainless-const": true - }, - "grammar": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar" - } - ], - "title": "Grammar format" - } - } - }, - "OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar": { - "type": "object", - "required": [ - "definition", - "syntax" - ], - "properties": { - "definition": { - "type": "string" - }, - "syntax": { - "type": "string", - "enum": [ - "lark", - "regex" - ] - } - } - }, - "OpenAI.CustomToolChatCompletionsCustomFormatText": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.CustomToolParam": { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "The type of the custom tool. Always `custom`.", - "x-stainless-const": true, - "default": "custom" - }, - "name": { - "type": "string", - "description": "The name of the custom tool, used to identify it in tool calls." - }, - "description": { - "type": "string", - "description": "Optional description of the custom tool, used to provide more context." - }, - "format": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CustomToolParamFormat" - } - ], - "description": "The input format for the custom tool. Default is unconstrained text." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools)", - "title": "Custom tool" - }, - "OpenAI.CustomToolParamFormat": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.CustomToolParamFormatType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "text": "#/components/schemas/OpenAI.CustomTextFormatParam", - "grammar": "#/components/schemas/OpenAI.CustomGrammarFormatParam" - } - }, - "description": "The input format for the custom tool. Default is unconstrained text." - }, - "OpenAI.CustomToolParamFormatType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "text", - "grammar" - ] - } - ] - }, - "OpenAI.DeleteFileResponse": { - "type": "object", - "required": [ - "id", - "object", - "deleted" - ], - "properties": { - "id": { - "type": "string" - }, - "object": { - "type": "string", - "enum": [ - "file" - ], - "x-stainless-const": true - }, - "deleted": { - "type": "boolean" - } - } - }, - "OpenAI.DeleteFineTuningCheckpointPermissionResponse": { - "type": "object", - "required": [ - "id", - "object", - "deleted" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the fine-tuned model checkpoint permission that was deleted." - }, - "object": { - "type": "string", - "enum": [ - "checkpoint.permission" - ], - "description": "The object type, which is always \"checkpoint.permission\".", - "x-stainless-const": true - }, - "deleted": { - "type": "boolean", - "description": "Whether the fine-tuned model checkpoint permission was successfully deleted." - } - } - }, - "OpenAI.DeleteMessageResponse": { - "type": "object", - "required": [ - "id", - "deleted", - "object" - ], - "properties": { - "id": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "object": { - "type": "string", - "enum": [ - "thread.message.deleted" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.DeleteModelResponse": { - "type": "object", - "required": [ - "id", - "deleted", - "object" - ], - "properties": { - "id": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "object": { - "type": "string" - } - } - }, - "OpenAI.DeleteThreadResponse": { - "type": "object", - "required": [ - "id", - "deleted", - "object" - ], - "properties": { - "id": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "object": { - "type": "string", - "enum": [ - "thread.deleted" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.DeleteVectorStoreFileResponse": { - "type": "object", - "required": [ - "id", - "deleted", - "object" - ], - "properties": { - "id": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "object": { - "type": "string", - "enum": [ - "vector_store.file.deleted" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.DeleteVectorStoreResponse": { - "type": "object", - "required": [ - "id", - "deleted", - "object" - ], - "properties": { - "id": { - "type": "string" - }, - "deleted": { - "type": "boolean" - }, - "object": { - "type": "string", - "enum": [ - "vector_store.deleted" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.DeletedConversationResource": { - "type": "object", - "required": [ - "object", - "deleted", - "id" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "conversation.deleted" - ], - "x-stainless-const": true, - "default": "conversation.deleted" - }, - "deleted": { - "type": "boolean" - }, - "id": { - "type": "string" - } - } - }, - "OpenAI.DoubleClickAction": { - "type": "object", - "required": [ - "type", - "x", - "y" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "double_click" - ], - "description": "Specifies the event type. For a double click action, this property is always set to `double_click`.", - "x-stainless-const": true, - "default": "double_click" - }, - "x": { - "type": "integer", - "description": "The x-coordinate where the double click occurred." - }, - "y": { - "type": "integer", - "description": "The y-coordinate where the double click occurred." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A double click action.", - "title": "DoubleClick" - }, - "OpenAI.Drag": { - "type": "object", - "required": [ - "type", - "path" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "drag" - ], - "description": "Specifies the event type. For a drag action, this property is\n always set to `drag`.", - "x-stainless-const": true, - "default": "drag" - }, - "path": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.DragPoint" - }, - "description": "An array of coordinates representing the path of the drag action. Coordinates will appear as an array\n of objects, eg\n ```\n [\n { x: 100, y: 200 },\n { x: 200, y: 300 }\n ]\n ```" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A drag action.", - "title": "Drag" - }, - "OpenAI.DragPoint": { - "type": "object", - "required": [ - "x", - "y" - ], - "properties": { - "x": { - "type": "integer", - "description": "The x-coordinate." - }, - "y": { - "type": "integer", - "description": "The y-coordinate." - } - }, - "description": "An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.", - "title": "Coordinate" - }, - "OpenAI.EasyInputMessage": { - "type": "object", - "required": [ - "role", - "content", - "type" - ], - "properties": { - "role": { - "type": "string", - "enum": [ - "user", - "assistant", - "system", - "developer" - ], - "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`." - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/OpenAI.InputMessageContentList" - } - ], - "description": "Text, image, or audio input to the model, used to generate a response.\n Can also contain previous assistant responses." - }, - "type": { - "type": "string", - "enum": [ - "message" - ], - "description": "The type of the message input. Always `message`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - ], - "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.", - "title": "Input message" - }, - "OpenAI.Embedding": { - "type": "object", - "required": [ - "index", - "embedding", - "object" - ], - "properties": { - "index": { - "type": "integer", - "description": "The index of the embedding in the list of embeddings." - }, - "embedding": { - "type": "array", - "items": { - "type": "number", - "format": "float" - }, - "description": "The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings)." - }, - "object": { - "type": "string", - "enum": [ - "embedding" - ], - "description": "The object type, which is always \"embedding\".", - "x-stainless-const": true - } - }, - "description": "Represents an embedding vector returned by embedding endpoint.", - "x-oaiMeta": { - "name": "The embedding object", - "example": "{\n \"object\": \"embedding\",\n \"embedding\": [\n 0.0023064255,\n -0.009327292,\n .... (1536 floats total for ada-002)\n -0.0028842222,\n ],\n \"index\": 0\n}\n" - } - }, - "OpenAI.Eval": { - "type": "object", - "required": [ - "object", - "id", - "name", - "data_source_config", - "testing_criteria", - "created_at", - "metadata" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "eval" - ], - "description": "The object type.", - "x-stainless-const": true, - "default": "eval" - }, - "id": { - "type": "string", - "description": "Unique identifier for the evaluation." - }, - "name": { - "type": "string", - "description": "The name of the evaluation." - }, - "data_source_config": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalCustomDataSourceConfig" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalLogsDataSourceConfig" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalStoredCompletionsDataSourceConfig" - } - ], - "description": "Configuration of data sources used in runs of the evaluation." - }, - "testing_criteria": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalLabelModelGrader" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderPython" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModel" - }, - { - "$ref": "#/components/schemas/EvalGraderEndpoint" - } - ] - }, - "description": "A list of testing criteria." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the eval was created." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - }, - "description": "An Eval object with a data source config and testing criteria.\nAn Eval represents a task to be done for your LLM integration.\nLike:\n- Improve the quality of my chatbot\n- See how well my chatbot handles customer support\n- Check if o4-mini is better at my usecase than gpt-4o", - "title": "Eval", - "x-oaiMeta": { - "name": "The eval object", - "group": "evals", - "example": "{\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"item_schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n },\n \"include_sample_schema\": true\n },\n \"testing_criteria\": [\n {\n \"name\": \"My string check grader\",\n \"type\": \"string_check\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\",\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {\n \"test\": \"synthetics\",\n }\n}\n" - } - }, - "OpenAI.EvalApiError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "description": "The error code." - }, - "message": { - "type": "string", - "description": "The error message." - } - }, - "description": "An object representing an error response from the Eval API.", - "title": "EvalApiError", - "x-oaiMeta": { - "name": "The API error object", - "group": "evals", - "example": "{\n \"code\": \"internal_error\",\n \"message\": \"The eval run failed due to an internal error.\"\n}\n" - } - }, - "OpenAI.EvalCustomDataSourceConfig": { - "type": "object", - "required": [ - "type", - "schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "The type of data source. Always `custom`.", - "x-stainless-const": true, - "default": "custom" - }, - "schema": { - "type": "object", - "unevaluatedProperties": {}, - "description": "The json schema for the run data source items.\n Learn how to build JSON schemas [here](https://json-schema.org/)." - } - }, - "description": "A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces.\nThe response schema defines the shape of the data that will be:\n- Used to define your testing criteria and\n- What data is required when creating a run", - "title": "CustomDataSourceConfig", - "x-oaiMeta": { - "name": "The eval custom data source config object", - "group": "evals", - "example": "{\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"label\": {\"type\": \"string\"},\n },\n \"required\": [\"label\"]\n }\n },\n \"required\": [\"item\"]\n }\n}\n" - } - }, - "OpenAI.EvalGraderPython": { - "type": "object", - "required": [ - "type", - "name", - "source" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "python" - ], - "description": "The object type, which is always `python`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "source": { - "type": "string", - "description": "The source code of the python script." - }, - "image_tag": { - "type": "string", - "description": "The image tag to use for the python script." - }, - "pass_threshold": { - "type": "number", - "description": "The threshold for the score." - } - }, - "title": "EvalGraderPython" - }, - "OpenAI.EvalGraderScoreModel": { - "type": "object", - "required": [ - "type", - "name", - "model", - "input" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "score_model" - ], - "description": "The object type, which is always `score_model`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "model": { - "type": "string", - "description": "The model to use for the evaluation." - }, - "sampling_params": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams" - } - ], - "description": "The sampling parameters for the model." - }, - "input": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalItem" - }, - "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings." - }, - "range": { - "type": "array", - "items": { - "type": "number" - }, - "description": "The range of the score. Defaults to `[0, 1]`." - }, - "pass_threshold": { - "type": "number", - "description": "The threshold for the score." - } - }, - "title": "EvalGraderScoreModel" - }, - "OpenAI.EvalGraderScoreModelSamplingParams": { - "type": "object", - "properties": { - "seed": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "max_completions_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "reasoning_effort": { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - } - } - }, - "OpenAI.EvalGraderStringCheck": { - "type": "object", - "required": [ - "type", - "name", - "input", - "reference", - "operation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string_check" - ], - "description": "The object type, which is always `string_check`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "input": { - "type": "string", - "description": "The input text. This may include template strings." - }, - "reference": { - "type": "string", - "description": "The reference text. This may include template strings." - }, - "operation": { - "type": "string", - "enum": [ - "eq", - "ne", - "like", - "ilike" - ], - "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`." - } - }, - "title": "StringCheckGrader" - }, - "OpenAI.EvalGraderTextSimilarity": { - "type": "object", - "required": [ - "type", - "name", - "input", - "reference", - "evaluation_metric", - "pass_threshold" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text_similarity" - ], - "description": "The type of grader.", - "x-stainless-const": true, - "default": "text_similarity" - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "input": { - "type": "string", - "description": "The text being graded." - }, - "reference": { - "type": "string", - "description": "The text being graded against." - }, - "evaluation_metric": { - "type": "string", - "enum": [ - "cosine", - "fuzzy_match", - "bleu", - "gleu", - "meteor", - "rouge_1", - "rouge_2", - "rouge_3", - "rouge_4", - "rouge_5", - "rouge_l" - ], - "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`." - }, - "pass_threshold": { - "type": "number", - "description": "The threshold for the score." - } - }, - "title": "EvalGraderTextSimilarity" - }, - "OpenAI.EvalItem": { - "type": "object", - "required": [ - "role", - "content" - ], - "properties": { - "role": { - "type": "string", - "enum": [ - "user", - "assistant", - "system", - "developer" - ], - "description": "The role of the message input. One of `user`, `assistant`, `system`, or\n `developer`." - }, - "content": { - "$ref": "#/components/schemas/OpenAI.EvalItemContent" - }, - "type": { - "type": "string", - "enum": [ - "message" - ], - "description": "The type of the message input. Always `message`.", - "x-stainless-const": true - } - }, - "description": "A message input to the model with a role indicating instruction following\nhierarchy. Instructions given with the `developer` or `system` role take\nprecedence over instructions given with the `user` role. Messages with the\n`assistant` role are presumed to have been generated by the model in previous\ninteractions.", - "title": "EvalItem" - }, - "OpenAI.EvalItemContent": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItem" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentArray" - } - ], - "description": "Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items.", - "title": "Eval content" - }, - "OpenAI.EvalItemContentArray": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItem" - }, - "description": "A list of inputs, each of which may be either an input text, output text, input\nimage, or input audio object.", - "title": "An array of Input text, Output text, Input image, and Input audio" - }, - "OpenAI.EvalItemContentItem": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentText" - }, - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" - } - ], - "description": "A single content item: input text, output text, input image, or input audio.", - "title": "Eval content item", - "x-stainless-naming": { - "ruby": { - "model_name": "GraderInputItem" - } - } - }, - "OpenAI.EvalItemContentItemObject": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObjectType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAI.EvalItemContentOutputText", - "input_image": "#/components/schemas/OpenAI.EvalItemInputImage", - "input_audio": "#/components/schemas/OpenAI.InputAudio", - "input_text": "#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent" - } - }, - "description": "A single content item: input text, output text, input image, or input audio.", - "title": "Eval content item", - "x-stainless-naming": { - "ruby": { - "model_name": "GraderInputItem" - } - } - }, - "OpenAI.EvalItemContentItemObjectInputTextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_text" - ], - "description": "The type of the input item. Always `input_text`.", - "x-stainless-const": true, - "default": "input_text" - }, - "text": { - "type": "string", - "description": "The text input to the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" - } - ], - "description": "A text input to the model.", - "title": "Input text" - }, - "OpenAI.EvalItemContentItemObjectType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "input_text", - "output_text", - "input_image", - "input_audio" - ] - } - ] - }, - "OpenAI.EvalItemContentOutputText": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "output_text" - ], - "description": "The type of the output text. Always `output_text`.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "The text output from the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" - } - ], - "description": "A text output from the model.", - "title": "Output text" - }, - "OpenAI.EvalItemContentText": { - "type": "string", - "description": "A text input to the model.", - "title": "Text input" - }, - "OpenAI.EvalItemInputImage": { - "type": "object", - "required": [ - "type", - "image_url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_image" - ], - "description": "The type of the image input. Always `input_image`.", - "x-stainless-const": true - }, - "image_url": { - "type": "string", - "format": "uri", - "description": "The URL of the image input." - }, - "detail": { - "type": "string", - "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" - } - ], - "description": "An image input block used within EvalItem content arrays.", - "title": "Input image" - }, - "OpenAI.EvalJsonlFileContentSource": { - "type": "object", - "required": [ - "type", - "content" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_content" - ], - "description": "The type of jsonl source. Always `file_content`.", - "x-stainless-const": true, - "default": "file_content" - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent" - }, - "description": "The content of the jsonl file." - } - }, - "title": "EvalJsonlFileContentSource" - }, - "OpenAI.EvalJsonlFileContentSourceContent": { - "type": "object", - "required": [ - "item" - ], - "properties": { - "item": { - "type": "object", - "unevaluatedProperties": {} - }, - "sample": { - "type": "object", - "unevaluatedProperties": {} - } - } - }, - "OpenAI.EvalJsonlFileIdSource": { - "type": "object", - "required": [ - "type", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_id" - ], - "description": "The type of jsonl source. Always `file_id`.", - "x-stainless-const": true, - "default": "file_id" - }, - "id": { - "type": "string", - "description": "The identifier of the file." - } - }, - "title": "EvalJsonlFileIdSource" - }, - "OpenAI.EvalList": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of this object. It is always set to \"list\".", - "x-stainless-const": true, - "default": "list" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Eval" - }, - "description": "An array of eval objects." - }, - "first_id": { - "type": "string", - "description": "The identifier of the first eval in the data array." - }, - "last_id": { - "type": "string", - "description": "The identifier of the last eval in the data array." - }, - "has_more": { - "type": "boolean", - "description": "Indicates whether there are more evals available." - } - }, - "description": "An object representing a list of evals.", - "title": "EvalList", - "x-oaiMeta": { - "name": "The eval list object", - "group": "evals", - "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval\",\n \"id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"data_source_config\": {\n \"type\": \"custom\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\",\n \"properties\": {\n \"input\": {\n \"type\": \"string\"\n },\n \"ground_truth\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"input\",\n \"ground_truth\"\n ]\n }\n },\n \"required\": [\n \"item\"\n ]\n }\n },\n \"testing_criteria\": [\n {\n \"name\": \"String check\",\n \"id\": \"String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2\",\n \"type\": \"string_check\",\n \"input\": \"{{item.input}}\",\n \"reference\": \"{{item.ground_truth}}\",\n \"operation\": \"eq\"\n }\n ],\n \"name\": \"External Data Eval\",\n \"created_at\": 1739314509,\n \"metadata\": {},\n }\n ],\n \"first_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"last_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"has_more\": true\n}\n" - } - }, - "OpenAI.EvalLogsDataSourceConfig": { - "type": "object", - "required": [ - "type", - "schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "logs" - ], - "description": "The type of data source. Always `logs`.", - "x-stainless-const": true, - "default": "logs" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "object", - "unevaluatedProperties": {}, - "description": "The json schema for the run data source items.\n Learn how to build JSON schemas [here](https://json-schema.org/)." - } - }, - "description": "A LogsDataSourceConfig which specifies the metadata property of your logs query.\nThis is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc.\nThe schema returned by this data source config is used to defined what variables are available in your evals.\n`item` and `sample` are both defined when using this data source config.", - "title": "LogsDataSourceConfig", - "x-oaiMeta": { - "name": "The logs data source object for evals", - "group": "evals", - "example": "{\n \"type\": \"logs\",\n \"metadata\": {\n \"language\": \"english\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n }\n}\n" - } - }, - "OpenAI.EvalResponsesSource": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "responses" - ], - "description": "The type of run data source. Always `responses`." - }, - "metadata": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": {} - }, - { - "type": "null" - } - ] - }, - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "instructions_search": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "created_after": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "created_before": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "reasoning_effort": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ] - }, - "users": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ] - }, - "tools": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ] - } - }, - "description": "A EvalResponsesSource object describing a run data source configuration.", - "title": "EvalResponsesSource", - "x-oaiMeta": { - "name": "The run data source object used to configure an individual run", - "group": "eval runs", - "example": "{\n \"type\": \"responses\",\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"temperature\": 0.7,\n \"top_p\": 1.0,\n \"users\": [\"user1\", \"user2\"],\n \"tools\": [\"tool1\", \"tool2\"],\n \"instructions_search\": \"You are a coding assistant\"\n}\n" - } - }, - "OpenAI.EvalRun": { - "type": "object", - "required": [ - "object", - "id", - "eval_id", - "status", - "model", - "name", - "created_at", - "report_url", - "result_counts", - "per_model_usage", - "per_testing_criteria_results", - "data_source", - "metadata", - "error" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "eval.run" - ], - "description": "The type of the object. Always \"eval.run\".", - "x-stainless-const": true, - "default": "eval.run" - }, - "id": { - "type": "string", - "description": "Unique identifier for the evaluation run." - }, - "eval_id": { - "type": "string", - "description": "The identifier of the associated evaluation." - }, - "status": { - "type": "string", - "description": "The status of the evaluation run." - }, - "model": { - "type": "string", - "description": "The model that is evaluated, if applicable." - }, - "name": { - "type": "string", - "description": "The name of the evaluation run." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) when the evaluation run was created." - }, - "report_url": { - "type": "string", - "format": "uri", - "description": "The URL to the rendered evaluation run report on the UI dashboard." - }, - "result_counts": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalRunResultCounts" - } - ], - "description": "Counters summarizing the outcomes of the evaluation run." - }, - "per_model_usage": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRunPerModelUsage" - }, - "description": "Usage statistics for each model during the evaluation run." - }, - "per_testing_criteria_results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults" - }, - "description": "Results per testing criteria applied during the evaluation run." - }, - "data_source": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource" - }, - { - "$ref": "#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource" - } - ], - "description": "Information about the run's data source." - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "error": { - "$ref": "#/components/schemas/OpenAI.EvalApiError" - } - }, - "description": "A schema representing an evaluation run.", - "title": "EvalRun", - "x-oaiMeta": { - "name": "The eval run object", - "group": "evals", - "example": "{\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67e57965b480819094274e3a32235e4c\",\n \"eval_id\": \"eval_67e579652b548190aaa83ada4b125f47\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c\",\n \"status\": \"queued\",\n \"model\": \"gpt-4o-mini\",\n \"name\": \"gpt-4o-mini\",\n \"created_at\": 1743092069,\n \"result_counts\": {\n \"total\": 0,\n \"errored\": 0,\n \"failed\": 0,\n \"passed\": 0\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": null,\n \"data_source\": {\n \"type\": \"completions\",\n \"source\": {\n \"type\": \"file_content\",\n \"content\": [\n {\n \"item\": {\n \"input\": \"Tech Company Launches Advanced Artificial Intelligence Platform\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Central Bank Increases Interest Rates Amid Inflation Concerns\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Summit Addresses Climate Change Strategies\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Major Retailer Reports Record-Breaking Holiday Sales\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"National Team Qualifies for World Championship Finals\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Stock Markets Rally After Positive Economic Data Released\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Manufacturer Announces Merger with Competitor\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Breakthrough in Renewable Energy Technology Unveiled\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"World Leaders Sign Historic Climate Agreement\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Professional Athlete Sets New Record in Championship Event\",\n \"ground_truth\": \"Sports\"\n }\n },\n {\n \"item\": {\n \"input\": \"Financial Institutions Adapt to New Regulatory Requirements\",\n \"ground_truth\": \"Business\"\n }\n },\n {\n \"item\": {\n \"input\": \"Tech Conference Showcases Advances in Artificial Intelligence\",\n \"ground_truth\": \"Technology\"\n }\n },\n {\n \"item\": {\n \"input\": \"Global Markets Respond to Oil Price Fluctuations\",\n \"ground_truth\": \"Markets\"\n }\n },\n {\n \"item\": {\n \"input\": \"International Cooperation Strengthened Through New Treaty\",\n \"ground_truth\": \"World\"\n }\n },\n {\n \"item\": {\n \"input\": \"Sports League Announces Revised Schedule for Upcoming Season\",\n \"ground_truth\": \"Sports\"\n }\n }\n ]\n },\n \"input_messages\": {\n \"type\": \"template\",\n \"template\": [\n {\n \"type\": \"message\",\n \"role\": \"developer\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports.\n\n# Steps\n\n1. Analyze the content of the news headline to understand its primary focus.\n2. Extract the subject matter, identifying any key indicators or keywords.\n3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports.\n4. Ensure only one category is selected per headline.\n\n# Output Format\n\nRespond with the chosen category as a single word. For instance: \"Technology\", \"Markets\", \"World\", \"Business\", or \"Sports\".\n\n# Examples\n\n**Input**: \"Apple Unveils New iPhone Model, Featuring Advanced AI Features\"\n**Output**: \"Technology\"\n\n**Input**: \"Global Stocks Mixed as Investors Await Central Bank Decisions\"\n**Output**: \"Markets\"\n\n**Input**: \"War in Ukraine: Latest Updates on Negotiation Status\"\n**Output**: \"World\"\n\n**Input**: \"Microsoft in Talks to Acquire Gaming Company for $2 Billion\"\n**Output**: \"Business\"\n\n**Input**: \"Manchester United Secures Win in Premier League Football Match\"\n**Output**: \"Sports\"\n\n# Notes\n\n- If the headline appears to fit into more than one category, choose the most dominant theme.\n- Keywords or phrases such as \"stocks\", \"company acquisition\", \"match\", or technological brands can be good indicators for classification.\n\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"{{item.input}}\"\n }\n }\n ]\n },\n \"model\": \"gpt-4o-mini\",\n \"sampling_params\": {\n \"seed\": 42,\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_completions_tokens\": 2048\n }\n },\n \"error\": null,\n \"metadata\": {}\n}\n" - } - }, - "OpenAI.EvalRunList": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of this object. It is always set to \"list\".", - "x-stainless-const": true, - "default": "list" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRun" - }, - "description": "An array of eval run objects." - }, - "first_id": { - "type": "string", - "description": "The identifier of the first eval run in the data array." - }, - "last_id": { - "type": "string", - "description": "The identifier of the last eval run in the data array." - }, - "has_more": { - "type": "boolean", - "description": "Indicates whether there are more evals available." - } - }, - "description": "An object representing a list of runs for an evaluation.", - "title": "EvalRunList", - "x-oaiMeta": { - "name": "The eval run list object", - "group": "evals", - "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval.run\",\n \"id\": \"evalrun_67b7fbdad46c819092f6fe7a14189620\",\n \"eval_id\": \"eval_67b7fa9a81a88190ab4aa417e397ea21\",\n \"report_url\": \"https://platform.openai.com/evaluations/eval_67b7fa9a81a88190ab4aa417e397ea21?run_id=evalrun_67b7fbdad46c819092f6fe7a14189620\",\n \"status\": \"completed\",\n \"model\": \"o3-mini\",\n \"name\": \"Academic Assistant\",\n \"created_at\": 1740110812,\n \"result_counts\": {\n \"total\": 171,\n \"errored\": 0,\n \"failed\": 80,\n \"passed\": 91\n },\n \"per_model_usage\": null,\n \"per_testing_criteria_results\": [\n {\n \"testing_criteria\": \"String check grader\",\n \"passed\": 91,\n \"failed\": 80\n }\n ],\n \"run_data_source\": {\n \"type\": \"completions\",\n \"template_messages\": [\n {\n \"type\": \"message\",\n \"role\": \"system\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"You are a helpful assistant.\"\n }\n },\n {\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": {\n \"type\": \"input_text\",\n \"text\": \"Hello, can you help me with my homework?\"\n }\n }\n ],\n \"datasource_reference\": null,\n \"model\": \"o3-mini\",\n \"max_completion_tokens\": null,\n \"seed\": null,\n \"temperature\": null,\n \"top_p\": null\n },\n \"error\": null,\n \"metadata\": {\"test\": \"synthetics\"}\n }\n ],\n \"first_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"last_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"has_more\": false\n}\n" - } - }, - "OpenAI.EvalRunOutputItem": { - "type": "object", - "required": [ - "object", - "id", - "run_id", - "eval_id", - "created_at", - "status", - "datasource_item_id", - "datasource_item", - "results", - "sample" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "eval.run.output_item" - ], - "description": "The type of the object. Always \"eval.run.output_item\".", - "x-stainless-const": true, - "default": "eval.run.output_item" - }, - "id": { - "type": "string", - "description": "Unique identifier for the evaluation run output item." - }, - "run_id": { - "type": "string", - "description": "The identifier of the evaluation run associated with this output item." - }, - "eval_id": { - "type": "string", - "description": "The identifier of the evaluation group." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) when the evaluation run was created." - }, - "status": { - "type": "string", - "description": "The status of the evaluation run." - }, - "datasource_item_id": { - "type": "integer", - "description": "The identifier for the data source item." - }, - "datasource_item": { - "type": "object", - "unevaluatedProperties": {}, - "description": "Details of the input data source item." - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemResult" - }, - "description": "A list of grader results for this output item." - }, - "sample": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSample" - } - ], - "description": "A sample containing the input and output of the evaluation run." - } - }, - "description": "A schema representing an evaluation run output item.", - "title": "EvalRunOutputItem", - "x-oaiMeta": { - "name": "The eval run output item object", - "group": "evals", - "example": "{\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n}\n" - } - }, - "OpenAI.EvalRunOutputItemList": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of this object. It is always set to \"list\".", - "x-stainless-const": true, - "default": "list" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItem" - }, - "description": "An array of eval run output item objects." - }, - "first_id": { - "type": "string", - "description": "The identifier of the first eval run output item in the data array." - }, - "last_id": { - "type": "string", - "description": "The identifier of the last eval run output item in the data array." - }, - "has_more": { - "type": "boolean", - "description": "Indicates whether there are more eval run output items available." - } - }, - "description": "An object representing a list of output items for an evaluation run.", - "title": "EvalRunOutputItemList", - "x-oaiMeta": { - "name": "The eval run output item list object", - "group": "evals", - "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"eval.run.output_item\",\n \"id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"run_id\": \"evalrun_67abd54d60ec8190832b46859da808f7\",\n \"eval_id\": \"eval_67abd54d9b0081909a86353f6fb9317a\",\n \"created_at\": 1739314509,\n \"status\": \"pass\",\n \"datasource_item_id\": 137,\n \"datasource_item\": {\n \"teacher\": \"To grade essays, I only check for style, content, and grammar.\",\n \"student\": \"I am a student who is trying to write the best essay.\"\n },\n \"results\": [\n {\n \"name\": \"String Check Grader\",\n \"type\": \"string-check-grader\",\n \"score\": 1.0,\n \"passed\": true,\n }\n ],\n \"sample\": {\n \"input\": [\n {\n \"role\": \"system\",\n \"content\": \"You are an evaluator bot...\"\n },\n {\n \"role\": \"user\",\n \"content\": \"You are assessing...\"\n }\n ],\n \"output\": [\n {\n \"role\": \"assistant\",\n \"content\": \"The rubric is not clear nor concise.\"\n }\n ],\n \"finish_reason\": \"stop\",\n \"model\": \"gpt-4o-2024-08-06\",\n \"usage\": {\n \"total_tokens\": 521,\n \"completion_tokens\": 2,\n \"prompt_tokens\": 519,\n \"cached_tokens\": 0\n },\n \"error\": null,\n \"temperature\": 1.0,\n \"max_completion_tokens\": 2048,\n \"top_p\": 1.0,\n \"seed\": 42\n }\n },\n ],\n \"first_id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"last_id\": \"outputitem_67abd55eb6548190bb580745d5644a33\",\n \"has_more\": false\n}\n" - } - }, - "OpenAI.EvalRunOutputItemResult": { - "type": "object", - "required": [ - "name", - "score", - "passed" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the grader." - }, - "type": { - "type": "string", - "description": "The grader type (for example, \"string-check-grader\")." - }, - "score": { - "type": "number", - "description": "The numeric score produced by the grader." - }, - "passed": { - "type": "boolean", - "description": "Whether the grader considered the output a pass." - }, - "sample": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": {} - }, - { - "type": "null" - } - ], - "description": "Optional sample or intermediate data produced by the grader." - } - }, - "unevaluatedProperties": {}, - "description": "A single grader result for an evaluation run output item.", - "title": "EvalRunOutputItemResult" - }, - "OpenAI.EvalRunOutputItemSample": { - "type": "object", - "required": [ - "input", - "output", - "finish_reason", - "model", - "usage", - "error", - "temperature", - "max_completion_tokens", - "top_p", - "seed" - ], - "properties": { - "input": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleInput" - } - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleOutput" - } - }, - "finish_reason": { - "type": "string" - }, - "model": { - "type": "string" - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage" - }, - "error": { - "$ref": "#/components/schemas/OpenAI.EvalApiError" - }, - "temperature": { - "type": "number" - }, - "max_completion_tokens": { - "type": "integer" - }, - "top_p": { - "type": "number" - }, - "seed": { - "type": "integer" - } - } - }, - "OpenAI.EvalRunOutputItemSampleInput": { - "type": "object", - "required": [ - "role", - "content" - ], - "properties": { - "role": { - "type": "string" - }, - "content": { - "type": "string" - } - } - }, - "OpenAI.EvalRunOutputItemSampleOutput": { - "type": "object", - "properties": { - "role": { - "type": "string" - }, - "content": { - "type": "string" - } - } - }, - "OpenAI.EvalRunOutputItemSampleUsage": { - "type": "object", - "required": [ - "total_tokens", - "completion_tokens", - "prompt_tokens", - "cached_tokens" - ], - "properties": { - "total_tokens": { - "type": "integer" - }, - "completion_tokens": { - "type": "integer" - }, - "prompt_tokens": { - "type": "integer" - }, - "cached_tokens": { - "type": "integer" - } - } - }, - "OpenAI.EvalRunPerModelUsage": { - "type": "object", - "required": [ - "model_name", - "invocation_count", - "prompt_tokens", - "completion_tokens", - "total_tokens", - "cached_tokens" - ], - "properties": { - "model_name": { - "type": "string", - "x-stainless-naming": { - "python": { - "property_name": "run_model_name" - } - } - }, - "invocation_count": { - "type": "integer" - }, - "prompt_tokens": { - "type": "integer" - }, - "completion_tokens": { - "type": "integer" - }, - "total_tokens": { - "type": "integer" - }, - "cached_tokens": { - "type": "integer" - } - } - }, - "OpenAI.EvalRunPerTestingCriteriaResults": { - "type": "object", - "required": [ - "testing_criteria", - "passed", - "failed" - ], - "properties": { - "testing_criteria": { - "type": "string" - }, - "passed": { - "type": "integer" - }, - "failed": { - "type": "integer" - } - } - }, - "OpenAI.EvalRunResultCounts": { - "type": "object", - "required": [ - "total", - "errored", - "failed", - "passed" - ], - "properties": { - "total": { - "type": "integer" - }, - "errored": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "passed": { - "type": "integer" - } - } - }, - "OpenAI.EvalStoredCompletionsDataSourceConfig": { - "type": "object", - "required": [ - "type", - "schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "stored_completions" - ], - "description": "The type of data source. Always `stored_completions`.", - "x-stainless-const": true, - "default": "stored_completions" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "schema": { - "type": "object", - "unevaluatedProperties": {}, - "description": "The json schema for the run data source items.\n Learn how to build JSON schemas [here](https://json-schema.org/)." - } - }, - "description": "Deprecated in favor of LogsDataSourceConfig.", - "title": "StoredCompletionsDataSourceConfig", - "deprecated": true, - "x-oaiMeta": { - "name": "The stored completions data source object for evals", - "group": "evals", - "example": "{\n \"type\": \"stored_completions\",\n \"metadata\": {\n \"language\": \"english\"\n },\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"item\": {\n \"type\": \"object\"\n },\n \"sample\": {\n \"type\": \"object\"\n }\n },\n \"required\": [\n \"item\",\n \"sample\"\n }\n}\n" - } - }, - "OpenAI.EvalStoredCompletionsSource": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "stored_completions" - ], - "description": "The type of source. Always `stored_completions`.", - "x-stainless-const": true, - "default": "stored_completions" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "created_after": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "created_before": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "limit": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - } - }, - "description": "A StoredCompletionsRunDataSource configuration describing a set of filters", - "title": "StoredCompletionsRunDataSource", - "x-oaiMeta": { - "name": "The stored completions data source object used to configure an individual run", - "group": "eval runs", - "example": "{\n \"type\": \"stored_completions\",\n \"model\": \"gpt-4o\",\n \"created_after\": 1668124800,\n \"created_before\": 1668124900,\n \"limit\": 100,\n \"metadata\": {}\n}\n" - } - }, - "OpenAI.FileCitationBody": { - "type": "object", - "required": [ - "type", - "file_id", - "index", - "filename" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_citation" - ], - "description": "The type of the file citation. Always `file_citation`.", - "x-stainless-const": true, - "default": "file_citation" - }, - "file_id": { - "type": "string", - "description": "The ID of the file." - }, - "index": { - "type": "integer", - "description": "The index of the file in the list of files." - }, - "filename": { - "type": "string", - "description": "The filename of the file cited." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Annotation" - } - ], - "description": "A citation to a file.", - "title": "File citation" - }, - "OpenAI.FilePath": { - "type": "object", - "required": [ - "type", - "file_id", - "index" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_path" - ], - "description": "The type of the file path. Always `file_path`.", - "x-stainless-const": true - }, - "file_id": { - "type": "string", - "description": "The ID of the file." - }, - "index": { - "type": "integer", - "description": "The index of the file in the list of files." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Annotation" - } - ], - "description": "A path to a file.", - "title": "File path" - }, - "OpenAI.FileSearchRanker": { - "type": "string", - "enum": [ - "auto", - "default_2024_08_21" - ], - "description": "The ranker to use for the file search. If not specified will use the `auto` ranker." - }, - "OpenAI.FileSearchRankingOptions": { - "type": "object", - "required": [ - "score_threshold" - ], - "properties": { - "ranker": { - "$ref": "#/components/schemas/OpenAI.FileSearchRanker" - }, - "score_threshold": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1." - } - }, - "description": "The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0.\nSee the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information.", - "title": "File search tool call ranking options" - }, - "OpenAI.FileSearchTool": { - "type": "object", - "required": [ - "type", - "vector_store_ids" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_search" - ], - "description": "The type of the file search tool. Always `file_search`.", - "x-stainless-const": true, - "default": "file_search" - }, - "vector_store_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The IDs of the vector stores to search." - }, - "max_num_results": { - "type": "integer", - "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive." - }, - "ranking_options": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RankingOptions" - } - ], - "description": "Ranking options for search." - }, - "filters": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Filters" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search).", - "title": "File search" - }, - "OpenAI.FileSearchToolCallResults": { - "type": "object", - "properties": { - "file_id": { - "type": "string" - }, - "text": { - "type": "string" - }, - "filename": { - "type": "string" - }, - "attributes": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" - }, - { - "type": "null" - } - ] - }, - "score": { - "type": "number", - "format": "float" - } - } - }, - "OpenAI.Filters": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComparisonFilter" - }, - { - "$ref": "#/components/schemas/OpenAI.CompoundFilter" - } - ] - }, - "OpenAI.FineTuneDPOHyperparameters": { - "type": "object", - "properties": { - "beta": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ], - "description": "The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model." - }, - "batch_size": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", - "default": "auto" - }, - "learning_rate_multiplier": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ], - "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." - }, - "n_epochs": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", - "default": "auto" - } - }, - "description": "The hyperparameters used for the DPO fine-tuning job." - }, - "OpenAI.FineTuneDPOMethod": { - "type": "object", - "properties": { - "hyperparameters": { - "$ref": "#/components/schemas/OpenAI.FineTuneDPOHyperparameters" - } - }, - "description": "Configuration for the DPO fine-tuning method." - }, - "OpenAI.FineTuneMethod": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "supervised", - "dpo", - "reinforcement" - ], - "description": "The type of method. Is either `supervised`, `dpo`, or `reinforcement`." - }, - "supervised": { - "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedMethod" - }, - "dpo": { - "$ref": "#/components/schemas/OpenAI.FineTuneDPOMethod" - }, - "reinforcement": { - "$ref": "#/components/schemas/AzureFineTuneReinforcementMethod" - } - }, - "description": "The method used for fine-tuning." - }, - "OpenAI.FineTuneReinforcementHyperparameters": { - "type": "object", - "properties": { - "batch_size": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", - "default": "auto" - }, - "learning_rate_multiplier": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ], - "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." - }, - "n_epochs": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", - "default": "auto" - }, - "reasoning_effort": { - "type": "string", - "enum": [ - "default", - "low", - "medium", - "high" - ], - "description": "Level of reasoning effort.", - "default": "default" - }, - "compute_multiplier": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ], - "description": "Multiplier on amount of compute used for exploring search space during training." - }, - "eval_interval": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "The number of training steps between evaluation runs.", - "default": "auto" - }, - "eval_samples": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "Number of evaluation samples to generate per training step.", - "default": "auto" - } - }, - "description": "The hyperparameters used for the reinforcement fine-tuning job." - }, - "OpenAI.FineTuneSupervisedHyperparameters": { - "type": "object", - "properties": { - "batch_size": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance.", - "default": "auto" - }, - "learning_rate_multiplier": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ], - "description": "Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting." - }, - "n_epochs": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "description": "The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset.", - "default": "auto" - } - }, - "description": "The hyperparameters used for the fine-tuning job." - }, - "OpenAI.FineTuneSupervisedMethod": { - "type": "object", - "properties": { - "hyperparameters": { - "$ref": "#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters" - } - }, - "description": "Configuration for the supervised fine-tuning method." - }, - "OpenAI.FineTuningCheckpointPermission": { - "type": "object", - "required": [ - "id", - "created_at", - "project_id", - "object" - ], - "properties": { - "id": { - "type": "string", - "description": "The permission identifier, which can be referenced in the API endpoints." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the permission was created." - }, - "project_id": { - "type": "string", - "description": "The project identifier that the permission is for." - }, - "object": { - "type": "string", - "enum": [ - "checkpoint.permission" - ], - "description": "The object type, which is always \"checkpoint.permission\".", - "x-stainless-const": true - } - }, - "description": "The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint.", - "title": "FineTuningCheckpointPermission", - "x-oaiMeta": { - "name": "The fine-tuned model checkpoint permission object", - "example": "{\n \"object\": \"checkpoint.permission\",\n \"id\": \"cp_zc4Q7MP6XxulcVzj4MZdwsAB\",\n \"created_at\": 1712211699,\n \"project_id\": \"proj_abGMw1llN8IrBb6SvvY5A1iH\"\n}\n" - } - }, - "OpenAI.FineTuningIntegration": { - "type": "object", - "required": [ - "type", - "wandb" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "wandb" - ], - "description": "The type of the integration being enabled for the fine-tuning job", - "x-stainless-const": true - }, - "wandb": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FineTuningIntegrationWandb" - } - ], - "description": "The settings for your integration with Weights and Biases. This payload specifies the project that\n metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags\n to your run, and set a default entity (team, username, etc) to be associated with your run." - } - }, - "title": "Fine-Tuning Job Integration" - }, - "OpenAI.FineTuningIntegrationWandb": { - "type": "object", - "required": [ - "project" - ], - "properties": { - "project": { - "type": "string" - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "entity": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "tags": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "OpenAI.FineTuningJob": { - "type": "object", - "required": [ - "id", - "created_at", - "error", - "fine_tuned_model", - "finished_at", - "hyperparameters", - "model", - "object", - "organization_id", - "result_files", - "status", - "trained_tokens", - "training_file", - "validation_file", - "seed" - ], - "properties": { - "id": { - "type": "string", - "description": "The object identifier, which can be referenced in the API endpoints." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created." - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.FineTuningJobError" - }, - { - "type": "null" - } - ] - }, - "fine_tuned_model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "finished_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "hyperparameters": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FineTuningJobHyperparameters" - } - ], - "description": "The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs." - }, - "model": { - "type": "string", - "description": "The base model that is being fine-tuned." - }, - "object": { - "type": "string", - "enum": [ - "fine_tuning.job" - ], - "description": "The object type, which is always \"fine_tuning.job\".", - "x-stainless-const": true - }, - "organization_id": { - "type": "string", - "description": "The organization that owns the fine-tuning job." - }, - "result_files": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents)." - }, - "status": { - "type": "string", - "enum": [ - "validating_files", - "queued", - "running", - "succeeded", - "failed", - "cancelled" - ], - "description": "The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`." - }, - "trained_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "training_file": { - "type": "string", - "description": "The file ID used for training. You can retrieve the training data with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents)." - }, - "validation_file": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "integrations": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FineTuningIntegration" - } - }, - { - "type": "null" - } - ] - }, - "seed": { - "type": "integer", - "description": "The seed used for the fine-tuning job." - }, - "estimated_finish": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "method": { - "$ref": "#/components/schemas/OpenAI.FineTuneMethod" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - }, - "description": "The `fine_tuning.job` object represents a fine-tuning job that has been created through the API.", - "title": "FineTuningJob", - "x-oaiMeta": { - "name": "The fine-tuning job object", - "example": "{\n \"object\": \"fine_tuning.job\",\n \"id\": \"ftjob-abc123\",\n \"model\": \"davinci-002\",\n \"created_at\": 1692661014,\n \"finished_at\": 1692661190,\n \"fine_tuned_model\": \"ft:davinci-002:my-org:custom_suffix:7q8mpxmy\",\n \"organization_id\": \"org-123\",\n \"result_files\": [\n \"file-abc123\"\n ],\n \"status\": \"succeeded\",\n \"validation_file\": null,\n \"training_file\": \"file-abc123\",\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n },\n \"trained_tokens\": 5768,\n \"integrations\": [],\n \"seed\": 0,\n \"estimated_finish\": 0,\n \"method\": {\n \"type\": \"supervised\",\n \"supervised\": {\n \"hyperparameters\": {\n \"n_epochs\": 4,\n \"batch_size\": 1,\n \"learning_rate_multiplier\": 1.0\n }\n }\n },\n \"metadata\": {\n \"key\": \"value\"\n }\n}\n" - } - }, - "OpenAI.FineTuningJobCheckpoint": { - "type": "object", - "required": [ - "id", - "created_at", - "fine_tuned_model_checkpoint", - "step_number", - "metrics", - "fine_tuning_job_id", - "object" - ], - "properties": { - "id": { - "type": "string", - "description": "The checkpoint identifier, which can be referenced in the API endpoints." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the checkpoint was created." - }, - "fine_tuned_model_checkpoint": { - "type": "string", - "description": "The name of the fine-tuned checkpoint model that is created." - }, - "step_number": { - "type": "integer", - "description": "The step number that the checkpoint was created at." - }, - "metrics": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics" - } - ], - "description": "Metrics at the step number during the fine-tuning job." - }, - "fine_tuning_job_id": { - "type": "string", - "description": "The name of the fine-tuning job that this checkpoint was created from." - }, - "object": { - "type": "string", - "enum": [ - "fine_tuning.job.checkpoint" - ], - "description": "The object type, which is always \"fine_tuning.job.checkpoint\".", - "x-stainless-const": true - } - }, - "description": "The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use.", - "title": "FineTuningJobCheckpoint", - "x-oaiMeta": { - "name": "The fine-tuning job checkpoint object", - "example": "{\n \"object\": \"fine_tuning.job.checkpoint\",\n \"id\": \"ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P\",\n \"created_at\": 1712211699,\n \"fine_tuned_model_checkpoint\": \"ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88\",\n \"fine_tuning_job_id\": \"ftjob-fpbNQ3H1GrMehXRf8cO97xTN\",\n \"metrics\": {\n \"step\": 88,\n \"train_loss\": 0.478,\n \"train_mean_token_accuracy\": 0.924,\n \"valid_loss\": 10.112,\n \"valid_mean_token_accuracy\": 0.145,\n \"full_valid_loss\": 0.567,\n \"full_valid_mean_token_accuracy\": 0.944\n },\n \"step_number\": 88\n}\n" - } - }, - "OpenAI.FineTuningJobCheckpointMetrics": { - "type": "object", - "properties": { - "step": { - "type": "number" - }, - "train_loss": { - "type": "number" - }, - "train_mean_token_accuracy": { - "type": "number" - }, - "valid_loss": { - "type": "number" - }, - "valid_mean_token_accuracy": { - "type": "number" - }, - "full_valid_loss": { - "type": "number" - }, - "full_valid_mean_token_accuracy": { - "type": "number" - } - } - }, - "OpenAI.FineTuningJobError": { - "type": "object", - "required": [ - "code", - "message", - "param" - ], - "properties": { - "code": { - "type": "string" - }, - "message": { - "type": "string" - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.FineTuningJobEvent": { - "type": "object", - "required": [ - "object", - "id", - "created_at", - "level", - "message" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "fine_tuning.job.event" - ], - "description": "The object type, which is always \"fine_tuning.job.event\".", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The object identifier." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the fine-tuning job was created." - }, - "level": { - "type": "string", - "enum": [ - "info", - "warn", - "error" - ], - "description": "The log level of the event." - }, - "message": { - "type": "string", - "description": "The message of the event." - }, - "type": { - "type": "string", - "enum": [ - "message", - "metrics" - ], - "description": "The type of event." - }, - "data": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FineTuningJobEventData" - } - ], - "description": "The data associated with the event." - } - }, - "description": "Fine-tuning job event object", - "x-oaiMeta": { - "name": "The fine-tuning job event object", - "example": "{\n \"object\": \"fine_tuning.job.event\",\n \"id\": \"ftevent-abc123\"\n \"created_at\": 1677610602,\n \"level\": \"info\",\n \"message\": \"Created fine-tuning job\",\n \"data\": {},\n \"type\": \"message\"\n}\n" - } - }, - "OpenAI.FineTuningJobEventData": { - "type": "object" - }, - "OpenAI.FineTuningJobHyperparameters": { - "type": "object", - "properties": { - "batch_size": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": "auto" - }, - "learning_rate_multiplier": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "number" - } - ] - }, - "n_epochs": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "integer" - } - ], - "default": "auto" - } - } - }, - "OpenAI.FunctionAndCustomToolCallOutput": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "input_text": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent", - "input_image": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent", - "input_file": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent" - } - } - }, - "OpenAI.FunctionAndCustomToolCallOutputInputFileContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_file" - ], - "description": "The type of the input item. Always `input_file`.", - "x-stainless-const": true, - "default": "input_file" - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "filename": { - "type": "string", - "description": "The name of the file to be sent to the model." - }, - "file_url": { - "type": "string", - "format": "uri", - "description": "The URL of the file to be sent to the model." - }, - "file_data": { - "type": "string", - "description": "The content of the file to be sent to the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" - } - ], - "description": "A file input to the model.", - "title": "Input file" - }, - "OpenAI.FunctionAndCustomToolCallOutputInputImageContent": { - "type": "object", - "required": [ - "type", - "detail" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_image" - ], - "description": "The type of the input item. Always `input_image`.", - "x-stainless-const": true, - "default": "input_image" - }, - "image_url": { - "anyOf": [ - { - "type": "string", - "format": "uri" - }, - { - "type": "null" - } - ] - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "detail": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ImageDetail" - } - ], - "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" - } - ], - "description": "An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).", - "title": "Input image" - }, - "OpenAI.FunctionAndCustomToolCallOutputInputTextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_text" - ], - "description": "The type of the input item. Always `input_text`.", - "x-stainless-const": true, - "default": "input_text" - }, - "text": { - "type": "string", - "description": "The text input to the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" - } - ], - "description": "A text input to the model.", - "title": "Input text" - }, - "OpenAI.FunctionAndCustomToolCallOutputType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "input_text", - "input_image", - "input_file" - ] - } - ] - }, - "OpenAI.FunctionObject": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "description": { - "type": "string", - "description": "A description of what the function does, used by the model to choose when and how to call the function." - }, - "name": { - "type": "string", - "description": "The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64." - }, - "parameters": { - "$ref": "#/components/schemas/OpenAI.FunctionParameters" - }, - "strict": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.FunctionParameters": { - "type": "object", - "unevaluatedProperties": {}, - "description": "The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format.\nOmitting `parameters` defines a function with an empty parameter list." - }, - "OpenAI.FunctionShellAction": { - "type": "object", - "required": [ - "commands", - "timeout_ms", - "max_output_length" - ], - "properties": { - "commands": { - "type": "array", - "items": { - "type": "string" - } - }, - "timeout_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "max_output_length": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - } - }, - "description": "Execute a shell command.", - "title": "Shell exec action" - }, - "OpenAI.FunctionShellCallOutputContent": { - "type": "object", - "required": [ - "stdout", - "stderr", - "outcome" - ], - "properties": { - "stdout": { - "type": "string", - "description": "The standard output that was captured." - }, - "stderr": { - "type": "string", - "description": "The standard error output that was captured." - }, - "outcome": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome" - } - ], - "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk." - }, - "created_by": { - "type": "string", - "description": "The identifier of the actor that created the item." - } - }, - "description": "The content of a shell tool call output that was emitted.", - "title": "Shell call output content" - }, - "OpenAI.FunctionShellCallOutputExitOutcome": { - "type": "object", - "required": [ - "type", - "exit_code" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "exit" - ], - "description": "The outcome type. Always `exit`.", - "x-stainless-const": true, - "default": "exit" - }, - "exit_code": { - "type": "integer", - "description": "Exit code from the shell process." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome" - } - ], - "description": "Indicates that the shell commands finished and returned an exit code.", - "title": "Shell call exit outcome" - }, - "OpenAI.FunctionShellCallOutputOutcome": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "timeout": "#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome", - "exit": "#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome" - } - }, - "description": "Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk.", - "title": "Shell call outcome" - }, - "OpenAI.FunctionShellCallOutputOutcomeType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "timeout", - "exit" - ] - } - ] - }, - "OpenAI.FunctionShellCallOutputTimeoutOutcome": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "timeout" - ], - "description": "The outcome type. Always `timeout`.", - "x-stainless-const": true, - "default": "timeout" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputOutcome" - } - ], - "description": "Indicates that the shell call exceeded its configured time limit.", - "title": "Shell call timeout outcome" - }, - "OpenAI.FunctionShellToolParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell" - ], - "description": "The type of the shell tool. Always `shell`.", - "x-stainless-const": true, - "default": "shell" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A tool that allows the model to execute shell commands.", - "title": "Shell tool" - }, - "OpenAI.FunctionTool": { - "type": "object", - "required": [ - "type", - "name", - "parameters", - "strict" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of the function tool. Always `function`.", - "x-stainless-const": true, - "default": "function" - }, - "name": { - "type": "string", - "description": "The name of the function to call." - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "parameters": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": {} - }, - { - "type": "null" - } - ] - }, - "strict": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling).", - "title": "Function" - }, - "OpenAI.GraderMulti": { - "type": "object", - "required": [ - "type", - "name", - "graders", - "calculate_output" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "multi" - ], - "description": "The object type, which is always `multi`.", - "x-stainless-const": true, - "default": "multi" - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "graders": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.GraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderScoreModel" - }, - { - "$ref": "#/components/schemas/GraderEndpoint" - } - ] - }, - "calculate_output": { - "type": "string", - "description": "A formula to calculate the output based on grader results." - } - }, - "description": "A MultiGrader object combines the output of multiple graders to produce a single score.", - "title": "MultiGrader", - "x-oaiMeta": { - "name": "Multi Grader", - "group": "graders", - "example": "{\n \"type\": \"multi\",\n \"name\": \"example multi grader\",\n \"graders\": [\n {\n \"type\": \"text_similarity\",\n \"name\": \"example text similarity grader\",\n \"input\": \"The graded text\",\n \"reference\": \"The reference text\",\n \"evaluation_metric\": \"fuzzy_match\"\n },\n {\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n }\n ],\n \"calculate_output\": \"0.5 * text_similarity_score + 0.5 * string_check_score)\"\n}\n" - } - }, - "OpenAI.GraderPython": { - "type": "object", - "required": [ - "type", - "name", - "source" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "python" - ], - "description": "The object type, which is always `python`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "source": { - "type": "string", - "description": "The source code of the python script." - }, - "image_tag": { - "type": "string", - "description": "The image tag to use for the python script." - } - }, - "description": "A PythonGrader object that runs a python script on the input.", - "title": "PythonGrader", - "x-oaiMeta": { - "name": "Python Grader", - "group": "graders", - "example": "{\n \"type\": \"python\",\n \"name\": \"Example python grader\",\n \"image_tag\": \"2025-05-08\",\n \"source\": \"\"\"\ndef grade(sample: dict, item: dict) -> float:\n \"\"\"\n Returns 1.0 if `output_text` equals `label`, otherwise 0.0.\n \"\"\"\n output = sample.get(\"output_text\")\n label = item.get(\"label\")\n return 1.0 if output == label else 0.0\n\"\"\",\n}\n" - } - }, - "OpenAI.GraderScoreModel": { - "type": "object", - "required": [ - "type", - "name", - "model", - "input" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "score_model" - ], - "description": "The object type, which is always `score_model`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "model": { - "type": "string", - "description": "The model to use for the evaluation." - }, - "sampling_params": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams" - } - ], - "description": "The sampling parameters for the model." - }, - "input": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.EvalItem" - }, - "description": "The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings." - }, - "range": { - "type": "array", - "items": { - "type": "number" - }, - "description": "The range of the score. Defaults to `[0, 1]`." - } - }, - "description": "A ScoreModelGrader object that uses a model to assign a score to the input.", - "title": "ScoreModelGrader", - "x-oaiMeta": { - "name": "Score Model Grader", - "group": "graders", - "example": "{\n \"type\": \"score_model\",\n \"name\": \"Example score model grader\",\n \"input\": [\n {\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": (\n \"Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different.\"\n \" Return just a floating point score\n\n\"\n \" Reference answer: {{item.label}}\n\n\"\n \" Model answer: {{sample.output_text}}\"\n )\n },\n {\n \"type\": \"input_image\",\n \"image_url\": \"https://example.com/reference.png\",\n \"file_id\": null,\n \"detail\": \"auto\"\n }\n ],\n }\n ],\n \"model\": \"gpt-5-mini\",\n \"sampling_params\": {\n \"temperature\": 1,\n \"top_p\": 1,\n \"seed\": 42,\n \"max_completions_tokens\": 32768,\n \"reasoning_effort\": \"medium\"\n },\n}\n" - } - }, - "OpenAI.GraderStringCheck": { - "type": "object", - "required": [ - "type", - "name", - "input", - "reference", - "operation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "string_check" - ], - "description": "The object type, which is always `string_check`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "input": { - "type": "string", - "description": "The input text. This may include template strings." - }, - "reference": { - "type": "string", - "description": "The reference text. This may include template strings." - }, - "operation": { - "type": "string", - "enum": [ - "eq", - "ne", - "like", - "ilike" - ], - "description": "The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`." - } - }, - "description": "A StringCheckGrader object that performs a string comparison between input and reference using a specified operation.", - "title": "StringCheckGrader", - "x-oaiMeta": { - "name": "String Check Grader", - "group": "graders", - "example": "{\n \"type\": \"string_check\",\n \"name\": \"Example string check grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"operation\": \"eq\"\n}\n" - } - }, - "OpenAI.GraderTextSimilarity": { - "type": "object", - "required": [ - "type", - "name", - "input", - "reference", - "evaluation_metric" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text_similarity" - ], - "description": "The type of grader.", - "x-stainless-const": true, - "default": "text_similarity" - }, - "name": { - "type": "string", - "description": "The name of the grader." - }, - "input": { - "type": "string", - "description": "The text being graded." - }, - "reference": { - "type": "string", - "description": "The text being graded against." - }, - "evaluation_metric": { - "type": "string", - "enum": [ - "cosine", - "fuzzy_match", - "bleu", - "gleu", - "meteor", - "rouge_1", - "rouge_2", - "rouge_3", - "rouge_4", - "rouge_5", - "rouge_l" - ], - "description": "The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`,\n `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`,\n or `rouge_l`." - } - }, - "description": "A TextSimilarityGrader object which grades text based on similarity metrics.", - "title": "TextSimilarityGrader", - "x-oaiMeta": { - "name": "Text Similarity Grader", - "group": "graders", - "example": "{\n \"type\": \"text_similarity\",\n \"name\": \"Example text similarity grader\",\n \"input\": \"{{sample.output_text}}\",\n \"reference\": \"{{item.label}}\",\n \"evaluation_metric\": \"fuzzy_match\"\n}\n" - } - }, - "OpenAI.GrammarSyntax1": { - "type": "string", - "enum": [ - "lark", - "regex" - ] - }, - "OpenAI.HybridSearchOptions": { - "type": "object", - "required": [ - "embedding_weight", - "text_weight" - ], - "properties": { - "embedding_weight": { - "type": "number", - "description": "The weight of the embedding in the reciprocal ranking fusion." - }, - "text_weight": { - "type": "number", - "description": "The weight of the text in the reciprocal ranking fusion." - } - } - }, - "OpenAI.Image": { - "type": "object", - "required": [ - "prompt_filter_results", - "content_filter_results" - ], - "properties": { - "b64_json": { - "type": "string", - "contentEncoding": "base64", - "description": "The base64-encoded JSON of the generated image. Returned by default for the GPT image models, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`." - }, - "url": { - "type": "string", - "format": "uri", - "description": "When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for the GPT image models." - }, - "revised_prompt": { - "type": "string", - "description": "For `dall-e-3` only, the revised prompt that was used to generate the image." - }, - "prompt_filter_results": { - "$ref": "#/components/schemas/AzureContentFilterImagePromptResults" - }, - "content_filter_results": { - "$ref": "#/components/schemas/AzureContentFilterImageResponseResults" - } - }, - "description": "Represents the content or the URL of an image generated by the OpenAI API." - }, - "OpenAI.ImageDetail": { - "type": "string", - "enum": [ - "low", - "high", - "auto" - ] - }, - "OpenAI.ImageGenInputUsageDetails": { - "type": "object", - "required": [ - "text_tokens", - "image_tokens" - ], - "properties": { - "text_tokens": { - "type": "integer", - "description": "The number of text tokens in the input prompt." - }, - "image_tokens": { - "type": "integer", - "description": "The number of image tokens in the input prompt." - } - }, - "description": "The input tokens detailed information for the image generation.", - "title": "Input usage details" - }, - "OpenAI.ImageGenOutputTokensDetails": { - "type": "object", - "required": [ - "image_tokens", - "text_tokens" - ], - "properties": { - "image_tokens": { - "type": "integer", - "description": "The number of image output tokens generated by the model." - }, - "text_tokens": { - "type": "integer", - "description": "The number of text output tokens generated by the model." - } - }, - "description": "The output token details for the image generation.", - "title": "Image generation output token details" - }, - "OpenAI.ImageGenTool": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_generation" - ], - "description": "The type of the image generation tool. Always `image_generation`.", - "x-stainless-const": true, - "default": "image_generation" - }, - "model": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "gpt-image-1", - "gpt-image-1-mini" - ] - } - ], - "default": "gpt-image-1" - }, - "quality": { - "type": "string", - "enum": [ - "low", - "medium", - "high", - "auto" - ], - "description": "The quality of the generated image. One of `low`, `medium`, `high`,\n or `auto`. Default: `auto`.", - "default": "auto" - }, - "size": { - "type": "string", - "enum": [ - "1024x1024", - "1024x1536", - "1536x1024", - "auto" - ], - "description": "The size of the generated image. One of `1024x1024`, `1024x1536`,\n `1536x1024`, or `auto`. Default: `auto`.", - "default": "auto" - }, - "output_format": { - "type": "string", - "enum": [ - "png", - "webp", - "jpeg" - ], - "description": "The output format of the generated image. One of `png`, `webp`, or\n `jpeg`. Default: `png`.", - "default": "png" - }, - "output_compression": { - "type": "integer", - "minimum": 0, - "maximum": 100, - "description": "Compression level for the output image. Default: 100.", - "default": 100 - }, - "moderation": { - "type": "string", - "enum": [ - "auto", - "low" - ], - "description": "Moderation level for the generated image. Default: `auto`.", - "default": "auto" - }, - "background": { - "type": "string", - "enum": [ - "transparent", - "opaque", - "auto" - ], - "description": "Background type for the generated image. One of `transparent`,\n `opaque`, or `auto`. Default: `auto`.", - "default": "auto" - }, - "input_fidelity": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputFidelity" - }, - { - "type": "null" - } - ] - }, - "input_image_mask": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ImageGenToolInputImageMask" - } - ], - "description": "Optional mask for inpainting. Contains `image_url`\n (string, optional) and `file_id` (string, optional)." - }, - "partial_images": { - "type": "integer", - "minimum": 0, - "maximum": 3, - "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A tool that generates images using the GPT image models.", - "title": "Image generation tool" - }, - "OpenAI.ImageGenToolInputImageMask": { - "type": "object", - "properties": { - "image_url": { - "type": "string" - }, - "file_id": { - "type": "string" - } - } - }, - "OpenAI.ImageGenUsage": { - "type": "object", - "required": [ - "input_tokens", - "total_tokens", - "output_tokens", - "input_tokens_details" - ], - "properties": { - "input_tokens": { - "type": "integer", - "description": "The number of tokens (images and text) in the input prompt." - }, - "total_tokens": { - "type": "integer", - "description": "The total number of tokens (images and text) used for the image generation." - }, - "output_tokens": { - "type": "integer", - "description": "The number of output tokens generated by the model." - }, - "output_tokens_details": { - "$ref": "#/components/schemas/OpenAI.ImageGenOutputTokensDetails" - }, - "input_tokens_details": { - "$ref": "#/components/schemas/OpenAI.ImageGenInputUsageDetails" - } - }, - "description": "For `gpt-image-1` only, the token usage information for the image generation.", - "title": "Image generation usage" - }, - "OpenAI.ImagesResponse": { - "type": "object", - "required": [ - "created" - ], - "properties": { - "created": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) of when the image was created." - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Image" - }, - "description": "The list of generated images." - }, - "background": { - "type": "string", - "enum": [ - "transparent", - "opaque" - ], - "description": "The background parameter used for the image generation. Either `transparent` or `opaque`." - }, - "output_format": { - "type": "string", - "enum": [ - "png", - "webp", - "jpeg" - ], - "description": "The output format of the image generation. Either `png`, `webp`, or `jpeg`." - }, - "size": { - "type": "string", - "enum": [ - "1024x1024", - "1024x1536", - "1536x1024" - ], - "description": "The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`." - }, - "quality": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ], - "description": "The quality of the image generated. Either `low`, `medium`, or `high`." - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.ImageGenUsage" - } - }, - "description": "The response from the image generation endpoint.", - "title": "Image generation response", - "x-oaiMeta": { - "name": "The image generation response", - "group": "images", - "example": "{\n \"created\": 1713833628,\n \"data\": [\n {\n \"b64_json\": \"...\"\n }\n ],\n \"background\": \"transparent\",\n \"output_format\": \"png\",\n \"size\": \"1024x1024\",\n \"quality\": \"high\",\n \"usage\": {\n \"total_tokens\": 100,\n \"input_tokens\": 50,\n \"output_tokens\": 50,\n \"input_tokens_details\": {\n \"text_tokens\": 10,\n \"image_tokens\": 40\n }\n }\n}\n" - } - }, - "OpenAI.IncludeEnum": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "file_search_call.results", - "web_search_call.results", - "web_search_call.action.sources", - "message.input_image.image_url", - "computer_call_output.output.image_url", - "code_interpreter_call.outputs", - "reasoning.encrypted_content", - "message.output_text.logprobs" - ] - } - ], - "description": "Specify additional output data to include in the model response. Currently supported values are:\n- `web_search_call.action.sources`: Include the sources of the web search tool call.\n- `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items.\n- `computer_call_output.output.image_url`: Include image urls from the computer call output.\n- `file_search_call.results`: Include the search results of the file search tool call.\n- `message.input_image.image_url`: Include image urls from the input message.\n- `message.output_text.logprobs`: Include logprobs with assistant messages.\n- `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program)." - }, - "OpenAI.InputAudio": { - "type": "object", - "required": [ - "type", - "input_audio" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_audio" - ], - "description": "The type of the input item. Always `input_audio`.", - "x-stainless-const": true - }, - "input_audio": { - "$ref": "#/components/schemas/OpenAI.InputAudioInputAudio" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.EvalItemContentItemObject" - } - ], - "description": "An audio input to the model.", - "title": "Input audio" - }, - "OpenAI.InputAudioInputAudio": { - "type": "object", - "required": [ - "data", - "format" - ], - "properties": { - "data": { - "type": "string" - }, - "format": { - "type": "string", - "enum": [ - "mp3", - "wav" - ] - } - } - }, - "OpenAI.InputContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.InputContentType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "input_text": "#/components/schemas/OpenAI.InputContentInputTextContent", - "input_image": "#/components/schemas/OpenAI.InputContentInputImageContent", - "input_file": "#/components/schemas/OpenAI.InputContentInputFileContent" - } - } - }, - "OpenAI.InputContentInputFileContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_file" - ], - "description": "The type of the input item. Always `input_file`.", - "x-stainless-const": true, - "default": "input_file" - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "filename": { - "type": "string", - "description": "The name of the file to be sent to the model." - }, - "file_url": { - "type": "string", - "format": "uri", - "description": "The URL of the file to be sent to the model." - }, - "file_data": { - "type": "string", - "description": "The content of the file to be sent to the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputContent" - } - ], - "description": "A file input to the model.", - "title": "Input file" - }, - "OpenAI.InputContentInputImageContent": { - "type": "object", - "required": [ - "type", - "detail" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_image" - ], - "description": "The type of the input item. Always `input_image`.", - "x-stainless-const": true, - "default": "input_image" - }, - "image_url": { - "anyOf": [ - { - "type": "string", - "format": "uri" - }, - { - "type": "null" - } - ] - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "detail": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ImageDetail" - } - ], - "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputContent" - } - ], - "description": "An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).", - "title": "Input image" - }, - "OpenAI.InputContentInputTextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_text" - ], - "description": "The type of the input item. Always `input_text`.", - "x-stainless-const": true, - "default": "input_text" - }, - "text": { - "type": "string", - "description": "The text input to the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputContent" - } - ], - "description": "A text input to the model.", - "title": "Input text" - }, - "OpenAI.InputContentType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "input_text", - "input_image", - "input_file" - ] - } - ] - }, - "OpenAI.InputFidelity": { - "type": "string", - "enum": [ - "high", - "low" - ], - "description": "Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`." - }, - "OpenAI.InputFileContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_file" - ], - "description": "The type of the input item. Always `input_file`.", - "x-stainless-const": true, - "default": "input_file" - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "filename": { - "type": "string", - "description": "The name of the file to be sent to the model." - }, - "file_url": { - "type": "string", - "format": "uri", - "description": "The URL of the file to be sent to the model." - }, - "file_data": { - "type": "string", - "description": "The content of the file to be sent to the model." - } - }, - "description": "A file input to the model.", - "title": "Input file" - }, - "OpenAI.InputImageContent": { - "type": "object", - "required": [ - "type", - "detail" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_image" - ], - "description": "The type of the input item. Always `input_image`.", - "x-stainless-const": true, - "default": "input_image" - }, - "image_url": { - "anyOf": [ - { - "type": "string", - "format": "uri" - }, - { - "type": "null" - } - ] - }, - "file_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "detail": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ImageDetail" - } - ], - "description": "The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`." - } - }, - "description": "An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).", - "title": "Input image" - }, - "OpenAI.InputItem": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.InputItemType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "message": "#/components/schemas/OpenAI.EasyInputMessage", - "item_reference": "#/components/schemas/OpenAI.ItemReferenceParam" - } - } - }, - "OpenAI.InputItemType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "message", - "item_reference" - ] - } - ] - }, - "OpenAI.InputMessageContentList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputContent" - }, - "description": "A list of one or many input items to the model, containing different content\ntypes.", - "title": "Input item content list" - }, - "OpenAI.InputMessageResource": { - "type": "object", - "required": [ - "type", - "role", - "content", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "message" - ], - "description": "The type of the message input. Always set to `message`.", - "x-stainless-const": true - }, - "role": { - "type": "string", - "enum": [ - "user", - "system", - "developer" - ], - "description": "The role of the message input. One of `user`, `system`, or `developer`." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - }, - "content": { - "$ref": "#/components/schemas/OpenAI.InputMessageContentList" - }, - "id": { - "type": "string", - "description": "The unique ID of the message input." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ] - }, - "OpenAI.InputParam": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - } - ], - "description": "Text, image, or file inputs to the model, used to generate a response.\nLearn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Image inputs](https://platform.openai.com/docs/guides/images)\n- [File inputs](https://platform.openai.com/docs/guides/pdf-files)\n- [Conversation state](https://platform.openai.com/docs/guides/conversation-state)\n- [Function calling](https://platform.openai.com/docs/guides/function-calling)" - }, - "OpenAI.InputTextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "input_text" - ], - "description": "The type of the input item. Always `input_text`.", - "x-stainless-const": true, - "default": "input_text" - }, - "text": { - "type": "string", - "description": "The text input to the model." - } - }, - "description": "A text input to the model.", - "title": "Input text" - }, - "OpenAI.ItemReferenceParam": { - "type": "object", - "required": [ - "type", - "id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "item_reference" - ], - "description": "The type of item to reference. Always `item_reference`.", - "x-stainless-const": true, - "default": "item_reference" - }, - "id": { - "type": "string", - "description": "The ID of the item to reference." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - ], - "description": "An internal identifier for an item to reference.", - "title": "Item reference" - }, - "OpenAI.ItemResource": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ItemResourceType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "message": "#/components/schemas/OpenAI.InputMessageResource", - "output_message": "#/components/schemas/OpenAI.ItemResourceOutputMessage", - "file_search_call": "#/components/schemas/OpenAI.ItemResourceFileSearchToolCall", - "computer_call": "#/components/schemas/OpenAI.ItemResourceComputerToolCall", - "computer_call_output": "#/components/schemas/OpenAI.ItemResourceComputerToolCallOutputResource", - "web_search_call": "#/components/schemas/OpenAI.ItemResourceWebSearchToolCall", - "function_call": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallResource", - "function_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutputResource", - "image_generation_call": "#/components/schemas/OpenAI.ItemResourceImageGenToolCall", - "code_interpreter_call": "#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall", - "local_shell_call": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCall", - "local_shell_call_output": "#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput", - "shell_call": "#/components/schemas/OpenAI.ItemResourceFunctionShellCall", - "shell_call_output": "#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput", - "apply_patch_call": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall", - "apply_patch_call_output": "#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput", - "mcp_list_tools": "#/components/schemas/OpenAI.ItemResourceMcpListTools", - "mcp_approval_request": "#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest", - "mcp_approval_response": "#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource", - "mcp_call": "#/components/schemas/OpenAI.ItemResourceMcpToolCall" - } - }, - "description": "Content item used to generate a response." - }, - "OpenAI.ItemResourceApplyPatchToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "status", - "operation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch_call" - ], - "description": "The type of the item. Always `apply_patch_call`.", - "x-stainless-const": true, - "default": "apply_patch_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the apply patch tool call generated by the model." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus" - } - ], - "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." - }, - "operation": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" - } - ], - "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A tool call that applies file diffs by creating, deleting, or updating files.", - "title": "Apply patch tool call" - }, - "OpenAI.ItemResourceApplyPatchToolCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch_call_output" - ], - "description": "The type of the item. Always `apply_patch_call_output`.", - "x-stainless-const": true, - "default": "apply_patch_call_output" - }, - "id": { - "type": "string", - "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the apply patch tool call generated by the model." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus" - } - ], - "description": "The status of the apply patch tool call output. One of `completed` or `failed`." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call output." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "The output emitted by an apply patch tool call.", - "title": "Apply patch tool call output" - }, - "OpenAI.ItemResourceCodeInterpreterToolCall": { - "type": "object", - "required": [ - "type", - "id", - "status", - "container_id", - "code", - "outputs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "code_interpreter_call" - ], - "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.", - "x-stainless-const": true, - "default": "code_interpreter_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the code interpreter tool call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete", - "interpreting", - "failed" - ], - "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." - }, - "container_id": { - "type": "string", - "description": "The ID of the container used to run the code." - }, - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "outputs": { - "anyOf": [ - { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs" - }, - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage" - } - ] - } - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A tool call to run code.", - "title": "Code interpreter tool call" - }, - "OpenAI.ItemResourceComputerToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "pending_safety_checks", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_call" - ], - "description": "The type of the computer call. Always `computer_call`.", - "default": "computer_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the computer call." - }, - "call_id": { - "type": "string", - "description": "An identifier used when responding to the tool call with output." - }, - "action": { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - }, - "pending_safety_checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" - }, - "description": "The pending safety checks for the computer call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.", - "title": "Computer tool call" - }, - "OpenAI.ItemResourceComputerToolCallOutputResource": { - "type": "object", - "required": [ - "type", - "call_id", - "output" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_call_output" - ], - "description": "The type of the computer tool call output. Always `computer_call_output`.", - "x-stainless-const": true, - "default": "computer_call_output" - }, - "id": { - "type": "string", - "description": "The ID of the computer tool call output." - }, - "call_id": { - "type": "string", - "description": "The ID of the computer tool call that produced the output." - }, - "acknowledged_safety_checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" - }, - "description": "The safety checks reported by the API that have been acknowledged by the\n developer." - }, - "output": { - "$ref": "#/components/schemas/OpenAI.ComputerScreenshotImage" - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ] - }, - "OpenAI.ItemResourceFileSearchToolCall": { - "type": "object", - "required": [ - "id", - "type", - "status", - "queries" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the file search tool call." - }, - "type": { - "type": "string", - "enum": [ - "file_search_call" - ], - "description": "The type of the file search tool call. Always `file_search_call`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "searching", - "completed", - "incomplete", - "failed" - ], - "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`," - }, - "queries": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The queries used to search for files." - }, - "results": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults" - } - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.", - "title": "File search tool call" - }, - "OpenAI.ItemResourceFunctionShellCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell_call" - ], - "description": "The type of the item. Always `shell_call`.", - "x-stainless-const": true, - "default": "shell_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the shell tool call. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the shell tool call generated by the model." - }, - "action": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionShellAction" - } - ], - "description": "The shell commands and limits that describe how to run the tool call." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.LocalShellCallStatus" - } - ], - "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A tool call that executes one or more shell commands in a managed environment.", - "title": "Shell tool call" - }, - "OpenAI.ItemResourceFunctionShellCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "output", - "max_output_length" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell_call_output" - ], - "description": "The type of the shell call output. Always `shell_call_output`.", - "x-stainless-const": true, - "default": "shell_call_output" - }, - "id": { - "type": "string", - "description": "The unique ID of the shell call output. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the shell tool call generated by the model." - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent" - }, - "description": "An array of shell call output contents" - }, - "max_output_length": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "created_by": { - "type": "string", - "description": "The identifier of the actor that created the item." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "The output of a shell tool call that was emitted.", - "title": "Shell call output" - }, - "OpenAI.ItemResourceFunctionToolCallOutputResource": { - "type": "object", - "required": [ - "type", - "call_id", - "output" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the function tool call output. Populated when this item\n is returned via API." - }, - "type": { - "type": "string", - "enum": [ - "function_call_output" - ], - "description": "The type of the function tool call output. Always `function_call_output`.", - "x-stainless-const": true - }, - "call_id": { - "type": "string", - "description": "The unique ID of the function tool call generated by the model." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput" - } - } - ], - "description": "The output from the function call generated by your code.\n Can be a string or an list of output content." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ] - }, - "OpenAI.ItemResourceFunctionToolCallResource": { - "type": "object", - "required": [ - "type", - "call_id", - "name", - "arguments" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the function tool call." - }, - "type": { - "type": "string", - "enum": [ - "function_call" - ], - "description": "The type of the function tool call. Always `function_call`.", - "x-stainless-const": true - }, - "call_id": { - "type": "string", - "description": "The unique ID of the function tool call generated by the model." - }, - "name": { - "type": "string", - "description": "The name of the function to run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of the arguments to pass to the function." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ] - }, - "OpenAI.ItemResourceImageGenToolCall": { - "type": "object", - "required": [ - "type", - "id", - "status", - "result" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_generation_call" - ], - "description": "The type of the image generation call. Always `image_generation_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the image generation call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "generating", - "failed" - ], - "description": "The status of the image generation call." - }, - "result": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "An image generation request made by the model.", - "title": "Image generation call" - }, - "OpenAI.ItemResourceLocalShellToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local_shell_call" - ], - "description": "The type of the local shell call. Always `local_shell_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the local shell call." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the local shell tool call generated by the model." - }, - "action": { - "$ref": "#/components/schemas/OpenAI.LocalShellExecAction" - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the local shell call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A tool call to run a command on the local shell.", - "title": "Local shell call" - }, - "OpenAI.ItemResourceLocalShellToolCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "output" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local_shell_call_output" - ], - "description": "The type of the local shell tool call output. Always `local_shell_call_output`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the local shell tool call generated by the model." - }, - "output": { - "type": "string", - "description": "A JSON string of the output of the local shell tool call." - }, - "status": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ] - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "The output of a local shell tool call.", - "title": "Local shell call output" - }, - "OpenAI.ItemResourceMcpApprovalRequest": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "name", - "arguments" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_approval_request" - ], - "description": "The type of the item. Always `mcp_approval_request`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the approval request." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server making the request." - }, - "name": { - "type": "string", - "description": "The name of the tool to run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of arguments for the tool." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A request for human approval of a tool invocation.", - "title": "MCP approval request" - }, - "OpenAI.ItemResourceMcpApprovalResponseResource": { - "type": "object", - "required": [ - "type", - "id", - "approval_request_id", - "approve" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_approval_response" - ], - "description": "The type of the item. Always `mcp_approval_response`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the approval response" - }, - "approval_request_id": { - "type": "string", - "description": "The ID of the approval request being answered." - }, - "approve": { - "type": "boolean", - "description": "Whether the request was approved." - }, - "reason": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A response to an MCP approval request.", - "title": "MCP approval response" - }, - "OpenAI.ItemResourceMcpListTools": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "tools" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_list_tools" - ], - "description": "The type of the item. Always `mcp_list_tools`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the list." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.MCPListToolsTool" - }, - "description": "The tools available on the server." - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "A list of tools available on an MCP server.", - "title": "MCP list tools" - }, - "OpenAI.ItemResourceMcpToolCall": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "name", - "arguments" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_call" - ], - "description": "The type of the item. Always `mcp_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the tool call." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server running the tool." - }, - "name": { - "type": "string", - "description": "The name of the tool that was run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of the arguments passed to the tool." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus" - } - ], - "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`." - }, - "approval_request_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "An invocation of a tool on an MCP server.", - "title": "MCP tool call" - }, - "OpenAI.ItemResourceOutputMessage": { - "type": "object", - "required": [ - "id", - "type", - "role", - "content", - "status" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the output message.", - "x-stainless-go-json": "omitzero" - }, - "type": { - "type": "string", - "enum": [ - "output_message" - ], - "description": "The type of the output message. Always `message`.", - "x-stainless-const": true - }, - "role": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "The role of the output message. Always `assistant`.", - "x-stainless-const": true - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OutputMessageContent" - }, - "description": "The content of the output message." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "An output message from the model.", - "title": "Output message" - }, - "OpenAI.ItemResourceType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "message", - "output_message", - "file_search_call", - "computer_call", - "computer_call_output", - "web_search_call", - "function_call", - "function_call_output", - "image_generation_call", - "code_interpreter_call", - "local_shell_call", - "local_shell_call_output", - "shell_call", - "shell_call_output", - "apply_patch_call", - "apply_patch_call_output", - "mcp_list_tools", - "mcp_approval_request", - "mcp_approval_response", - "mcp_call" - ] - } - ] - }, - "OpenAI.ItemResourceWebSearchToolCall": { - "type": "object", - "required": [ - "id", - "type", - "status", - "action" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the web search tool call." - }, - "type": { - "type": "string", - "enum": [ - "web_search_call" - ], - "description": "The type of the web search tool call. Always `web_search_call`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "searching", - "completed", - "failed" - ], - "description": "The status of the web search tool call." - }, - "action": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch" - }, - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage" - }, - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionFind" - } - ], - "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find)." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ItemResource" - } - ], - "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.", - "title": "Web search tool call" - }, - "OpenAI.KeyPressAction": { - "type": "object", - "required": [ - "type", - "keys" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "keypress" - ], - "description": "Specifies the event type. For a keypress action, this property is always set to `keypress`.", - "x-stainless-const": true, - "default": "keypress" - }, - "keys": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A collection of keypresses the model would like to perform.", - "title": "KeyPress" - }, - "OpenAI.ListBatchesResponse": { - "type": "object", - "required": [ - "data", - "has_more", - "object" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Batch" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - }, - "object": { - "type": "string", - "enum": [ - "list" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.ListFilesResponse": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OpenAIFile" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListFineTuningCheckpointPermissionResponse": { - "type": "object", - "required": [ - "data", - "object", - "has_more" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FineTuningCheckpointPermission" - } - }, - "object": { - "type": "string", - "enum": [ - "list" - ], - "x-stainless-const": true - }, - "first_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "last_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListFineTuningJobCheckpointsResponse": { - "type": "object", - "required": [ - "data", - "object", - "has_more" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FineTuningJobCheckpoint" - } - }, - "object": { - "type": "string", - "enum": [ - "list" - ], - "x-stainless-const": true - }, - "first_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "last_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListFineTuningJobEventsResponse": { - "type": "object", - "required": [ - "data", - "object", - "has_more" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FineTuningJobEvent" - } - }, - "object": { - "type": "string", - "enum": [ - "list" - ], - "x-stainless-const": true - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListMessagesResponse": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.MessageObject" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListModelsResponse": { - "type": "object", - "required": [ - "object", - "data" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "x-stainless-const": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Model" - } - } - } - }, - "OpenAI.ListPaginatedFineTuningJobsResponse": { - "type": "object", - "required": [ - "data", - "has_more", - "object" - ], - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FineTuningJob" - } - }, - "has_more": { - "type": "boolean" - }, - "object": { - "type": "string", - "enum": [ - "list" - ], - "x-stainless-const": true - } - } - }, - "OpenAI.ListRunStepsResponse": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RunStepObject" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListRunsResponse": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RunObject" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListVectorStoreFilesResponse": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileObject" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.ListVectorStoresResponse": { - "type": "object", - "required": [ - "object", - "data", - "first_id", - "last_id", - "has_more" - ], - "properties": { - "object": { - "type": "string" - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.VectorStoreObject" - } - }, - "first_id": { - "type": "string" - }, - "last_id": { - "type": "string" - }, - "has_more": { - "type": "boolean" - } - } - }, - "OpenAI.LocalShellCallStatus": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ] - }, - "OpenAI.LocalShellExecAction": { - "type": "object", - "required": [ - "type", - "command", - "env" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "exec" - ], - "description": "The type of the local shell action. Always `exec`.", - "x-stainless-const": true, - "default": "exec" - }, - "command": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The command to run." - }, - "timeout_ms": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "working_directory": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "env": { - "type": "object", - "unevaluatedProperties": { - "type": "string" - }, - "description": "Environment variables to set for the command.", - "x-oaiTypeLabel": "map" - }, - "user": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "description": "Execute a shell command on the server.", - "title": "Local shell exec action" - }, - "OpenAI.LocalShellToolParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local_shell" - ], - "description": "The type of the local shell tool. Always `local_shell`.", - "x-stainless-const": true, - "default": "local_shell" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "A tool that allows the model to execute shell commands in a local environment.", - "title": "Local shell tool" - }, - "OpenAI.LogProb": { - "type": "object", - "required": [ - "token", - "logprob", - "bytes", - "top_logprobs" - ], - "properties": { - "token": { - "type": "string" - }, - "logprob": { - "type": "number" - }, - "bytes": { - "type": "array", - "items": { - "type": "integer" - } - }, - "top_logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.TopLogProb" - } - } - }, - "description": "The log probability of a token.", - "title": "Log probability" - }, - "OpenAI.MCPListToolsTool": { - "type": "object", - "required": [ - "name", - "input_schema" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the tool." - }, - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "input_schema": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MCPListToolsToolInputSchema" - } - ], - "description": "The JSON schema describing the tool's input." - }, - "annotations": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.MCPListToolsToolAnnotations" - }, - { - "type": "null" - } - ] - } - }, - "description": "A tool available on an MCP server.", - "title": "MCP list tools tool" - }, - "OpenAI.MCPListToolsToolAnnotations": { - "type": "object" - }, - "OpenAI.MCPListToolsToolInputSchema": { - "type": "object" - }, - "OpenAI.MCPTool": { - "type": "object", - "required": [ - "type", - "server_label" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp" - ], - "description": "The type of the MCP tool. Always `mcp`.", - "x-stainless-const": true - }, - "server_label": { - "type": "string", - "description": "A label for this MCP server, used to identify it in tool calls." - }, - "server_url": { - "type": "string", - "format": "uri", - "description": "The URL for the MCP server. One of `server_url` or `connector_id` must be\n provided." - }, - "connector_id": { - "type": "string", - "enum": [ - "connector_dropbox", - "connector_gmail", - "connector_googlecalendar", - "connector_googledrive", - "connector_microsoftteams", - "connector_outlookcalendar", - "connector_outlookemail", - "connector_sharepoint" - ], - "description": "Identifier for service connectors, like those available in ChatGPT. One of\n `server_url` or `connector_id` must be provided. Learn more about service\n connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors).\n Currently supported `connector_id` values are:\n - Dropbox: `connector_dropbox`\n - Gmail: `connector_gmail`\n - Google Calendar: `connector_googlecalendar`\n - Google Drive: `connector_googledrive`\n - Microsoft Teams: `connector_microsoftteams`\n - Outlook Calendar: `connector_outlookcalendar`\n - Outlook Email: `connector_outlookemail`\n - SharePoint: `connector_sharepoint`" - }, - "authorization": { - "type": "string", - "description": "An OAuth access token that can be used with a remote MCP server, either\n with a custom MCP server URL or a service connector. Your application\n must handle the OAuth authorization flow and provide the token here." - }, - "server_description": { - "type": "string", - "description": "Optional description of the MCP server, used to provide more context." - }, - "headers": { - "anyOf": [ - { - "type": "object", - "unevaluatedProperties": { - "type": "string" - } - }, - { - "type": "null" - } - ] - }, - "allowed_tools": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "$ref": "#/components/schemas/OpenAI.MCPToolFilter" - }, - { - "type": "null" - } - ] - }, - "require_approval": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.MCPToolRequireApproval" - }, - { - "type": "string", - "enum": [ - "always", - "never" - ] - }, - { - "type": "null" - } - ], - "default": "always" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "Give the model access to additional tools via remote Model Context Protocol\n(MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp).", - "title": "MCP tool" - }, - "OpenAI.MCPToolCallStatus": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete", - "calling", - "failed" - ] - }, - "OpenAI.MCPToolFilter": { - "type": "object", - "properties": { - "tool_names": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of allowed tool names.", - "title": "MCP allowed tools" - }, - "read_only": { - "type": "boolean", - "description": "Indicates whether or not a tool modifies data or is read-only. If an\n MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint),\n it will match this filter." - } - }, - "description": "A filter object to specify which tools are allowed.", - "title": "MCP tool filter" - }, - "OpenAI.MCPToolRequireApproval": { - "type": "object", - "properties": { - "always": { - "$ref": "#/components/schemas/OpenAI.MCPToolFilter" - }, - "never": { - "$ref": "#/components/schemas/OpenAI.MCPToolFilter" - } - } - }, - "OpenAI.MessageContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.MessageContentType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "image_url": "#/components/schemas/OpenAI.MessageContentImageUrlObject", - "text": "#/components/schemas/OpenAI.MessageContentTextObject", - "refusal": "#/components/schemas/OpenAI.MessageContentRefusalObject" - } - } - }, - "OpenAI.MessageContentImageFileObject": { - "type": "object", - "required": [ - "type", - "image_file" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_file" - ], - "description": "Always `image_file`.", - "x-stainless-const": true - }, - "image_file": { - "$ref": "#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageContent" - } - ], - "description": "References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message.", - "title": "Image file" - }, - "OpenAI.MessageContentImageFileObjectImageFile": { - "type": "object", - "required": [ - "file_id" - ], - "properties": { - "file_id": { - "type": "string" - }, - "detail": { - "type": "string", - "enum": [ - "auto", - "low", - "high" - ], - "default": "auto" - } - } - }, - "OpenAI.MessageContentImageUrlObject": { - "type": "object", - "required": [ - "type", - "image_url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_url" - ], - "description": "The type of the content part.", - "x-stainless-const": true - }, - "image_url": { - "$ref": "#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageContent" - } - ], - "description": "References an image URL in the content of a message.", - "title": "Image URL" - }, - "OpenAI.MessageContentImageUrlObjectImageUrl": { - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "type": "string", - "format": "uri" - }, - "detail": { - "type": "string", - "enum": [ - "auto", - "low", - "high" - ], - "default": "auto" - } - } - }, - "OpenAI.MessageContentRefusalObject": { - "type": "object", - "required": [ - "type", - "refusal" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "refusal" - ], - "description": "Always `refusal`.", - "x-stainless-const": true - }, - "refusal": { - "type": "string" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageContent" - } - ], - "description": "The refusal content generated by the assistant.", - "title": "Refusal" - }, - "OpenAI.MessageContentTextAnnotationsFileCitationObject": { - "type": "object", - "required": [ - "type", - "text", - "file_citation", - "start_index", - "end_index" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_citation" - ], - "description": "Always `file_citation`.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "The text in the message content that needs to be replaced." - }, - "file_citation": { - "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation" - }, - "start_index": { - "type": "integer", - "minimum": 0 - }, - "end_index": { - "type": "integer", - "minimum": 0 - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.TextAnnotation" - } - ], - "description": "A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the \"file_search\" tool to search files.", - "title": "File citation" - }, - "OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation": { - "type": "object", - "required": [ - "file_id" - ], - "properties": { - "file_id": { - "type": "string" - } - } - }, - "OpenAI.MessageContentTextAnnotationsFilePathObject": { - "type": "object", - "required": [ - "type", - "text", - "file_path", - "start_index", - "end_index" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_path" - ], - "description": "Always `file_path`.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "The text in the message content that needs to be replaced." - }, - "file_path": { - "$ref": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath" - }, - "start_index": { - "type": "integer", - "minimum": 0 - }, - "end_index": { - "type": "integer", - "minimum": 0 - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.TextAnnotation" - } - ], - "description": "A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file.", - "title": "File path" - }, - "OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath": { - "type": "object", - "required": [ - "file_id" - ], - "properties": { - "file_id": { - "type": "string" - } - } - }, - "OpenAI.MessageContentTextObject": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "Always `text`.", - "x-stainless-const": true - }, - "text": { - "$ref": "#/components/schemas/OpenAI.MessageContentTextObjectText" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageContent" - } - ], - "description": "The text content that is part of a message.", - "title": "Text" - }, - "OpenAI.MessageContentTextObjectText": { - "type": "object", - "required": [ - "value", - "annotations" - ], - "properties": { - "value": { - "type": "string" - }, - "annotations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.TextAnnotation" - } - } - } - }, - "OpenAI.MessageContentType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "image_file", - "image_url", - "text", - "refusal" - ] - } - ] - }, - "OpenAI.MessageObject": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "thread_id", - "status", - "incomplete_details", - "completed_at", - "incomplete_at", - "role", - "content", - "assistant_id", - "run_id", - "attachments", - "metadata" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "thread.message" - ], - "description": "The object type, which is always `thread.message`.", - "x-stainless-const": true - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the message was created." - }, - "thread_id": { - "type": "string", - "description": "The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "incomplete", - "completed" - ], - "description": "The status of the message, which can be either `in_progress`, `incomplete`, or `completed`." - }, - "incomplete_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.MessageObjectIncompleteDetails" - }, - { - "type": "null" - } - ] - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "incomplete_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "role": { - "type": "string", - "enum": [ - "user", - "assistant" - ], - "description": "The entity that produced the message. One of `user` or `assistant`." - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.MessageContent" - }, - "description": "The content of the message in array of text and/or images." - }, - "assistant_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "run_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "attachments": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.MessageObjectAttachments" - } - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - }, - "description": "Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads).", - "title": "The message object", - "x-oaiMeta": { - "name": "The message object", - "beta": true, - "example": "{\n \"id\": \"msg_abc123\",\n \"object\": \"thread.message\",\n \"created_at\": 1698983503,\n \"thread_id\": \"thread_abc123\",\n \"role\": \"assistant\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": {\n \"value\": \"Hi! How can I help you today?\",\n \"annotations\": []\n }\n }\n ],\n \"assistant_id\": \"asst_abc123\",\n \"run_id\": \"run_abc123\",\n \"attachments\": [],\n \"metadata\": {}\n}\n" - } - }, - "OpenAI.MessageObjectAttachments": { - "type": "object", - "properties": { - "file_id": { - "type": "string" - }, - "tools": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.AssistantToolsCode" - }, - { - "$ref": "#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly" - } - ] - } - } - } - }, - "OpenAI.MessageObjectIncompleteDetails": { - "type": "object", - "required": [ - "reason" - ], - "properties": { - "reason": { - "type": "string", - "enum": [ - "content_filter", - "max_tokens", - "run_cancelled", - "run_expired", - "run_failed" - ] - } - } - }, - "OpenAI.MessageRequestContentTextObject": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "Always `text`.", - "x-stainless-const": true - }, - "text": { - "type": "string", - "description": "Text content to be sent to the model" - } - }, - "description": "The text content that is part of a message.", - "title": "Text" - }, - "OpenAI.MessageRole": { - "type": "string", - "enum": [ - "unknown", - "user", - "assistant", - "system", - "critic", - "discriminator", - "developer", - "tool" - ] - }, - "OpenAI.MessageStatus": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ] - }, - "OpenAI.Metadata": { - "type": "object", - "unevaluatedProperties": { - "type": "string" - }, - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.", - "x-oaiTypeLabel": "map" - }, - "OpenAI.Model": { - "type": "object", - "required": [ - "id", - "created", - "object", - "owned_by" - ], - "properties": { - "id": { - "type": "string", - "description": "The model identifier, which can be referenced in the API endpoints." - }, - "created": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) when the model was created." - }, - "object": { - "type": "string", - "enum": [ - "model" - ], - "description": "The object type, which is always \"model\".", - "x-stainless-const": true - }, - "owned_by": { - "type": "string", - "description": "The organization that owns the model." - } - }, - "description": "Describes an OpenAI model offering that can be used with the API.", - "title": "Model", - "x-oaiMeta": { - "name": "The model object", - "example": "{\n \"id\": \"VAR_chat_model_id\",\n \"object\": \"model\",\n \"created\": 1686935002,\n \"owned_by\": \"openai\"\n}\n" - } - }, - "OpenAI.ModifyMessageRequest": { - "type": "object", - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.ModifyRunRequest": { - "type": "object", - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.ModifyThreadRequest": { - "type": "object", - "properties": { - "tool_resources": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResources" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.ModifyThreadRequestToolResources": { - "type": "object", - "properties": { - "code_interpreter": { - "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter" - }, - "file_search": { - "$ref": "#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch" - } - } - }, - "OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter": { - "type": "object", - "properties": { - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 20 - } - } - }, - "OpenAI.ModifyThreadRequestToolResourcesFileSearch": { - "type": "object", - "properties": { - "vector_store_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 1 - } - } - }, - "OpenAI.Move": { - "type": "object", - "required": [ - "type", - "x", - "y" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "move" - ], - "description": "Specifies the event type. For a move action, this property is\n always set to `move`.", - "x-stainless-const": true, - "default": "move" - }, - "x": { - "type": "integer", - "description": "The x-coordinate to move to." - }, - "y": { - "type": "integer", - "description": "The y-coordinate to move to." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A mouse move action.", - "title": "Move" - }, - "OpenAI.NoiseReductionType": { - "type": "string", - "enum": [ - "near_field", - "far_field" - ], - "description": "Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones." - }, - "OpenAI.OpenAIFile": { - "type": "object", - "required": [ - "id", - "bytes", - "created_at", - "filename", - "object", - "purpose", - "status" - ], - "properties": { - "id": { - "type": "string", - "description": "The file identifier, which can be referenced in the API endpoints." - }, - "bytes": { - "type": "integer", - "description": "The size of the file, in bytes." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the file was created." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the file will expire." - }, - "filename": { - "type": "string", - "description": "The name of the file." - }, - "object": { - "type": "string", - "enum": [ - "file" - ], - "description": "The object type, which is always `file`.", - "x-stainless-const": true - }, - "status_details": { - "type": "string", - "description": "Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`.", - "deprecated": true - }, - "purpose": { - "type": "string", - "enum": [ - "assistants", - "assistants_output", - "batch", - "batch_output", - "fine-tune", - "fine-tune-results", - "evals" - ], - "description": "The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`." - }, - "status": { - "type": "string", - "enum": [ - "uploaded", - "pending", - "running", - "processed", - "error", - "deleting", - "deleted" - ] - } - }, - "description": "The `File` object represents a document that has been uploaded to OpenAI.", - "title": "OpenAIFile", - "x-oaiMeta": { - "name": "The file object", - "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"file\",\n \"bytes\": 120000,\n \"created_at\": 1677610602,\n \"expires_at\": 1680202602,\n \"filename\": \"salesOverview.pdf\",\n \"purpose\": \"assistants\",\n}\n" - } - }, - "OpenAI.OtherChunkingStrategyResponseParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "other" - ], - "description": "Always `other`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse" - } - ], - "description": "This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API.", - "title": "Other Chunking Strategy" - }, - "OpenAI.OutputContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.OutputContentType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAI.OutputContentOutputTextContent", - "refusal": "#/components/schemas/OpenAI.OutputContentRefusalContent" - } - } - }, - "OpenAI.OutputContentOutputTextContent": { - "type": "object", - "required": [ - "type", - "text", - "annotations" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "output_text" - ], - "description": "The type of the output text. Always `output_text`.", - "x-stainless-const": true, - "default": "output_text" - }, - "text": { - "type": "string", - "description": "The text output from the model." - }, - "annotations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Annotation" - }, - "description": "The annotations of the text output." - }, - "logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.LogProb" - } - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputContent" - } - ], - "description": "A text output from the model.", - "title": "Output text" - }, - "OpenAI.OutputContentRefusalContent": { - "type": "object", - "required": [ - "type", - "refusal" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "refusal" - ], - "description": "The type of the refusal. Always `refusal`.", - "x-stainless-const": true, - "default": "refusal" - }, - "refusal": { - "type": "string", - "description": "The refusal explanation from the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputContent" - } - ], - "description": "A refusal from the model.", - "title": "Refusal" - }, - "OpenAI.OutputContentType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "output_text", - "refusal", - "reasoning_text" - ] - } - ] - }, - "OpenAI.OutputItem": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.OutputItemType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "output_message": "#/components/schemas/OpenAI.OutputItemOutputMessage", - "file_search_call": "#/components/schemas/OpenAI.OutputItemFileSearchToolCall", - "function_call": "#/components/schemas/OpenAI.OutputItemFunctionToolCall", - "web_search_call": "#/components/schemas/OpenAI.OutputItemWebSearchToolCall", - "computer_call": "#/components/schemas/OpenAI.OutputItemComputerToolCall", - "reasoning": "#/components/schemas/OpenAI.OutputItemReasoningItem", - "compaction": "#/components/schemas/OpenAI.OutputItemCompactionBody", - "image_generation_call": "#/components/schemas/OpenAI.OutputItemImageGenToolCall", - "code_interpreter_call": "#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall", - "local_shell_call": "#/components/schemas/OpenAI.OutputItemLocalShellToolCall", - "shell_call": "#/components/schemas/OpenAI.OutputItemFunctionShellCall", - "shell_call_output": "#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput", - "apply_patch_call": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCall", - "apply_patch_call_output": "#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput", - "mcp_call": "#/components/schemas/OpenAI.OutputItemMcpToolCall", - "mcp_list_tools": "#/components/schemas/OpenAI.OutputItemMcpListTools", - "mcp_approval_request": "#/components/schemas/OpenAI.OutputItemMcpApprovalRequest", - "custom_tool_call": "#/components/schemas/OpenAI.OutputItemCustomToolCall" - } - } - }, - "OpenAI.OutputItemApplyPatchToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "status", - "operation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch_call" - ], - "description": "The type of the item. Always `apply_patch_call`.", - "x-stainless-const": true, - "default": "apply_patch_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the apply patch tool call generated by the model." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchCallStatus" - } - ], - "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." - }, - "operation": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchFileOperation" - } - ], - "description": "One of the create_file, delete_file, or update_file operations applied via apply_patch." - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A tool call that applies file diffs by creating, deleting, or updating files.", - "title": "Apply patch tool call" - }, - "OpenAI.OutputItemApplyPatchToolCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch_call_output" - ], - "description": "The type of the item. Always `apply_patch_call_output`.", - "x-stainless-const": true, - "default": "apply_patch_call_output" - }, - "id": { - "type": "string", - "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the apply patch tool call generated by the model." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApplyPatchCallOutputStatus" - } - ], - "description": "The status of the apply patch tool call output. One of `completed` or `failed`." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call output." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "The output emitted by an apply patch tool call.", - "title": "Apply patch tool call output" - }, - "OpenAI.OutputItemCodeInterpreterToolCall": { - "type": "object", - "required": [ - "type", - "id", - "status", - "container_id", - "code", - "outputs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "code_interpreter_call" - ], - "description": "The type of the code interpreter tool call. Always `code_interpreter_call`.", - "x-stainless-const": true, - "default": "code_interpreter_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the code interpreter tool call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete", - "interpreting", - "failed" - ], - "description": "The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`." - }, - "container_id": { - "type": "string", - "description": "The ID of the container used to run the code." - }, - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "outputs": { - "anyOf": [ - { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputLogs" - }, - { - "$ref": "#/components/schemas/OpenAI.CodeInterpreterOutputImage" - } - ] - } - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A tool call to run code.", - "title": "Code interpreter tool call" - }, - "OpenAI.OutputItemCompactionBody": { - "type": "object", - "required": [ - "type", - "id", - "encrypted_content" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "compaction" - ], - "description": "The type of the item. Always `compaction`.", - "x-stainless-const": true, - "default": "compaction" - }, - "id": { - "type": "string", - "description": "The unique ID of the compaction item." - }, - "encrypted_content": { - "type": "string", - "description": "The encrypted content that was produced by compaction." - }, - "created_by": { - "type": "string", - "description": "The identifier of the actor that created the item." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact).", - "title": "Compaction item" - }, - "OpenAI.OutputItemComputerToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "pending_safety_checks", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_call" - ], - "description": "The type of the computer call. Always `computer_call`.", - "default": "computer_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the computer call." - }, - "call_id": { - "type": "string", - "description": "An identifier used when responding to the tool call with output." - }, - "action": { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - }, - "pending_safety_checks": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ComputerCallSafetyCheckParam" - }, - "description": "The pending safety checks for the computer call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A tool call to a computer use tool. See the\n[computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information.", - "title": "Computer tool call" - }, - "OpenAI.OutputItemCustomToolCall": { - "type": "object", - "required": [ - "type", - "call_id", - "name", - "input" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom_tool_call" - ], - "description": "The type of the custom tool call. Always `custom_tool_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the custom tool call in the OpenAI platform." - }, - "call_id": { - "type": "string", - "description": "An identifier used to map this custom tool call to a tool call output." - }, - "name": { - "type": "string", - "description": "The name of the custom tool being called." - }, - "input": { - "type": "string", - "description": "The input for the custom tool call generated by the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A call to a custom tool created by the model.", - "title": "Custom tool call" - }, - "OpenAI.OutputItemFileSearchToolCall": { - "type": "object", - "required": [ - "id", - "type", - "status", - "queries" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the file search tool call." - }, - "type": { - "type": "string", - "enum": [ - "file_search_call" - ], - "description": "The type of the file search tool call. Always `file_search_call`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "searching", - "completed", - "incomplete", - "failed" - ], - "description": "The status of the file search tool call. One of `in_progress`,\n `searching`, `incomplete` or `failed`," - }, - "queries": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The queries used to search for files." - }, - "results": { - "anyOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FileSearchToolCallResults" - } - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "The results of a file search tool call. See the\n[file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information.", - "title": "File search tool call" - }, - "OpenAI.OutputItemFunctionShellCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell_call" - ], - "description": "The type of the item. Always `shell_call`.", - "x-stainless-const": true, - "default": "shell_call" - }, - "id": { - "type": "string", - "description": "The unique ID of the shell tool call. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the shell tool call generated by the model." - }, - "action": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.FunctionShellAction" - } - ], - "description": "The shell commands and limits that describe how to run the tool call." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.LocalShellCallStatus" - } - ], - "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." - }, - "created_by": { - "type": "string", - "description": "The ID of the entity that created this tool call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A tool call that executes one or more shell commands in a managed environment.", - "title": "Shell tool call" - }, - "OpenAI.OutputItemFunctionShellCallOutput": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "output", - "max_output_length" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell_call_output" - ], - "description": "The type of the shell call output. Always `shell_call_output`.", - "x-stainless-const": true, - "default": "shell_call_output" - }, - "id": { - "type": "string", - "description": "The unique ID of the shell call output. Populated when this item is returned via API." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the shell tool call generated by the model." - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.FunctionShellCallOutputContent" - }, - "description": "An array of shell call output contents" - }, - "max_output_length": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "created_by": { - "type": "string", - "description": "The identifier of the actor that created the item." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "The output of a shell tool call that was emitted.", - "title": "Shell call output" - }, - "OpenAI.OutputItemFunctionToolCall": { - "type": "object", - "required": [ - "type", - "call_id", - "name", - "arguments" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the function tool call." - }, - "type": { - "type": "string", - "enum": [ - "function_call" - ], - "description": "The type of the function tool call. Always `function_call`.", - "x-stainless-const": true - }, - "call_id": { - "type": "string", - "description": "The unique ID of the function tool call generated by the model." - }, - "name": { - "type": "string", - "description": "The name of the function to run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of the arguments to pass to the function." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A tool call to run a function. See the\n[function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information.", - "title": "Function tool call" - }, - "OpenAI.OutputItemImageGenToolCall": { - "type": "object", - "required": [ - "type", - "id", - "status", - "result" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_generation_call" - ], - "description": "The type of the image generation call. Always `image_generation_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the image generation call." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "generating", - "failed" - ], - "description": "The status of the image generation call." - }, - "result": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "An image generation request made by the model.", - "title": "Image generation call" - }, - "OpenAI.OutputItemLocalShellToolCall": { - "type": "object", - "required": [ - "type", - "id", - "call_id", - "action", - "status" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "local_shell_call" - ], - "description": "The type of the local shell call. Always `local_shell_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the local shell call." - }, - "call_id": { - "type": "string", - "description": "The unique ID of the local shell tool call generated by the model." - }, - "action": { - "$ref": "#/components/schemas/OpenAI.LocalShellExecAction" - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the local shell call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A tool call to run a command on the local shell.", - "title": "Local shell call" - }, - "OpenAI.OutputItemMcpApprovalRequest": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "name", - "arguments" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_approval_request" - ], - "description": "The type of the item. Always `mcp_approval_request`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the approval request." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server making the request." - }, - "name": { - "type": "string", - "description": "The name of the tool to run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of arguments for the tool." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A request for human approval of a tool invocation.", - "title": "MCP approval request" - }, - "OpenAI.OutputItemMcpListTools": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "tools" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_list_tools" - ], - "description": "The type of the item. Always `mcp_list_tools`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the list." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.MCPListToolsTool" - }, - "description": "The tools available on the server." - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A list of tools available on an MCP server.", - "title": "MCP list tools" - }, - "OpenAI.OutputItemMcpToolCall": { - "type": "object", - "required": [ - "type", - "id", - "server_label", - "name", - "arguments" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp_call" - ], - "description": "The type of the item. Always `mcp_call`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique ID of the tool call." - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server running the tool." - }, - "name": { - "type": "string", - "description": "The name of the tool that was run." - }, - "arguments": { - "type": "string", - "description": "A JSON string of the arguments passed to the tool." - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "error": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.MCPToolCallStatus" - } - ], - "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`." - }, - "approval_request_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "An invocation of a tool on an MCP server.", - "title": "MCP tool call" - }, - "OpenAI.OutputItemOutputMessage": { - "type": "object", - "required": [ - "id", - "type", - "role", - "content", - "status" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the output message.", - "x-stainless-go-json": "omitzero" - }, - "type": { - "type": "string", - "enum": [ - "output_message" - ], - "description": "The type of the output message. Always `message`.", - "x-stainless-const": true - }, - "role": { - "type": "string", - "enum": [ - "assistant" - ], - "description": "The role of the output message. Always `assistant`.", - "x-stainless-const": true - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OutputMessageContent" - }, - "description": "The content of the output message." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the message input. One of `in_progress`, `completed`, or\n `incomplete`. Populated when input items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "An output message from the model.", - "title": "Output message" - }, - "OpenAI.OutputItemReasoningItem": { - "type": "object", - "required": [ - "type", - "id", - "summary" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "reasoning" - ], - "description": "The type of the object. Always `reasoning`.", - "x-stainless-const": true - }, - "id": { - "type": "string", - "description": "The unique identifier of the reasoning content." - }, - "encrypted_content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "summary": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Summary" - }, - "description": "Reasoning summary content." - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ReasoningTextContent" - }, - "description": "Reasoning text content." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "incomplete" - ], - "description": "The status of the item. One of `in_progress`, `completed`, or\n `incomplete`. Populated when items are returned via API." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "A description of the chain of thought used by a reasoning model while generating\na response. Be sure to include these items in your `input` to the Responses API\nfor subsequent turns of a conversation if you are manually\n[managing context](https://platform.openai.com/docs/guides/conversation-state).", - "title": "Reasoning" - }, - "OpenAI.OutputItemType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "output_message", - "file_search_call", - "function_call", - "web_search_call", - "computer_call", - "reasoning", - "compaction", - "image_generation_call", - "code_interpreter_call", - "local_shell_call", - "shell_call", - "shell_call_output", - "apply_patch_call", - "apply_patch_call_output", - "mcp_call", - "mcp_list_tools", - "mcp_approval_request", - "custom_tool_call" - ] - } - ] - }, - "OpenAI.OutputItemWebSearchToolCall": { - "type": "object", - "required": [ - "id", - "type", - "status", - "action" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique ID of the web search tool call." - }, - "type": { - "type": "string", - "enum": [ - "web_search_call" - ], - "description": "The type of the web search tool call. Always `web_search_call`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "searching", - "completed", - "failed" - ], - "description": "The status of the web search tool call." - }, - "action": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionSearch" - }, - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionOpenPage" - }, - { - "$ref": "#/components/schemas/OpenAI.WebSearchActionFind" - } - ], - "description": "An object describing the specific action taken in this web search call.\n Includes details on how the model used the web (search, open_page, find)." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "The results of a web search tool call. See the\n[web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information.", - "title": "Web search tool call" - }, - "OpenAI.OutputMessageContent": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.OutputMessageContentType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "output_text": "#/components/schemas/OpenAI.OutputMessageContentOutputTextContent", - "refusal": "#/components/schemas/OpenAI.OutputMessageContentRefusalContent" - } - } - }, - "OpenAI.OutputMessageContentOutputTextContent": { - "type": "object", - "required": [ - "type", - "text", - "annotations" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "output_text" - ], - "description": "The type of the output text. Always `output_text`.", - "x-stainless-const": true, - "default": "output_text" - }, - "text": { - "type": "string", - "description": "The text output from the model." - }, - "annotations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Annotation" - }, - "description": "The annotations of the text output." - }, - "logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.LogProb" - } - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputMessageContent" - } - ], - "description": "A text output from the model.", - "title": "Output text" - }, - "OpenAI.OutputMessageContentRefusalContent": { - "type": "object", - "required": [ - "type", - "refusal" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "refusal" - ], - "description": "The type of the refusal. Always `refusal`.", - "x-stainless-const": true, - "default": "refusal" - }, - "refusal": { - "type": "string", - "description": "The refusal explanation from the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputMessageContent" - } - ], - "description": "A refusal from the model.", - "title": "Refusal" - }, - "OpenAI.OutputMessageContentType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "output_text", - "refusal" - ] - } - ] - }, - "OpenAI.OutputTextContent": { - "type": "object", - "required": [ - "type", - "text", - "annotations" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "output_text" - ], - "description": "The type of the output text. Always `output_text`.", - "x-stainless-const": true, - "default": "output_text" - }, - "text": { - "type": "string", - "description": "The text output from the model." - }, - "annotations": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Annotation" - }, - "description": "The annotations of the text output." - }, - "logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.LogProb" - } - } - }, - "description": "A text output from the model.", - "title": "Output text" - }, - "OpenAI.ParallelToolCalls": { - "type": "boolean", - "description": "Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use." - }, - "OpenAI.PartialImages": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 0, - "maximum": 3, - "description": "The number of partial images to generate. This parameter is used for\nstreaming responses that return partial images. Value must be between 0 and 3.\nWhen set to 0, the response will be a single image sent in one streaming event.\nNote that the final image may be sent before the full number of partial images\nare generated if the full image is generated more quickly." - }, - "OpenAI.PredictionContent": { - "type": "object", - "required": [ - "type", - "content" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "content" - ], - "description": "The type of the predicted content you want to provide. This type is\n currently always `content`.", - "x-stainless-const": true - }, - "content": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText" - } - } - ], - "description": "The content that should be matched when generating a model response.\n If generated tokens would match this content, the entire model response\n can be returned much more quickly." - } - }, - "description": "Static predicted output content, such as the content of a text file that is\nbeing regenerated.", - "title": "Static Content" - }, - "OpenAI.Prompt": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string", - "description": "The unique identifier of the prompt template to use." - }, - "version": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "variables": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponsePromptVariables" - }, - { - "type": "null" - } - ] - } - }, - "description": "Reference to a prompt template and its variables.\n[Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts)." - }, - "OpenAI.RankerVersionType": { - "type": "string", - "enum": [ - "auto", - "default-2024-11-15" - ] - }, - "OpenAI.RankingOptions": { - "type": "object", - "properties": { - "ranker": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RankerVersionType" - } - ], - "description": "The ranker to use for the file search." - }, - "score_threshold": { - "type": "number", - "description": "The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results." - }, - "hybrid_search": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.HybridSearchOptions" - } - ], - "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled." - } - } - }, - "OpenAI.RealtimeAudioFormats": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormatsType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "audio/pcm": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm", - "audio/pcmu": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu", - "audio/pcma": "#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma" - } - } - }, - "OpenAI.RealtimeAudioFormatsAudioPcm": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "audio/pcm" - ] - }, - "rate": { - "type": "number", - "enum": [ - 24000 - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - } - ] - }, - "OpenAI.RealtimeAudioFormatsAudioPcma": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "audio/pcma" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - } - ] - }, - "OpenAI.RealtimeAudioFormatsAudioPcmu": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "audio/pcmu" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - } - ] - }, - "OpenAI.RealtimeAudioFormatsType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "audio/pcm", - "audio/pcmu", - "audio/pcma" - ] - } - ] - }, - "OpenAI.RealtimeCallCreateRequest": { - "type": "object", - "properties": { - "sdp": { - "type": "string", - "description": "WebRTC Session Description Protocol (SDP) offer generated by the caller." - }, - "session": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA" - } - ], - "description": "Optional session configuration to apply before the realtime session is\n created. Use the same parameters you would send in a [`create client secret`](https://platform.openai.com/docs/api-reference/realtime-sessions/create-realtime-client-secret)\n request." - } - }, - "required": [ - "sdp" - ] - }, - "OpenAI.RealtimeCallReferRequest": { - "type": "object", - "required": [ - "target_uri" - ], - "properties": { - "target_uri": { - "type": "string", - "description": "URI that should appear in the SIP Refer-To header. Supports values like\n `tel:+14155550123` or `sip:agent\\@example.com`." - } - }, - "description": "Parameters required to transfer a SIP call to a new destination using the\nRealtime API.", - "title": "Realtime call refer request" - }, - "OpenAI.RealtimeCallRejectRequest": { - "type": "object", - "properties": { - "status_code": { - "type": "integer", - "description": "SIP response code to send back to the caller. Defaults to `603` (Decline)\n when omitted." - } - }, - "description": "Parameters used to decline an incoming SIP call handled by the Realtime API.", - "title": "Realtime call reject request" - }, - "OpenAI.RealtimeCreateClientSecretRequest": { - "type": "object", - "properties": { - "expires_after": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter" - } - ], - "description": "Configuration for the client secret expiration. Expiration refers to the time after which\n a client secret will no longer be valid for creating sessions. The session itself may\n continue after that time once started. A secret can be used to create multiple sessions\n until it expires.", - "title": "Client secret expiration" - }, - "session": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion" - } - ], - "description": "Session configuration to use for the client secret. Choose either a realtime\n session or a transcription session." - } - }, - "description": "Create a session and client secret for the Realtime API. The request can specify\neither a realtime or a transcription session configuration.\n[Learn more about the Realtime API](https://platform.openai.com/docs/guides/realtime).", - "title": "Realtime client secret creation request" - }, - "OpenAI.RealtimeCreateClientSecretRequestExpiresAfter": { - "type": "object", - "properties": { - "anchor": { - "type": "string", - "enum": [ - "created_at" - ], - "x-stainless-const": true, - "default": "created_at" - }, - "seconds": { - "type": "integer", - "minimum": 10, - "maximum": 7200, - "default": 600 - } - } - }, - "OpenAI.RealtimeCreateClientSecretResponse": { - "type": "object", - "required": [ - "value", - "expires_at", - "session" - ], - "properties": { - "value": { - "type": "string", - "description": "The generated client secret value." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "Expiration timestamp for the client secret, in seconds since epoch." - }, - "session": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion" - } - ], - "description": "The session configuration for either a realtime or transcription session." - } - }, - "description": "Response from creating a session and client secret for the Realtime API.", - "title": "Realtime session and client secret", - "x-oaiMeta": { - "name": "Session response object", - "group": "realtime", - "example": "{\n \"value\": \"ek_68af296e8e408191a1120ab6383263c2\",\n \"expires_at\": 1756310470,\n \"session\": {\n \"type\": \"realtime\",\n \"object\": \"realtime.session\",\n \"id\": \"sess_C9CiUVUzUzYIssh3ELY1d\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"output_modalities\": [\n \"audio\"\n ],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"auto\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": null,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"expires_at\": 0,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": null,\n \"noise_reduction\": null,\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200,\n \"idle_timeout_ms\": null,\n \"create_response\": true,\n \"interrupt_response\": true\n }\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n },\n \"include\": null\n }\n}\n" - } - }, - "OpenAI.RealtimeFunctionTool": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of the tool, i.e. `function`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the function." - }, - "description": { - "type": "string", - "description": "The description of the function, including guidance on when and how\n to call it, and guidance about what to tell the user when calling\n (if anything)." - }, - "parameters": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeFunctionToolParameters" - } - ], - "description": "Parameters of the function in JSON Schema." - } - }, - "title": "Function tool" - }, - "OpenAI.RealtimeFunctionToolParameters": { - "type": "object" - }, - "OpenAI.RealtimeSessionCreateRequest": { - "type": "object", - "required": [ - "client_secret", - "type" - ], - "properties": { - "client_secret": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret" - } - ], - "description": "Ephemeral key returned by the API." - }, - "modalities": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "text", - "audio" - ] - }, - "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"].", - "default": [ - "text", - "audio" - ] - }, - "instructions": { - "type": "string", - "description": "The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.\n Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session." - }, - "voice": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" - } - ], - "description": "The voice the model uses to respond. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the session once the model has responded with audio at least once." - }, - "input_audio_format": { - "type": "string", - "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`." - }, - "output_audio_format": { - "type": "string", - "description": "The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`." - }, - "input_audio_transcription": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription" - } - ], - "description": "Configuration for input audio transcription, defaults to off and can be\n set to `null` to turn off once on. Input audio transcription is not native\n to the model, since the model consumes audio directly. Transcription runs\n asynchronously and should be treated as rough guidance\n rather than the representation understood by the model." - }, - "speed": { - "type": "number", - "minimum": 0.25, - "maximum": 1.5, - "description": "The speed of the model's spoken response. 1.0 is the default speed. 0.25 is\n the minimum speed. 1.5 is the maximum speed. This value can only be changed\n in between model turns, not while a response is in progress.", - "default": 1 - }, - "tracing": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "object", - "properties": { - "workflow_name": { - "type": "string" - }, - "group_id": { - "type": "string" - }, - "metadata": { - "type": "object", - "unevaluatedProperties": {} - } - } - } - ], - "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.", - "title": "Tracing Configuration", - "default": "auto" - }, - "turn_detection": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection" - } - ], - "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools" - }, - "description": "Tools (functions) available to the model." - }, - "tool_choice": { - "type": "string", - "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function." - }, - "temperature": { - "type": "number", - "description": "Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8." - }, - "max_response_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string", - "enum": [ - "inf" - ] - } - ], - "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`." - }, - "truncation": { - "$ref": "#/components/schemas/OpenAI.RealtimeTruncation" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - }, - "type": { - "type": "string", - "enum": [ - "realtime" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion" - } - ], - "description": "A new Realtime session configuration, with an ephemeral key. Default TTL\nfor keys is one minute.", - "x-oaiMeta": { - "name": "The session object", - "group": "realtime", - "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"model\": \"gpt-realtime-2025-08-25\",\n \"modalities\": [\"audio\", \"text\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"voice\": \"alloy\",\n \"input_audio_format\": \"pcm16\",\n \"output_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"whisper-1\"\n },\n \"turn_detection\": null,\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"temperature\": 0.7,\n \"speed\": 1.1,\n \"tracing\": \"auto\",\n \"max_response_output_tokens\": 200,\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"client_secret\": {\n \"value\": \"ek_abc123\",\n \"expires_at\": 1234567890\n }\n}\n" - } - }, - "OpenAI.RealtimeSessionCreateRequestClientSecret": { - "type": "object", - "required": [ - "value", - "expires_at" - ], - "properties": { - "value": { - "type": "string" - }, - "expires_at": { - "type": "integer", - "format": "unixtime" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestGA": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "realtime" - ], - "description": "The type of session to create. Always `realtime` for the Realtime API.", - "x-stainless-const": true - }, - "output_modalities": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "text", - "audio" - ] - }, - "description": "The set of modalities the model can respond with. It defaults to `[\"audio\"]`, indicating\n that the model will respond with audio plus a transcript. `[\"text\"]` can be used to make\n the model respond with text only. It is not possible to request both `text` and `audio` at the same time.", - "default": [ - "audio" - ] - }, - "model": { - "type": "string", - "description": "The Realtime model used for this session." - }, - "instructions": { - "type": "string", - "description": "The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion into your voice\", \"laugh frequently\"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior.\n Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session." - }, - "audio": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio" - } - ], - "description": "Configuration for input and output audio." - }, - "include": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "item.input_audio_transcription.logprobs" - ] - }, - "description": "Additional fields to include in server outputs.\n `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription." - }, - "tracing": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing" - }, - { - "type": "null" - } - ], - "description": "Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.", - "title": "Tracing Configuration", - "default": "auto" - }, - "tools": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool" - }, - { - "$ref": "#/components/schemas/OpenAI.MCPTool" - } - ] - }, - "description": "Tools available to the model." - }, - "tool_choice": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceOptions" - }, - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceFunction" - }, - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceMCP" - } - ], - "description": "How the model chooses tools. Provide one of the string modes or force a specific\n function/MCP tool.", - "default": "auto" - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string", - "enum": [ - "inf" - ] - } - ], - "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`." - }, - "truncation": { - "$ref": "#/components/schemas/OpenAI.RealtimeTruncation" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - } - }, - "description": "Realtime session object configuration.", - "title": "Realtime session configuration" - }, - "OpenAI.RealtimeSessionCreateRequestGAAudio": { - "type": "object", - "properties": { - "input": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput" - }, - "output": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestGAAudioInput": { - "type": "object", - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - }, - "transcription": { - "$ref": "#/components/schemas/OpenAI.AudioTranscription" - }, - "noise_reduction": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction" - }, - "turn_detection": { - "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetection" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.NoiseReductionType" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestGAAudioOutput": { - "type": "object", - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - }, - "voice": { - "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" - }, - "speed": { - "type": "number", - "minimum": 0.25, - "maximum": 1.5, - "default": 1 - } - } - }, - "OpenAI.RealtimeSessionCreateRequestGATracing": { - "type": "object", - "properties": { - "workflow_name": { - "type": "string" - }, - "group_id": { - "type": "string" - }, - "metadata": { - "type": "object", - "unevaluatedProperties": {} - } - } - }, - "OpenAI.RealtimeSessionCreateRequestInputAudioTranscription": { - "type": "object", - "properties": { - "model": { - "type": "string" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestTools": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "x-stainless-const": true - }, - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "parameters": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestToolsParameters": { - "type": "object" - }, - "OpenAI.RealtimeSessionCreateRequestTurnDetection": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "prefix_padding_ms": { - "type": "integer" - }, - "silence_duration_ms": { - "type": "integer" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestUnion": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateRequest", - "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest" - } - } - }, - "OpenAI.RealtimeSessionCreateRequestUnionType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "realtime", - "transcription" - ] - } - ] - }, - "OpenAI.RealtimeSessionCreateResponse": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the session that looks like `sess_1234567890abcdef`." - }, - "object": { - "type": "string", - "description": "The object type. Always `realtime.session`." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "Expiration timestamp for the session, in seconds since epoch." - }, - "include": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "item.input_audio_transcription.logprobs" - ] - }, - "description": "Additional fields to include in server outputs.\n - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription." - }, - "model": { - "type": "string", - "description": "The Realtime model used for this session." - }, - "output_modalities": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "text", - "audio" - ] - }, - "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]." - }, - "instructions": { - "type": "string", - "description": "The default system instructions (i.e. system message) prepended to model\n calls. This field allows the client to guide the model on desired\n responses. The model can be instructed on response content and format,\n (e.g. \"be extremely succinct\", \"act friendly\", \"here are examples of good\n responses\") and on audio behavior (e.g. \"talk quickly\", \"inject emotion\n into your voice\", \"laugh frequently\"). The instructions are not guaranteed\n to be followed by the model, but they provide guidance to the model on the\n desired behavior.\n Note that the server sets default instructions which will be used if this\n field is not set and are visible in the `session.created` event at the\n start of the session." - }, - "audio": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio" - } - ], - "description": "Configuration for input and output audio for the session." - }, - "tracing": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto" - ] - }, - { - "type": "object", - "properties": { - "workflow_name": { - "type": "string" - }, - "group_id": { - "type": "string" - }, - "metadata": { - "type": "object", - "unevaluatedProperties": {} - } - } - } - ], - "description": "Configuration options for tracing. Set to null to disable tracing. Once\n tracing is enabled for a session, the configuration cannot be modified.\n `auto` will create a trace for the session with default values for the\n workflow name, group id, and metadata.", - "title": "Tracing Configuration", - "default": "auto" - }, - "turn_detection": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection" - } - ], - "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RealtimeFunctionTool" - }, - "description": "Tools (functions) available to the model." - }, - "tool_choice": { - "type": "string", - "description": "How the model chooses tools. Options are `auto`, `none`, `required`, or\n specify a function." - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "string", - "enum": [ - "inf" - ] - } - ], - "description": "Maximum number of output tokens for a single assistant response,\n inclusive of tool calls. Provide an integer between 1 and 4096 to\n limit output tokens, or `inf` for the maximum available tokens for a\n given model. Defaults to `inf`." - }, - "type": { - "type": "string", - "enum": [ - "realtime" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion" - } - ], - "description": "A Realtime session configuration object.", - "title": "Realtime session configuration object", - "x-oaiMeta": { - "name": "The session object", - "group": "realtime", - "example": "{\n \"id\": \"sess_001\",\n \"object\": \"realtime.session\",\n \"expires_at\": 1742188264,\n \"model\": \"gpt-realtime\",\n \"output_modalities\": [\"audio\"],\n \"instructions\": \"You are a friendly assistant.\",\n \"tools\": [],\n \"tool_choice\": \"none\",\n \"max_output_tokens\": \"inf\",\n \"tracing\": \"auto\",\n \"truncation\": \"auto\",\n \"prompt\": null,\n \"audio\": {\n \"input\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"transcription\": { \"model\": \"whisper-1\" },\n \"noise_reduction\": null,\n \"turn_detection\": null\n },\n \"output\": {\n \"format\": {\n \"type\": \"audio/pcm\",\n \"rate\": 24000\n },\n \"voice\": \"alloy\",\n \"speed\": 1.0\n }\n }\n}\n" - } - }, - "OpenAI.RealtimeSessionCreateResponseAudio": { - "type": "object", - "properties": { - "input": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput" - }, - "output": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseAudioInput": { - "type": "object", - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - }, - "transcription": { - "$ref": "#/components/schemas/OpenAI.AudioTranscription" - }, - "noise_reduction": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction" - }, - "turn_detection": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.NoiseReductionType" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "prefix_padding_ms": { - "type": "integer" - }, - "silence_duration_ms": { - "type": "integer" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseAudioOutput": { - "type": "object", - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAI.RealtimeAudioFormats" - }, - "voice": { - "$ref": "#/components/schemas/OpenAI.VoiceIdsShared" - }, - "speed": { - "type": "number" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseTurnDetection": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "prefix_padding_ms": { - "type": "integer" - }, - "silence_duration_ms": { - "type": "integer" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseUnion": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "realtime": "#/components/schemas/OpenAI.RealtimeSessionCreateResponse", - "transcription": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse" - } - } - }, - "OpenAI.RealtimeSessionCreateResponseUnionType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "realtime", - "transcription" - ] - } - ] - }, - "OpenAI.RealtimeTranscriptionSessionCreateRequest": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "turn_detection": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection" - } - ], - "description": "Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech." - }, - "input_audio_noise_reduction": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction" - } - ], - "description": "Configuration for input audio noise reduction. This can be set to `null` to turn off.\n Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model.\n Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio." - }, - "input_audio_format": { - "type": "string", - "enum": [ - "pcm16", - "g711_ulaw", - "g711_alaw" - ], - "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`.\n For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate,\n single channel (mono), and little-endian byte order.", - "default": "pcm16" - }, - "input_audio_transcription": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.AudioTranscription" - } - ], - "description": "Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service." - }, - "include": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "item.input_audio_transcription.logprobs" - ] - }, - "description": "The set of items to include in the transcription. Current available items are:\n `item.input_audio_transcription.logprobs`" - }, - "type": { - "type": "string", - "enum": [ - "transcription" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion" - } - ], - "description": "Realtime transcription session object configuration.", - "title": "Realtime transcription session configuration" - }, - "OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.NoiseReductionType" - } - } - }, - "OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "server_vad" - ] - }, - "threshold": { - "type": "number" - }, - "prefix_padding_ms": { - "type": "integer" - }, - "silence_duration_ms": { - "type": "integer" - } - } - }, - "OpenAI.RealtimeTranscriptionSessionCreateResponse": { - "type": "object", - "required": [ - "client_secret", - "type" - ], - "properties": { - "client_secret": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret" - } - ], - "description": "Ephemeral key returned by the API. Only present when the session is\n created on the server via REST API." - }, - "modalities": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "text", - "audio" - ] - }, - "description": "The set of modalities the model can respond with. To disable audio,\n set this to [\"text\"]." - }, - "input_audio_format": { - "type": "string", - "description": "The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`." - }, - "input_audio_transcription": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.AudioTranscription" - } - ], - "description": "Configuration of the transcription model." - }, - "turn_detection": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection" - } - ], - "description": "Configuration for turn detection. Can be set to `null` to turn off. Server\n VAD means that the model will detect the start and end of speech based on\n audio volume and respond at the end of user speech." - }, - "type": { - "type": "string", - "enum": [ - "transcription" - ], - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion" - } - ], - "description": "A new Realtime transcription session configuration.\nWhen a session is created on the server via REST API, the session object\nalso contains an ephemeral key. Default TTL for keys is 10 minutes. This\nproperty is not present when a session is updated via the WebSocket API.", - "x-oaiMeta": { - "name": "The transcription session object", - "group": "realtime", - "example": "{\n \"id\": \"sess_BBwZc7cFV3XizEyKGDCGL\",\n \"object\": \"realtime.transcription_session\",\n \"expires_at\": 1742188264,\n \"modalities\": [\"audio\", \"text\"],\n \"turn_detection\": {\n \"type\": \"server_vad\",\n \"threshold\": 0.5,\n \"prefix_padding_ms\": 300,\n \"silence_duration_ms\": 200\n },\n \"input_audio_format\": \"pcm16\",\n \"input_audio_transcription\": {\n \"model\": \"gpt-4o-transcribe\",\n \"language\": null,\n \"prompt\": \"\"\n },\n \"client_secret\": null\n}\n" - } - }, - "OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret": { - "type": "object", - "required": [ - "value", - "expires_at" - ], - "properties": { - "value": { - "type": "string" - }, - "expires_at": { - "type": "integer", - "format": "unixtime" - } - } - }, - "OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection": { - "type": "object", - "properties": { - "type": { - "type": "string" - }, - "threshold": { - "type": "number" - }, - "prefix_padding_ms": { - "type": "integer" - }, - "silence_duration_ms": { - "type": "integer" - } - } - }, - "OpenAI.RealtimeTruncation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "disabled" - ] - }, - { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "retention_ratio" - ], - "x-stainless-const": true - }, - "retention_ratio": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "token_limits": { - "$ref": "#/components/schemas/OpenAI.TokenLimits" - } - }, - "required": [ - "type", - "retention_ratio" - ] - } - ], - "description": "When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs.\nClients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost.\nTruncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate.\nTruncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit.", - "title": "Realtime Truncation Controls" - }, - "OpenAI.RealtimeTurnDetection": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.RealtimeTurnDetectionType" - } - }, - "discriminator": { - "propertyName": "type" - } - }, - "OpenAI.RealtimeTurnDetectionType": { - "type": "string" - }, - "OpenAI.Reasoning": { - "type": "object", - "properties": { - "effort": { - "$ref": "#/components/schemas/OpenAI.ReasoningEffort" - }, - "summary": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "concise", - "detailed" - ] - }, - { - "type": "null" - } - ] - }, - "generate_summary": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "concise", - "detailed" - ] - }, - { - "type": "null" - } - ] - } - }, - "description": "**gpt-5 and o-series models only**\nConfiguration options for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).", - "title": "Reasoning" - }, - "OpenAI.ReasoningEffort": { - "anyOf": [ - { - "type": "string", - "enum": [ - "none", - "minimal", - "low", - "medium", - "high", - "xhigh" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains effort on reasoning for\n[reasoning models](https://platform.openai.com/docs/guides/reasoning).\nCurrently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing\nreasoning effort can result in faster responses and fewer tokens used\non reasoning in a response.\n- `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.\n- All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.\n- The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.\n- `xhigh` is supported for all models after `gpt-5.1-codex-max`." - }, - "OpenAI.ReasoningTextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "reasoning_text" - ], - "description": "The type of the reasoning text. Always `reasoning_text`.", - "x-stainless-const": true, - "default": "reasoning_text" - }, - "text": { - "type": "string", - "description": "The reasoning text from the model." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputContent" - } - ], - "description": "Reasoning text from the model.", - "title": "ReasoningTextContent" - }, - "OpenAI.RefusalContent": { - "type": "object", - "required": [ - "type", - "refusal" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "refusal" - ], - "description": "The type of the refusal. Always `refusal`.", - "x-stainless-const": true, - "default": "refusal" - }, - "refusal": { - "type": "string", - "description": "The refusal explanation from the model." - } - }, - "description": "A refusal from the model.", - "title": "Refusal" - }, - "OpenAI.Response": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "error", - "incomplete_details", - "output", - "instructions", - "parallel_tool_calls", - "content_filters" - ], - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "top_logprobs": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "default": 1 - }, - "user": { - "type": "string", - "description": "This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations.\n A stable identifier for your end-users.\n Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers).", - "deprecated": true - }, - "safety_identifier": { - "type": "string", - "description": "A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies.\n The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers)." - }, - "prompt_cache_key": { - "type": "string", - "description": "Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching)." - }, - "prompt_cache_retention": { - "anyOf": [ - { - "type": "string", - "enum": [ - "in-memory", - "24h" - ] - }, - { - "type": "null" - } - ] - }, - "previous_response_id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model": { - "type": "string", - "description": "Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI\n offers a wide range of models with different capabilities, performance\n characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models)\n to browse and compare available models." - }, - "reasoning": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Reasoning" - }, - { - "type": "null" - } - ] - }, - "background": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "max_output_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "max_tool_calls": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "text": { - "$ref": "#/components/schemas/OpenAI.ResponseTextParam" - }, - "tools": { - "$ref": "#/components/schemas/OpenAI.ToolsArray" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - }, - "prompt": { - "$ref": "#/components/schemas/OpenAI.Prompt" - }, - "truncation": { - "anyOf": [ - { - "type": "string", - "enum": [ - "auto", - "disabled" - ] - }, - { - "type": "null" - } - ], - "default": "disabled" - }, - "id": { - "type": "string", - "description": "Unique identifier for this Response." - }, - "object": { - "type": "string", - "enum": [ - "response" - ], - "description": "The object type of this resource - always set to `response`.", - "x-stainless-const": true - }, - "status": { - "type": "string", - "enum": [ - "completed", - "failed", - "in_progress", - "cancelled", - "queued", - "incomplete" - ], - "description": "The status of the response generation. One of `completed`, `failed`,\n `in_progress`, `cancelled`, `queued`, or `incomplete`." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (in seconds) of when this Response was created." - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseError" - }, - { - "type": "null" - } - ] - }, - "incomplete_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseIncompleteDetails" - }, - { - "type": "null" - } - ] - }, - "output": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.OutputItem" - }, - "description": "An array of content items generated by the model.\n - The length and order of items in the `output` array is dependent\n on the model's response.\n - Rather than accessing the first item in the `output` array and\n assuming it's an `assistant` message with the content generated by\n the model, you might consider using the `output_text` property where\n supported in SDKs." - }, - "instructions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.InputItem" - } - }, - { - "type": "null" - } - ] - }, - "output_text": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "x-stainless-skip": true - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.ResponseUsage" - }, - "parallel_tool_calls": { - "type": "boolean", - "description": "Whether to allow the model to run tool calls in parallel.", - "default": true - }, - "conversation": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ConversationReference" - }, - { - "type": "null" - } - ] - }, - "content_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AzureContentFilterForResponsesAPI" - }, - "description": "The content filter results from RAI." - } - }, - "title": "The response object" - }, - "OpenAI.ResponseAudioDeltaEvent": { - "type": "object", - "required": [ - "type", - "sequence_number", - "delta" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.audio.delta" - ], - "description": "The type of the event. Always `response.audio.delta`.", - "x-stainless-const": true - }, - "sequence_number": { - "type": "integer", - "description": "A sequence number for this chunk of the stream response." - }, - "delta": { - "type": "string", - "contentEncoding": "base64", - "description": "A chunk of Base64 encoded response audio bytes." - } - }, - "description": "Emitted when there is a partial audio response.", - "x-oaiMeta": { - "name": "response.audio.delta", - "group": "responses", - "example": "{\n \"type\": \"response.audio.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \"base64encoded...\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseAudioTranscriptDeltaEvent": { - "type": "object", - "required": [ - "type", - "delta", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.audio.transcript.delta" - ], - "description": "The type of the event. Always `response.audio.transcript.delta`.", - "x-stainless-const": true - }, - "delta": { - "type": "string", - "description": "The partial transcript of the audio response." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when there is a partial transcript of audio.", - "x-oaiMeta": { - "name": "response.audio.transcript.delta", - "group": "responses", - "example": "{\n \"type\": \"response.audio.transcript.delta\",\n \"response_id\": \"resp_123\",\n \"delta\": \" ... partial transcript ... \",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "delta", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.code_interpreter_call_code.delta" - ], - "description": "The type of the event. Always `response.code_interpreter_call_code.delta`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response for which the code is being streamed." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the code interpreter tool call item." - }, - "delta": { - "type": "string", - "description": "The partial code snippet being streamed by the code interpreter." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event, used to order streaming events." - } - }, - "description": "Emitted when a partial code snippet is streamed by the code interpreter.", - "x-oaiMeta": { - "name": "response.code_interpreter_call_code.delta", - "group": "responses", - "example": "{\n \"type\": \"response.code_interpreter_call_code.delta\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"delta\": \"print('Hello, world')\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseCodeInterpreterCallInProgressEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.code_interpreter_call.in_progress" - ], - "description": "The type of the event. Always `response.code_interpreter_call.in_progress`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response for which the code interpreter call is in progress." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the code interpreter tool call item." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event, used to order streaming events." - } - }, - "description": "Emitted when a code interpreter call is in progress.", - "x-oaiMeta": { - "name": "response.code_interpreter_call.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.code_interpreter_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseCodeInterpreterCallInterpretingEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.code_interpreter_call.interpreting" - ], - "description": "The type of the event. Always `response.code_interpreter_call.interpreting`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response for which the code interpreter is interpreting code." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the code interpreter tool call item." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event, used to order streaming events." - } - }, - "description": "Emitted when the code interpreter is actively interpreting the code snippet.", - "x-oaiMeta": { - "name": "response.code_interpreter_call.interpreting", - "group": "responses", - "example": "{\n \"type\": \"response.code_interpreter_call.interpreting\",\n \"output_index\": 4,\n \"item_id\": \"ci_12345\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseContentPartAddedEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "content_index", - "part", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.content_part.added" - ], - "description": "The type of the event. Always `response.content_part.added`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the output item that the content part was added to." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the content part was added to." - }, - "content_index": { - "type": "integer", - "description": "The index of the content part that was added." - }, - "part": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputContent" - } - ], - "description": "The content part that was added." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when a new content part is added.", - "x-oaiMeta": { - "name": "response.content_part.added", - "group": "responses", - "example": "{\n \"type\": \"response.content_part.added\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"part\": {\n \"type\": \"output_text\",\n \"text\": \"\",\n \"annotations\": []\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseCreatedEvent": { - "type": "object", - "required": [ - "type", - "response", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.created" - ], - "description": "The type of the event. Always `response.created`.", - "x-stainless-const": true - }, - "response": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Response" - } - ], - "description": "The response that was created." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number for this event." - } - }, - "description": "An event that is emitted when a response is created.", - "x-oaiMeta": { - "name": "response.created", - "group": "responses", - "example": "{\n \"type\": \"response.created\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseCustomToolCallInputDeltaEvent": { - "type": "object", - "required": [ - "type", - "sequence_number", - "output_index", - "item_id", - "delta" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.custom_tool_call_input.delta" - ], - "description": "The event type identifier.", - "x-stainless-const": true - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "output_index": { - "type": "integer", - "description": "The index of the output this delta applies to." - }, - "item_id": { - "type": "string", - "description": "Unique identifier for the API item associated with this event." - }, - "delta": { - "type": "string", - "description": "The incremental input data (delta) for the custom tool call." - } - }, - "description": "Event representing a delta (partial update) to the input of a custom tool call.", - "title": "ResponseCustomToolCallInputDelta", - "x-oaiMeta": { - "name": "response.custom_tool_call_input.delta", - "group": "responses", - "example": "{\n \"type\": \"response.custom_tool_call_input.delta\",\n \"output_index\": 0,\n \"item_id\": \"ctc_1234567890abcdef\",\n \"delta\": \"partial input text\"\n}\n" - } - }, - "OpenAI.ResponseError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "$ref": "#/components/schemas/OpenAI.ResponseErrorCode" - }, - "message": { - "type": "string", - "description": "A human-readable description of the error." - } - }, - "description": "An error object returned when the model fails to generate a Response." - }, - "OpenAI.ResponseErrorCode": { - "type": "string", - "enum": [ - "server_error", - "rate_limit_exceeded", - "invalid_prompt", - "vector_store_timeout", - "invalid_image", - "invalid_image_format", - "invalid_base64_image", - "invalid_image_url", - "image_too_large", - "image_too_small", - "image_parse_error", - "image_content_policy_violation", - "invalid_image_mode", - "image_file_too_large", - "unsupported_image_media_type", - "empty_image_file", - "failed_to_download_image", - "image_file_not_found" - ], - "description": "The error code for the response." - }, - "OpenAI.ResponseErrorEvent": { - "type": "object", - "required": [ - "type", - "code", - "message", - "param", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "error" - ], - "description": "The type of the event. Always `error`.", - "x-stainless-const": true - }, - "code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "message": { - "type": "string", - "description": "The error message." - }, - "param": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when an error occurs.", - "x-oaiMeta": { - "name": "error", - "group": "responses", - "example": "{\n \"type\": \"error\",\n \"code\": \"ERR_SOMETHING\",\n \"message\": \"Something went wrong\",\n \"param\": null,\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseFailedEvent": { - "type": "object", - "required": [ - "type", - "sequence_number", - "response" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.failed" - ], - "description": "The type of the event. Always `response.failed`.", - "x-stainless-const": true - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "response": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Response" - } - ], - "description": "The response that failed." - } - }, - "description": "An event that is emitted when a response fails.", - "x-oaiMeta": { - "name": "response.failed", - "group": "responses", - "example": "{\n \"type\": \"response.failed\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"failed\",\n \"completed_at\": null,\n \"error\": {\n \"code\": \"server_error\",\n \"message\": \"The model failed to generate a response.\"\n },\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n }\n}\n" - } - }, - "OpenAI.ResponseFileSearchCallInProgressEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.file_search_call.in_progress" - ], - "description": "The type of the event. Always `response.file_search_call.in_progress`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the file search call is initiated." - }, - "item_id": { - "type": "string", - "description": "The ID of the output item that the file search call is initiated." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when a file search call is initiated.", - "x-oaiMeta": { - "name": "response.file_search_call.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.file_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseFileSearchCallSearchingEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.file_search_call.searching" - ], - "description": "The type of the event. Always `response.file_search_call.searching`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the file search call is searching." - }, - "item_id": { - "type": "string", - "description": "The ID of the output item that the file search call is initiated." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when a file search is currently searching.", - "x-oaiMeta": { - "name": "response.file_search_call.searching", - "group": "responses", - "example": "{\n \"type\": \"response.file_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"fs_123\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseFormatJsonObject": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "json_object" - ], - "description": "The type of response format being defined. Always `json_object`.", - "x-stainless-const": true - } - }, - "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.", - "title": "JSON object" - }, - "OpenAI.ResponseFormatJsonSchema": { - "type": "object", - "required": [ - "type", - "json_schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "json_schema" - ], - "description": "The type of response format being defined. Always `json_schema`.", - "x-stainless-const": true - }, - "json_schema": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema" - } - ], - "description": "Structured Outputs configuration options, including a JSON Schema.", - "title": "JSON schema" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat" - } - ], - "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).", - "title": "JSON schema" - }, - "OpenAI.ResponseFormatJsonSchemaJsonSchema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "description": { - "type": "string" - }, - "name": { - "type": "string" - }, - "schema": { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema" - }, - "strict": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.ResponseFormatJsonSchemaSchema": { - "type": "object", - "unevaluatedProperties": {}, - "description": "The schema for the response format, described as a JSON Schema object.\nLearn how to build JSON schemas [here](https://json-schema.org/).", - "title": "JSON schema" - }, - "OpenAI.ResponseFormatText": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of response format being defined. Always `text`.", - "x-stainless-const": true - } - }, - "description": "Default response format. Used to generate text responses.", - "title": "Text" - }, - "OpenAI.ResponseFunctionCallArgumentsDeltaEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "sequence_number", - "delta" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.function_call_arguments.delta" - ], - "description": "The type of the event. Always `response.function_call_arguments.delta`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the output item that the function-call arguments delta is added to." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the function-call arguments delta is added to." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "delta": { - "type": "string", - "description": "The function-call arguments delta that is added." - } - }, - "description": "Emitted when there is a partial function-call arguments delta.", - "x-oaiMeta": { - "name": "response.function_call_arguments.delta", - "group": "responses", - "example": "{\n \"type\": \"response.function_call_arguments.delta\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"delta\": \"{ \"arg\":\"\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseImageGenCallGeneratingEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.image_generation_call.generating" - ], - "description": "The type of the event. Always 'response.image_generation_call.generating'.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response's output array." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the image generation item being processed." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of the image generation item being processed." - } - }, - "description": "Emitted when an image generation tool call is actively generating an image (intermediate state).", - "title": "ResponseImageGenCallGeneratingEvent", - "x-oaiMeta": { - "name": "response.image_generation_call.generating", - "group": "responses", - "example": "{\n \"type\": \"response.image_generation_call.generating\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n" - } - }, - "OpenAI.ResponseImageGenCallInProgressEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.image_generation_call.in_progress" - ], - "description": "The type of the event. Always 'response.image_generation_call.in_progress'.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response's output array." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the image generation item being processed." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of the image generation item being processed." - } - }, - "description": "Emitted when an image generation tool call is in progress.", - "title": "ResponseImageGenCallInProgressEvent", - "x-oaiMeta": { - "name": "response.image_generation_call.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.image_generation_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0\n}\n" - } - }, - "OpenAI.ResponseImageGenCallPartialImageEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number", - "partial_image_index", - "partial_image_b64" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.image_generation_call.partial_image" - ], - "description": "The type of the event. Always 'response.image_generation_call.partial_image'.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response's output array." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the image generation item being processed." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of the image generation item being processed." - }, - "partial_image_index": { - "type": "integer", - "description": "0-based index for the partial image (backend is 1-based, but this is 0-based for the user)." - }, - "partial_image_b64": { - "type": "string", - "description": "Base64-encoded partial image data, suitable for rendering as an image." - } - }, - "description": "Emitted when a partial image is available during image generation streaming.", - "title": "ResponseImageGenCallPartialImageEvent", - "x-oaiMeta": { - "name": "response.image_generation_call.partial_image", - "group": "responses", - "example": "{\n \"type\": \"response.image_generation_call.partial_image\",\n \"output_index\": 0,\n \"item_id\": \"item-123\",\n \"sequence_number\": 0,\n \"partial_image_index\": 0,\n \"partial_image_b64\": \"...\"\n}\n" - } - }, - "OpenAI.ResponseInProgressEvent": { - "type": "object", - "required": [ - "type", - "response", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.in_progress" - ], - "description": "The type of the event. Always `response.in_progress`.", - "x-stainless-const": true - }, - "response": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Response" - } - ], - "description": "The response that is in progress." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when the response is in progress.", - "x-oaiMeta": { - "name": "response.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.in_progress\",\n \"response\": {\n \"id\": \"resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c\",\n \"object\": \"response\",\n \"created_at\": 1741487325,\n \"status\": \"in_progress\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": null,\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-2024-08-06\",\n \"output\": [],\n \"parallel_tool_calls\": true,\n \"previous_response_id\": null,\n \"reasoning\": {\n \"effort\": null,\n \"summary\": null\n },\n \"store\": true,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseIncompleteDetails": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "enum": [ - "max_output_tokens", - "content_filter" - ] - } - } - }, - "OpenAI.ResponseIncompleteEvent": { - "type": "object", - "required": [ - "type", - "response", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.incomplete" - ], - "description": "The type of the event. Always `response.incomplete`.", - "x-stainless-const": true - }, - "response": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Response" - } - ], - "description": "The response that was incomplete." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "An event that is emitted when a response finishes as incomplete.", - "x-oaiMeta": { - "name": "response.incomplete", - "group": "responses", - "example": "{\n \"type\": \"response.incomplete\",\n \"response\": {\n \"id\": \"resp_123\",\n \"object\": \"response\",\n \"created_at\": 1740855869,\n \"status\": \"incomplete\",\n \"completed_at\": null,\n \"error\": null,\n \"incomplete_details\": {\n \"reason\": \"max_tokens\"\n },\n \"instructions\": null,\n \"max_output_tokens\": null,\n \"model\": \"gpt-4o-mini-2024-07-18\",\n \"output\": [],\n \"previous_response_id\": null,\n \"reasoning_effort\": null,\n \"store\": false,\n \"temperature\": 1,\n \"text\": {\n \"format\": {\n \"type\": \"text\"\n }\n },\n \"tool_choice\": \"auto\",\n \"tools\": [],\n \"top_p\": 1,\n \"truncation\": \"disabled\",\n \"usage\": null,\n \"user\": null,\n \"metadata\": {}\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseItemList": { - "type": "object", - "required": [ - "object", - "data", - "has_more", - "first_id", - "last_id" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ], - "description": "The type of object returned, must be `list`.", - "x-stainless-const": true - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ItemResource" - }, - "description": "A list of items used to generate this response." - }, - "has_more": { - "type": "boolean", - "description": "Whether there are more items available." - }, - "first_id": { - "type": "string", - "description": "The ID of the first item in the list." - }, - "last_id": { - "type": "string", - "description": "The ID of the last item in the list." - } - }, - "description": "A list of Response items.", - "x-oaiMeta": { - "name": "The input item list", - "group": "responses", - "example": "{\n \"object\": \"list\",\n \"data\": [\n {\n \"id\": \"msg_abc123\",\n \"type\": \"message\",\n \"role\": \"user\",\n \"content\": [\n {\n \"type\": \"input_text\",\n \"text\": \"Tell me a three sentence bedtime story about a unicorn.\"\n }\n ]\n }\n ],\n \"first_id\": \"msg_abc123\",\n \"last_id\": \"msg_abc123\",\n \"has_more\": false\n}\n" - } - }, - "OpenAI.ResponseLogProb": { - "type": "object", - "required": [ - "token", - "logprob" - ], - "properties": { - "token": { - "type": "string", - "description": "A possible text token." - }, - "logprob": { - "type": "number", - "description": "The log probability of this token." - }, - "top_logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ResponseLogProbTopLogprobs" - }, - "description": "The log probability of the top 20 most likely tokens." - } - }, - "description": "A logprob is the logarithmic probability that the model assigns to producing\na particular token at a given position in the sequence. Less-negative (higher)\nlogprob values indicate greater model confidence in that token choice." - }, - "OpenAI.ResponseLogProbTopLogprobs": { - "type": "object", - "properties": { - "token": { - "type": "string" - }, - "logprob": { - "type": "number" - } - } - }, - "OpenAI.ResponseMCPCallArgumentsDeltaEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "delta", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.mcp_call_arguments.delta" - ], - "description": "The type of the event. Always 'response.mcp_call_arguments.delta'.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response's output array." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the MCP tool call item being processed." - }, - "delta": { - "type": "string", - "description": "A JSON string containing the partial update to the arguments for the MCP tool call." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when there is a delta (partial update) to the arguments of an MCP tool call.", - "title": "ResponseMCPCallArgumentsDeltaEvent", - "x-oaiMeta": { - "name": "response.mcp_call_arguments.delta", - "group": "responses", - "example": "{\n \"type\": \"response.mcp_call_arguments.delta\",\n \"output_index\": 0,\n \"item_id\": \"item-abc\",\n \"delta\": \"{\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseMCPCallFailedEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.mcp_call.failed" - ], - "description": "The type of the event. Always 'response.mcp_call.failed'.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the MCP tool call item that failed." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that failed." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when an MCP tool call has failed.", - "title": "ResponseMCPCallFailedEvent", - "x-oaiMeta": { - "name": "response.mcp_call.failed", - "group": "responses", - "example": "{\n \"type\": \"response.mcp_call.failed\",\n \"sequence_number\": 1,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\",\n \"output_index\": 0\n}\n" - } - }, - "OpenAI.ResponseMCPCallInProgressEvent": { - "type": "object", - "required": [ - "type", - "sequence_number", - "output_index", - "item_id" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.mcp_call.in_progress" - ], - "description": "The type of the event. Always 'response.mcp_call.in_progress'.", - "x-stainless-const": true - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response's output array." - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the MCP tool call item being processed." - } - }, - "description": "Emitted when an MCP tool call is in progress.", - "title": "ResponseMCPCallInProgressEvent", - "x-oaiMeta": { - "name": "response.mcp_call.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.mcp_call.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90\"\n}\n" - } - }, - "OpenAI.ResponseMCPListToolsFailedEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.mcp_list_tools.failed" - ], - "description": "The type of the event. Always 'response.mcp_list_tools.failed'.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the MCP tool call item that failed." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that failed." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when the attempt to list available MCP tools has failed.", - "title": "ResponseMCPListToolsFailedEvent", - "x-oaiMeta": { - "name": "response.mcp_list_tools.failed", - "group": "responses", - "example": "{\n \"type\": \"response.mcp_list_tools.failed\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" - } - }, - "OpenAI.ResponseMCPListToolsInProgressEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.mcp_list_tools.in_progress" - ], - "description": "The type of the event. Always 'response.mcp_list_tools.in_progress'.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the MCP tool call item that is being processed." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that is being processed." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when the system is in the process of retrieving the list of available MCP tools.", - "title": "ResponseMCPListToolsInProgressEvent", - "x-oaiMeta": { - "name": "response.mcp_list_tools.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.mcp_list_tools.in_progress\",\n \"sequence_number\": 1,\n \"output_index\": 0,\n \"item_id\": \"mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90\"\n}\n" - } - }, - "OpenAI.ResponseModalities": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string", - "enum": [ - "text", - "audio" - ] - } - }, - { - "type": "null" - } - ], - "description": "Output types that you would like the model to generate.\nMost models are capable of generating text, which is the default:\n`[\"text\"]`\nThe `gpt-4o-audio-preview` model can also be used to\n[generate audio](https://platform.openai.com/docs/guides/audio). To request that this model generate\nboth text and audio responses, you can use:\n`[\"text\", \"audio\"]`" - }, - "OpenAI.ResponseOutputItemAddedEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "sequence_number", - "item" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.output_item.added" - ], - "description": "The type of the event. Always `response.output_item.added`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that was added." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "item": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.OutputItem" - } - ], - "description": "The output item that was added." - } - }, - "description": "Emitted when a new output item is added.", - "x-oaiMeta": { - "name": "response.output_item.added", - "group": "responses", - "example": "{\n \"type\": \"response.output_item.added\",\n \"output_index\": 0,\n \"item\": {\n \"id\": \"msg_123\",\n \"status\": \"in_progress\",\n \"type\": \"message\",\n \"role\": \"assistant\",\n \"content\": []\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseOutputTextAnnotationAddedEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "content_index", - "annotation_index", - "sequence_number", - "annotation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.output_text.annotation.added" - ], - "description": "The type of the event. Always 'response.output_text.annotation.added'.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The unique identifier of the item to which the annotation is being added." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item in the response's output array." - }, - "content_index": { - "type": "integer", - "description": "The index of the content part within the output item." - }, - "annotation_index": { - "type": "integer", - "description": "The index of the annotation within the content part." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "annotation": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Annotation" - } - ], - "description": "The annotation object being added. (See annotation schema for details.)" - } - }, - "description": "Emitted when an annotation is added to output text content.", - "title": "ResponseOutputTextAnnotationAddedEvent", - "x-oaiMeta": { - "name": "response.output_text.annotation.added", - "group": "responses", - "example": "{\n \"type\": \"response.output_text.annotation.added\",\n \"item_id\": \"item-abc\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"annotation_index\": 0,\n \"annotation\": {\n \"type\": \"text_annotation\",\n \"text\": \"This is a test annotation\",\n \"start\": 0,\n \"end\": 10\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponsePromptVariables": { - "type": "object", - "unevaluatedProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/OpenAI.InputTextContent" - }, - { - "$ref": "#/components/schemas/OpenAI.InputImageContent" - }, - { - "$ref": "#/components/schemas/OpenAI.InputFileContent" - } - ] - }, - "description": "Optional map of values to substitute in for variables in your\nprompt. The substitution values can either be strings, or other\nResponse input types like images or files.", - "title": "Prompt Variables", - "x-oaiExpandable": true, - "x-oaiTypeLabel": "map" - }, - "OpenAI.ResponseQueuedEvent": { - "type": "object", - "required": [ - "type", - "response", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.queued" - ], - "description": "The type of the event. Always 'response.queued'.", - "x-stainless-const": true - }, - "response": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Response" - } - ], - "description": "The full response object that is queued." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number for this event." - } - }, - "description": "Emitted when a response is queued and waiting to be processed.", - "title": "ResponseQueuedEvent", - "x-oaiMeta": { - "name": "response.queued", - "group": "responses", - "example": "{\n \"type\": \"response.queued\",\n \"response\": {\n \"id\": \"res_123\",\n \"status\": \"queued\",\n \"created_at\": \"2021-01-01T00:00:00Z\",\n \"updated_at\": \"2021-01-01T00:00:00Z\"\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseReasoningSummaryPartAddedEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "summary_index", - "sequence_number", - "part" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.reasoning_summary_part.added" - ], - "description": "The type of the event. Always `response.reasoning_summary_part.added`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the item this summary part is associated with." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item this summary part is associated with." - }, - "summary_index": { - "type": "integer", - "description": "The index of the summary part within the reasoning summary." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - }, - "part": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart" - } - ], - "description": "The summary part that was added." - } - }, - "description": "Emitted when a new reasoning summary part is added.", - "x-oaiMeta": { - "name": "response.reasoning_summary_part.added", - "group": "responses", - "example": "{\n \"type\": \"response.reasoning_summary_part.added\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"part\": {\n \"type\": \"summary_text\",\n \"text\": \"\"\n },\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseReasoningSummaryPartAddedEventPart": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "summary_text" - ], - "x-stainless-const": true - }, - "text": { - "type": "string" - } - } - }, - "OpenAI.ResponseReasoningSummaryTextDeltaEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "summary_index", - "delta", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.reasoning_summary_text.delta" - ], - "description": "The type of the event. Always `response.reasoning_summary_text.delta`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the item this summary text delta is associated with." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item this summary text delta is associated with." - }, - "summary_index": { - "type": "integer", - "description": "The index of the summary part within the reasoning summary." - }, - "delta": { - "type": "string", - "description": "The text delta that was added to the summary." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when a delta is added to a reasoning summary text.", - "x-oaiMeta": { - "name": "response.reasoning_summary_text.delta", - "group": "responses", - "example": "{\n \"type\": \"response.reasoning_summary_text.delta\",\n \"item_id\": \"rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476\",\n \"output_index\": 0,\n \"summary_index\": 0,\n \"delta\": \"**Responding to a greeting**\n\nThe user just said, \"Hello!\" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, \"Hello! How can I assist you today?\" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseReasoningTextDeltaEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "content_index", - "delta", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.reasoning_text.delta" - ], - "description": "The type of the event. Always `response.reasoning_text.delta`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the item this reasoning text delta is associated with." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item this reasoning text delta is associated with." - }, - "content_index": { - "type": "integer", - "description": "The index of the reasoning content part this delta is associated with." - }, - "delta": { - "type": "string", - "description": "The text delta that was added to the reasoning content." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when a delta is added to a reasoning text.", - "x-oaiMeta": { - "name": "response.reasoning_text.delta", - "group": "responses", - "example": "{\n \"type\": \"response.reasoning_text.delta\",\n \"item_id\": \"rs_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"The\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseRefusalDeltaEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "content_index", - "delta", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.refusal.delta" - ], - "description": "The type of the event. Always `response.refusal.delta`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the output item that the refusal text is added to." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the refusal text is added to." - }, - "content_index": { - "type": "integer", - "description": "The index of the content part that the refusal text is added to." - }, - "delta": { - "type": "string", - "description": "The refusal text that is added." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of this event." - } - }, - "description": "Emitted when there is a partial refusal text.", - "x-oaiMeta": { - "name": "response.refusal.delta", - "group": "responses", - "example": "{\n \"type\": \"response.refusal.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"refusal text so far\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseStreamOptions": { - "type": "object", - "properties": { - "include_obfuscation": { - "type": "boolean", - "description": "When true, stream obfuscation will be enabled. Stream obfuscation adds\n random characters to an `obfuscation` field on streaming delta events to\n normalize payload sizes as a mitigation to certain side-channel attacks.\n These obfuscation fields are included by default, but add a small amount\n of overhead to the data stream. You can set `include_obfuscation` to\n false to optimize for bandwidth if you trust the network links between\n your application and the OpenAI API." - } - }, - "description": "Options for streaming responses. Only set this when you set `stream: true`." - }, - "OpenAI.ResponseTextDeltaEvent": { - "type": "object", - "required": [ - "type", - "item_id", - "output_index", - "content_index", - "delta", - "sequence_number", - "logprobs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.output_text.delta" - ], - "description": "The type of the event. Always `response.output_text.delta`.", - "x-stainless-const": true - }, - "item_id": { - "type": "string", - "description": "The ID of the output item that the text delta was added to." - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the text delta was added to." - }, - "content_index": { - "type": "integer", - "description": "The index of the content part that the text delta was added to." - }, - "delta": { - "type": "string", - "description": "The text delta that was added." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number for this event." - }, - "logprobs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.ResponseLogProb" - }, - "description": "The log probabilities of the tokens in the delta." - } - }, - "description": "Emitted when there is an additional text delta.", - "x-oaiMeta": { - "name": "response.output_text.delta", - "group": "responses", - "example": "{\n \"type\": \"response.output_text.delta\",\n \"item_id\": \"msg_123\",\n \"output_index\": 0,\n \"content_index\": 0,\n \"delta\": \"In\",\n \"sequence_number\": 1\n}\n" - } - }, - "OpenAI.ResponseTextParam": { - "type": "object", - "properties": { - "format": { - "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" - }, - "verbosity": { - "$ref": "#/components/schemas/OpenAI.Verbosity" - } - }, - "description": "Configuration options for a text response from the model. Can be plain\ntext or structured JSON data. Learn more:\n- [Text inputs and outputs](https://platform.openai.com/docs/guides/text)\n- [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs)" - }, - "OpenAI.ResponseUsage": { - "type": "object", - "required": [ - "input_tokens", - "input_tokens_details", - "output_tokens", - "output_tokens_details", - "total_tokens" - ], - "properties": { - "input_tokens": { - "type": "integer", - "description": "The number of input tokens." - }, - "input_tokens_details": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseUsageInputTokensDetails" - } - ], - "description": "A detailed breakdown of the input tokens." - }, - "output_tokens": { - "type": "integer", - "description": "The number of output tokens." - }, - "output_tokens_details": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails" - } - ], - "description": "A detailed breakdown of the output tokens." - }, - "total_tokens": { - "type": "integer", - "description": "The total number of tokens used." - } - }, - "description": "Represents token usage details including input tokens, output tokens,\na breakdown of output tokens, and the total tokens used." - }, - "OpenAI.ResponseUsageInputTokensDetails": { - "type": "object", - "required": [ - "cached_tokens" - ], - "properties": { - "cached_tokens": { - "type": "integer" - } - } - }, - "OpenAI.ResponseUsageOutputTokensDetails": { - "type": "object", - "required": [ - "reasoning_tokens" - ], - "properties": { - "reasoning_tokens": { - "type": "integer" - } - } - }, - "OpenAI.ResponseWebSearchCallInProgressEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.web_search_call.in_progress" - ], - "description": "The type of the event. Always `response.web_search_call.in_progress`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the web search call is associated with." - }, - "item_id": { - "type": "string", - "description": "Unique ID for the output item associated with the web search call." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of the web search call being processed." - } - }, - "description": "Note: web_search is not yet available via Azure OpenAI.", - "x-oaiMeta": { - "name": "response.web_search_call.in_progress", - "group": "responses", - "example": "{\n \"type\": \"response.web_search_call.in_progress\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" - } - }, - "OpenAI.ResponseWebSearchCallSearchingEvent": { - "type": "object", - "required": [ - "type", - "output_index", - "item_id", - "sequence_number" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "response.web_search_call.searching" - ], - "description": "The type of the event. Always `response.web_search_call.searching`.", - "x-stainless-const": true - }, - "output_index": { - "type": "integer", - "description": "The index of the output item that the web search call is associated with." - }, - "item_id": { - "type": "string", - "description": "Unique ID for the output item associated with the web search call." - }, - "sequence_number": { - "type": "integer", - "description": "The sequence number of the web search call being processed." - } - }, - "description": "Note: web_search is not yet available via Azure OpenAI.", - "x-oaiMeta": { - "name": "response.web_search_call.searching", - "group": "responses", - "example": "{\n \"type\": \"response.web_search_call.searching\",\n \"output_index\": 0,\n \"item_id\": \"ws_123\",\n \"sequence_number\": 0\n}\n" - } - }, - "OpenAI.RunCompletionUsage": { - "type": "object", - "required": [ - "completion_tokens", - "prompt_tokens", - "total_tokens" - ], - "properties": { - "completion_tokens": { - "type": "integer", - "description": "Number of completion tokens used over the course of the run." - }, - "prompt_tokens": { - "type": "integer", - "description": "Number of prompt tokens used over the course of the run." - }, - "total_tokens": { - "type": "integer", - "description": "Total number of tokens used (prompt + completion)." - } - }, - "description": "Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.)." - }, - "OpenAI.RunGraderRequest": { - "type": "object", - "required": [ - "grader", - "model_sample" - ], - "properties": { - "grader": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.GraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderPython" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderScoreModel" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderMulti" - }, - { - "$ref": "#/components/schemas/GraderEndpoint" - } - ], - "description": "The grader used for the fine-tuning job." - }, - "item": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunGraderRequestItem" - } - ], - "description": "The dataset item provided to the grader. This will be used to populate\n the `item` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details." - }, - "model_sample": { - "type": "string", - "description": "The model sample to be evaluated. This value will be used to populate\n the `sample` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details.\n The `output_json` variable will be populated if the model sample is a\n valid JSON string." - } - }, - "title": "RunGraderRequest" - }, - "OpenAI.RunGraderRequestItem": { - "type": "object" - }, - "OpenAI.RunGraderResponse": { - "type": "object", - "required": [ - "reward", - "metadata", - "sub_rewards", - "model_grader_token_usage_per_model" - ], - "properties": { - "reward": { - "type": "number" - }, - "metadata": { - "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadata" - }, - "sub_rewards": { - "type": "object", - "unevaluatedProperties": {} - }, - "model_grader_token_usage_per_model": { - "type": "object", - "unevaluatedProperties": {} - } - } - }, - "OpenAI.RunGraderResponseMetadata": { - "type": "object", - "required": [ - "name", - "type", - "errors", - "execution_time", - "scores", - "token_usage", - "sampled_model_name" - ], - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - }, - "errors": { - "$ref": "#/components/schemas/OpenAI.RunGraderResponseMetadataErrors" - }, - "execution_time": { - "type": "number" - }, - "scores": { - "type": "object", - "unevaluatedProperties": {} - }, - "token_usage": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - }, - "sampled_model_name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.RunGraderResponseMetadataErrors": { - "type": "object", - "required": [ - "formula_parse_error", - "sample_parse_error", - "truncated_observation_error", - "unresponsive_reward_error", - "invalid_variable_error", - "other_error", - "python_grader_server_error", - "python_grader_server_error_type", - "python_grader_runtime_error", - "python_grader_runtime_error_details", - "model_grader_server_error", - "model_grader_refusal_error", - "model_grader_parse_error", - "model_grader_server_error_details" - ], - "properties": { - "formula_parse_error": { - "type": "boolean" - }, - "sample_parse_error": { - "type": "boolean" - }, - "truncated_observation_error": { - "type": "boolean" - }, - "unresponsive_reward_error": { - "type": "boolean" - }, - "invalid_variable_error": { - "type": "boolean" - }, - "other_error": { - "type": "boolean" - }, - "python_grader_server_error": { - "type": "boolean" - }, - "python_grader_server_error_type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "python_grader_runtime_error": { - "type": "boolean" - }, - "python_grader_runtime_error_details": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "model_grader_server_error": { - "type": "boolean" - }, - "model_grader_refusal_error": { - "type": "boolean" - }, - "model_grader_parse_error": { - "type": "boolean" - }, - "model_grader_server_error_details": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.RunObject": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "thread_id", - "assistant_id", - "status", - "required_action", - "last_error", - "expires_at", - "started_at", - "cancelled_at", - "failed_at", - "completed_at", - "incomplete_details", - "model", - "instructions", - "tools", - "metadata", - "usage", - "max_prompt_tokens", - "max_completion_tokens", - "truncation_strategy", - "tool_choice", - "parallel_tool_calls", - "response_format" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "thread.run" - ], - "description": "The object type, which is always `thread.run`.", - "x-stainless-const": true - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the run was created." - }, - "thread_id": { - "type": "string", - "description": "The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run." - }, - "assistant_id": { - "type": "string", - "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run." - }, - "status": { - "$ref": "#/components/schemas/OpenAI.RunStatus" - }, - "required_action": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunObjectRequiredAction" - }, - { - "type": "null" - } - ], - "description": "Details on the action required to continue the run. Will be `null` if no action is required." - }, - "last_error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunObjectLastError" - }, - { - "type": "null" - } - ], - "description": "The last error associated with this run. Will be `null` if there are no errors." - }, - "expires_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp", - "description": "The Unix timestamp (in seconds) for when the run will expire." - }, - "started_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp", - "description": "The Unix timestamp (in seconds) for when the run was started." - }, - "cancelled_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp", - "description": "The Unix timestamp (in seconds) for when the run was cancelled." - }, - "failed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp", - "description": "The Unix timestamp (in seconds) for when the run failed." - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp", - "description": "The Unix timestamp (in seconds) for when the run was completed." - }, - "incomplete_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunObjectIncompleteDetails" - }, - { - "type": "null" - } - ], - "description": "Details on why the run is incomplete. Will be `null` if the run is not incomplete." - }, - "model": { - "type": "string", - "description": "The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run." - }, - "instructions": { - "type": "string", - "description": "The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run." - }, - "tools": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.AssistantTool" - }, - "maxItems": 20, - "description": "The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.", - "default": [] - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "usage": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunCompletionUsage" - }, - { - "type": "null" - } - ] - }, - "temperature": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "The sampling temperature used for this run. If not set, defaults to 1." - }, - "top_p": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "description": "The nucleus sampling value used for this run. If not set, defaults to 1." - }, - "max_prompt_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 256, - "description": "The maximum number of prompt tokens specified to have been used over the course of the run." - }, - "max_completion_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "minimum": 256, - "description": "The maximum number of completion tokens specified to have been used over the course of the run." - }, - "truncation_strategy": { - "$ref": "#/components/schemas/OpenAI.TruncationObject" - }, - "tool_choice": { - "$ref": "#/components/schemas/OpenAI.AssistantsApiToolChoiceOption" - }, - "parallel_tool_calls": { - "$ref": "#/components/schemas/OpenAI.ParallelToolCalls" - }, - "response_format": { - "$ref": "#/components/schemas/OpenAI.AssistantsApiResponseFormatOption" - } - }, - "description": "Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads).", - "title": "A run on a thread", - "x-oaiMeta": { - "name": "The run object", - "beta": true, - "example": "{\n \"id\": \"run_abc123\",\n \"object\": \"thread.run\",\n \"created_at\": 1698107661,\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"status\": \"completed\",\n \"started_at\": 1699073476,\n \"expires_at\": null,\n \"cancelled_at\": null,\n \"failed_at\": null,\n \"completed_at\": 1699073498,\n \"last_error\": null,\n \"model\": \"gpt-4o\",\n \"instructions\": null,\n \"tools\": [{\"type\": \"file_search\"}, {\"type\": \"code_interpreter\"}],\n \"metadata\": {},\n \"incomplete_details\": null,\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n },\n \"temperature\": 1.0,\n \"top_p\": 1.0,\n \"max_prompt_tokens\": 1000,\n \"max_completion_tokens\": 1000,\n \"truncation_strategy\": {\n \"type\": \"auto\",\n \"last_messages\": null\n },\n \"response_format\": \"auto\",\n \"tool_choice\": \"auto\",\n \"parallel_tool_calls\": true\n}\n" - } - }, - "OpenAI.RunObjectIncompleteDetails": { - "type": "object", - "properties": { - "reason": { - "type": "string", - "enum": [ - "max_completion_tokens", - "max_prompt_tokens" - ] - } - } - }, - "OpenAI.RunObjectLastError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "server_error", - "rate_limit_exceeded", - "invalid_prompt" - ] - }, - "message": { - "type": "string" - } - } - }, - "OpenAI.RunObjectRequiredAction": { - "type": "object", - "required": [ - "type", - "submit_tool_outputs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "submit_tool_outputs" - ], - "x-stainless-const": true - }, - "submit_tool_outputs": { - "$ref": "#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs" - } - } - }, - "OpenAI.RunObjectRequiredActionSubmitToolOutputs": { - "type": "object", - "required": [ - "tool_calls" - ], - "properties": { - "tool_calls": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RunToolCallObject" - } - } - } - }, - "OpenAI.RunStatus": { - "type": "string", - "enum": [ - "queued", - "in_progress", - "requires_action", - "cancelling", - "cancelled", - "failed", - "completed", - "incomplete", - "expired" - ], - "description": "The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`." - }, - "OpenAI.RunStepCompletionUsage": { - "type": "object", - "required": [ - "completion_tokens", - "prompt_tokens", - "total_tokens" - ], - "properties": { - "completion_tokens": { - "type": "integer", - "description": "Number of completion tokens used over the course of the run step." - }, - "prompt_tokens": { - "type": "integer", - "description": "Number of prompt tokens used over the course of the run step." - }, - "total_tokens": { - "type": "integer", - "description": "Total number of tokens used (prompt + completion)." - } - }, - "description": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`." - }, - "OpenAI.RunStepDetailsMessageCreationObject": { - "type": "object", - "required": [ - "type", - "message_creation" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "message_creation" - ], - "description": "Always `message_creation`.", - "x-stainless-const": true - }, - "message_creation": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation" - } - }, - "description": "Details of the message creation by the run step.", - "title": "Message creation" - }, - "OpenAI.RunStepDetailsMessageCreationObjectMessageCreation": { - "type": "object", - "required": [ - "message_id" - ], - "properties": { - "message_id": { - "type": "string" - } - } - }, - "OpenAI.RunStepDetailsToolCall": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "code_interpreter": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject", - "file_search": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject", - "function": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject" - } - } - }, - "OpenAI.RunStepDetailsToolCallType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "code_interpreter", - "file_search", - "function" - ] - } - ] - }, - "OpenAI.RunStepDetailsToolCallsCodeObject": { - "type": "object", - "required": [ - "id", - "type", - "code_interpreter" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the tool call." - }, - "type": { - "type": "string", - "enum": [ - "code_interpreter" - ], - "description": "The type of tool call. This is always going to be `code_interpreter` for this type of tool call.", - "x-stainless-const": true - }, - "code_interpreter": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter" - } - ], - "description": "The Code Interpreter tool call definition." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" - } - ], - "description": "Details of the Code Interpreter tool call the run step was involved in.", - "title": "Code Interpreter tool call" - }, - "OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter": { - "type": "object", - "required": [ - "input", - "outputs" - ], - "properties": { - "input": { - "type": "string" - }, - "outputs": { - "type": "array", - "items": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject" - }, - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject" - } - ] - } - } - } - }, - "OpenAI.RunStepDetailsToolCallsCodeOutputImageObject": { - "type": "object", - "required": [ - "type", - "image" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image" - ], - "description": "Always `image`.", - "x-stainless-const": true - }, - "image": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage" - } - }, - "title": "Code Interpreter image output", - "x-stainless-naming": { - "java": { - "type_name": "ImageOutput" - }, - "kotlin": { - "type_name": "ImageOutput" - } - } - }, - "OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage": { - "type": "object", - "required": [ - "file_id" - ], - "properties": { - "file_id": { - "type": "string" - } - } - }, - "OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject": { - "type": "object", - "required": [ - "type", - "logs" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "logs" - ], - "description": "Always `logs`.", - "x-stainless-const": true - }, - "logs": { - "type": "string", - "description": "The text output from the Code Interpreter tool call." - } - }, - "description": "Text output from the Code Interpreter tool call as part of a run step.", - "title": "Code Interpreter log output", - "x-stainless-naming": { - "java": { - "type_name": "LogsOutput" - }, - "kotlin": { - "type_name": "LogsOutput" - } - } - }, - "OpenAI.RunStepDetailsToolCallsFileSearchObject": { - "type": "object", - "required": [ - "id", - "type", - "file_search" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the tool call object." - }, - "type": { - "type": "string", - "enum": [ - "file_search" - ], - "description": "The type of tool call. This is always going to be `file_search` for this type of tool call.", - "x-stainless-const": true - }, - "file_search": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch" - } - ], - "description": "For now, this is always going to be an empty object.", - "x-oaiTypeLabel": "map" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" - } - ], - "title": "File search tool call" - }, - "OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch": { - "type": "object", - "properties": { - "ranking_options": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject" - }, - "results": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject" - } - } - } - }, - "OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject": { - "type": "object", - "required": [ - "ranker", - "score_threshold" - ], - "properties": { - "ranker": { - "$ref": "#/components/schemas/OpenAI.FileSearchRanker" - }, - "score_threshold": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "The score threshold for the file search. All values must be a floating point number between 0 and 1." - } - }, - "description": "The ranking options for the file search.", - "title": "File search tool call ranking options" - }, - "OpenAI.RunStepDetailsToolCallsFileSearchResultObject": { - "type": "object", - "required": [ - "file_id", - "file_name", - "score" - ], - "properties": { - "file_id": { - "type": "string", - "description": "The ID of the file that result was found in." - }, - "file_name": { - "type": "string", - "description": "The name of the file that result was found in." - }, - "score": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "The score of the result. All values must be a floating point number between 0 and 1." - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent" - }, - "description": "The content of the result that was found. The content is only included if requested via the include query parameter." - } - }, - "description": "A result instance of the file search.", - "title": "File search tool call result", - "x-oaiTypeLabel": "map" - }, - "OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "x-stainless-const": true - }, - "text": { - "type": "string" - } - } - }, - "OpenAI.RunStepDetailsToolCallsFunctionObject": { - "type": "object", - "required": [ - "id", - "type", - "function" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the tool call object." - }, - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of tool call. This is always going to be `function` for this type of tool call.", - "x-stainless-const": true - }, - "function": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction" - } - ], - "description": "The definition of the function that was called." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" - } - ], - "title": "Function tool call" - }, - "OpenAI.RunStepDetailsToolCallsFunctionObjectFunction": { - "type": "object", - "required": [ - "name", - "arguments", - "output" - ], - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string" - }, - "output": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.RunStepDetailsToolCallsObject": { - "type": "object", - "required": [ - "type", - "tool_calls" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "tool_calls" - ], - "description": "Always `tool_calls`.", - "x-stainless-const": true - }, - "tool_calls": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCall" - }, - "description": "An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`." - } - }, - "description": "Details of the tool call.", - "title": "Tool calls" - }, - "OpenAI.RunStepObject": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "assistant_id", - "thread_id", - "run_id", - "type", - "status", - "step_details", - "last_error", - "expired_at", - "cancelled_at", - "failed_at", - "completed_at", - "metadata", - "usage" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier of the run step, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "thread.run.step" - ], - "description": "The object type, which is always `thread.run.step`.", - "x-stainless-const": true - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the run step was created." - }, - "assistant_id": { - "type": "string", - "description": "The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step." - }, - "thread_id": { - "type": "string", - "description": "The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run." - }, - "run_id": { - "type": "string", - "description": "The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of." - }, - "type": { - "type": "string", - "enum": [ - "message_creation", - "tool_calls" - ], - "description": "The type of run step, which can be either `message_creation` or `tool_calls`." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "cancelled", - "failed", - "completed", - "expired" - ], - "description": "The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`." - }, - "step_details": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject" - }, - { - "$ref": "#/components/schemas/OpenAI.RunStepDetailsToolCallsObject" - } - ], - "description": "The details of the run step." - }, - "last_error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunStepObjectLastError" - }, - { - "type": "null" - } - ] - }, - "expired_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "cancelled_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "failed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "completed_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - }, - "usage": { - "$ref": "#/components/schemas/OpenAI.RunStepCompletionUsage" - } - }, - "description": "Represents a step in execution of a run.", - "title": "Run steps", - "x-oaiMeta": { - "name": "The run step object", - "beta": true, - "example": "{\n \"id\": \"step_abc123\",\n \"object\": \"thread.run.step\",\n \"created_at\": 1699063291,\n \"run_id\": \"run_abc123\",\n \"assistant_id\": \"asst_abc123\",\n \"thread_id\": \"thread_abc123\",\n \"type\": \"message_creation\",\n \"status\": \"completed\",\n \"cancelled_at\": null,\n \"completed_at\": 1699063291,\n \"expired_at\": null,\n \"failed_at\": null,\n \"last_error\": null,\n \"step_details\": {\n \"type\": \"message_creation\",\n \"message_creation\": {\n \"message_id\": \"msg_abc123\"\n }\n },\n \"usage\": {\n \"prompt_tokens\": 123,\n \"completion_tokens\": 456,\n \"total_tokens\": 579\n }\n}\n" - } - }, - "OpenAI.RunStepObjectLastError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "server_error", - "rate_limit_exceeded" - ] - }, - "message": { - "type": "string" - } - } - }, - "OpenAI.RunToolCallObject": { - "type": "object", - "required": [ - "id", - "type", - "function" - ], - "properties": { - "id": { - "type": "string", - "description": "The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint." - }, - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "The type of tool call the output is required for. For now, this is always `function`.", - "x-stainless-const": true - }, - "function": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.RunToolCallObjectFunction" - } - ], - "description": "The function definition." - } - }, - "description": "Tool call objects" - }, - "OpenAI.RunToolCallObjectFunction": { - "type": "object", - "required": [ - "name", - "arguments" - ], - "properties": { - "name": { - "type": "string" - }, - "arguments": { - "type": "string" - } - } - }, - "OpenAI.Screenshot": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "screenshot" - ], - "description": "Specifies the event type. For a screenshot action, this property is\n always set to `screenshot`.", - "x-stainless-const": true, - "default": "screenshot" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A screenshot action.", - "title": "Screenshot" - }, - "OpenAI.Scroll": { - "type": "object", - "required": [ - "type", - "x", - "y", - "scroll_x", - "scroll_y" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "scroll" - ], - "description": "Specifies the event type. For a scroll action, this property is\n always set to `scroll`.", - "x-stainless-const": true, - "default": "scroll" - }, - "x": { - "type": "integer", - "description": "The x-coordinate where the scroll occurred." - }, - "y": { - "type": "integer", - "description": "The y-coordinate where the scroll occurred." - }, - "scroll_x": { - "type": "integer", - "description": "The horizontal scroll distance." - }, - "scroll_y": { - "type": "integer", - "description": "The vertical scroll distance." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A scroll action.", - "title": "Scroll" - }, - "OpenAI.SearchContextSize": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - "OpenAI.SpecificApplyPatchParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apply_patch" - ], - "description": "The tool to call. Always `apply_patch`.", - "x-stainless-const": true, - "default": "apply_patch" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Forces the model to call the apply_patch tool when executing a tool call.", - "title": "Specific apply patch tool choice" - }, - "OpenAI.SpecificFunctionShellParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "shell" - ], - "description": "The tool to call. Always `shell`.", - "x-stainless-const": true, - "default": "shell" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Forces the model to call the shell tool when a tool call is required.", - "title": "Specific shell tool choice" - }, - "OpenAI.StaticChunkingStrategy": { - "type": "object", - "required": [ - "max_chunk_size_tokens", - "chunk_overlap_tokens" - ], - "properties": { - "max_chunk_size_tokens": { - "type": "integer", - "minimum": 100, - "maximum": 4096, - "description": "The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`." - }, - "chunk_overlap_tokens": { - "type": "integer", - "description": "The number of tokens that overlap between chunks. The default value is `400`.\n Note that the overlap must not exceed half of `max_chunk_size_tokens`." - } - } - }, - "OpenAI.StaticChunkingStrategyRequestParam": { - "type": "object", - "required": [ - "type", - "static" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "static" - ], - "description": "Always `static`.", - "x-stainless-const": true - }, - "static": { - "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyRequestParam" - } - ], - "description": "Customize your own chunking strategy by setting chunk size and chunk overlap.", - "title": "Static Chunking Strategy" - }, - "OpenAI.StaticChunkingStrategyResponseParam": { - "type": "object", - "required": [ - "type", - "static" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "static" - ], - "description": "Always `static`.", - "x-stainless-const": true - }, - "static": { - "$ref": "#/components/schemas/OpenAI.StaticChunkingStrategy" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse" - } - ], - "title": "Static Chunking Strategy" - }, - "OpenAI.StopConfiguration": { - "anyOf": [ - { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ], - "description": "Not supported with latest reasoning models `o3` and `o4-mini`.\nUp to 4 sequences where the API will stop generating further tokens. The\nreturned text will not contain the stop sequence." - }, - "OpenAI.SubmitToolOutputsRunRequest": { - "type": "object", - "required": [ - "tool_outputs" - ], - "properties": { - "tool_outputs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs" - }, - "description": "A list of tools for which the outputs are being submitted." - }, - "stream": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.SubmitToolOutputsRunRequestToolOutputs": { - "type": "object", - "properties": { - "tool_call_id": { - "type": "string" - }, - "output": { - "type": "string" - } - } - }, - "OpenAI.Summary": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "summary_text" - ], - "description": "The type of the object. Always `summary_text`.", - "x-stainless-const": true, - "default": "summary_text" - }, - "text": { - "type": "string", - "description": "A summary of the reasoning output from the model so far." - } - }, - "description": "A summary text from the model.", - "title": "Summary text" - }, - "OpenAI.SummaryTextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "summary_text" - ], - "description": "The type of the object. Always `summary_text`.", - "x-stainless-const": true, - "default": "summary_text" - }, - "text": { - "type": "string", - "description": "A summary of the reasoning output from the model so far." - } - }, - "description": "A summary text from the model.", - "title": "Summary text" - }, - "OpenAI.TextAnnotation": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.TextAnnotationType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "file_citation": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject", - "file_path": "#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject" - } - } - }, - "OpenAI.TextAnnotationType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "file_citation", - "file_path" - ] - } - ] - }, - "OpenAI.TextContent": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "x-stainless-const": true, - "default": "text" - }, - "text": { - "type": "string" - } - }, - "description": "A text content.", - "title": "Text Content" - }, - "OpenAI.TextResponseFormatConfiguration": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfigurationType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "json_schema": "#/components/schemas/OpenAI.TextResponseFormatJsonSchema", - "text": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText", - "json_object": "#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject" - } - }, - "description": "An object specifying the format that the model must output.\nConfiguring `{ \"type\": \"json_schema\" }` enables Structured Outputs,\nwhich ensures the model will match your supplied JSON schema. Learn more in the\n[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).\nThe default format is `{ \"type\": \"text\" }` with no additional options.\n*Not recommended for gpt-4o and newer models:**\nSetting to `{ \"type\": \"json_object\" }` enables the older JSON mode, which\nensures the message the model generates is valid JSON. Using `json_schema`\nis preferred for models that support it." - }, - "OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "json_object" - ], - "description": "The type of response format being defined. Always `json_object`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" - } - ], - "description": "JSON object response format. An older method of generating JSON responses.\nUsing `json_schema` is recommended for models that support it. Note that the\nmodel will not generate JSON without a system or user message instructing it\nto do so.", - "title": "JSON object" - }, - "OpenAI.TextResponseFormatConfigurationResponseFormatText": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of response format being defined. Always `text`.", - "x-stainless-const": true - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" - } - ], - "description": "Default response format. Used to generate text responses.", - "title": "Text" - }, - "OpenAI.TextResponseFormatConfigurationType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "text", - "json_schema", - "json_object" - ] - } - ] - }, - "OpenAI.TextResponseFormatJsonSchema": { - "type": "object", - "required": [ - "type", - "name", - "schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "json_schema" - ], - "description": "The type of response format being defined. Always `json_schema`.", - "x-stainless-const": true - }, - "description": { - "type": "string", - "description": "A description of what the response format is for, used by the model to\n determine how to respond in the format." - }, - "name": { - "type": "string", - "description": "The name of the response format. Must be a-z, A-Z, 0-9, or contain\n underscores and dashes, with a maximum length of 64." - }, - "schema": { - "$ref": "#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema" - }, - "strict": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.TextResponseFormatConfiguration" - } - ], - "description": "JSON Schema response format. Used to generate structured JSON responses.\nLearn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).", - "title": "JSON schema" - }, - "OpenAI.ThreadObject": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "tool_resources", - "metadata" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "thread" - ], - "description": "The object type, which is always `thread`.", - "x-stainless-const": true - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the thread was created." - }, - "tool_resources": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResources" - }, - { - "type": "null" - } - ] - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - }, - "description": "Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages).", - "title": "Thread", - "x-oaiMeta": { - "name": "The thread object", - "beta": true, - "example": "{\n \"id\": \"thread_abc123\",\n \"object\": \"thread\",\n \"created_at\": 1698107661,\n \"metadata\": {}\n}\n" - } - }, - "OpenAI.ThreadObjectToolResources": { - "type": "object", - "properties": { - "code_interpreter": { - "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter" - }, - "file_search": { - "$ref": "#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch" - } - } - }, - "OpenAI.ThreadObjectToolResourcesCodeInterpreter": { - "type": "object", - "properties": { - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 20 - } - } - }, - "OpenAI.ThreadObjectToolResourcesFileSearch": { - "type": "object", - "properties": { - "vector_store_ids": { - "type": "array", - "items": { - "type": "string" - }, - "maxItems": 1 - } - } - }, - "OpenAI.TokenLimits": { - "type": "object", - "properties": { - "post_instructions": { - "type": "integer", - "minimum": 0 - } - } - }, - "OpenAI.Tool": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ToolType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "code_interpreter": "#/components/schemas/OpenAI.CodeInterpreterTool", - "function": "#/components/schemas/OpenAI.FunctionTool", - "file_search": "#/components/schemas/OpenAI.FileSearchTool", - "computer_use_preview": "#/components/schemas/OpenAI.ComputerUsePreviewTool", - "web_search": "#/components/schemas/OpenAI.WebSearchTool", - "mcp": "#/components/schemas/OpenAI.MCPTool", - "image_generation": "#/components/schemas/OpenAI.ImageGenTool", - "local_shell": "#/components/schemas/OpenAI.LocalShellToolParam", - "shell": "#/components/schemas/OpenAI.FunctionShellToolParam", - "custom": "#/components/schemas/OpenAI.CustomToolParam", - "web_search_preview": "#/components/schemas/OpenAI.WebSearchPreviewTool", - "apply_patch": "#/components/schemas/OpenAI.ApplyPatchToolParam" - } - }, - "description": "A tool that can be used to generate a response." - }, - "OpenAI.ToolChoiceAllowed": { - "type": "object", - "required": [ - "type", - "mode", - "tools" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "allowed_tools" - ], - "description": "Allowed tool configuration type. Always `allowed_tools`.", - "x-stainless-const": true - }, - "mode": { - "type": "string", - "enum": [ - "auto", - "required" - ], - "description": "Constrains the tools available to the model to a pre-defined set.\n `auto` allows the model to pick from among the allowed tools and generate a\n message.\n `required` requires the model to call one or more of the allowed tools." - }, - "tools": { - "type": "array", - "items": { - "type": "object", - "unevaluatedProperties": {} - }, - "description": "A list of tool definitions that the model should be allowed to call.\n For the Responses API, the list of tool definitions might look like:\n ```json\n [\n { \"type\": \"function\", \"name\": \"get_weather\" },\n { \"type\": \"mcp\", \"server_label\": \"deepwiki\" },\n { \"type\": \"image_generation\" }\n ]\n ```" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Constrains the tools available to the model to a pre-defined set.", - "title": "Allowed tools" - }, - "OpenAI.ToolChoiceCodeInterpreter": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "code_interpreter" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." - }, - "OpenAI.ToolChoiceComputerUsePreview": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "computer_use_preview" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." - }, - "OpenAI.ToolChoiceCustom": { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "custom" - ], - "description": "For custom tool calling, the type is always `custom`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the custom tool to call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Use this option to force the model to call a specific custom tool.", - "title": "Custom tool" - }, - "OpenAI.ToolChoiceFileSearch": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "file_search" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." - }, - "OpenAI.ToolChoiceFunction": { - "type": "object", - "required": [ - "type", - "name" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "function" - ], - "description": "For function calling, the type is always `function`.", - "x-stainless-const": true - }, - "name": { - "type": "string", - "description": "The name of the function to call." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Use this option to force the model to call a specific function.", - "title": "Function tool" - }, - "OpenAI.ToolChoiceImageGeneration": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "image_generation" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." - }, - "OpenAI.ToolChoiceMCP": { - "type": "object", - "required": [ - "type", - "server_label" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "mcp" - ], - "description": "For MCP tools, the type is always `mcp`.", - "x-stainless-const": true - }, - "server_label": { - "type": "string", - "description": "The label of the MCP server to use." - }, - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Use this option to force the model to call a specific tool on a remote MCP server.", - "title": "MCP tool" - }, - "OpenAI.ToolChoiceOptions": { - "type": "string", - "enum": [ - "none", - "auto", - "required" - ], - "description": "Controls which (if any) tool is called by the model.\n`none` means the model will not call any tool and instead generates a message.\n`auto` means the model can pick between generating a message or calling one or\nmore tools.\n`required` means the model must call one or more tools.", - "title": "Tool choice mode" - }, - "OpenAI.ToolChoiceParam": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParamType" - } - }, - "discriminator": { - "propertyName": "type", - "mapping": { - "allowed_tools": "#/components/schemas/OpenAI.ToolChoiceAllowed", - "mcp": "#/components/schemas/OpenAI.ToolChoiceMCP", - "custom": "#/components/schemas/OpenAI.ToolChoiceCustom", - "apply_patch": "#/components/schemas/OpenAI.SpecificApplyPatchParam", - "shell": "#/components/schemas/OpenAI.SpecificFunctionShellParam", - "file_search": "#/components/schemas/OpenAI.ToolChoiceFileSearch", - "web_search_preview": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview", - "computer_use_preview": "#/components/schemas/OpenAI.ToolChoiceComputerUsePreview", - "web_search_preview_2025_03_11": "#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311", - "image_generation": "#/components/schemas/OpenAI.ToolChoiceImageGeneration", - "code_interpreter": "#/components/schemas/OpenAI.ToolChoiceCodeInterpreter" - } - }, - "description": "How the model should select which tool (or tools) to use when generating\na response. See the `tools` parameter to see how to specify which tools\nthe model can call." - }, - "OpenAI.ToolChoiceParamType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "allowed_tools", - "function", - "mcp", - "custom", - "apply_patch", - "shell", - "file_search", - "web_search_preview", - "computer_use_preview", - "web_search_preview_2025_03_11", - "image_generation", - "code_interpreter" - ] - } - ] - }, - "OpenAI.ToolChoiceWebSearchPreview": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "web_search_preview" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Note: web_search is not yet available via Azure OpenAI." - }, - "OpenAI.ToolChoiceWebSearchPreview20250311": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "web_search_preview_2025_03_11" - ] - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ToolChoiceParam" - } - ], - "description": "Indicates that the model should use a built-in tool to generate a response.\n[Learn more about built-in tools](https://platform.openai.com/docs/guides/tools)." - }, - "OpenAI.ToolType": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "function", - "file_search", - "computer_use_preview", - "web_search", - "mcp", - "code_interpreter", - "image_generation", - "local_shell", - "shell", - "custom", - "web_search_preview", - "apply_patch" - ] - } - ] - }, - "OpenAI.ToolsArray": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.Tool" - }, - "description": "An array of tools the model may call while generating a response. You\ncan specify which tool to use by setting the `tool_choice` parameter.\nWe support the following categories of tools:\n- **Built-in tools**: Tools that are provided by OpenAI that extend the\nmodel's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search)\nor [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about\n[built-in tools](https://platform.openai.com/docs/guides/tools).\n- **MCP Tools**: Integrations with third-party systems via custom MCP servers\nor predefined connectors such as Google Drive and SharePoint. Learn more about\n[MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp).\n- **Function calls (custom tools)**: Functions that are defined by you,\nenabling the model to call your own code with strongly typed arguments\nand outputs. Learn more about\n[function calling](https://platform.openai.com/docs/guides/function-calling). You can also use\ncustom tools to call your own code." - }, - "OpenAI.TopLogProb": { - "type": "object", - "required": [ - "token", - "logprob", - "bytes" - ], - "properties": { - "token": { - "type": "string" - }, - "logprob": { - "type": "number" - }, - "bytes": { - "type": "array", - "items": { - "type": "integer" - } - } - }, - "description": "The top log probability of a token.", - "title": "Top log probability" - }, - "OpenAI.TranscriptionSegment": { - "type": "object", - "required": [ - "id", - "seek", - "start", - "end", - "text", - "tokens", - "temperature", - "avg_logprob", - "compression_ratio", - "no_speech_prob" - ], - "properties": { - "id": { - "type": "integer", - "description": "Unique identifier of the segment." - }, - "seek": { - "type": "integer", - "description": "Seek offset of the segment." - }, - "start": { - "type": "number", - "format": "float", - "description": "Start time of the segment in seconds." - }, - "end": { - "type": "number", - "format": "float", - "description": "End time of the segment in seconds." - }, - "text": { - "type": "string", - "description": "Text content of the segment." - }, - "tokens": { - "type": "array", - "items": { - "type": "integer" - }, - "description": "Array of token IDs for the text content." - }, - "temperature": { - "type": "number", - "format": "float", - "description": "Temperature parameter used for generating the segment." - }, - "avg_logprob": { - "type": "number", - "format": "float", - "description": "Average logprob of the segment. If the value is lower than -1, consider the logprobs failed." - }, - "compression_ratio": { - "type": "number", - "format": "float", - "description": "Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed." - }, - "no_speech_prob": { - "type": "number", - "format": "float", - "description": "Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent." - } - } - }, - "OpenAI.TranscriptionWord": { - "type": "object", - "required": [ - "word", - "start", - "end" - ], - "properties": { - "word": { - "type": "string", - "description": "The text content of the word." - }, - "start": { - "type": "number", - "format": "float", - "description": "Start time of the word in seconds." - }, - "end": { - "type": "number", - "format": "float", - "description": "End time of the word in seconds." - } - } - }, - "OpenAI.TruncationObject": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "auto", - "last_messages" - ], - "description": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`." - }, - "last_messages": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ] - } - }, - "description": "Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run.", - "title": "Thread Truncation Controls" - }, - "OpenAI.Type": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "type" - ], - "description": "Specifies the event type. For a type action, this property is\n always set to `type`.", - "x-stainless-const": true, - "default": "type" - }, - "text": { - "type": "string", - "description": "The text to type." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "An action to type in text.", - "title": "Type" - }, - "OpenAI.UpdateConversationBody": { - "type": "object", - "required": [ - "metadata" - ], - "properties": { - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ], - "description": "Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard.\n Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters." - } - } - }, - "OpenAI.UpdateVectorStoreFileAttributesRequest": { - "type": "object", - "required": [ - "attributes" - ], - "properties": { - "attributes": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" - }, - { - "type": "null" - } - ] - } - }, - "x-oaiMeta": { - "name": "Update vector store file attributes request" - } - }, - "OpenAI.UpdateVectorStoreRequest": { - "type": "object", - "properties": { - "name": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "The name of the vector store." - }, - "expires_after": { - "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - } - }, - "OpenAI.UrlCitationBody": { - "type": "object", - "required": [ - "type", - "url", - "start_index", - "end_index", - "title" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "url_citation" - ], - "description": "The type of the URL citation. Always `url_citation`.", - "x-stainless-const": true, - "default": "url_citation" - }, - "url": { - "type": "string", - "format": "uri", - "description": "The URL of the web resource." - }, - "start_index": { - "type": "integer", - "description": "The index of the first character of the URL citation in the message." - }, - "end_index": { - "type": "integer", - "description": "The index of the last character of the URL citation in the message." - }, - "title": { - "type": "string", - "description": "The title of the web resource." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Annotation" - } - ], - "description": "A citation for a web resource used to generate a model response.", - "title": "URL citation" - }, - "OpenAI.ValidateGraderResponse": { - "type": "object", - "properties": { - "grader": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.GraderStringCheck" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderTextSimilarity" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderPython" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderScoreModel" - }, - { - "$ref": "#/components/schemas/OpenAI.GraderMulti" - }, - { - "$ref": "#/components/schemas/GraderEndpoint" - } - ], - "description": "The grader used for the fine-tuning job." - } - }, - "title": "ValidateGraderResponse" - }, - "OpenAI.VectorStoreExpirationAfter": { - "type": "object", - "required": [ - "anchor", - "days" - ], - "properties": { - "anchor": { - "type": "string", - "enum": [ - "last_active_at" - ], - "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.", - "x-stainless-const": true - }, - "days": { - "type": "integer", - "minimum": 1, - "maximum": 365, - "description": "The number of days after the anchor time that the vector store will expire." - } - }, - "description": "The expiration policy for a vector store.", - "title": "Vector store expiration policy" - }, - "OpenAI.VectorStoreFileAttributes": { - "type": "object", - "unevaluatedProperties": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "number" - }, - { - "type": "boolean" - } - ] - }, - "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard. Keys are strings\nwith a maximum length of 64 characters. Values are strings with a maximum\nlength of 512 characters, booleans, or numbers.", - "x-oaiTypeLabel": "map" - }, - "OpenAI.VectorStoreFileBatchObject": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "vector_store_id", - "status", - "file_counts" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "vector_store.files_batch" - ], - "description": "The object type, which is always `vector_store.file_batch`.", - "x-stainless-const": true - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the vector store files batch was created." - }, - "vector_store_id": { - "type": "string", - "description": "The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "cancelled", - "failed" - ], - "description": "The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`." - }, - "file_counts": { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts" - } - }, - "description": "A batch of files attached to a vector store.", - "title": "Vector store file batch", - "x-oaiMeta": { - "name": "The vector store files batch object", - "beta": true, - "example": "{\n \"id\": \"vsfb_123\",\n \"object\": \"vector_store.files_batch\",\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"failed\": 0,\n \"cancelled\": 0,\n \"total\": 100\n }\n}\n" - } - }, - "OpenAI.VectorStoreFileBatchObjectFileCounts": { - "type": "object", - "required": [ - "in_progress", - "completed", - "failed", - "cancelled", - "total" - ], - "properties": { - "in_progress": { - "type": "integer" - }, - "completed": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "cancelled": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "OpenAI.VectorStoreFileObject": { - "type": "object", - "required": [ - "id", - "object", - "usage_bytes", - "created_at", - "vector_store_id", - "status", - "last_error" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "vector_store.file" - ], - "description": "The object type, which is always `vector_store.file`.", - "x-stainless-const": true - }, - "usage_bytes": { - "type": "integer", - "description": "The total vector store usage in bytes. Note that this may be different from the original file size." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the vector store file was created." - }, - "vector_store_id": { - "type": "string", - "description": "The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to." - }, - "status": { - "type": "string", - "enum": [ - "in_progress", - "completed", - "cancelled", - "failed" - ], - "description": "The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use." - }, - "last_error": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileObjectLastError" - }, - { - "type": "null" - } - ] - }, - "chunking_strategy": { - "$ref": "#/components/schemas/OpenAI.ChunkingStrategyResponse" - }, - "attributes": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" - }, - { - "type": "null" - } - ] - } - }, - "description": "A list of files attached to a vector store.", - "title": "Vector store files", - "x-oaiMeta": { - "name": "The vector store file object", - "beta": true, - "example": "{\n \"id\": \"file-abc123\",\n \"object\": \"vector_store.file\",\n \"usage_bytes\": 1234,\n \"created_at\": 1698107661,\n \"vector_store_id\": \"vs_abc123\",\n \"status\": \"completed\",\n \"last_error\": null,\n \"chunking_strategy\": {\n \"type\": \"static\",\n \"static\": {\n \"max_chunk_size_tokens\": 800,\n \"chunk_overlap_tokens\": 400\n }\n }\n}\n" - } - }, - "OpenAI.VectorStoreFileObjectLastError": { - "type": "object", - "required": [ - "code", - "message" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "server_error", - "unsupported_file", - "invalid_file" - ] - }, - "message": { - "type": "string" - } - } - }, - "OpenAI.VectorStoreObject": { - "type": "object", - "required": [ - "id", - "object", - "created_at", - "name", - "usage_bytes", - "file_counts", - "status", - "last_active_at", - "metadata" - ], - "properties": { - "id": { - "type": "string", - "description": "The identifier, which can be referenced in API endpoints." - }, - "object": { - "type": "string", - "enum": [ - "vector_store" - ], - "description": "The object type, which is always `vector_store`.", - "x-stainless-const": true - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "The Unix timestamp (in seconds) for when the vector store was created." - }, - "name": { - "type": "string", - "description": "The name of the vector store." - }, - "usage_bytes": { - "type": "integer", - "description": "The total number of bytes used by the files in the vector store." - }, - "file_counts": { - "$ref": "#/components/schemas/OpenAI.VectorStoreObjectFileCounts" - }, - "status": { - "type": "string", - "enum": [ - "expired", - "in_progress", - "completed" - ], - "description": "The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use." - }, - "expires_after": { - "$ref": "#/components/schemas/OpenAI.VectorStoreExpirationAfter" - }, - "expires_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "last_active_at": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "type": "integer", - "format": "unixTimestamp" - }, - "metadata": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.Metadata" - }, - { - "type": "null" - } - ] - } - }, - "description": "A vector store is a collection of processed files can be used by the `file_search` tool.", - "title": "Vector store", - "x-oaiMeta": { - "name": "The vector store object", - "example": "{\n \"id\": \"vs_123\",\n \"object\": \"vector_store\",\n \"created_at\": 1698107661,\n \"usage_bytes\": 123456,\n \"last_active_at\": 1698107661,\n \"name\": \"my_vector_store\",\n \"status\": \"completed\",\n \"file_counts\": {\n \"in_progress\": 0,\n \"completed\": 100,\n \"cancelled\": 0,\n \"failed\": 0,\n \"total\": 100\n },\n \"last_used_at\": 1698107661\n}\n" - } - }, - "OpenAI.VectorStoreObjectFileCounts": { - "type": "object", - "required": [ - "in_progress", - "completed", - "failed", - "cancelled", - "total" - ], - "properties": { - "in_progress": { - "type": "integer" - }, - "completed": { - "type": "integer" - }, - "failed": { - "type": "integer" - }, - "cancelled": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "OpenAI.VectorStoreSearchRequest": { - "type": "object", - "required": [ - "query" - ], - "properties": { - "query": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ], - "description": "A query string for a search" - }, - "rewrite_query": { - "type": "boolean", - "description": "Whether to rewrite the natural language query for vector search." - }, - "max_num_results": { - "type": "integer", - "minimum": 1, - "maximum": 50, - "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive.", - "default": 10 - }, - "filters": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComparisonFilter" - }, - { - "$ref": "#/components/schemas/OpenAI.CompoundFilter" - } - ], - "description": "A filter to apply based on file attributes." - }, - "ranking_options": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions" - } - ], - "description": "Ranking options for search." - } - }, - "x-oaiMeta": { - "name": "Vector store search request" - } - }, - "OpenAI.VectorStoreSearchRequestRankingOptions": { - "type": "object", - "properties": { - "ranker": { - "type": "string", - "enum": [ - "none", - "auto", - "default-2024-11-15" - ], - "default": "auto" - }, - "score_threshold": { - "type": "number", - "minimum": 0, - "maximum": 1 - } - } - }, - "OpenAI.VectorStoreSearchResultContentObject": { - "type": "object", - "required": [ - "type", - "text" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "text" - ], - "description": "The type of content." - }, - "text": { - "type": "string", - "description": "The text content returned from search." - } - }, - "x-oaiMeta": { - "name": "Vector store search result content object" - } - }, - "OpenAI.VectorStoreSearchResultItem": { - "type": "object", - "required": [ - "file_id", - "filename", - "score", - "attributes", - "content" - ], - "properties": { - "file_id": { - "type": "string", - "description": "The ID of the vector store file." - }, - "filename": { - "type": "string", - "description": "The name of the vector store file." - }, - "score": { - "type": "number", - "minimum": 0, - "maximum": 1, - "description": "The similarity score for the result." - }, - "attributes": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.VectorStoreFileAttributes" - }, - { - "type": "null" - } - ] - }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultContentObject" - }, - "description": "Content chunks from the file." - } - }, - "x-oaiMeta": { - "name": "Vector store search result item" - } - }, - "OpenAI.VectorStoreSearchResultsPage": { - "type": "object", - "required": [ - "object", - "search_query", - "data", - "has_more", - "next_page" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "vector_store.search_results.page" - ], - "description": "The object type, which is always `vector_store.search_results.page`", - "x-stainless-const": true - }, - "search_query": { - "type": "array", - "items": { - "type": "string" - } - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.VectorStoreSearchResultItem" - }, - "description": "The list of search result items." - }, - "has_more": { - "type": "boolean", - "description": "Indicates if there are more results to fetch." - }, - "next_page": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "x-oaiMeta": { - "name": "Vector store search results page" - } - }, - "OpenAI.Verbosity": { - "anyOf": [ - { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ] - }, - { - "type": "null" - } - ], - "description": "Constrains the verbosity of the model's response. Lower values will result in\nmore concise responses, while higher values will result in more verbose responses.\nCurrently supported values are `low`, `medium`, and `high`." - }, - "OpenAI.VoiceIdsShared": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "alloy", - "ash", - "ballad", - "coral", - "echo", - "sage", - "shimmer", - "verse", - "marin", - "cedar" - ] - } - ] - }, - "OpenAI.Wait": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "wait" - ], - "description": "Specifies the event type. For a wait action, this property is\n always set to `wait`.", - "x-stainless-const": true, - "default": "wait" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.ComputerAction" - } - ], - "description": "A wait action.", - "title": "Wait" - }, - "OpenAI.WebSearchActionFind": { - "type": "object", - "required": [ - "type", - "url", - "pattern" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "find_in_page" - ], - "description": "The action type.", - "x-stainless-const": true - }, - "url": { - "type": "string", - "format": "uri", - "description": "The URL of the page searched for the pattern." - }, - "pattern": { - "type": "string", - "description": "The pattern or text to search for within the page." - } - }, - "description": "Action type \"find\": Searches for a pattern within a loaded page.", - "title": "Find action" - }, - "OpenAI.WebSearchActionOpenPage": { - "type": "object", - "required": [ - "type", - "url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "open_page" - ], - "description": "The action type.", - "x-stainless-const": true - }, - "url": { - "type": "string", - "format": "uri", - "description": "The URL opened by the model." - } - }, - "description": "Action type \"open_page\" - Opens a specific URL from search results.", - "title": "Open page action" - }, - "OpenAI.WebSearchActionSearch": { - "type": "object", - "required": [ - "type", - "query" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "search" - ], - "description": "The action type.", - "x-stainless-const": true - }, - "query": { - "type": "string", - "description": "[DEPRECATED] The search query.", - "deprecated": true - }, - "queries": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The search queries.", - "title": "Search queries" - }, - "sources": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAI.WebSearchActionSearchSources" - }, - "description": "The sources used in the search.", - "title": "Web search sources" - } - }, - "description": "Action type \"search\" - Performs a web search query.", - "title": "Search action" - }, - "OpenAI.WebSearchActionSearchSources": { - "type": "object", - "required": [ - "type", - "url" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "url" - ], - "x-stainless-const": true - }, - "url": { - "type": "string" - } - } - }, - "OpenAI.WebSearchApproximateLocation": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "approximate" - ], - "description": "The type of location approximation. Always `approximate`.", - "x-stainless-const": true, - "default": "approximate" - }, - "country": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "region": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "city": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "timezone": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - } - }, - "description": "The approximate location of the user.", - "title": "Web search approximate location" - }, - "OpenAI.WebSearchPreviewTool": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "web_search_preview" - ], - "description": "The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`.", - "x-stainless-const": true, - "default": "web_search_preview" - }, - "user_location": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.ApproximateLocation" - }, - { - "type": "null" - } - ] - }, - "search_context_size": { - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.SearchContextSize" - } - ], - "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default." - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "Note: web_search is not yet available via Azure OpenAI.", - "title": "Web search preview" - }, - "OpenAI.WebSearchTool": { - "type": "object", - "required": [ - "type" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "web_search" - ], - "description": "The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.", - "default": "web_search" - }, - "filters": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.WebSearchToolFilters" - }, - { - "type": "null" - } - ] - }, - "user_location": { - "anyOf": [ - { - "$ref": "#/components/schemas/OpenAI.WebSearchApproximateLocation" - }, - { - "type": "null" - } - ] - }, - "search_context_size": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ], - "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default.", - "default": "medium" - } - }, - "allOf": [ - { - "$ref": "#/components/schemas/OpenAI.Tool" - } - ], - "description": "Note: web_search is not yet available via Azure OpenAI.", - "title": "Web search" - }, - "OpenAI.WebSearchToolFilters": { - "type": "object", - "properties": { - "allowed_domains": { - "anyOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "null" - } - ] - } - } - }, - "Order": { - "type": "string", - "enum": [ - "asc", - "desc" - ] - }, - "ResponseFormatJSONSchemaRequest": { - "type": "object", - "required": [ - "type", - "json_schema" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "json_schema" - ], - "description": "Type of response format" - }, - "json_schema": { - "type": "object", - "unevaluatedProperties": {}, - "description": "JSON Schema for the response format" - } - } - }, - "SpeechGenerationResponse": { - "type": "object", - "required": [ - "audio" - ], - "properties": { - "audio": { - "type": "string", - "contentEncoding": "base64", - "description": "The generated audio, generated in the requested audio output format." - } - }, - "description": "A representation of a response for a text-to-speech operation." - }, - "SpeechGenerationResponseFormat": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "mp3", - "opus", - "aac", - "flac", - "wav", - "pcm" - ] - } - ], - "description": "The supported audio output formats for text-to-speech." - }, - "SpeechVoice": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "string", - "enum": [ - "alloy", - "echo", - "fable", - "onyx", - "nova", - "shimmer" - ] - } - ], - "description": "The available voices for text-to-speech." - }, - "VideoContent": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "contentEncoding": "base64" - } - } - }, - "VideoContentVariant": { - "anyOf": [ - { - "type": "string", - "enum": [ - "video", - "thumbnail", - "spritesheet" - ] - }, - { - "type": "string" - } - ], - "description": "Selectable asset variants for downloaded content." - }, - "VideoList": { - "type": "object", - "required": [ - "object", - "data", - "has_more" - ], - "properties": { - "object": { - "type": "string", - "enum": [ - "list" - ] - }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VideoResource" - }, - "description": "The list of video generation jobs." - }, - "has_more": { - "type": "boolean", - "description": "A flag indicating whether there are more jobs available after the list." - }, - "first_id": { - "type": "string", - "description": "The ID of the first video in the current page, if available." - }, - "last_id": { - "type": "string", - "description": "The ID of the last video in the current page, if available." - } - }, - "description": "A list of video generation jobs." - }, - "VideoResource": { - "type": "object", - "required": [ - "id", - "object", - "model", - "status", - "progress", - "created_at", - "size", - "seconds" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the video job." - }, - "object": { - "type": "string", - "description": "The object type, which is always `video`." - }, - "model": { - "type": "string", - "description": "The video generation model deployment that produced the job." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoStatus" - } - ], - "description": "Current lifecycle status of the video job." - }, - "progress": { - "type": "integer", - "format": "int32", - "description": "Approximate completion percentage for the generation task." - }, - "created_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (seconds) for when the job was created." - }, - "completed_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (seconds) for when the job completed, if finished." - }, - "expires_at": { - "type": "integer", - "format": "unixtime", - "description": "Unix timestamp (seconds) for when the video generation expires (and will be deleted)." - }, - "size": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoSize" - } - ], - "description": "The resolution of the generated video." - }, - "seconds": { - "allOf": [ - { - "$ref": "#/components/schemas/VideoSeconds" - } - ], - "description": "Duration of the generated clip in seconds." - }, - "remixed_from_video_id": { - "type": "string", - "description": "Identifier of the source video if this video is a remix." - }, - "error": { - "allOf": [ - { - "$ref": "#/components/schemas/Error" - } - ], - "description": "Error payload that explains why generation failed, if applicable." - } - }, - "description": "Structured information describing a generated video job." - }, - "VideoSeconds": { - "anyOf": [ - { - "type": "string", - "enum": [ - "4", - "8", - "12" - ] - }, - { - "type": "string" - } - ], - "description": "Supported clip durations, measured in seconds." - }, - "VideoSize": { - "anyOf": [ - { - "type": "string", - "enum": [ - "720x1280", - "1280x720", - "1024x1792", - "1792x1024" - ] - }, - { - "type": "string" - } - ], - "description": "Output dimensions formatted as `{width}x{height}`." - }, - "VideoStatus": { - "anyOf": [ - { - "type": "string", - "enum": [ - "queued", - "in_progress", - "completed", - "failed" - ] - }, - { - "type": "string" - } - ], - "description": "Lifecycle state of a generated video." - } - }, - "securitySchemes": { - "ApiKeyAuth": { - "type": "apiKey", - "in": "header", - "name": "api-key" - }, - "ApiKeyAuth_": { - "type": "apiKey", - "in": "header", - "name": "authorization" - }, - "OAuth2Auth": { - "type": "oauth2", - "flows": { - "implicit": { - "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", - "scopes": { - "https://cognitiveservices.azure.com/.default": "" - } - } - } - } - } - }, - "servers": [ - { - "url": "{endpoint}/openai/v1", - "description": "Azure AI Foundry Models APIs", - "variables": { - "endpoint": { - "default": "", - "description": "A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname.\nFor example:\nhttps://westus.api.cognitive.microsoft.com)." - } - } - } - ] -} \ No newline at end of file diff --git a/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml b/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml new file mode 100644 index 000000000..91e6d2957 --- /dev/null +++ b/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml @@ -0,0 +1,8 @@ +# Filter to keep only /responses/** paths +inverseOperationIds: + - createResponse + - getResponse + - cancelResponse + - listInputItems +unusedComponents: + - schemas \ No newline at end of file From a9a299a898df0a85cd3f1ed07f52d3be8c6c82a7 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 10 Mar 2026 17:20:39 +0100 Subject: [PATCH 05/31] Attach spec filter command --- .../resources/spec/azure-v1-v1-generated.yaml | 27491 ---------------- .../main/resources/spec/filter-config.yaml | 6 +- 2 files changed, 5 insertions(+), 27492 deletions(-) delete mode 100644 foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml b/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml deleted file mode 100644 index b6629813d..000000000 --- a/foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml +++ /dev/null @@ -1,27491 +0,0 @@ -openapi: 3.1.0 -info: - title: Azure AI Foundry Models Service - license: - name: MIT - url: https://github.com/openai/openai-openapi/blob/master/LICENSE - version: v1 -tags: - - name: Batch - - name: Chat - - name: Completions - - name: Containers - - name: Conversations - - name: Evals - - name: Files - - name: Embeddings - - name: Fine-tuning - - name: Models - - name: Realtime - - name: Responses - - name: Threads - - name: Vector Stores -paths: - /batches: - post: - operationId: createBatch - summary: Creates and executes a batch from an uploaded file of requests - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: accept - in: header - required: true - schema: - type: string - enum: - - application/json - responses: - '201': - description: The request has succeeded and a new resource has been created as a result. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - endpoint - - completion_window - - status - - created_at - properties: - id: - type: string - object: - type: string - enum: - - batch - description: The object type, which is always `batch`. - x-stainless-const: true - endpoint: - type: string - description: The OpenAI API endpoint used by the batch. - model: - type: string - description: |- - Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model - guide](https://platform.openai.com/docs/models) to browse and compare available models. - errors: - $ref: '#/components/schemas/OpenAI.BatchErrors' - completion_window: - type: string - description: The time frame within which the batch should be processed. - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - description: The current status of the batch. - output_file_id: - type: string - description: The ID of the file containing the outputs of successfully executed requests. - error_file_id: - type: string - description: The ID of the file containing the outputs of requests with errors. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was created. - in_progress_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started processing. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch will expire. - finalizing_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started finalizing. - completed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was completed. - failed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch failed. - expired_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch expired. - cancelling_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started cancelling. - cancelled_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was cancelled. - request_counts: - $ref: '#/components/schemas/OpenAI.BatchRequestCounts' - usage: - allOf: - - $ref: '#/components/schemas/OpenAI.BatchUsage' - description: |- - Represents token usage details including input tokens, output tokens, a - breakdown of output tokens, and the total tokens used. Only populated on - batches created after September 7, 2025. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - input_file_id: - anyOf: - - type: string - - type: 'null' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Batch - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - input_file_id: - type: string - description: |- - The ID of an uploaded file that contains requests for the new batch. - - See [upload file](/docs/api-reference/files/create) for how to upload a file. - - Your input file must be formatted as a [JSONL file](/docs/api-reference/batch/requestInput), - and must be uploaded with the purpose `batch`. - endpoint: - type: string - enum: - - /v1/chat/completions - - /v1/embeddings - description: The endpoint to be used for all requests in the batch. Currently `/v1/chat/completions` is supported. - completion_window: - type: string - enum: - - 24h - description: The time frame within which the batch should be processed. Currently only `24h` is supported. - required: - - endpoint - - completion_window - unevaluatedProperties: - type: string - get: - operationId: listBatches - summary: List your organization's batches. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: accept - in: header - required: true - schema: - type: string - enum: - - application/json - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListBatchesResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Batch - /batches/{batch_id}: - get: - operationId: retrieveBatch - summary: Retrieves a batch. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: accept - in: header - required: true - schema: - type: string - enum: - - application/json - - name: batch_id - in: path - required: true - description: The ID of the batch to retrieve. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - endpoint - - completion_window - - status - - created_at - properties: - id: - type: string - object: - type: string - enum: - - batch - description: The object type, which is always `batch`. - x-stainless-const: true - endpoint: - type: string - description: The OpenAI API endpoint used by the batch. - model: - type: string - description: |- - Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model - guide](https://platform.openai.com/docs/models) to browse and compare available models. - errors: - $ref: '#/components/schemas/OpenAI.BatchErrors' - completion_window: - type: string - description: The time frame within which the batch should be processed. - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - description: The current status of the batch. - output_file_id: - type: string - description: The ID of the file containing the outputs of successfully executed requests. - error_file_id: - type: string - description: The ID of the file containing the outputs of requests with errors. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was created. - in_progress_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started processing. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch will expire. - finalizing_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started finalizing. - completed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was completed. - failed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch failed. - expired_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch expired. - cancelling_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started cancelling. - cancelled_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was cancelled. - request_counts: - $ref: '#/components/schemas/OpenAI.BatchRequestCounts' - usage: - allOf: - - $ref: '#/components/schemas/OpenAI.BatchUsage' - description: |- - Represents token usage details including input tokens, output tokens, a - breakdown of output tokens, and the total tokens used. Only populated on - batches created after September 7, 2025. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - input_file_id: - anyOf: - - type: string - - type: 'null' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Batch - /batches/{batch_id}/cancel: - post: - operationId: cancelBatch - summary: Cancels an in-progress batch. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: accept - in: header - required: true - schema: - type: string - enum: - - application/json - - name: batch_id - in: path - required: true - description: The ID of the batch to cancel. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - endpoint - - completion_window - - status - - created_at - properties: - id: - type: string - object: - type: string - enum: - - batch - description: The object type, which is always `batch`. - x-stainless-const: true - endpoint: - type: string - description: The OpenAI API endpoint used by the batch. - model: - type: string - description: |- - Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model - guide](https://platform.openai.com/docs/models) to browse and compare available models. - errors: - $ref: '#/components/schemas/OpenAI.BatchErrors' - completion_window: - type: string - description: The time frame within which the batch should be processed. - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - description: The current status of the batch. - output_file_id: - type: string - description: The ID of the file containing the outputs of successfully executed requests. - error_file_id: - type: string - description: The ID of the file containing the outputs of requests with errors. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was created. - in_progress_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started processing. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch will expire. - finalizing_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started finalizing. - completed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was completed. - failed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch failed. - expired_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch expired. - cancelling_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started cancelling. - cancelled_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was cancelled. - request_counts: - $ref: '#/components/schemas/OpenAI.BatchRequestCounts' - usage: - allOf: - - $ref: '#/components/schemas/OpenAI.BatchUsage' - description: |- - Represents token usage details including input tokens, output tokens, a - breakdown of output tokens, and the total tokens used. Only populated on - batches created after September 7, 2025. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - input_file_id: - anyOf: - - type: string - - type: 'null' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Batch - /chat/completions: - post: - operationId: createChatCompletion - description: Creates a chat completion. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - anyOf: - - type: object - required: - - id - - choices - - created - - model - - object - properties: - id: - type: string - description: A unique identifier for the chat completion. - choices: - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoices' - description: A list of chat completion choices. Can be more than one if `n` is greater than 1. - created: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) of when the chat completion was created. - model: - type: string - description: The model used for the chat completion. - system_fingerprint: - type: string - description: |- - This fingerprint represents the backend configuration that the model runs with. - Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. - deprecated: true - object: - type: string - enum: - - chat.completion - description: The object type, which is always `chat.completion`. - x-stainless-const: true - usage: - $ref: '#/components/schemas/OpenAI.CompletionUsage' - prompt_filter_results: - type: array - items: - type: object - properties: - prompt_index: - type: integer - format: int32 - description: The index of the input prompt that this content filter result corresponds to. - content_filter_results: - allOf: - - $ref: '#/components/schemas/AzureContentFilterResultForPrompt' - description: The content filter results associated with the indexed input prompt. - required: - - prompt_index - - content_filter_results - - type: object - required: - - id - - choices - - created - - model - - object - properties: - id: - type: string - description: A unique identifier for the chat completion. Each chunk has the same ID. - choices: - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoices' - description: |- - A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the - last chunk if you set `stream_options: {"include_usage": true}`. - created: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. - model: - type: string - description: The model to generate the completion. - system_fingerprint: - type: string - description: |- - This fingerprint represents the backend configuration that the model runs with. - Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. - deprecated: true - object: - type: string - enum: - - chat.completion.chunk - description: The object type, which is always `chat.completion.chunk`. - x-stainless-const: true - usage: - allOf: - - $ref: '#/components/schemas/OpenAI.CompletionUsage' - description: |- - An optional field that will only be present when you set - `stream_options: {"include_usage": true}` in your request. When present, it - contains a null value **except for the last chunk** which contains the - token usage statistics for the entire request. - *NOTE:** If the stream is interrupted or cancelled, you may not - receive the final usage chunk which contains the total token usage for - the request. - delta: - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta' - content_filter_results: - $ref: '#/components/schemas/AzureContentFilterResultForChoice' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Chat - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - A unique identifier representing your end-user, which can help to - monitor and detect abuse. - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - messages: - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - minItems: 1 - description: |- - A list of messages comprising the conversation so far. Depending on the - model you use, different message types (modalities) are supported, - like text, images, and audio. - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - modalities: - $ref: '#/components/schemas/OpenAI.ResponseModalities' - verbosity: - $ref: '#/components/schemas/OpenAI.Verbosity' - reasoning_effort: - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - max_completion_tokens: - anyOf: - - type: integer - - type: 'null' - description: |- - An upper bound for the number of tokens that can be generated for a - completion, including visible output tokens and reasoning tokens. - frequency_penalty: - anyOf: - - type: number - - type: 'null' - minimum: -2 - maximum: 2 - description: |- - Number between -2.0 and 2.0. Positive values penalize new tokens based on - their existing frequency in the text so far, decreasing the model's - likelihood to repeat the same line verbatim. - presence_penalty: - anyOf: - - type: number - - type: 'null' - minimum: -2 - maximum: 2 - 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. - response_format: - allOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' - description: |- - An object specifying the format that the model must output. - - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables - Structured Outputs which ensures the model will match your supplied JSON - schema. - - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures - the message the model generates is valid JSON. - - **Important:** when using JSON mode, you **must** also instruct the model - to produce JSON yourself via a system or user message. Without this, the - model may generate an unending stream of whitespace until the generation - reaches the token limit, resulting in a long-running and seemingly "stuck" - request. Also note that the message content may be partially cut off if - `finish_reason="length"`, which indicates the generation exceeded - `max_tokens` or the conversation exceeded the max context length. - audio: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestAudio' - - type: 'null' - description: |- - Parameters for audio output. Required when audio output is requested with - `modalities: ["audio"]`. - store: - anyOf: - - type: boolean - - type: 'null' - description: |- - Whether or not to store the output of this chat completion request for - use in model distillation or evals products. - stream: - anyOf: - - type: boolean - - type: 'null' - description: |- - If set to true, the model response data will be streamed to the client - as it is generated using server-sent events. - stop: - $ref: '#/components/schemas/OpenAI.StopConfiguration' - logit_bias: - anyOf: - - type: object - unevaluatedProperties: - type: integer - - type: 'null' - description: |- - Modify the likelihood of specified tokens appearing in the completion. - Accepts a JSON object that maps tokens (specified by their token ID in the - tokenizer) to an associated bias value from -100 to 100. Mathematically, - the bias is added to the logits generated by the model prior to sampling. - The exact effect will vary per model, but values between -1 and 1 should - decrease or increase likelihood of selection; values like -100 or 100 - should result in a ban or exclusive selection of the relevant token. - x-oaiTypeLabel: map - logprobs: - anyOf: - - type: boolean - - type: 'null' - description: |- - Whether to return log probabilities of the output tokens or not. If true, - returns the log probabilities of each output token returned in the - `content` of `message`. - max_tokens: - anyOf: - - type: integer - - type: 'null' - description: |- - The maximum number of tokens that can be generated in the chat completion. - This value can be used to control costs for text generated via API. - - This value is now deprecated in favor of `max_completion_tokens`, and is - not compatible with o1 series models. - deprecated: true - 'n': - anyOf: - - type: integer - - type: 'null' - minimum: 1 - maximum: 128 - description: How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. - default: 1 - prediction: - allOf: - - $ref: '#/components/schemas/OpenAI.PredictionContent' - description: |- - Configuration for a predicted output, which can greatly improve - response times when large parts of the model response are known - ahead of time. This is most common when you are regenerating a - file with only minor changes to most of the content. - seed: - anyOf: - - type: integer - format: int64 - - type: 'null' - description: |- - This feature is in Beta. - If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. - Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. - deprecated: true - x-oaiMeta: - beta: true - stream_options: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions' - - type: 'null' - tools: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionTool' - - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletions' - description: |- - A list of tools the model may call. You can provide either - [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or - [function tools](https://platform.openai.com/docs/guides/function-calling). - tool_choice: - $ref: '#/components/schemas/OpenAI.ChatCompletionToolChoiceOption' - parallel_tool_calls: - $ref: '#/components/schemas/OpenAI.ParallelToolCalls' - function_call: - anyOf: - - type: string - enum: - - none - - auto - - $ref: '#/components/schemas/OpenAI.ChatCompletionFunctionCallOption' - description: |- - Deprecated in favor of `tool_choice`. - Controls which (if any) function is called by the model. - `none` means the model will not call a function and instead generates a - message. - `auto` means the model can pick between generating a message or calling a - function. - Specifying a particular function via `{"name": "my_function"}` forces the - model to call that function. - `none` is the default when no functions are present. `auto` is the default - if functions are present. - deprecated: true - functions: - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionFunctions' - minItems: 1 - maxItems: 128 - description: |- - Deprecated in favor of `tools`. - A list of functions the model may generate JSON inputs for. - deprecated: true - user_security_context: - $ref: '#/components/schemas/AzureUserSecurityContext' - required: - - messages - - model - /completions: - post: - operationId: createCompletion - description: Creates a completion. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - choices - - created - - model - - object - properties: - id: - type: string - description: A unique identifier for the completion. - choices: - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoices' - description: The list of completion choices the model generated for the input prompt. - created: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) of when the completion was created. - model: - type: string - description: The model used for completion. - system_fingerprint: - type: string - description: |- - This fingerprint represents the backend configuration that the model runs with. - Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. - object: - type: string - enum: - - text_completion - description: The object type, which is always "text_completion" - x-stainless-const: true - usage: - $ref: '#/components/schemas/OpenAI.CompletionUsage' - prompt_filter_results: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterResultForPrompt' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Completions - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - model: - type: string - description: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - x-oaiTypeLabel: string - best_of: - anyOf: - - type: integer - - type: 'null' - minimum: 0 - maximum: 20 - description: |- - Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. - When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. - *Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. - default: 1 - echo: - anyOf: - - type: boolean - - type: 'null' - description: Echo back the prompt in addition to the completion - frequency_penalty: - anyOf: - - type: number - - type: 'null' - minimum: -2 - maximum: 2 - description: |- - Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. - [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) - logit_bias: - anyOf: - - type: object - unevaluatedProperties: - type: integer - - type: 'null' - description: |- - Modify the likelihood of specified tokens appearing in the completion. - Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. - As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. - x-oaiTypeLabel: map - logprobs: - anyOf: - - type: integer - - type: 'null' - minimum: 0 - maximum: 5 - description: |- - Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. - The maximum value for `logprobs` is 5. - max_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 0 - description: |- - The maximum number of [tokens](/tokenizer) that can be generated in the completion. - The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. - default: 16 - 'n': - anyOf: - - type: integer - - type: 'null' - minimum: 1 - maximum: 128 - description: |- - How many completions to generate for each prompt. - *Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. - default: 1 - presence_penalty: - anyOf: - - type: number - - type: 'null' - minimum: -2 - maximum: 2 - 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. - [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) - seed: - anyOf: - - type: integer - format: int64 - - type: 'null' - description: |- - If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. - Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. - stop: - $ref: '#/components/schemas/OpenAI.StopConfiguration' - stream: - anyOf: - - type: boolean - - type: 'null' - description: 'Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions).' - stream_options: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamOptions' - - type: 'null' - suffix: - anyOf: - - type: string - - type: 'null' - description: |- - The suffix that comes after a completion of inserted text. - This parameter is only supported for `gpt-3.5-turbo-instruct`. - temperature: - anyOf: - - type: number - - type: 'null' - minimum: 0 - maximum: 2 - description: |- - What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - We generally recommend altering this or `top_p` but not both. - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - minimum: 0 - maximum: 1 - description: |- - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - We generally recommend altering this or `temperature` but not both. - default: 1 - user: - type: string - description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). - prompt: - anyOf: - - type: string - - type: array - items: - type: string - - type: 'null' - default: <|endoftext|> - required: - - model - /containers: - get: - operationId: listContainers - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ContainerListResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - post: - operationId: createContainer - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ContainerResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateContainerBody' - /containers/{container_id}: - get: - operationId: retrieveContainer - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container to retrieve. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ContainerResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - delete: - operationId: deleteContainer - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - /containers/{container_id}/files: - get: - operationId: listContainerFiles - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container to list files from. - schema: - type: string - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ContainerFileListResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - post: - operationId: createContainerFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container to create a file in. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ContainerFileResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - requestBody: - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/OpenAI.CreateContainerFileBody' - /containers/{container_id}/files/{file_id}: - get: - operationId: retrieveContainerFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container. - schema: - type: string - - name: file_id - in: path - required: true - description: The ID of the file to retrieve. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ContainerFileResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - delete: - operationId: deleteContainerFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container. - schema: - type: string - - name: file_id - in: path - required: true - description: The ID of the file to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - /containers/{container_id}/files/{file_id}/content: - get: - operationId: retrieveContainerFileContent - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: container_id - in: path - required: true - description: The ID of the container. - schema: - type: string - - name: file_id - in: path - required: true - description: The ID of the file to retrieve content from. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/octet-stream: - schema: - contentMediaType: application/octet-stream - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Containers - /conversations: - post: - operationId: createConversation - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateConversationBody' - /conversations/{conversation_id}: - get: - operationId: retrieveConversation - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation to retrieve. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - post: - operationId: updateConversation - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation to update. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.UpdateConversationBody' - delete: - operationId: deleteConversation - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeletedConversationResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - /conversations/{conversation_id}/items: - get: - operationId: listConversationItems - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation to list items for. - schema: - type: string - - name: limit - in: query - required: false - description: A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: The order to return the input items in. Default is `desc`. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: An item ID to list items after, used in pagination. - schema: - type: string - explode: false - - name: include - in: query - required: false - description: Specify additional output data to include in the model response. - schema: - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationItemList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - post: - operationId: createConversationItems - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation to add the item to. - schema: - type: string - - name: include - in: query - required: false - description: Additional fields to include in the response. - schema: - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationItemList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateConversationItemsParametersBody' - /conversations/{conversation_id}/items/{item_id}: - get: - operationId: retrieveConversationItem - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation that contains the item. - schema: - type: string - - name: item_id - in: path - required: true - description: The ID of the item to retrieve. - schema: - type: string - - name: include - in: query - required: false - description: Additional fields to include in the response. - schema: - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationItem' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - delete: - operationId: deleteConversationItem - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: conversation_id - in: path - required: true - description: The ID of the conversation that contains the item. - schema: - type: string - - name: item_id - in: path - required: true - description: The ID of the item to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ConversationResource' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Conversations - /embeddings: - post: - operationId: createEmbedding - summary: Creates an embedding vector representing the input text. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Embeddings - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateEmbeddingRequest' - /evals: - get: - operationId: listEvals - summary: List evaluations for a project. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: after - in: query - required: false - description: Identifier for the last eval from the previous pagination request. - schema: - type: string - explode: false - - name: limit - in: query - required: false - description: A limit on the number of evals to be returned in a single pagination response. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order for evals by timestamp. Use `asc` for ascending order or - `desc` for descending order. - schema: - type: string - enum: - - asc - - desc - default: asc - explode: false - - name: order_by - in: query - required: false - description: |- - Evals can be ordered by creation time or last updated time. Use - `created_at` for creation time or `updated_at` for last updated - time. - schema: - type: string - enum: - - created_at - - updated_at - default: created_at - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - post: - operationId: createEval - description: |- - Create the structure of an evaluation that can be used to test a model's - performance. - - An evaluation is a set of testing criteria and a datasource. After - creating an evaluation, you can run it on different models and model - parameters. We support several types of graders and datasources. - - For more information, see the [Evals guide](/docs/guides/evals). - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.Eval' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - statusCode: - type: number - enum: - - 201 - name: - type: string - description: The name of the evaluation. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - data_source_config: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalCustomDataSourceConfig' - - $ref: '#/components/schemas/OpenAI.CreateEvalLogsDataSourceConfig' - - $ref: '#/components/schemas/OpenAI.CreateEvalStoredCompletionsDataSourceConfig' - description: The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation. - testing_criteria: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalLabelModelGrader' - - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck' - - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.EvalGraderPython' - - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel' - - $ref: '#/components/schemas/EvalGraderEndpoint' - description: A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`). - required: - - statusCode - - data_source_config - - testing_criteria - /evals/{eval_id}: - get: - operationId: getEval - summary: Retrieve an evaluation by its ID. - description: Retrieves an evaluation by its ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.Eval' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - post: - operationId: updateEval - description: Update select, mutable properties of a specified evaluation. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.Eval' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - name: - type: string - metadata: - $ref: '#/components/schemas/OpenAI.Metadata' - delete: - operationId: deleteEval - description: Delete a specified evaluation. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - object - - deleted - - eval_id - properties: - object: - type: string - enum: - - eval.deleted - deleted: - type: boolean - eval_id: - type: string - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - /evals/{eval_id}/runs: - get: - operationId: getEvalRuns - summary: '' - description: Retrieve a list of runs for a specified evaluation. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - - name: after - in: query - required: false - schema: - type: string - explode: false - - name: limit - in: query - required: false - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - schema: - type: string - enum: - - asc - - desc - default: asc - explode: false - - name: status - in: query - required: false - schema: - type: string - enum: - - queued - - in_progress - - completed - - canceled - - failed - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalRunList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - post: - operationId: createEvalRun - description: Create a new evaluation run, beginning the grading process. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - responses: - '201': - description: The request has succeeded and a new resource has been created as a result. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalRun' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateEvalRunRequest' - /evals/{eval_id}/runs/{run_id}: - get: - operationId: getEvalRun - description: Retrieve a specific evaluation run by its ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalRun' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - post: - operationId: cancelEvalRun - description: Cancel a specific evaluation run by its ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalRun' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - delete: - operationId: deleteEvalRun - description: Delete a specific evaluation run by its ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - object - - deleted - - eval_run_id - properties: - object: - type: string - enum: - - eval_run.deleted - deleted: - type: boolean - eval_run_id: - type: string - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - /evals/{eval_id}/runs/{run_id}/output_items: - get: - operationId: getEvalRunOutputItems - description: Get a list of output items for a specified evaluation run. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - - name: after - in: query - required: false - schema: - type: string - explode: false - - name: limit - in: query - required: false - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: status - in: query - required: false - schema: - type: string - enum: - - fail - - pass - explode: false - - name: order - in: query - required: false - schema: - type: string - enum: - - asc - - desc - default: asc - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - /evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}: - get: - operationId: getEvalRunOutputItem - description: Retrieve a specific output item from an evaluation run by its ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: eval_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - - name: output_item_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItem' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Evals - /files: - post: - operationId: createFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - bytes - - created_at - - filename - - object - - purpose - - status - properties: - id: - type: string - description: The file identifier, which can be referenced in the API endpoints. - bytes: - type: integer - description: The size of the file, in bytes. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the file was created. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the file will expire. - filename: - type: string - description: The name of the file. - object: - type: string - enum: - - file - description: The object type, which is always `file`. - x-stainless-const: true - status_details: - type: string - description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. - deprecated: true - purpose: - type: string - enum: - - assistants - - assistants_output - - batch - - batch_output - - fine-tune - - fine-tune-results - - evals - description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`. - status: - type: string - enum: - - uploaded - - pending - - running - - processed - - error - - deleting - - deleted - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Files - requestBody: - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/OpenAI.CreateFileRequest' - get: - operationId: listFiles - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: purpose - in: query - required: false - schema: - type: string - explode: false - - name: limit - in: query - required: false - schema: - type: integer - explode: false - - name: order - in: query - required: false - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListFilesResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Files - /files/{file_id}: - get: - operationId: retrieveFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: file_id - in: path - required: true - description: The ID of the file to use for this request. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - bytes - - created_at - - filename - - object - - purpose - - status - properties: - id: - type: string - description: The file identifier, which can be referenced in the API endpoints. - bytes: - type: integer - description: The size of the file, in bytes. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the file was created. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the file will expire. - filename: - type: string - description: The name of the file. - object: - type: string - enum: - - file - description: The object type, which is always `file`. - x-stainless-const: true - status_details: - type: string - description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. - deprecated: true - purpose: - type: string - enum: - - assistants - - assistants_output - - batch - - batch_output - - fine-tune - - fine-tune-results - - evals - description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`. - status: - type: string - enum: - - uploaded - - pending - - running - - processed - - error - - deleting - - deleted - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Files - delete: - operationId: deleteFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: file_id - in: path - required: true - description: The ID of the file to use for this request. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteFileResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Files - /files/{file_id}/content: - get: - operationId: downloadFile - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: file_id - in: path - required: true - description: The ID of the file to use for this request. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/octet-stream: - schema: - contentMediaType: application/octet-stream - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Files - /fine_tuning/alpha/graders/run: - post: - operationId: runGrader - summary: Run a grader. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunGraderResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunGraderRequest' - /fine_tuning/alpha/graders/validate: - post: - operationId: validateGrader - summary: Validate a grader. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ValidateGraderResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - grader: - anyOf: - - $ref: '#/components/schemas/OpenAI.GraderStringCheck' - - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.GraderPython' - - $ref: '#/components/schemas/OpenAI.GraderScoreModel' - - $ref: '#/components/schemas/OpenAI.GraderMulti' - - $ref: '#/components/schemas/GraderEndpoint' - /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions: - get: - operationId: listFineTuningCheckpointPermissions - summary: List checkpoint permissions - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuned_model_checkpoint - in: path - required: true - description: The ID of the fine-tuned model checkpoint to get permissions for. - schema: - type: string - - name: project_id - in: query - required: false - description: The ID of the project to get permissions for. - schema: - type: string - explode: false - - name: after - in: query - required: false - description: Identifier for the last permission ID from the previous pagination request. - schema: - type: string - explode: false - - name: limit - in: query - required: false - description: Number of permissions to retrieve. - schema: - type: integer - format: int32 - default: 10 - explode: false - - name: order - in: query - required: false - description: The order in which to retrieve permissions. - schema: - type: string - enum: - - ascending - - descending - default: descending - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - post: - operationId: createFineTuningCheckpointPermission - summary: Create checkpoint permissions - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuned_model_checkpoint - in: path - required: true - description: The ID of the fine-tuned model checkpoint to create a permission for. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListFineTuningCheckpointPermissionResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateFineTuningCheckpointPermissionRequest' - /fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}: - delete: - operationId: deleteFineTuningCheckpointPermission - summary: Delete checkpoint permission - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuned_model_checkpoint - in: path - required: true - description: The ID of the fine-tuned model checkpoint to delete a permission for. - schema: - type: string - - name: permission_id - in: path - required: true - description: The ID of the fine-tuned model checkpoint permission to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteFineTuningCheckpointPermissionResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs: - post: - operationId: createFineTuningJob - summary: |- - Creates a fine-tuning job which begins the process of creating a new model from a given dataset. - - Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. - - [Learn more about fine-tuning](/docs/guides/fine-tuning) - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.FineTuningJob' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequest' - get: - operationId: listPaginatedFineTuningJobs - summary: List your organization's fine-tuning jobs - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: after - in: query - required: false - description: Identifier for the last job from the previous pagination request. - schema: - type: string - explode: false - - name: limit - in: query - required: false - description: Number of fine-tuning jobs to retrieve. - schema: - type: integer - format: int32 - default: 20 - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListPaginatedFineTuningJobsResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}: - get: - operationId: retrieveFineTuningJob - summary: |- - Get info about a fine-tuning job. - - [Learn more about fine-tuning](/docs/guides/fine-tuning) - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuning_job_id - in: path - required: true - description: The ID of the fine-tuning job. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.FineTuningJob' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}/cancel: - post: - operationId: cancelFineTuningJob - summary: Immediately cancel a fine-tune job. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuning_job_id - in: path - required: true - description: The ID of the fine-tuning job to cancel. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.FineTuningJob' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints: - get: - operationId: listFineTuningJobCheckpoints - summary: List the checkpoints for a fine-tuning job. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuning_job_id - in: path - required: true - description: The ID of the fine-tuning job to get checkpoints for. - schema: - type: string - - name: after - in: query - required: false - description: Identifier for the last checkpoint ID from the previous pagination request. - schema: - type: string - explode: false - - name: limit - in: query - required: false - description: Number of checkpoints to retrieve. - schema: - type: integer - format: int32 - default: 10 - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListFineTuningJobCheckpointsResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints/{fine_tuning_checkpoint_id}/copy: - post: - operationId: FineTuning_CopyCheckpoint - description: |- - Creates a copy of a fine-tuning checkpoint at the given destination account and region. - - NOTE: This Azure OpenAI API is in preview and subject to change. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: aoai-copy-ft-checkpoints - in: header - required: true - description: |- - Enables access to checkpoint copy operations for models, an AOAI preview feature. - This feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'. - schema: - type: string - enum: - - preview - - name: accept - in: header - required: true - schema: - type: string - enum: - - application/json - - name: fine_tuning_job_id - in: path - required: true - schema: - type: string - - name: fine_tuning_checkpoint_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CopyModelResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/CopyModelRequest' - get: - operationId: FineTuning_GetCheckpoint - description: |- - Gets the status of a fine-tuning checkpoint copy. - - NOTE: This Azure OpenAI API is in preview and subject to change. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: aoai-copy-ft-checkpoints - in: header - required: true - description: |- - Enables access to checkpoint copy operations for models, an AOAI preview feature. - This feature requires the 'aoai-copy-ft-checkpoints' header to be set to 'preview'. - schema: - type: string - enum: - - preview - - name: accept - in: header - required: true - schema: - type: string - enum: - - application/json - - name: fine_tuning_job_id - in: path - required: true - schema: - type: string - - name: fine_tuning_checkpoint_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CopyModelResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}/events: - get: - operationId: listFineTuningEvents - summary: Get status updates for a fine-tuning job. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuning_job_id - in: path - required: true - description: The ID of the fine-tuning job to get events for. - schema: - type: string - - name: after - in: query - required: false - description: Identifier for the last event from the previous pagination request. - schema: - type: string - explode: false - - name: limit - in: query - required: false - description: Number of events to retrieve. - schema: - type: integer - format: int32 - default: 20 - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListFineTuningJobEventsResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}/pause: - post: - operationId: pauseFineTuningJob - summary: Pause a fine-tune job. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuning_job_id - in: path - required: true - description: The ID of the fine-tuning job to pause. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.FineTuningJob' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /fine_tuning/jobs/{fine_tuning_job_id}/resume: - post: - operationId: resumeFineTuningJob - summary: Resume a paused fine-tune job. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: fine_tuning_job_id - in: path - required: true - description: The ID of the fine-tuning job to resume. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.FineTuningJob' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Fine-tuning - /models: - get: - operationId: listModels - summary: |- - Lists the currently available models, and provides basic information about each one such as the - owner and availability. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListModelsResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Models - /models/{model}: - get: - operationId: retrieveModel - summary: |- - Retrieves a model instance, providing basic information about the model such as the owner and - permissioning. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: model - in: path - required: true - description: The ID of the model to use for this request. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.Model' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Models - delete: - operationId: deleteModel - summary: Deletes a model instance. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: model - in: path - required: true - description: The ID of the model to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteModelResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Models - /realtime/calls: - post: - operationId: createRealtimeCall - summary: Create a new Realtime API call over WebRTC and receive the SDP answer needed to complete the peer connection. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '201': - description: The request has succeeded and a new resource has been created as a result. - headers: - location: - required: false - description: Relative URL containing the call ID for subsequent control requests. - schema: - type: string - content: - application/sdp: - schema: - type: string - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeCallCreateRequest' - encoding: - session: - contentType: application/json - /realtime/calls/{call_id}/accept: - post: - operationId: acceptRealtimeCall - summary: Accept an incoming SIP call and configure the realtime session that will handle it. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: call_id - in: path - required: true - description: The identifier for the call provided in the realtime.call.incoming webhook. - schema: - type: string - responses: - '200': - description: The request has succeeded. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA' - description: Session configuration to apply before the caller is bridged to the model. - /realtime/calls/{call_id}/hangup: - post: - operationId: hangupRealtimeCall - summary: End an active Realtime API call, whether it was initiated over SIP or WebRTC. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: call_id - in: path - required: true - description: The identifier for the call. - schema: - type: string - responses: - '200': - description: The request has succeeded. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - /realtime/calls/{call_id}/refer: - post: - operationId: referRealtimeCall - summary: Transfer an active SIP call to a new destination using the SIP REFER verb. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: call_id - in: path - required: true - description: The identifier for the call provided in the realtime.call.incoming webhook. - schema: - type: string - responses: - '200': - description: The request has succeeded. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeCallReferRequest' - description: Destination URI for the REFER request. - /realtime/calls/{call_id}/reject: - post: - operationId: rejectRealtimeCall - summary: Decline an incoming SIP call by returning a SIP status code to the caller. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: call_id - in: path - required: true - description: The identifier for the call provided in the realtime.call.incoming webhook. - schema: - type: string - responses: - '200': - description: The request has succeeded. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeCallRejectRequest' - description: Provide an optional SIP status code. When omitted the API responds with 603 Decline. - /realtime/client_secrets: - post: - operationId: createRealtimeClientSecret - summary: Create a Realtime client secret with an associated session configuration. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretRequest' - description: Create a client secret with the given session configuration. - /realtime/sessions: - post: - operationId: createRealtimeSession - summary: Create an ephemeral API token for use in client-side applications with the Realtime API. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequest' - description: Create an ephemeral API key with the given session configuration. - /realtime/transcription_sessions: - post: - operationId: createRealtimeTranscriptionSession - summary: Create an ephemeral API token for use in client-side applications with the Realtime API specifically for realtime transcriptions. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Realtime - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest' - description: Create an ephemeral API key with the given session configuration. - /responses: - post: - operationId: createResponse - description: Creates a model response. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - text/event-stream: - itemSchema: - type: object - properties: - event: - type: string - data: - type: string - required: - - event - oneOf: - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent' - event: - const: response.audio.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent' - event: - const: response.audio.transcript.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent' - event: - const: response.code_interpreter_call_code.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent' - event: - const: response.code_interpreter_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent' - event: - const: response.code_interpreter_call.interpreting - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent' - event: - const: response.content_part.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent' - event: - const: response.created - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseErrorEvent' - event: - const: error - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent' - event: - const: response.file_search_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent' - event: - const: response.file_search_call.searching - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent' - event: - const: response.function_call_arguments.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent' - event: - const: response.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFailedEvent' - event: - const: response.failed - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent' - event: - const: response.incomplete - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent' - event: - const: response.output_item.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent' - event: - const: response.reasoning_summary_part.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent' - event: - const: response.reasoning_summary_text.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent' - event: - const: response.reasoning_text.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent' - event: - const: response.refusal.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent' - event: - const: response.output_text.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent' - event: - const: response.web_search_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent' - event: - const: response.web_search_call.searching - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent' - event: - const: response.image_generation_call.generating - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent' - event: - const: response.image_generation_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent' - event: - const: response.image_generation_call.partial_image - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent' - event: - const: response.mcp_call_arguments.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent' - event: - const: response.mcp_call.failed - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent' - event: - const: response.mcp_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent' - event: - const: response.mcp_list_tools.failed - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent' - event: - const: response.mcp_list_tools.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent' - event: - const: response.output_text.annotation.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent' - event: - const: response.queued - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent' - event: - const: response.custom_tool_call_input.delta - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Responses - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateResponse' - /responses/{response_id}: - get: - operationId: getResponse - description: Retrieves a model response with the given ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - - name: include[] - in: query - required: false - description: Additional fields to include in the response. See the include parameter for Response creation above for more information. - schema: - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - default: [] - - name: stream - in: query - required: false - description: If set to true, the model response data will be streamed to the client as it is generated using server-sent events. - schema: - type: boolean - explode: false - - name: starting_after - in: query - required: false - description: The sequence number of the event after which to start streaming. - schema: - type: integer - format: int32 - explode: false - - name: include_obfuscation - in: query - required: false - description: When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API. - schema: - type: boolean - default: true - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Responses - delete: - operationId: deleteResponse - description: Deletes a response by ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - object - - id - - deleted - properties: - object: - type: string - enum: - - response.deleted - id: - type: string - deleted: - type: boolean - enum: - - true - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Responses - /responses/{response_id}/cancel: - post: - operationId: cancelResponse - description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Responses - /responses/{response_id}/input_items: - get: - operationId: listInputItems - description: Returns a list of input items for a given response. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ResponseItemList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Responses - /threads: - post: - operationId: createThread - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ThreadObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateThreadRequest' - /threads/runs: - post: - operationId: createThreadAndRun - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequest' - /threads/{thread_id}: - delete: - operationId: deleteThread - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteThreadResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - get: - operationId: retrieveThread - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ThreadObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - post: - operationId: modifyThread - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ThreadObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ModifyThreadRequest' - /threads/{thread_id}/messages: - get: - operationId: listMessages - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - explode: false - - name: order - in: query - required: false - schema: - type: string - enum: - - asc - - desc - default: desc - explode: false - - name: after - in: query - required: false - schema: - type: string - explode: false - - name: before - in: query - required: false - schema: - type: string - explode: false - - name: run_id - in: query - required: false - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListMessagesResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - post: - operationId: createMessage - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.MessageObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateMessageRequest' - /threads/{thread_id}/messages/{message_id}: - delete: - operationId: deleteMessage - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: message_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteMessageResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - get: - operationId: retrieveMessage - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: message_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.MessageObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - post: - operationId: modifyMessage - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: message_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.MessageObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ModifyMessageRequest' - /threads/{thread_id}/runs: - post: - operationId: createRun - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateRunRequest' - get: - operationId: listRuns - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - explode: false - - name: order - in: query - required: false - schema: - type: string - enum: - - asc - - desc - default: desc - explode: false - - name: after - in: query - required: false - schema: - type: string - explode: false - - name: before - in: query - required: false - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListRunsResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - /threads/{thread_id}/runs/{run_id}: - get: - operationId: retrieveRun - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - post: - operationId: modifyRun - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ModifyRunRequest' - /threads/{thread_id}/runs/{run_id}/cancel: - post: - operationId: cancelRun - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - /threads/{thread_id}/runs/{run_id}/steps: - get: - operationId: listRunSteps - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - schema: - type: integer - default: 20 - explode: false - - name: order - in: query - required: false - schema: - type: string - enum: - - asc - - desc - default: desc - explode: false - - name: after - in: query - required: false - schema: - type: string - explode: false - - name: before - in: query - required: false - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListRunStepsResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - /threads/{thread_id}/runs/{run_id}/steps/{step_id}: - get: - operationId: getRunStep - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - - name: step_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunStepObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - /threads/{thread_id}/runs/{run_id}/submit_tool_outputs: - post: - operationId: submitToolOutputsToRun - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: thread_id - in: path - required: true - schema: - type: string - - name: run_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.RunObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Threads - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequest' - /vector_stores: - get: - operationId: listVectorStores - summary: Returns a list of vector stores. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListVectorStoresResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - post: - operationId: createVectorStore - summary: Creates a vector store. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateVectorStoreRequest' - /vector_stores/{vector_store_id}: - get: - operationId: getVectorStore - summary: Retrieves a vector store. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store to retrieve. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - post: - operationId: modifyVectorStore - summary: Modifies a vector store. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store to modify. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.UpdateVectorStoreRequest' - delete: - operationId: deleteVectorStore - summary: Delete a vector store. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteVectorStoreResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - /vector_stores/{vector_store_id}/file_batches: - post: - operationId: createVectorStoreFileBatch - summary: Create a vector store file batch. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store for which to create a file batch. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileBatchRequest' - /vector_stores/{vector_store_id}/file_batches/{batch_id}: - get: - operationId: getVectorStoreFileBatch - summary: Retrieves a vector store file batch. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store that the file batch belongs to. - schema: - type: string - - name: batch_id - in: path - required: true - description: The ID of the file batch being retrieved. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - /vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: - post: - operationId: cancelVectorStoreFileBatch - summary: Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store that the file batch belongs to. - schema: - type: string - - name: batch_id - in: path - required: true - description: The ID of the file batch to cancel. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - /vector_stores/{vector_store_id}/file_batches/{batch_id}/files: - get: - operationId: listFilesInVectorStoreBatch - summary: Returns a list of vector store files in a batch. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store that the file batch belongs to. - schema: - type: string - - name: batch_id - in: path - required: true - description: The ID of the file batch that the files belong to. - schema: - type: string - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - - name: filter - in: query - required: false - description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. - schema: - type: string - enum: - - in_progress - - completed - - failed - - cancelled - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - /vector_stores/{vector_store_id}/files: - get: - operationId: listVectorStoreFiles - summary: Returns a list of vector store files. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store that the files belong to. - schema: - type: string - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - - name: filter - in: query - required: false - description: Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. - schema: - type: string - enum: - - in_progress - - completed - - failed - - cancelled - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ListVectorStoreFilesResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - post: - operationId: createVectorStoreFile - summary: Create a vector store file by attaching a [File](/docs/api-reference/files) to a [vector store](/docs/api-reference/vector-stores/object). - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store for which to create a File. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest' - /vector_stores/{vector_store_id}/files/{file_id}: - get: - operationId: getVectorStoreFile - summary: Retrieves a vector store file. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store that the file belongs to. - schema: - type: string - - name: file_id - in: path - required: true - description: The ID of the file being retrieved. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - post: - operationId: updateVectorStoreFileAttributes - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - schema: - type: string - - name: file_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.UpdateVectorStoreFileAttributesRequest' - delete: - operationId: deleteVectorStoreFile - summary: Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](/docs/api-reference/files/delete) endpoint. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store that the file belongs to. - schema: - type: string - - name: file_id - in: path - required: true - description: The ID of the file to delete. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.DeleteVectorStoreFileResponse' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - /vector_stores/{vector_store_id}/files/{file_id}/content: - get: - operationId: retrieveVectorStoreFileContent - summary: Retrieve vector store file content - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store to search. - schema: - type: string - - name: file_id - in: path - required: true - description: The ID of the file to retrieve content for. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultsPage' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - /vector_stores/{vector_store_id}/search: - post: - operationId: searchVectorStore - summary: Search vector store - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: vector_store_id - in: path - required: true - description: The ID of the vector store to search. - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultsPage' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - inner_error: {} - required: - - code - - message - - param - - type - tags: - - Vector Stores - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequest' -security: - - ApiKeyAuth: [] - - ApiKeyAuth_: [] - - OAuth2Auth: - - https://cognitiveservices.azure.com/.default -components: - schemas: - AudioSegment: - type: object - required: - - id - - start - - end - - text - - temperature - - avg_logprob - - compression_ratio - - no_speech_prob - - tokens - - seek - properties: - id: - type: integer - format: int32 - description: The 0-based index of this segment within a translation. - start: - type: number - format: float - description: The time at which this segment started relative to the beginning of the translated audio. - end: - type: number - format: float - description: The time at which this segment ended relative to the beginning of the translated audio. - text: - type: string - description: The translated text that was part of this audio segment. - temperature: - type: number - format: float - description: The temperature score associated with this audio segment. - avg_logprob: - type: number - format: float - description: The average log probability associated with this audio segment. - compression_ratio: - type: number - format: float - description: The compression ratio of this audio segment. - no_speech_prob: - type: number - format: float - description: The probability of no speech detection within this audio segment. - tokens: - type: array - items: - type: integer - format: int32 - description: The token IDs matching the translated text in this audio segment. - seek: - type: integer - format: int32 - description: |- - The seek position associated with the processing of this audio segment. - Seek positions are expressed as hundredths of seconds. - The model may process several segments from a single seek position, so while the seek position will never represent - a later time than the segment's start, the segment's start may represent a significantly later time than the - segment's associated seek position. - AudioTaskLabel: - anyOf: - - type: string - - type: string - enum: - - transcribe - - translate - description: Defines the possible descriptors for available audio operation responses. - AudioTranslationSegment: - type: object - required: - - id - - start - - end - - text - - temperature - - avg_logprob - - compression_ratio - - no_speech_prob - - tokens - - seek - properties: - id: - type: integer - format: int32 - description: The 0-based index of this segment within a translation. - start: - type: number - format: float - description: The time at which this segment started relative to the beginning of the translated audio. - end: - type: number - format: float - description: The time at which this segment ended relative to the beginning of the translated audio. - text: - type: string - description: The translated text that was part of this audio segment. - temperature: - type: number - format: float - description: The temperature score associated with this audio segment. - avg_logprob: - type: number - format: float - description: The average log probability associated with this audio segment. - compression_ratio: - type: number - format: float - description: The compression ratio of this audio segment. - no_speech_prob: - type: number - format: float - description: The probability of no speech detection within this audio segment. - tokens: - type: array - items: - type: integer - format: int32 - description: The token IDs matching the translated text in this audio segment. - seek: - type: integer - format: int32 - description: |- - The seek position associated with the processing of this audio segment. - Seek positions are expressed as hundredths of seconds. - The model may process several segments from a single seek position, so while the seek position will never represent - a later time than the segment's start, the segment's start may represent a significantly later time than the - segment's associated seek position. - description: |- - Extended information about a single segment of translated audio data. - Segments generally represent roughly 5-10 seconds of speech. Segment boundaries typically occur between words but not - necessarily sentences. - AzureAIFoundryModelsApiVersion: - type: string - enum: - - v1 - - preview - AzureAudioTranscriptionResponse: - type: object - required: - - text - properties: - text: - type: string - description: The transcribed text for the provided audio data. - task: - allOf: - - $ref: '#/components/schemas/AudioTaskLabel' - description: The label that describes which operation type generated the accompanying response data. - language: - type: string - description: |- - The spoken language that was detected in the transcribed audio data. - This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. - duration: - type: number - format: float - description: The total duration of the audio processed to produce accompanying transcription information. - segments: - type: array - items: - $ref: '#/components/schemas/OpenAI.TranscriptionSegment' - description: A collection of information about the timing, probabilities, and other detail of each processed audio segment. - words: - type: array - items: - $ref: '#/components/schemas/OpenAI.TranscriptionWord' - description: A collection of information about the timing of each processed word. - description: Result information for an operation that transcribed spoken audio into written text. - AzureAudioTranslationResponse: - type: object - required: - - text - properties: - text: - type: string - description: The translated text for the provided audio data. - task: - allOf: - - $ref: '#/components/schemas/AudioTaskLabel' - description: The label that describes which operation type generated the accompanying response data. - language: - type: string - description: |- - The spoken language that was detected in the translated audio data. - This is expressed as a two-letter ISO-639-1 language code like 'en' or 'fr'. - duration: - type: number - format: float - description: The total duration of the audio processed to produce accompanying translation information. - segments: - type: array - items: - $ref: '#/components/schemas/AudioTranslationSegment' - description: A collection of information about the timing, probabilities, and other detail of each processed audio segment. - description: Result information for an operation that translated spoken audio into written text. - AzureCompletionsSamplingParams: - type: object - properties: - max_tokens: - type: integer - format: int32 - description: The maximum number of tokens in the generated output. - allOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams' - description: Sampling parameters for controlling the behavior of completions. - AzureContentFilterBlocklistIdResult: - type: object - required: - - id - - filtered - properties: - id: - type: string - description: The ID of the custom blocklist associated with the filtered status. - filtered: - type: boolean - description: Whether the associated blocklist resulted in the content being filtered. - description: |- - A content filter result item that associates an existing custom blocklist ID with a value indicating whether or not - the corresponding blocklist resulted in content being filtered. - AzureContentFilterBlocklistResult: - type: object - required: - - filtered - properties: - filtered: - type: boolean - description: A value indicating whether any of the detailed blocklists resulted in a filtering action. - details: - type: array - items: - type: object - properties: - filtered: - type: boolean - description: A value indicating whether the blocklist produced a filtering action. - id: - type: string - description: The ID of the custom blocklist evaluated. - required: - - filtered - - id - description: The pairs of individual blocklist IDs and whether they resulted in a filtering action. - description: A collection of true/false filtering results for configured custom blocklists. - AzureContentFilterCompletionTextSpan: - type: object - required: - - completion_start_offset - - completion_end_offset - properties: - completion_start_offset: - type: integer - format: int32 - description: Offset of the UTF32 code point which begins the span. - completion_end_offset: - type: integer - format: int32 - description: Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. - description: A representation of a span of completion text as used by Azure OpenAI content filter results. - AzureContentFilterCompletionTextSpanDetectionResult: - type: object - required: - - filtered - - detected - - details - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - details: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan' - description: Detailed information about the detected completion text spans. - AzureContentFilterCustomTopicIdResult: - type: object - required: - - id - - detected - properties: - id: - type: string - description: The ID of the custom topic associated with the detected status. - detected: - type: boolean - description: Whether the associated custom topic resulted in the content being detected. - description: |- - A content filter result item that associates an existing custom topic ID with a value indicating whether or not - the corresponding topic resulted in content being detected. - AzureContentFilterCustomTopicResult: - type: object - required: - - filtered - properties: - filtered: - type: boolean - description: A value indicating whether any of the detailed topics resulted in a filtering action. - details: - type: array - items: - type: object - properties: - detected: - type: boolean - description: A value indicating whether the topic is detected. - id: - type: string - description: The ID of the custom topic evaluated. - required: - - detected - - id - description: The pairs of individual topic IDs and whether they are detected. - description: A collection of true/false filtering results for configured custom topics. - AzureContentFilterDetectionResult: - type: object - required: - - filtered - - detected - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - description: |- - A labeled content filter result item that indicates whether the content was detected and whether the content was - filtered. - AzureContentFilterForResponsesAPI: - type: object - required: - - blocked - - source_type - - content_filter_results - - content_filter_offsets - properties: - blocked: - type: boolean - description: Indicate if the response is blocked. - source_type: - type: string - description: The name of the source type of the message. - content_filter_results: - allOf: - - $ref: '#/components/schemas/AzureContentFilterResultsForResponsesAPI' - description: A content filter result for a single response item produced by a generative AI system. - content_filter_offsets: - $ref: '#/components/schemas/AzureContentFilterResultOffsets' - AzureContentFilterHarmExtensions: - type: object - properties: - pii_sub_categories: - type: array - items: - $ref: '#/components/schemas/AzurePiiSubCategory' - description: Configuration for PIIHarmSubCategory(s). - description: Extensions for harm categories, providing additional configuration options. - AzureContentFilterImagePromptResults: - type: object - required: - - jailbreak - properties: - profanity: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - content. - custom_blocklists: - allOf: - - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' - description: A collection of binary filtering outcomes for configured custom blocklists. - custom_topics: - allOf: - - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' - description: A collection of binary filtering outcomes for configured custom topics. - jailbreak: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - generation or violations of system-imposed restrictions. - allOf: - - $ref: '#/components/schemas/AzureContentFilterImageResponseResults' - description: A content filter result for an image generation operation's input request content. - AzureContentFilterImageResponseResults: - type: object - properties: - sexual: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - violence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - someone or something; describes weapons, guns and related entities, such as manufactures, associations, - legislation, and so on. - hate: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - language with reference to a person or identity group based on certain differentiating attributes of these groups - including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - religion, immigration status, ability status, personal appearance, and body size. - self_harm: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that describes language related to physical actions intended to purposely hurt, injure, - damage one's body or kill oneself. - description: A content filter result for an image generation operation's output response content. - AzureContentFilterPersonallyIdentifiableInformationResult: - type: object - properties: - redacted_text: - type: string - description: The redacted text with PII information removed or masked. - sub_categories: - type: array - items: - $ref: '#/components/schemas/AzurePiiSubCategoryResult' - description: Detailed results for individual PIIHarmSubCategory(s). - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A content filter detection result for Personally Identifiable Information that includes harm extensions. - AzureContentFilterResultForChoice: - type: object - properties: - sexual: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - hate: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - language with reference to a person or identity group based on certain differentiating attributes of these groups - including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - religion, immigration status, ability status, personal appearance, and body size. - violence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - someone or something; describes weapons, guns and related entities, such as manufactures, associations, - legislation, and so on. - self_harm: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that describes language related to physical actions intended to purposely hurt, injure, - damage one's body or kill oneself. - profanity: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - content. - custom_blocklists: - allOf: - - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' - description: A collection of binary filtering outcomes for configured custom blocklists. - custom_topics: - allOf: - - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' - description: A collection of binary filtering outcomes for configured custom topics. - error: - type: object - properties: - code: - type: integer - format: int32 - description: A distinct, machine-readable code associated with the error. - message: - type: string - description: A human-readable message associated with the error. - required: - - code - - message - description: If present, details about an error that prevented content filtering from completing its evaluation. - protected_material_text: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A detection result that describes a match against text protected under copyright or other status. - protected_material_code: - type: object - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - citation: - type: object - properties: - license: - type: string - description: The name or identifier of the license associated with the detection. - URL: - type: string - format: uri - description: The URL associated with the license. - description: If available, the citation details describing the associated license and its location. - required: - - filtered - - detected - description: A detection result that describes a match against licensed code or other protected source material. - ungrounded_material: - $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult' - personally_identifiable_information: - allOf: - - $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult' - description: A detection result that describes matches against Personal Identifiable Information with configurable subcategories. - description: A content filter result for a single response item produced by a generative AI system. - AzureContentFilterResultForPrompt: - type: object - properties: - prompt_index: - type: integer - format: int32 - description: The index of the input prompt associated with the accompanying content filter result categories. - content_filter_results: - type: object - properties: - sexual: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - hate: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - language with reference to a person or identity group based on certain differentiating attributes of these groups - including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - religion, immigration status, ability status, personal appearance, and body size. - violence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - someone or something; describes weapons, guns and related entities, such as manufactures, associations, - legislation, and so on. - self_harm: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that describes language related to physical actions intended to purposely hurt, injure, - damage one's body or kill oneself. - profanity: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - content. - custom_blocklists: - allOf: - - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' - description: A collection of binary filtering outcomes for configured custom blocklists. - custom_topics: - allOf: - - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' - description: A collection of binary filtering outcomes for configured custom topics. - error: - type: object - properties: - code: - type: integer - format: int32 - description: A distinct, machine-readable code associated with the error. - message: - type: string - description: A human-readable message associated with the error. - required: - - code - - message - description: If present, details about an error that prevented content filtering from completing its evaluation. - jailbreak: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - generation or violations of system-imposed restrictions. - indirect_attack: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes attacks on systems powered by Generative AI models that can happen every time - an application processes information that wasn’t directly authored by either the developer of the application or - the user. - required: - - jailbreak - - indirect_attack - description: The content filter category details for the result. - description: A content filter result associated with a single input prompt item into a generative AI system. - AzureContentFilterResultOffsets: - type: object - required: - - start_offset - - end_offset - - check_offset - properties: - start_offset: - type: integer - format: int32 - end_offset: - type: integer - format: int32 - check_offset: - type: integer - format: int32 - AzureContentFilterResultsForResponsesAPI: - type: object - required: - - jailbreak - - task_adherence - properties: - sexual: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - hate: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - language with reference to a person or identity group based on certain differentiating attributes of these groups - including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - religion, immigration status, ability status, personal appearance, and body size. - violence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - someone or something; describes weapons, guns and related entities, such as manufactures, associations, - legislation, and so on. - self_harm: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that describes language related to physical actions intended to purposely hurt, injure, - damage one's body or kill oneself. - profanity: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - content. - custom_blocklists: - allOf: - - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' - description: A collection of binary filtering outcomes for configured custom blocklists. - custom_topics: - allOf: - - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' - description: A collection of binary filtering outcomes for configured custom topics. - error: - type: object - properties: - code: - type: integer - format: int32 - description: A distinct, machine-readable code associated with the error. - message: - type: string - description: A human-readable message associated with the error. - required: - - code - - message - description: If present, details about an error that prevented content filtering from completing its evaluation. - jailbreak: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - generation or violations of system-imposed restrictions. - task_adherence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A detection result that indicates if the execution flow still sticks the plan. - protected_material_text: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A detection result that describes a match against text protected under copyright or other status. - protected_material_code: - type: object - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - citation: - type: object - properties: - license: - type: string - description: The name or identifier of the license associated with the detection. - URL: - type: string - format: uri - description: The URL associated with the license. - description: If available, the citation details describing the associated license and its location. - required: - - filtered - - detected - description: A detection result that describes a match against licensed code or other protected source material. - ungrounded_material: - $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult' - personally_identifiable_information: - allOf: - - $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult' - description: A detection result that describes matches against Personal Identifiable Information with configurable subcategories. - indirect_attack: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes attacks on systems powered by Generative AI models that can happen every time - an application processes information that wasn’t directly authored by either the developer of the application or - the user. - AzureContentFilterSeverityResult: - type: object - required: - - filtered - - severity - properties: - filtered: - type: boolean - description: Whether the content severity resulted in a content filtering action. - severity: - type: string - enum: - - safe - - low - - medium - - high - description: The labeled severity of the content. - description: |- - A labeled content filter result item that indicates whether the content was filtered and what the qualitative - severity level of the content was, as evaluated against content filter configuration for the category. - AzureFileExpiryAnchor: - type: string - enum: - - created_at - AzureFineTuneReinforcementMethod: - type: object - required: - - grader - properties: - grader: - anyOf: - - $ref: '#/components/schemas/OpenAI.GraderStringCheck' - - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.GraderScoreModel' - - $ref: '#/components/schemas/OpenAI.GraderMulti' - - $ref: '#/components/schemas/GraderEndpoint' - response_format: - allOf: - - $ref: '#/components/schemas/ResponseFormatJSONSchemaRequest' - description: Response format to be used while sampling during RFT training - hyperparameters: - $ref: '#/components/schemas/OpenAI.FineTuneReinforcementHyperparameters' - AzurePiiSubCategory: - type: object - required: - - sub_category - - detect - - redact - - filter - properties: - sub_category: - type: string - description: The PIIHarmSubCategory being configured. - detect: - type: boolean - description: Whether detection is enabled for this subcategory. - redact: - type: boolean - description: Whether content containing this subcategory should be redacted. - filter: - type: boolean - description: Whether content containing this subcategory should be blocked. - description: Configuration for individual PIIHarmSubCategory(s) within the harm extensions framework. - AzurePiiSubCategoryResult: - type: object - required: - - sub_category - - filtered - - detected - - redacted - properties: - sub_category: - type: string - description: The PIIHarmSubCategory that was evaluated. - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action for this subcategory. - detected: - type: boolean - description: Whether the labeled content subcategory was detected in the content. - redacted: - type: boolean - description: Whether the content was redacted for this subcategory. - description: Result details for individual PIIHarmSubCategory(s). - AzureResponsesSamplingParams: - type: object - properties: - max_tokens: - type: integer - format: int32 - description: The maximum number of tokens in the generated output. - allOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParams' - description: Sampling parameters for controlling the behavior of responses. - AzureUserSecurityContext: - type: object - properties: - application_name: - type: string - description: The name of the application. Sensitive personal information should not be included in this field. - end_user_id: - type: string - description: This identifier is the Microsoft Entra ID (formerly Azure Active Directory) user object ID used to authenticate end-users within the generative AI application. Sensitive personal information should not be included in this field. - end_user_tenant_id: - type: string - description: The Microsoft 365 tenant ID the end user belongs to. It's required when the generative AI application is multitenant. - source_ip: - type: string - description: Captures the original client's IP address. - description: User security context contains several parameters that describe the application itself, and the end user that interacts with the application. These fields assist your security operations teams to investigate and mitigate security incidents by providing a comprehensive approach to protecting your AI applications. [Learn more](https://aka.ms/TP4AI/Documentation/EndUserContext) about protecting AI applications using Microsoft Defender for Cloud. - CopiedAccountDetails: - type: object - required: - - destinationResourceId - - region - - status - properties: - destinationResourceId: - type: string - description: The ID of the destination resource where the model was copied to. - region: - type: string - description: The region where the model was copied to. - status: - type: string - enum: - - Completed - - Failed - - InProgress - description: The status of the copy operation. - CopyModelRequest: - type: object - required: - - destinationResourceId - - region - properties: - destinationResourceId: - type: string - description: The ID of the destination Resource to copy. - region: - type: string - description: The region to copy the model to. - CopyModelResponse: - type: object - required: - - checkpointedModelName - - fineTuningJobId - - copiedAccountDetails - properties: - checkpointedModelName: - type: string - description: The ID of the copied model. - fineTuningJobId: - type: string - description: The ID of the fine-tuning job that the checkpoint was copied from. - copiedAccountDetails: - type: array - items: - $ref: '#/components/schemas/CopiedAccountDetails' - description: The ID of the destination resource id where it was copied - CreateVideoBody: - type: object - required: - - model - - prompt - properties: - model: - type: string - description: The name of the deployment to use for this request. - prompt: - type: string - minLength: 1 - description: Text prompt that describes the video to generate. - seconds: - allOf: - - $ref: '#/components/schemas/VideoSeconds' - description: Clip duration in seconds. Defaults to 4 seconds. - default: '4' - size: - allOf: - - $ref: '#/components/schemas/VideoSize' - description: Output resolution formatted as width x height. Defaults to 720x1280. - default: 720x1280 - CreateVideoBodyWithInputReference: - type: object - required: - - model - - prompt - - input_reference - properties: - model: - type: object - description: The name of the deployment to use for this request. - prompt: - type: object - description: Text prompt that describes the video to generate. - seconds: - type: object - description: Clip duration in seconds. Defaults to 4 seconds. - size: - type: object - description: Output resolution formatted as width x height. Defaults to 720x1280. - input_reference: - type: object - description: Optional image reference that guides generation. - x-oaiTypeLabel: file - description: The properties of a video generation job request with media files. - CreateVideoRemixBody: - type: object - required: - - prompt - properties: - prompt: - type: string - minLength: 1 - description: Updated text prompt that directs the remix generation. - description: Parameters for remixing an existing generated video. - DeletedVideoResource: - type: object - required: - - object - - deleted - - id - properties: - object: - type: string - description: The object type that signals the deletion response. - default: video.deleted - deleted: - type: boolean - description: Indicates that the video resource was deleted. - default: true - id: - type: string - description: Identifier of the deleted video. - description: Confirmation payload returned after deleting a video. - Error: - type: object - required: - - code - - message - properties: - code: - type: string - message: - type: string - EvalGraderEndpoint: - type: object - required: - - type - - name - - url - properties: - type: - type: string - enum: - - endpoint - default: endpoint - name: - type: string - description: The name of the grader - url: - type: string - pattern: ^https:// - description: The HTTPS URL of the endpoint to call for grading - headers: - anyOf: - - type: object - unevaluatedProperties: - type: string - - type: 'null' - description: Optional HTTP headers to include in requests to the endpoint - rate_limit: - anyOf: - - type: integer - format: int32 - - type: 'null' - description: |- - Optional rate limit for requests per second to the endpoint - Must be a positive integer - pass_threshold: - anyOf: - - type: number - format: decimal - - type: 'null' - description: |- - Optional threshold score above which the grade is considered passing - If not specified, all scores are considered valid - GraderEndpoint: - type: object - required: - - type - - name - - url - properties: - type: - type: string - enum: - - endpoint - default: endpoint - name: - type: string - description: The name of the grader - url: - type: string - pattern: ^https:// - description: The HTTPS URL of the endpoint to call for grading - headers: - anyOf: - - type: object - unevaluatedProperties: - type: string - - type: 'null' - description: Optional HTTP headers to include in requests to the endpoint - rate_limit: - anyOf: - - type: integer - format: int32 - - type: 'null' - description: |- - Optional rate limit for requests per second to the endpoint - Must be a positive integer - pass_threshold: - anyOf: - - type: number - format: decimal - - type: 'null' - description: |- - Optional threshold score above which the grade is considered passing - If not specified, all scores are considered valid - description: Endpoint grader configuration for external HTTP endpoint evaluation - OpenAI.Annotation: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.AnnotationType' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAI.FileCitationBody' - url_citation: '#/components/schemas/OpenAI.UrlCitationBody' - container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody' - file_path: '#/components/schemas/OpenAI.FilePath' - description: An annotation that applies to a span of output text. - OpenAI.AnnotationType: - anyOf: - - type: string - - type: string - enum: - - file_citation - - url_citation - - container_file_citation - - file_path - OpenAI.ApplyPatchCallOutputStatus: - type: string - enum: - - completed - - failed - OpenAI.ApplyPatchCallStatus: - type: string - enum: - - in_progress - - completed - OpenAI.ApplyPatchCreateFileOperation: - type: object - required: - - type - - path - - diff - properties: - type: - type: string - enum: - - create_file - description: Create a new file with the provided diff. - x-stainless-const: true - default: create_file - path: - type: string - description: Path of the file to create. - diff: - type: string - description: Diff to apply. - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' - description: Instruction describing how to create a file via the apply_patch tool. - title: Apply patch create file operation - OpenAI.ApplyPatchDeleteFileOperation: - type: object - required: - - type - - path - properties: - type: - type: string - enum: - - delete_file - description: Delete the specified file. - x-stainless-const: true - default: delete_file - path: - type: string - description: Path of the file to delete. - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' - description: Instruction describing how to delete a file via the apply_patch tool. - title: Apply patch delete file operation - OpenAI.ApplyPatchFileOperation: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperationType' - discriminator: - propertyName: type - mapping: - create_file: '#/components/schemas/OpenAI.ApplyPatchCreateFileOperation' - delete_file: '#/components/schemas/OpenAI.ApplyPatchDeleteFileOperation' - update_file: '#/components/schemas/OpenAI.ApplyPatchUpdateFileOperation' - description: One of the create_file, delete_file, or update_file operations applied via apply_patch. - title: Apply patch operation - OpenAI.ApplyPatchFileOperationType: - anyOf: - - type: string - - type: string - enum: - - create_file - - delete_file - - update_file - OpenAI.ApplyPatchToolParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - apply_patch - description: The type of the tool. Always `apply_patch`. - x-stainless-const: true - default: apply_patch - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: Allows the assistant to create, delete, or update files using unified diffs. - title: Apply patch tool - OpenAI.ApplyPatchUpdateFileOperation: - type: object - required: - - type - - path - - diff - properties: - type: - type: string - enum: - - update_file - description: Update an existing file with the provided diff. - x-stainless-const: true - default: update_file - path: - type: string - description: Path of the file to update. - diff: - type: string - description: Diff to apply. - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' - description: Instruction describing how to update a file via the apply_patch tool. - title: Apply patch update file operation - OpenAI.ApproximateLocation: - type: object - required: - - type - properties: - type: - type: string - enum: - - approximate - description: The type of location approximation. Always `approximate`. - x-stainless-const: true - default: approximate - country: - anyOf: - - type: string - - type: 'null' - region: - anyOf: - - type: string - - type: 'null' - city: - anyOf: - - type: string - - type: 'null' - timezone: - anyOf: - - type: string - - type: 'null' - OpenAI.AssistantTool: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.AssistantToolType' - discriminator: - propertyName: type - mapping: - code_interpreter: '#/components/schemas/OpenAI.AssistantToolsCode' - file_search: '#/components/schemas/OpenAI.AssistantToolsFileSearch' - function: '#/components/schemas/OpenAI.AssistantToolsFunction' - OpenAI.AssistantToolType: - anyOf: - - type: string - - type: string - enum: - - code_interpreter - - file_search - - function - OpenAI.AssistantToolsCode: - type: object - required: - - type - properties: - type: - type: string - enum: - - code_interpreter - description: 'The type of tool being defined: `code_interpreter`' - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.AssistantTool' - title: Code interpreter tool - OpenAI.AssistantToolsFileSearch: - type: object - required: - - type - properties: - type: - type: string - enum: - - file_search - description: 'The type of tool being defined: `file_search`' - x-stainless-const: true - file_search: - allOf: - - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchFileSearch' - description: Overrides for the file search tool. - allOf: - - $ref: '#/components/schemas/OpenAI.AssistantTool' - title: FileSearch tool - OpenAI.AssistantToolsFileSearchFileSearch: - type: object - properties: - max_num_results: - type: integer - minimum: 1 - maximum: 50 - ranking_options: - $ref: '#/components/schemas/OpenAI.FileSearchRankingOptions' - OpenAI.AssistantToolsFileSearchTypeOnly: - type: object - required: - - type - properties: - type: - type: string - enum: - - file_search - description: 'The type of tool being defined: `file_search`' - x-stainless-const: true - title: AssistantToolsFileSearchTypeOnly - OpenAI.AssistantToolsFunction: - type: object - required: - - type - - function - properties: - type: - type: string - enum: - - function - description: 'The type of tool being defined: `function`' - x-stainless-const: true - function: - $ref: '#/components/schemas/OpenAI.FunctionObject' - allOf: - - $ref: '#/components/schemas/OpenAI.AssistantTool' - title: Function tool - OpenAI.AssistantsApiResponseFormatOption: - anyOf: - - type: string - enum: - - auto - - $ref: '#/components/schemas/OpenAI.ResponseFormatText' - - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject' - - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema' - description: |- - Specifies the format that the model must output. Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema. Learn more in the [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON. - *Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. - OpenAI.AssistantsApiToolChoiceOption: - anyOf: - - type: string - enum: - - none - - auto - - required - - $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoice' - description: |- - Controls which (if any) tool is called by the model. - `none` means the model will not call any tools and instead generates a message. - `auto` is the default value and means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools before responding to the user. - Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - OpenAI.AssistantsNamedToolChoice: - type: object - required: - - type - properties: - type: - type: string - enum: - - function - - code_interpreter - - file_search - description: The type of the tool. If type is `function`, the function name must be set - function: - $ref: '#/components/schemas/OpenAI.AssistantsNamedToolChoiceFunction' - description: Specifies a tool the model should use. Use to force the model to call a specific tool. - OpenAI.AssistantsNamedToolChoiceFunction: - type: object - required: - - name - properties: - name: - type: string - OpenAI.AudioTranscription: - type: object - properties: - model: - type: string - description: The model to use for transcription. Current options are `whisper-1`, `gpt-4o-mini-transcribe`, `gpt-4o-mini-transcribe-2025-12-15`, `gpt-4o-transcribe`, and `gpt-4o-transcribe-diarize`. Use `gpt-4o-transcribe-diarize` when you need diarization with speaker labels. - language: - type: string - description: |- - The language of the input audio. Supplying the input language in - [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format - will improve accuracy and latency. - prompt: - type: string - description: |- - An optional text to guide the model's style or continue a previous audio - segment. - For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). - For `gpt-4o-transcribe` models (excluding `gpt-4o-transcribe-diarize`), the prompt is a free text string, for example "expect words related to technology". - OpenAI.AutoChunkingStrategyRequestParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - auto - description: Always `auto`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' - description: The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. - title: Auto Chunking Strategy - OpenAI.Batch: - type: object - required: - - id - - object - - endpoint - - completion_window - - status - - created_at - properties: - id: - type: string - object: - type: string - enum: - - batch - description: The object type, which is always `batch`. - x-stainless-const: true - endpoint: - type: string - description: The OpenAI API endpoint used by the batch. - model: - type: string - description: |- - Model ID used to process the batch, like `gpt-5-2025-08-07`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model - guide](https://platform.openai.com/docs/models) to browse and compare available models. - errors: - $ref: '#/components/schemas/OpenAI.BatchErrors' - completion_window: - type: string - description: The time frame within which the batch should be processed. - status: - type: string - enum: - - validating - - failed - - in_progress - - finalizing - - completed - - expired - - cancelling - - cancelled - description: The current status of the batch. - output_file_id: - type: string - description: The ID of the file containing the outputs of successfully executed requests. - error_file_id: - type: string - description: The ID of the file containing the outputs of requests with errors. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was created. - in_progress_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started processing. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch will expire. - finalizing_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started finalizing. - completed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was completed. - failed_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch failed. - expired_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch expired. - cancelling_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch started cancelling. - cancelled_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the batch was cancelled. - request_counts: - $ref: '#/components/schemas/OpenAI.BatchRequestCounts' - usage: - allOf: - - $ref: '#/components/schemas/OpenAI.BatchUsage' - description: |- - Represents token usage details including input tokens, output tokens, a - breakdown of output tokens, and the total tokens used. Only populated on - batches created after September 7, 2025. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - input_file_id: - anyOf: - - type: string - - type: 'null' - x-oaiMeta: - name: The batch object - example: | - { - "id": "batch_abc123", - "object": "batch", - "endpoint": "/v1/completions", - "model": "gpt-5-2025-08-07", - "errors": null, - "input_file_id": "file-abc123", - "completion_window": "24h", - "status": "completed", - "output_file_id": "file-cvaTdG", - "error_file_id": "file-HOWS94", - "created_at": 1711471533, - "in_progress_at": 1711471538, - "expires_at": 1711557933, - "finalizing_at": 1711493133, - "completed_at": 1711493163, - "failed_at": null, - "expired_at": null, - "cancelling_at": null, - "cancelled_at": null, - "request_counts": { - "total": 100, - "completed": 95, - "failed": 5 - }, - "usage": { - "input_tokens": 1500, - "input_tokens_details": { - "cached_tokens": 1024 - }, - "output_tokens": 500, - "output_tokens_details": { - "reasoning_tokens": 300 - }, - "total_tokens": 2000 - }, - "metadata": { - "customer_id": "user_123456789", - "batch_description": "Nightly eval job", - } - } - OpenAI.BatchError: - type: object - properties: - code: - type: string - description: An error code identifying the error type. - message: - type: string - description: A human-readable message providing more details about the error. - param: - anyOf: - - type: string - - type: 'null' - line: - anyOf: - - type: integer - - type: 'null' - OpenAI.BatchErrors: - type: object - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.BatchError' - OpenAI.BatchRequestCounts: - type: object - required: - - total - - completed - - failed - properties: - total: - type: integer - description: Total number of requests in the batch. - completed: - type: integer - description: Number of requests that have been completed successfully. - failed: - type: integer - description: Number of requests that have failed. - description: The request counts for different statuses within the batch. - OpenAI.BatchUsage: - type: object - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - properties: - input_tokens: - type: integer - input_tokens_details: - $ref: '#/components/schemas/OpenAI.BatchUsageInputTokensDetails' - output_tokens: - type: integer - output_tokens_details: - $ref: '#/components/schemas/OpenAI.BatchUsageOutputTokensDetails' - total_tokens: - type: integer - OpenAI.BatchUsageInputTokensDetails: - type: object - required: - - cached_tokens - properties: - cached_tokens: - type: integer - OpenAI.BatchUsageOutputTokensDetails: - type: object - required: - - reasoning_tokens - properties: - reasoning_tokens: - type: integer - OpenAI.ChatCompletionAllowedTools: - type: object - required: - - mode - - tools - properties: - mode: - type: string - enum: - - auto - - required - description: |- - Constrains the tools available to the model to a pre-defined set. - `auto` allows the model to pick from among the allowed tools and generate a - message. - `required` requires the model to call one or more of the allowed tools. - tools: - type: array - items: - type: object - unevaluatedProperties: {} - description: |- - A list of tool definitions that the model should be allowed to call. - For the Chat Completions API, the list of tool definitions might look like: - ```json - [ - { "type": "function", "function": { "name": "get_weather" } }, - { "type": "function", "function": { "name": "get_time" } } - ] - ``` - description: Constrains the tools available to the model to a pre-defined set. - title: Allowed tools - OpenAI.ChatCompletionAllowedToolsChoice: - type: object - required: - - type - - allowed_tools - properties: - type: - type: string - enum: - - allowed_tools - description: Allowed tool configuration type. Always `allowed_tools`. - x-stainless-const: true - allowed_tools: - $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedTools' - description: Constrains the tools available to the model to a pre-defined set. - title: Allowed tools - OpenAI.ChatCompletionFunctionCallOption: - type: object - required: - - name - properties: - name: - type: string - description: The name of the function to call. - description: 'Specifying a particular function via `{"name": "my_function"}` forces the model to call that function.' - x-stainless-variantName: function_call_option - OpenAI.ChatCompletionFunctions: - type: object - required: - - name - properties: - description: - type: string - description: A description of what the function does, used by the model to choose when and how to call the function. - name: - type: string - description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - parameters: - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionParameters' - description: |- - The parameters the functions accepts, described as a JSON Schema object. - See the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) - for documentation about the format. - - Omitting `parameters` defines a function with an empty parameter list. - deprecated: true - OpenAI.ChatCompletionMessageCustomToolCall: - type: object - required: - - id - - type - - custom - properties: - id: - type: string - description: The ID of the tool call. - type: - type: string - enum: - - custom - description: The type of the tool. Always `custom`. - x-stainless-const: true - custom: - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCallCustom' - description: The custom tool that the model called. - description: A call to a custom tool created by the model. - title: Custom tool call - OpenAI.ChatCompletionMessageCustomToolCallCustom: - type: object - required: - - name - - input - properties: - name: - type: string - input: - type: string - OpenAI.ChatCompletionMessageToolCall: - type: object - required: - - id - - type - - function - properties: - id: - type: string - description: The ID of the tool call. - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - x-stainless-const: true - function: - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallFunction' - description: The function that the model called. - description: A call to a function tool created by the model. - title: Function tool call - OpenAI.ChatCompletionMessageToolCallChunk: - type: object - required: - - index - properties: - index: - type: integer - id: - type: string - description: The ID of the tool call. - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - x-stainless-const: true - function: - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunkFunction' - OpenAI.ChatCompletionMessageToolCallChunkFunction: - type: object - properties: - name: - type: string - arguments: - type: string - OpenAI.ChatCompletionMessageToolCallFunction: - type: object - required: - - name - - arguments - properties: - name: - type: string - arguments: - type: string - OpenAI.ChatCompletionMessageToolCalls: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall' - - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall' - description: The tool calls generated by the model, such as function calls. - OpenAI.ChatCompletionMessageToolCallsItem: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCall' - - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageCustomToolCall' - description: The tool calls generated by the model, such as function calls. - OpenAI.ChatCompletionNamedToolChoice: - type: object - required: - - type - - function - properties: - type: - type: string - enum: - - function - description: For function calling, the type is always `function`. - x-stainless-const: true - function: - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceFunction' - description: Specifies a tool the model should use. Use to force the model to call a specific function. - title: Function tool choice - OpenAI.ChatCompletionNamedToolChoiceCustom: - type: object - required: - - type - - custom - properties: - type: - type: string - enum: - - custom - description: For custom tool calling, the type is always `custom`. - x-stainless-const: true - custom: - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustomCustom' - description: Specifies a tool the model should use. Use to force the model to call a specific custom tool. - title: Custom tool choice - OpenAI.ChatCompletionNamedToolChoiceCustomCustom: - type: object - required: - - name - properties: - name: - type: string - OpenAI.ChatCompletionNamedToolChoiceFunction: - type: object - required: - - name - properties: - name: - type: string - OpenAI.ChatCompletionRequestAssistantMessage: - type: object - required: - - role - properties: - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart' - - type: 'null' - refusal: - anyOf: - - type: string - - type: 'null' - role: - type: string - enum: - - assistant - description: The role of the messages author, in this case `assistant`. - x-stainless-const: true - name: - type: string - description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. - audio: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageAudio' - - type: 'null' - description: Data about a previous audio response from the model. - tool_calls: - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCalls' - function_call: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageFunctionCall' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - description: Messages sent by the model in response to user messages. - title: Assistant message - x-stainless-soft-required: - - content - OpenAI.ChatCompletionRequestAssistantMessageAudio: - type: object - required: - - id - properties: - id: - type: string - OpenAI.ChatCompletionRequestAssistantMessageContentPart: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartType' - discriminator: - propertyName: type - mapping: - refusal: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartRefusal' - text: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText' - OpenAI.ChatCompletionRequestAssistantMessageContentPartChatCompletionRequestMessageContentPartText: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - description: The type of the content part. - x-stainless-const: true - text: - type: string - description: The text content. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart' - description: Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation). - title: Text content part - x-stainless-naming: - go: - variant_constructor: TextContentPart - OpenAI.ChatCompletionRequestAssistantMessageContentPartType: - anyOf: - - type: string - - type: string - enum: - - text - - refusal - OpenAI.ChatCompletionRequestAssistantMessageFunctionCall: - type: object - required: - - arguments - - name - properties: - arguments: - type: string - name: - type: string - OpenAI.ChatCompletionRequestDeveloperMessage: - type: object - required: - - content - - role - properties: - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' - description: The contents of the developer message. - role: - type: string - enum: - - developer - description: The role of the messages author, in this case `developer`. - x-stainless-const: true - name: - type: string - description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - description: |- - Developer-provided instructions that the model should follow, regardless of - messages sent by the user. With o1 models and newer, `developer` messages - replace the previous `system` messages. - title: Developer message - x-stainless-naming: - go: - variant_constructor: DeveloperMessage - OpenAI.ChatCompletionRequestFunctionMessage: - type: object - required: - - role - - content - - name - properties: - role: - type: string - enum: - - function - description: The role of the messages author, in this case `function`. - x-stainless-const: true - content: - anyOf: - - type: string - - type: 'null' - name: - type: string - description: The name of the function to call. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - title: Function message - deprecated: true - OpenAI.ChatCompletionRequestMessage: - type: object - required: - - role - properties: - role: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageType' - discriminator: - propertyName: role - mapping: - assistant: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessage' - developer: '#/components/schemas/OpenAI.ChatCompletionRequestDeveloperMessage' - function: '#/components/schemas/OpenAI.ChatCompletionRequestFunctionMessage' - system: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessage' - user: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessage' - tool: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessage' - OpenAI.ChatCompletionRequestMessageContentPartAudio: - type: object - required: - - type - - input_audio - properties: - type: - type: string - enum: - - input_audio - description: The type of the content part. Always `input_audio`. - x-stainless-const: true - input_audio: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio' - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' - description: '' - title: Audio content part - x-stainless-naming: - go: - variant_constructor: InputAudioContentPart - OpenAI.ChatCompletionRequestMessageContentPartAudioInputAudio: - type: object - required: - - data - - format - properties: - data: - type: string - format: - type: string - enum: - - wav - - mp3 - OpenAI.ChatCompletionRequestMessageContentPartFile: - type: object - required: - - type - - file - properties: - type: - type: string - enum: - - file - description: The type of the content part. Always `file`. - x-stainless-const: true - file: - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFileFile' - x-stainless-naming: - java: - type_name: FileObject - kotlin: - type_name: FileObject - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' - description: Learn about [file inputs](https://platform.openai.com/docs/guides/text) for text generation. - title: File content part - x-stainless-naming: - go: - variant_constructor: FileContentPart - OpenAI.ChatCompletionRequestMessageContentPartFileFile: - type: object - properties: - filename: - type: string - file_data: - type: string - file_id: - type: string - OpenAI.ChatCompletionRequestMessageContentPartImage: - type: object - required: - - type - - image_url - properties: - type: - type: string - enum: - - image_url - description: The type of the content part. - x-stainless-const: true - image_url: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl' - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' - description: '' - title: Image content part - x-stainless-naming: - go: - variant_constructor: ImageContentPart - OpenAI.ChatCompletionRequestMessageContentPartImageImageUrl: - type: object - required: - - url - properties: - url: - type: string - format: uri - detail: - type: string - enum: - - auto - - low - - high - default: auto - OpenAI.ChatCompletionRequestMessageContentPartRefusal: - type: object - required: - - type - - refusal - properties: - type: - type: string - enum: - - refusal - description: The type of the content part. - x-stainless-const: true - refusal: - type: string - description: The refusal message generated by the model. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestAssistantMessageContentPart' - title: Refusal content part - OpenAI.ChatCompletionRequestMessageContentPartText: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - description: The type of the content part. - x-stainless-const: true - text: - type: string - description: The text content. - description: '' - title: Text content part - x-stainless-naming: - go: - variant_constructor: TextContentPart - OpenAI.ChatCompletionRequestMessageType: - anyOf: - - type: string - - type: string - enum: - - developer - - system - - user - - assistant - - tool - - function - OpenAI.ChatCompletionRequestSystemMessage: - type: object - required: - - content - - role - properties: - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestSystemMessageContentPart' - description: The contents of the system message. - role: - type: string - enum: - - system - description: The role of the messages author, in this case `system`. - x-stainless-const: true - name: - type: string - description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - description: |- - Developer-provided instructions that the model should follow, regardless of - messages sent by the user. With o1 models and newer, use `developer` messages - for this purpose instead. - title: System message - x-stainless-naming: - go: - variant_constructor: SystemMessage - OpenAI.ChatCompletionRequestSystemMessageContentPart: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' - OpenAI.ChatCompletionRequestToolMessage: - type: object - required: - - role - - content - - tool_call_id - properties: - role: - type: string - enum: - - tool - description: The role of the messages author, in this case `tool`. - x-stainless-const: true - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestToolMessageContentPart' - description: The contents of the tool message. - tool_call_id: - type: string - description: Tool call that this message is responding to. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - title: Tool message - x-stainless-naming: - go: - variant_constructor: ToolMessage - OpenAI.ChatCompletionRequestToolMessageContentPart: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' - OpenAI.ChatCompletionRequestUserMessage: - type: object - required: - - content - - role - properties: - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' - description: The contents of the user message. - role: - type: string - enum: - - user - description: The role of the messages author, in this case `user`. - x-stainless-const: true - name: - type: string - description: An optional name for the participant. Provides the model information to differentiate between participants of the same role. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessage' - description: |- - Messages sent by an end user, containing prompts or additional context - information. - title: User message - x-stainless-naming: - go: - variant_constructor: UserMessage - OpenAI.ChatCompletionRequestUserMessageContentPart: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartType' - discriminator: - propertyName: type - mapping: - image_url: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartImage' - input_audio: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartAudio' - file: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartFile' - text: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText' - OpenAI.ChatCompletionRequestUserMessageContentPartChatCompletionRequestMessageContentPartText: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - description: The type of the content part. - x-stainless-const: true - text: - type: string - description: The text content. - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestUserMessageContentPart' - description: Learn about [text inputs](https://platform.openai.com/docs/guides/text-generation). - title: Text content part - x-stainless-naming: - go: - variant_constructor: TextContentPart - OpenAI.ChatCompletionRequestUserMessageContentPartType: - anyOf: - - type: string - - type: string - enum: - - text - - image_url - - input_audio - - file - OpenAI.ChatCompletionResponseMessage: - type: object - required: - - content - - refusal - - role - properties: - content: - anyOf: - - type: string - - type: 'null' - refusal: - anyOf: - - type: string - - type: 'null' - tool_calls: - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallsItem' - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotations' - description: |- - Annotations for the message, when applicable, as when using the - [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). - role: - type: string - enum: - - assistant - description: The role of the author of this message. - x-stainless-const: true - function_call: - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageFunctionCall' - description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. - deprecated: true - audio: - anyOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAudio' - - type: 'null' - reasoning_content: - type: string - description: An Azure-specific extension property containing generated reasoning content from supported models. - description: |- - If the audio output modality is requested, this object contains data - about the audio response from the model. - OpenAI.ChatCompletionResponseMessageAnnotations: - type: object - required: - - type - - url_citation - properties: - type: - type: string - enum: - - url_citation - x-stainless-const: true - url_citation: - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation' - OpenAI.ChatCompletionResponseMessageAnnotationsUrlCitation: - type: object - required: - - end_index - - start_index - - url - - title - properties: - end_index: - type: integer - start_index: - type: integer - url: - type: string - title: - type: string - OpenAI.ChatCompletionResponseMessageAudio: - type: object - required: - - id - - expires_at - - data - - transcript - properties: - id: - type: string - expires_at: - type: integer - format: unixtime - data: - type: string - transcript: - type: string - OpenAI.ChatCompletionResponseMessageFunctionCall: - type: object - required: - - arguments - - name - properties: - arguments: - type: string - name: - type: string - OpenAI.ChatCompletionStreamOptions: - type: object - properties: - include_usage: - type: boolean - description: |- - If set, an additional chunk will be streamed before the `data: [DONE]` - message. The `usage` field on this chunk shows the token usage statistics - for the entire request, and the `choices` field will always be an empty - array. - All other chunks will also include a `usage` field, but with a null - value. **NOTE:** If the stream is interrupted, you may not receive the - final usage chunk which contains the total token usage for the request. - include_obfuscation: - type: boolean - description: |- - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. - description: 'Options for streaming response. Only set this when you set `stream: true`.' - OpenAI.ChatCompletionStreamResponseDelta: - type: object - properties: - content: - anyOf: - - type: string - - type: 'null' - function_call: - allOf: - - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamResponseDeltaFunctionCall' - description: Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. - deprecated: true - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionMessageToolCallChunk' - role: - type: string - enum: - - developer - - system - - user - - assistant - - tool - description: The role of the author of this message. - refusal: - anyOf: - - type: string - - type: 'null' - reasoning_content: - type: string - description: An Azure-specific extension property containing generated reasoning content from supported models. - description: A chat completion delta generated by streamed model responses. - OpenAI.ChatCompletionStreamResponseDeltaFunctionCall: - type: object - properties: - arguments: - type: string - name: - type: string - OpenAI.ChatCompletionTokenLogprob: - type: object - required: - - token - - logprob - - bytes - - top_logprobs - properties: - token: - type: string - description: The token. - logprob: - type: number - description: The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely. - bytes: - anyOf: - - type: array - items: - type: integer - - type: 'null' - top_logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprobTopLogprobs' - description: List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. - OpenAI.ChatCompletionTokenLogprobTopLogprobs: - type: object - required: - - token - - logprob - - bytes - properties: - token: - type: string - logprob: - type: number - bytes: - anyOf: - - type: array - items: - type: integer - - type: 'null' - OpenAI.ChatCompletionTool: - type: object - required: - - type - - function - properties: - type: - type: string - enum: - - function - description: The type of the tool. Currently, only `function` is supported. - x-stainless-const: true - function: - $ref: '#/components/schemas/OpenAI.FunctionObject' - description: A function tool that can be used to generate a response. - title: Function tool - OpenAI.ChatCompletionToolChoiceOption: - anyOf: - - type: string - enum: - - none - - auto - - required - - $ref: '#/components/schemas/OpenAI.ChatCompletionAllowedToolsChoice' - - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoice' - - $ref: '#/components/schemas/OpenAI.ChatCompletionNamedToolChoiceCustom' - description: |- - Controls which (if any) tool is called by the model. - `none` means the model will not call any tool and instead generates a message. - `auto` means the model can pick between generating a message or calling one or more tools. - `required` means the model must call one or more tools. - Specifying a particular tool via `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. - `none` is the default when no tools are present. `auto` is the default if tools are present. - x-stainless-go-variant-constructor: - naming: tool_choice_option_{variant} - OpenAI.ChunkingStrategyRequestParam: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParamType' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/OpenAI.AutoChunkingStrategyRequestParam' - static: '#/components/schemas/OpenAI.StaticChunkingStrategyRequestParam' - description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty. - OpenAI.ChunkingStrategyRequestParamType: - anyOf: - - type: string - - type: string - enum: - - auto - - static - OpenAI.ChunkingStrategyResponse: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponseType' - discriminator: - propertyName: type - mapping: - static: '#/components/schemas/OpenAI.StaticChunkingStrategyResponseParam' - other: '#/components/schemas/OpenAI.OtherChunkingStrategyResponseParam' - description: The strategy used to chunk the file. - OpenAI.ChunkingStrategyResponseType: - anyOf: - - type: string - - type: string - enum: - - static - - other - OpenAI.ClickButtonType: - type: string - enum: - - left - - right - - wheel - - back - - forward - OpenAI.ClickParam: - type: object - required: - - type - - button - - x - - 'y' - properties: - type: - type: string - enum: - - click - description: Specifies the event type. For a click action, this property is always `click`. - x-stainless-const: true - default: click - button: - allOf: - - $ref: '#/components/schemas/OpenAI.ClickButtonType' - description: Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - x: - type: integer - description: The x-coordinate where the click occurred. - 'y': - type: integer - description: The y-coordinate where the click occurred. - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A click action. - title: Click - OpenAI.CodeInterpreterContainerAuto: - type: object - required: - - type - properties: - type: - type: string - enum: - - auto - description: Always `auto`. - x-stainless-const: true - default: auto - file_ids: - type: array - items: - type: string - maxItems: 50 - description: An optional list of uploaded files to make available to your code. - memory_limit: - anyOf: - - $ref: '#/components/schemas/OpenAI.ContainerMemoryLimit' - - type: 'null' - description: Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. - title: CodeInterpreterToolAuto - x-stainless-naming: - go: - type_name: ToolCodeInterpreterContainerCodeInterpreterContainerAuto - OpenAI.CodeInterpreterOutputImage: - type: object - required: - - type - - url - properties: - type: - type: string - enum: - - image - description: The type of the output. Always `image`. - x-stainless-const: true - default: image - url: - type: string - format: uri - description: The URL of the image output from the code interpreter. - description: The image output from the code interpreter. - title: Code interpreter output image - OpenAI.CodeInterpreterOutputLogs: - type: object - required: - - type - - logs - properties: - type: - type: string - enum: - - logs - description: The type of the output. Always `logs`. - x-stainless-const: true - default: logs - logs: - type: string - description: The logs output from the code interpreter. - description: The logs output from the code interpreter. - title: Code interpreter output logs - OpenAI.CodeInterpreterTool: - type: object - required: - - type - - container - properties: - type: - type: string - enum: - - code_interpreter - description: The type of the code interpreter tool. Always `code_interpreter`. - x-stainless-const: true - container: - anyOf: - - type: string - - $ref: '#/components/schemas/OpenAI.CodeInterpreterContainerAuto' - description: |- - The code interpreter container. Can be a container ID or an object that - specifies uploaded file IDs to make available to your code, along with an - optional `memory_limit` setting. - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A tool that runs Python code to help generate a response to a prompt. - title: Code interpreter - OpenAI.ComparisonFilter: - type: object - required: - - type - - key - - value - properties: - type: - type: string - enum: - - eq - - ne - - gt - - gte - - lt - - lte - description: |- - Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. - - `eq`: equals - - `ne`: not equal - - `gt`: greater than - - `gte`: greater than or equal - - `lt`: less than - - `lte`: less than or equal - - `in`: in - - `nin`: not in - default: eq - key: - type: string - description: The key to compare against the value. - value: - anyOf: - - type: string - - type: number - - type: boolean - - type: array - items: - $ref: '#/components/schemas/OpenAI.ComparisonFilterValueItems' - description: The value to compare against the attribute key; supports string, number, or boolean types. - description: A filter used to compare a specified attribute key to a given value using a defined comparison operation. - title: Comparison Filter - x-oaiMeta: - name: ComparisonFilter - OpenAI.ComparisonFilterValueItems: - anyOf: - - type: string - - type: number - OpenAI.CompletionUsage: - type: object - required: - - completion_tokens - - prompt_tokens - - total_tokens - properties: - completion_tokens: - type: integer - description: Number of tokens in the generated completion. - prompt_tokens: - type: integer - description: Number of tokens in the prompt. - total_tokens: - type: integer - description: Total number of tokens used in the request (prompt + completion). - completion_tokens_details: - allOf: - - $ref: '#/components/schemas/OpenAI.CompletionUsageCompletionTokensDetails' - description: Breakdown of tokens used in a completion. - prompt_tokens_details: - allOf: - - $ref: '#/components/schemas/OpenAI.CompletionUsagePromptTokensDetails' - description: Breakdown of tokens used in the prompt. - description: Usage statistics for the completion request. - OpenAI.CompletionUsageCompletionTokensDetails: - type: object - properties: - accepted_prediction_tokens: - type: integer - audio_tokens: - type: integer - reasoning_tokens: - type: integer - rejected_prediction_tokens: - type: integer - OpenAI.CompletionUsagePromptTokensDetails: - type: object - properties: - audio_tokens: - type: integer - cached_tokens: - type: integer - OpenAI.CompoundFilter: - type: object - required: - - type - - filters - properties: - type: - type: string - enum: - - and - - or - description: 'Type of operation: `and` or `or`.' - filters: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.ComparisonFilter' - description: Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - description: Combine multiple filters using `and` or `or`. - title: Compound Filter - x-oaiMeta: - name: CompoundFilter - OpenAI.ComputerAction: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ComputerActionType' - discriminator: - propertyName: type - mapping: - click: '#/components/schemas/OpenAI.ClickParam' - double_click: '#/components/schemas/OpenAI.DoubleClickAction' - drag: '#/components/schemas/OpenAI.Drag' - keypress: '#/components/schemas/OpenAI.KeyPressAction' - move: '#/components/schemas/OpenAI.Move' - screenshot: '#/components/schemas/OpenAI.Screenshot' - scroll: '#/components/schemas/OpenAI.Scroll' - type: '#/components/schemas/OpenAI.Type' - wait: '#/components/schemas/OpenAI.Wait' - OpenAI.ComputerActionType: - anyOf: - - type: string - - type: string - enum: - - click - - double_click - - drag - - keypress - - move - - screenshot - - scroll - - type - - wait - OpenAI.ComputerCallSafetyCheckParam: - type: object - required: - - id - properties: - id: - type: string - description: The ID of the pending safety check. - code: - anyOf: - - type: string - - type: 'null' - message: - anyOf: - - type: string - - type: 'null' - description: A pending safety check for the computer call. - OpenAI.ComputerEnvironment: - type: string - enum: - - windows - - mac - - linux - - ubuntu - - browser - OpenAI.ComputerScreenshotContent: - type: object - required: - - type - - image_url - - file_id - properties: - type: - type: string - enum: - - computer_screenshot - description: Specifies the event type. For a computer screenshot, this property is always set to `computer_screenshot`. - x-stainless-const: true - default: computer_screenshot - image_url: - anyOf: - - type: string - format: uri - - type: 'null' - file_id: - anyOf: - - type: string - - type: 'null' - description: A screenshot of a computer. - title: Computer screenshot - OpenAI.ComputerScreenshotImage: - type: object - required: - - type - properties: - type: - type: string - enum: - - computer_screenshot - description: |- - Specifies the event type. For a computer screenshot, this property is - always set to `computer_screenshot`. - x-stainless-const: true - default: computer_screenshot - image_url: - type: string - format: uri - description: The URL of the screenshot image. - file_id: - type: string - description: The identifier of an uploaded file that contains the screenshot. - description: A computer screenshot image used with the computer use tool. - OpenAI.ComputerUsePreviewTool: - type: object - required: - - type - - environment - - display_width - - display_height - properties: - type: - type: string - enum: - - computer_use_preview - description: The type of the computer use tool. Always `computer_use_preview`. - x-stainless-const: true - default: computer_use_preview - environment: - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerEnvironment' - description: The type of computer environment to control. - display_width: - type: integer - description: The width of the computer display. - display_height: - type: integer - description: The height of the computer display. - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - title: Computer use preview - OpenAI.ContainerFileCitationBody: - type: object - required: - - type - - container_id - - file_id - - start_index - - end_index - - filename - properties: - type: - type: string - enum: - - container_file_citation - description: The type of the container file citation. Always `container_file_citation`. - x-stainless-const: true - default: container_file_citation - container_id: - type: string - description: The ID of the container file. - file_id: - type: string - description: The ID of the file. - start_index: - type: integer - description: The index of the first character of the container file citation in the message. - end_index: - type: integer - description: The index of the last character of the container file citation in the message. - filename: - type: string - description: The filename of the container file cited. - allOf: - - $ref: '#/components/schemas/OpenAI.Annotation' - description: A citation for a container file used to generate a model response. - title: Container file citation - OpenAI.ContainerFileListResource: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - enum: - - list - description: The type of object returned, must be 'list'. - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.ContainerFileResource' - description: A list of container files. - first_id: - type: string - description: The ID of the first file in the list. - last_id: - type: string - description: The ID of the last file in the list. - has_more: - type: boolean - description: Whether there are more files available. - OpenAI.ContainerFileResource: - type: object - required: - - id - - object - - container_id - - created_at - - bytes - - path - - source - properties: - id: - type: string - description: Unique identifier for the file. - object: - type: string - enum: - - container.file - description: The type of this object (`container.file`). - container_id: - type: string - description: The container this file belongs to. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) when the file was created. - bytes: - type: integer - description: Size of the file in bytes. - path: - type: string - description: Path of the file in the container. - source: - type: string - description: Source of the file (e.g., `user`, `assistant`). - title: The container file object - x-oaiMeta: - name: The container file object - example: | - { - "id": "cfile_682e0e8a43c88191a7978f477a09bdf5", - "object": "container.file", - "created_at": 1747848842, - "bytes": 880, - "container_id": "cntr_682e0e7318108198aa783fd921ff305e08e78805b9fdbb04", - "path": "/mnt/data/88e12fa445d32636f190a0b33daed6cb-tsconfig.json", - "source": "user" - } - OpenAI.ContainerListResource: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - enum: - - list - description: The type of object returned, must be 'list'. - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.ContainerResource' - description: A list of containers. - first_id: - type: string - description: The ID of the first container in the list. - last_id: - type: string - description: The ID of the last container in the list. - has_more: - type: boolean - description: Whether there are more containers available. - OpenAI.ContainerMemoryLimit: - type: string - enum: - - 1g - - 4g - - 16g - - 64g - OpenAI.ContainerResource: - type: object - required: - - id - - object - - name - - created_at - - status - properties: - id: - type: string - description: Unique identifier for the container. - object: - type: string - description: The type of this object. - name: - type: string - description: Name of the container. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) when the container was created. - status: - type: string - description: Status of the container (e.g., active, deleted). - last_active_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) when the container was last active. - expires_after: - allOf: - - $ref: '#/components/schemas/OpenAI.ContainerResourceExpiresAfter' - description: |- - The container will expire after this time period. - The anchor is the reference point for the expiration. - The minutes is the number of minutes after the anchor before the container expires. - memory_limit: - type: string - enum: - - 1g - - 4g - - 16g - - 64g - description: The memory limit configured for the container. - title: The container object - x-oaiMeta: - name: The container object - example: | - { - "id": "cntr_682dfebaacac8198bbfe9c2474fb6f4a085685cbe3cb5863", - "object": "container", - "created_at": 1747844794, - "status": "running", - "expires_after": { - "anchor": "last_active_at", - "minutes": 20 - }, - "last_active_at": 1747844794, - "memory_limit": "1g", - "name": "My Container" - } - OpenAI.ContainerResourceExpiresAfter: - type: object - properties: - anchor: - type: string - enum: - - last_active_at - minutes: - type: integer - OpenAI.ConversationItem: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ConversationItemType' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAI.ConversationItemMessage' - function_call: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallResource' - function_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionToolCallOutputResource' - file_search_call: '#/components/schemas/OpenAI.ConversationItemFileSearchToolCall' - web_search_call: '#/components/schemas/OpenAI.ConversationItemWebSearchToolCall' - image_generation_call: '#/components/schemas/OpenAI.ConversationItemImageGenToolCall' - computer_call: '#/components/schemas/OpenAI.ConversationItemComputerToolCall' - computer_call_output: '#/components/schemas/OpenAI.ConversationItemComputerToolCallOutputResource' - reasoning: '#/components/schemas/OpenAI.ConversationItemReasoningItem' - code_interpreter_call: '#/components/schemas/OpenAI.ConversationItemCodeInterpreterToolCall' - local_shell_call: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCall' - local_shell_call_output: '#/components/schemas/OpenAI.ConversationItemLocalShellToolCallOutput' - shell_call: '#/components/schemas/OpenAI.ConversationItemFunctionShellCall' - shell_call_output: '#/components/schemas/OpenAI.ConversationItemFunctionShellCallOutput' - apply_patch_call: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCall' - apply_patch_call_output: '#/components/schemas/OpenAI.ConversationItemApplyPatchToolCallOutput' - mcp_list_tools: '#/components/schemas/OpenAI.ConversationItemMcpListTools' - mcp_approval_request: '#/components/schemas/OpenAI.ConversationItemMcpApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAI.ConversationItemMcpApprovalResponseResource' - mcp_call: '#/components/schemas/OpenAI.ConversationItemMcpToolCall' - custom_tool_call: '#/components/schemas/OpenAI.ConversationItemCustomToolCall' - custom_tool_call_output: '#/components/schemas/OpenAI.ConversationItemCustomToolCallOutput' - description: A single item within a conversation. The set of possible types are the same as the `output` type of a [Response object](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output). - title: Conversation item - OpenAI.ConversationItemApplyPatchToolCall: - type: object - required: - - type - - id - - call_id - - status - - operation - properties: - type: - type: string - enum: - - apply_patch_call - description: The type of the item. Always `apply_patch_call`. - x-stainless-const: true - default: apply_patch_call - id: - type: string - description: The unique ID of the apply patch tool call. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the apply patch tool call generated by the model. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus' - description: The status of the apply patch tool call. One of `in_progress` or `completed`. - operation: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' - description: One of the create_file, delete_file, or update_file operations applied via apply_patch. - created_by: - type: string - description: The ID of the entity that created this tool call. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A tool call that applies file diffs by creating, deleting, or updating files. - title: Apply patch tool call - OpenAI.ConversationItemApplyPatchToolCallOutput: - type: object - required: - - type - - id - - call_id - - status - properties: - type: - type: string - enum: - - apply_patch_call_output - description: The type of the item. Always `apply_patch_call_output`. - x-stainless-const: true - default: apply_patch_call_output - id: - type: string - description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the apply patch tool call generated by the model. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus' - description: The status of the apply patch tool call output. One of `completed` or `failed`. - output: - anyOf: - - type: string - - type: 'null' - created_by: - type: string - description: The ID of the entity that created this tool call output. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: The output emitted by an apply patch tool call. - title: Apply patch tool call output - OpenAI.ConversationItemCodeInterpreterToolCall: - type: object - required: - - type - - id - - status - - container_id - - code - - outputs - properties: - type: - type: string - enum: - - code_interpreter_call - description: The type of the code interpreter tool call. Always `code_interpreter_call`. - x-stainless-const: true - default: code_interpreter_call - id: - type: string - description: The unique ID of the code interpreter tool call. - status: - type: string - enum: - - in_progress - - completed - - incomplete - - interpreting - - failed - description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - container_id: - type: string - description: The ID of the container used to run the code. - code: - anyOf: - - type: string - - type: 'null' - outputs: - anyOf: - - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs' - - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A tool call to run code. - title: Code interpreter tool call - OpenAI.ConversationItemComputerToolCall: - type: object - required: - - type - - id - - call_id - - action - - pending_safety_checks - - status - properties: - type: - type: string - enum: - - computer_call - description: The type of the computer call. Always `computer_call`. - default: computer_call - id: - type: string - description: The unique ID of the computer call. - call_id: - type: string - description: An identifier used when responding to the tool call with output. - action: - $ref: '#/components/schemas/OpenAI.ComputerAction' - pending_safety_checks: - type: array - items: - $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' - description: The pending safety checks for the computer call. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: |- - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - title: Computer tool call - OpenAI.ConversationItemComputerToolCallOutputResource: - type: object - required: - - type - - call_id - - output - properties: - type: - type: string - enum: - - computer_call_output - description: The type of the computer tool call output. Always `computer_call_output`. - x-stainless-const: true - default: computer_call_output - id: - type: string - description: The ID of the computer tool call output. - call_id: - type: string - description: The ID of the computer tool call that produced the output. - acknowledged_safety_checks: - type: array - items: - $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' - description: |- - The safety checks reported by the API that have been acknowledged by the - developer. - output: - $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage' - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - OpenAI.ConversationItemCustomToolCall: - type: object - required: - - type - - call_id - - name - - input - properties: - type: - type: string - enum: - - custom_tool_call - description: The type of the custom tool call. Always `custom_tool_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the custom tool call in the OpenAI platform. - call_id: - type: string - description: An identifier used to map this custom tool call to a tool call output. - name: - type: string - description: The name of the custom tool being called. - input: - type: string - description: The input for the custom tool call generated by the model. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A call to a custom tool created by the model. - title: Custom tool call - OpenAI.ConversationItemCustomToolCallOutput: - type: object - required: - - type - - call_id - - output - properties: - type: - type: string - enum: - - custom_tool_call_output - description: The type of the custom tool call output. Always `custom_tool_call_output`. - x-stainless-const: true - id: - type: string - description: The unique ID of the custom tool call output in the OpenAI platform. - call_id: - type: string - description: The call ID, used to map this custom tool call output to a custom tool call. - output: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' - description: |- - The output from the custom tool call generated by your code. - Can be a string or an list of output content. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: The output of a custom tool call from your code, being sent back to the model. - title: Custom tool call output - OpenAI.ConversationItemFileSearchToolCall: - type: object - required: - - id - - type - - status - - queries - properties: - id: - type: string - description: The unique ID of the file search tool call. - type: - type: string - enum: - - file_search_call - description: The type of the file search tool call. Always `file_search_call`. - x-stainless-const: true - status: - type: string - enum: - - in_progress - - searching - - completed - - incomplete - - failed - description: |- - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, - queries: - type: array - items: - type: string - description: The queries used to search for files. - results: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: |- - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - title: File search tool call - OpenAI.ConversationItemFunctionShellCall: - type: object - required: - - type - - id - - call_id - - action - - status - properties: - type: - type: string - enum: - - shell_call - description: The type of the item. Always `shell_call`. - x-stainless-const: true - default: shell_call - id: - type: string - description: The unique ID of the shell tool call. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the shell tool call generated by the model. - action: - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionShellAction' - description: The shell commands and limits that describe how to run the tool call. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.LocalShellCallStatus' - description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - created_by: - type: string - description: The ID of the entity that created this tool call. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A tool call that executes one or more shell commands in a managed environment. - title: Shell tool call - OpenAI.ConversationItemFunctionShellCallOutput: - type: object - required: - - type - - id - - call_id - - output - - max_output_length - properties: - type: - type: string - enum: - - shell_call_output - description: The type of the shell call output. Always `shell_call_output`. - x-stainless-const: true - default: shell_call_output - id: - type: string - description: The unique ID of the shell call output. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the shell tool call generated by the model. - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent' - description: An array of shell call output contents - max_output_length: - anyOf: - - type: integer - - type: 'null' - created_by: - type: string - description: The identifier of the actor that created the item. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: The output of a shell tool call that was emitted. - title: Shell call output - OpenAI.ConversationItemFunctionToolCallOutputResource: - type: object - required: - - type - - call_id - - output - properties: - id: - type: string - description: |- - The unique ID of the function tool call output. Populated when this item - is returned via API. - type: - type: string - enum: - - function_call_output - description: The type of the function tool call output. Always `function_call_output`. - x-stainless-const: true - call_id: - type: string - description: The unique ID of the function tool call generated by the model. - output: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' - description: |- - The output from the function call generated by your code. - Can be a string or an list of output content. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - OpenAI.ConversationItemFunctionToolCallResource: - type: object - required: - - type - - call_id - - name - - arguments - properties: - id: - type: string - description: The unique ID of the function tool call. - type: - type: string - enum: - - function_call - description: The type of the function tool call. Always `function_call`. - x-stainless-const: true - call_id: - type: string - description: The unique ID of the function tool call generated by the model. - name: - type: string - description: The name of the function to run. - arguments: - type: string - description: A JSON string of the arguments to pass to the function. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - OpenAI.ConversationItemImageGenToolCall: - type: object - required: - - type - - id - - status - - result - properties: - type: - type: string - enum: - - image_generation_call - description: The type of the image generation call. Always `image_generation_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the image generation call. - status: - type: string - enum: - - in_progress - - completed - - generating - - failed - description: The status of the image generation call. - result: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: An image generation request made by the model. - title: Image generation call - OpenAI.ConversationItemList: - type: object - required: - - object - - data - - has_more - - first_id - - last_id - properties: - object: - type: string - enum: - - list - description: The type of object returned, must be `list`. - x-stainless-const: true - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A list of conversation items. - has_more: - type: boolean - description: Whether there are more items available. - first_id: - type: string - description: The ID of the first item in the list. - last_id: - type: string - description: The ID of the last item in the list. - description: A list of Conversation items. - title: The conversation item list - x-oaiMeta: - name: The item list - group: conversations - OpenAI.ConversationItemLocalShellToolCall: - type: object - required: - - type - - id - - call_id - - action - - status - properties: - type: - type: string - enum: - - local_shell_call - description: The type of the local shell call. Always `local_shell_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the local shell call. - call_id: - type: string - description: The unique ID of the local shell tool call generated by the model. - action: - $ref: '#/components/schemas/OpenAI.LocalShellExecAction' - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: The status of the local shell call. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A tool call to run a command on the local shell. - title: Local shell call - OpenAI.ConversationItemLocalShellToolCallOutput: - type: object - required: - - type - - id - - output - properties: - type: - type: string - enum: - - local_shell_call_output - description: The type of the local shell tool call output. Always `local_shell_call_output`. - x-stainless-const: true - id: - type: string - description: The unique ID of the local shell tool call generated by the model. - output: - type: string - description: A JSON string of the output of the local shell tool call. - status: - anyOf: - - type: string - enum: - - in_progress - - completed - - incomplete - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: The output of a local shell tool call. - title: Local shell call output - OpenAI.ConversationItemMcpApprovalRequest: - type: object - required: - - type - - id - - server_label - - name - - arguments - properties: - type: - type: string - enum: - - mcp_approval_request - description: The type of the item. Always `mcp_approval_request`. - x-stainless-const: true - id: - type: string - description: The unique ID of the approval request. - server_label: - type: string - description: The label of the MCP server making the request. - name: - type: string - description: The name of the tool to run. - arguments: - type: string - description: A JSON string of arguments for the tool. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A request for human approval of a tool invocation. - title: MCP approval request - OpenAI.ConversationItemMcpApprovalResponseResource: - type: object - required: - - type - - id - - approval_request_id - - approve - properties: - type: - type: string - enum: - - mcp_approval_response - description: The type of the item. Always `mcp_approval_response`. - x-stainless-const: true - id: - type: string - description: The unique ID of the approval response - approval_request_id: - type: string - description: The ID of the approval request being answered. - approve: - type: boolean - description: Whether the request was approved. - reason: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A response to an MCP approval request. - title: MCP approval response - OpenAI.ConversationItemMcpListTools: - type: object - required: - - type - - id - - server_label - - tools - properties: - type: - type: string - enum: - - mcp_list_tools - description: The type of the item. Always `mcp_list_tools`. - x-stainless-const: true - id: - type: string - description: The unique ID of the list. - server_label: - type: string - description: The label of the MCP server. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.MCPListToolsTool' - description: The tools available on the server. - error: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A list of tools available on an MCP server. - title: MCP list tools - OpenAI.ConversationItemMcpToolCall: - type: object - required: - - type - - id - - server_label - - name - - arguments - properties: - type: - type: string - enum: - - mcp_call - description: The type of the item. Always `mcp_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the tool call. - server_label: - type: string - description: The label of the MCP server running the tool. - name: - type: string - description: The name of the tool that was run. - arguments: - type: string - description: A JSON string of the arguments passed to the tool. - output: - anyOf: - - type: string - - type: 'null' - error: - anyOf: - - type: string - - type: 'null' - status: - allOf: - - $ref: '#/components/schemas/OpenAI.MCPToolCallStatus' - description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - approval_request_id: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: An invocation of a tool on an MCP server. - title: MCP tool call - OpenAI.ConversationItemMessage: - type: object - required: - - type - - id - - status - - role - - content - properties: - type: - type: string - enum: - - message - description: The type of the message. Always set to `message`. - x-stainless-const: true - default: message - id: - type: string - description: The unique ID of the message. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.MessageStatus' - description: The status of item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API. - role: - allOf: - - $ref: '#/components/schemas/OpenAI.MessageRole' - description: The role of the message. One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`, `developer`, or `tool`. - content: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.InputTextContent' - - $ref: '#/components/schemas/OpenAI.OutputTextContent' - - $ref: '#/components/schemas/OpenAI.TextContent' - - $ref: '#/components/schemas/OpenAI.SummaryTextContent' - - $ref: '#/components/schemas/OpenAI.ReasoningTextContent' - - $ref: '#/components/schemas/OpenAI.RefusalContent' - - $ref: '#/components/schemas/OpenAI.InputImageContent' - - $ref: '#/components/schemas/OpenAI.ComputerScreenshotContent' - - $ref: '#/components/schemas/OpenAI.InputFileContent' - description: The content of the message - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: A message to or from the model. - title: Message - OpenAI.ConversationItemReasoningItem: - type: object - required: - - type - - id - - summary - properties: - type: - type: string - enum: - - reasoning - description: The type of the object. Always `reasoning`. - x-stainless-const: true - id: - type: string - description: The unique identifier of the reasoning content. - encrypted_content: - anyOf: - - type: string - - type: 'null' - summary: - type: array - items: - $ref: '#/components/schemas/OpenAI.Summary' - description: Reasoning summary content. - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.ReasoningTextContent' - description: Reasoning text content. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: |- - A description of the chain of thought used by a reasoning model while generating - a response. Be sure to include these items in your `input` to the Responses API - for subsequent turns of a conversation if you are manually - [managing context](https://platform.openai.com/docs/guides/conversation-state). - title: Reasoning - OpenAI.ConversationItemType: - anyOf: - - type: string - - type: string - enum: - - message - - function_call - - function_call_output - - file_search_call - - web_search_call - - image_generation_call - - computer_call - - computer_call_output - - reasoning - - code_interpreter_call - - local_shell_call - - local_shell_call_output - - shell_call - - shell_call_output - - apply_patch_call - - apply_patch_call_output - - mcp_list_tools - - mcp_approval_request - - mcp_approval_response - - mcp_call - - custom_tool_call - - custom_tool_call_output - OpenAI.ConversationItemWebSearchToolCall: - type: object - required: - - id - - type - - status - - action - properties: - id: - type: string - description: The unique ID of the web search tool call. - type: - type: string - enum: - - web_search_call - description: The type of the web search tool call. Always `web_search_call`. - x-stainless-const: true - status: - type: string - enum: - - in_progress - - searching - - completed - - failed - description: The status of the web search tool call. - action: - anyOf: - - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch' - - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage' - - $ref: '#/components/schemas/OpenAI.WebSearchActionFind' - description: |- - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). - allOf: - - $ref: '#/components/schemas/OpenAI.ConversationItem' - description: |- - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - title: Web search tool call - OpenAI.ConversationParam: - anyOf: - - type: string - - $ref: '#/components/schemas/OpenAI.ConversationParam-2' - description: |- - The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. - Input items and output items from this response are automatically added to this conversation after this response completes. - OpenAI.ConversationParam-2: - type: object - required: - - id - properties: - id: - type: string - description: The unique ID of the conversation. - description: The conversation that this response belongs to. - title: Conversation object - OpenAI.ConversationReference: - type: object - required: - - id - properties: - id: - type: string - description: The unique ID of the conversation that this response was associated with. - description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - title: Conversation - OpenAI.ConversationResource: - type: object - required: - - id - - object - - metadata - - created_at - properties: - id: - type: string - description: The unique ID of the conversation. - object: - type: string - enum: - - conversation - description: The object type, which is always `conversation`. - x-stainless-const: true - default: conversation - metadata: - description: |- - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. - Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. - created_at: - type: integer - format: unixtime - description: The time at which the conversation was created, measured in seconds since the Unix epoch. - OpenAI.CreateChatCompletionRequestAudio: - type: object - required: - - voice - - format - properties: - voice: - $ref: '#/components/schemas/OpenAI.VoiceIdsShared' - format: - type: string - enum: - - wav - - aac - - mp3 - - flac - - opus - - pcm16 - OpenAI.CreateChatCompletionRequestResponseFormat: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatType' - discriminator: - propertyName: type - mapping: - json_schema: '#/components/schemas/OpenAI.ResponseFormatJsonSchema' - text: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText' - json_object: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject' - description: |- - An object specifying the format that the model must output. - Setting to `{ "type": "json_schema", "json_schema": {...} }` enables - Structured Outputs which ensures the model will match your supplied JSON - schema. Learn more in the [Structured Outputs - guide](https://platform.openai.com/docs/guides/structured-outputs). - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. - OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatJsonObject: - type: object - required: - - type - properties: - type: - type: string - enum: - - json_object - description: The type of response format being defined. Always `json_object`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' - description: |- - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - title: JSON object - OpenAI.CreateChatCompletionRequestResponseFormatResponseFormatText: - type: object - required: - - type - properties: - type: - type: string - enum: - - text - description: The type of response format being defined. Always `text`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' - description: Default response format. Used to generate text responses. - title: Text - OpenAI.CreateChatCompletionRequestResponseFormatType: - anyOf: - - type: string - - type: string - enum: - - text - - json_schema - - json_object - OpenAI.CreateChatCompletionResponseChoices: - type: object - required: - - finish_reason - - index - - message - - logprobs - properties: - finish_reason: - type: string - enum: - - stop - - length - - tool_calls - - content_filter - - function_call - index: - type: integer - message: - $ref: '#/components/schemas/OpenAI.ChatCompletionResponseMessage' - logprobs: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionResponseChoicesLogprobs' - - type: 'null' - content_filter_results: - $ref: '#/components/schemas/AzureContentFilterResultForChoice' - OpenAI.CreateChatCompletionResponseChoicesLogprobs: - type: object - required: - - content - - refusal - properties: - content: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' - - type: 'null' - refusal: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' - - type: 'null' - OpenAI.CreateChatCompletionStreamResponseChoices: - type: object - required: - - delta - - finish_reason - - index - properties: - delta: - $ref: '#/components/schemas/OpenAI.ChatCompletionStreamResponseDelta' - logprobs: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs' - - type: 'null' - finish_reason: - anyOf: - - type: string - enum: - - stop - - length - - tool_calls - - content_filter - - function_call - - type: 'null' - index: - type: integer - OpenAI.CreateChatCompletionStreamResponseChoicesLogprobs: - type: object - required: - - content - - refusal - properties: - content: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' - - type: 'null' - refusal: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionTokenLogprob' - - type: 'null' - OpenAI.CreateCompletionResponseChoices: - type: object - required: - - finish_reason - - index - - logprobs - - text - properties: - finish_reason: - type: string - enum: - - stop - - length - - content_filter - index: - type: integer - format: int32 - logprobs: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateCompletionResponseChoicesLogprobs' - - type: 'null' - text: - type: string - content_filter_results: - $ref: '#/components/schemas/AzureContentFilterResultForChoice' - OpenAI.CreateCompletionResponseChoicesLogprobs: - type: object - properties: - text_offset: - type: array - items: - type: integer - format: int32 - token_logprobs: - type: array - items: - type: number - format: float - tokens: - type: array - items: - type: string - top_logprobs: - type: array - items: - type: object - unevaluatedProperties: - type: number - format: float - OpenAI.CreateContainerBody: - type: object - required: - - name - properties: - name: - type: string - description: Name of the container to create. - file_ids: - type: array - items: - type: string - description: IDs of files to copy to the container. - expires_after: - allOf: - - $ref: '#/components/schemas/OpenAI.CreateContainerBodyExpiresAfter' - description: Container expiration time in seconds relative to the 'anchor' time. - memory_limit: - type: string - enum: - - 1g - - 4g - - 16g - - 64g - description: Optional memory limit for the container. Defaults to "1g". - OpenAI.CreateContainerBodyExpiresAfter: - type: object - required: - - anchor - - minutes - properties: - anchor: - type: string - enum: - - last_active_at - minutes: - type: integer - OpenAI.CreateContainerFileBody: - type: object - properties: - file_id: - type: string - description: Name of the file to create. - file: - description: The File object (not file name) to be uploaded. - required: [] - OpenAI.CreateConversationBody: - type: object - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - items: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - OpenAI.CreateConversationItemsParametersBody: - type: object - required: - - items - properties: - items: - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - maxItems: 20 - OpenAI.CreateEmbeddingRequest: - type: object - required: - - input - - model - properties: - input: - anyOf: - - type: string - - type: array - items: - type: string - - type: array - items: - type: integer - - type: array - items: - type: array - items: - type: integer - description: Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request. - model: - type: string - description: ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - x-oaiTypeLabel: string - encoding_format: - type: string - enum: - - float - - base64 - description: The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). - default: float - dimensions: - type: integer - minimum: 1 - description: The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. - user: - type: string - description: A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). - OpenAI.CreateEmbeddingResponse: - type: object - required: - - data - - model - - object - - usage - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.Embedding' - description: The list of embeddings generated by the model. - model: - type: string - description: The name of the model used to generate the embedding. - object: - type: string - enum: - - list - description: The object type, which is always "list". - x-stainless-const: true - usage: - allOf: - - $ref: '#/components/schemas/OpenAI.CreateEmbeddingResponseUsage' - description: The usage information for the request. - OpenAI.CreateEmbeddingResponseUsage: - type: object - required: - - prompt_tokens - - total_tokens - properties: - prompt_tokens: - type: integer - total_tokens: - type: integer - OpenAI.CreateEvalCompletionsRunDataSource: - type: object - required: - - type - - source - properties: - type: - type: string - enum: - - completions - description: The type of run data source. Always `completions`. - default: completions - input_messages: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate' - - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference' - description: Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. - sampling_params: - $ref: '#/components/schemas/AzureCompletionsSamplingParams' - model: - type: string - description: The name of the model to use for generating completions (e.g. "o3-mini"). - source: - anyOf: - - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource' - - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource' - - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsSource' - description: Determines what populates the `item` namespace in this run's data source. - description: A CompletionsRunDataSource object describing a model sampling configuration. - title: CompletionsRunDataSource - x-oaiMeta: - name: The completions data source object used to configure an individual run - group: eval runs - example: | - { - "name": "gpt-4o-mini-2024-07-18", - "data_source": { - "type": "completions", - "input_messages": { - "type": "item_reference", - "item_reference": "item.input" - }, - "model": "gpt-4o-mini-2024-07-18", - "source": { - "type": "stored_completions", - "model": "gpt-4o-mini-2024-07-18" - } - } - } - OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesItemReference: - type: object - required: - - type - - item_reference - properties: - type: - type: string - enum: - - item_reference - item_reference: - type: string - OpenAI.CreateEvalCompletionsRunDataSourceInputMessagesTemplate: - type: object - required: - - type - - template - properties: - type: - type: string - enum: - - template - template: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.EasyInputMessage' - - $ref: '#/components/schemas/OpenAI.EvalItem' - OpenAI.CreateEvalCompletionsRunDataSourceSamplingParams: - type: object - properties: - reasoning_effort: - allOf: - - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - description: Controls the level of reasoning effort applied during generation. - temperature: - type: number - description: A higher temperature increases randomness in the outputs. - default: 1 - max_completion_tokens: - type: integer - top_p: - type: number - description: An alternative to temperature for nucleus sampling; 1.0 includes all tokens. - default: 1 - seed: - type: integer - description: A seed value initializes the randomness during sampling. - default: 42 - response_format: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseFormatText' - - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchema' - - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonObject' - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionTool' - OpenAI.CreateEvalCustomDataSourceConfig: - type: object - required: - - type - - item_schema - properties: - type: - type: string - enum: - - custom - description: The type of data source. Always `custom`. - x-stainless-const: true - default: custom - item_schema: - type: object - unevaluatedProperties: {} - description: The json schema for each row in the data source. - include_sample_schema: - type: boolean - description: Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) - description: |- - A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs. - This schema is used to define the shape of the data that will be: - - Used to define your testing criteria and - - What data is required when creating a run - title: CustomDataSourceConfig - x-oaiMeta: - name: The eval file data source config object - group: evals - example: | - { - "type": "custom", - "item_schema": { - "type": "object", - "properties": { - "name": {"type": "string"}, - "age": {"type": "integer"} - }, - "required": ["name", "age"] - }, - "include_sample_schema": true - } - OpenAI.CreateEvalItem: - type: object - required: - - role - - content - properties: - role: - type: string - description: The role of the message (e.g. "system", "assistant", "user"). - content: - type: string - description: The content of the message. - description: A chat message that makes up the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. - title: SimpleInputMessage - x-oaiMeta: - name: The chat message object used to configure an individual run - OpenAI.CreateEvalJsonlRunDataSource: - type: object - required: - - type - - source - properties: - type: - type: string - enum: - - jsonl - description: The type of data source. Always `jsonl`. - x-stainless-const: true - default: jsonl - source: - anyOf: - - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource' - - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource' - description: Determines what populates the `item` namespace in the data source. - description: A JsonlRunDataSource object with that specifies a JSONL file that matches the eval - title: JsonlRunDataSource - x-oaiMeta: - name: The file data source object for the eval run configuration - group: evals - example: | - { - "type": "jsonl", - "source": { - "type": "file_id", - "id": "file-9GYS6xbkWgWhmE7VoLUWFg" - } - } - OpenAI.CreateEvalLabelModelGrader: - type: object - required: - - type - - name - - model - - input - - labels - - passing_labels - properties: - type: - type: string - enum: - - label_model - description: The object type, which is always `label_model`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - model: - type: string - description: The model to use for the evaluation. Must support structured outputs. - input: - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateEvalItem' - description: A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. - labels: - type: array - items: - type: string - description: The labels to classify to each item in the evaluation. - passing_labels: - type: array - items: - type: string - description: The labels that indicate a passing result. Must be a subset of labels. - description: |- - A LabelModelGrader object which uses a model to assign labels to each item - in the evaluation. - title: LabelModelGrader - x-oaiMeta: - name: The eval label model grader object - group: evals - example: | - { - "type": "label_model", - "model": "gpt-4o-2024-08-06", - "input": [ - { - "role": "system", - "content": "Classify the sentiment of the following statement as one of 'positive', 'neutral', or 'negative'" - }, - { - "role": "user", - "content": "Statement: {{item.response}}" - } - ], - "passing_labels": ["positive"], - "labels": ["positive", "neutral", "negative"], - "name": "Sentiment label grader" - } - OpenAI.CreateEvalLogsDataSourceConfig: - type: object - required: - - type - properties: - type: - type: string - enum: - - logs - description: The type of data source. Always `logs`. - x-stainless-const: true - default: logs - metadata: - type: object - unevaluatedProperties: {} - description: Metadata filters for the logs data source. - description: |- - A data source config which specifies the metadata property of your logs query. - This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. - title: LogsDataSourceConfig - x-oaiMeta: - name: The logs data source object for evals - group: evals - example: | - { - "type": "logs", - "metadata": { - "use_case": "customer_support_agent" - } - } - OpenAI.CreateEvalResponsesRunDataSource: - type: object - required: - - type - - source - properties: - type: - type: string - enum: - - responses - description: The type of run data source. Always `responses`. - default: responses - input_messages: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate' - - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference' - description: Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. - sampling_params: - $ref: '#/components/schemas/AzureResponsesSamplingParams' - model: - type: string - description: The name of the model to use for generating completions (e.g. "o3-mini"). - source: - anyOf: - - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSource' - - $ref: '#/components/schemas/OpenAI.EvalJsonlFileIdSource' - - $ref: '#/components/schemas/OpenAI.EvalResponsesSource' - description: Determines what populates the `item` namespace in this run's data source. - description: A ResponsesRunDataSource object describing a model sampling configuration. - title: CreateEvalResponsesRunDataSource - x-oaiMeta: - name: The completions data source object used to configure an individual run - group: eval runs - example: | - { - "name": "gpt-4o-mini-2024-07-18", - "data_source": { - "type": "responses", - "input_messages": { - "type": "item_reference", - "item_reference": "item.input" - }, - "model": "gpt-4o-mini-2024-07-18", - "source": { - "type": "responses", - "model": "gpt-4o-mini-2024-07-18" - } - } - } - OpenAI.CreateEvalResponsesRunDataSourceInputMessagesItemReference: - type: object - required: - - type - - item_reference - properties: - type: - type: string - enum: - - item_reference - item_reference: - type: string - OpenAI.CreateEvalResponsesRunDataSourceInputMessagesTemplate: - type: object - required: - - type - - template - properties: - type: - type: string - enum: - - template - template: - type: array - items: - anyOf: - - type: object - properties: - role: - type: string - content: - type: string - required: - - role - - content - - $ref: '#/components/schemas/OpenAI.EvalItem' - OpenAI.CreateEvalResponsesRunDataSourceSamplingParams: - type: object - properties: - reasoning_effort: - allOf: - - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - description: Controls the level of reasoning effort applied during generation. - temperature: - type: number - description: A higher temperature increases randomness in the outputs. - default: 1 - top_p: - type: number - description: An alternative to temperature for nucleus sampling; 1.0 includes all tokens. - default: 1 - seed: - type: integer - description: A seed value initializes the randomness during sampling. - default: 42 - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.Tool' - text: - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText' - OpenAI.CreateEvalResponsesRunDataSourceSamplingParamsText: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' - OpenAI.CreateEvalRunRequest: - type: object - required: - - data_source - properties: - name: - type: string - description: The name of the run. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - data_source: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource' - - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource' - - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource' - description: Details about the run's data source. - title: CreateEvalRunRequest - OpenAI.CreateEvalStoredCompletionsDataSourceConfig: - type: object - required: - - type - properties: - type: - type: string - enum: - - stored_completions - description: The type of data source. Always `stored_completions`. - x-stainless-const: true - default: stored_completions - metadata: - type: object - unevaluatedProperties: {} - description: Metadata filters for the stored completions data source. - description: Deprecated in favor of LogsDataSourceConfig. - title: StoredCompletionsDataSourceConfig - deprecated: true - x-oaiMeta: - name: The stored completions data source object for evals - group: evals - example: | - { - "type": "stored_completions", - "metadata": { - "use_case": "customer_support_agent" - } - } - OpenAI.CreateFileRequest: - type: object - properties: - file: - description: The File object (not file name) to be uploaded. - x-oaiMeta: - exampleFilePath: fine-tune.jsonl - expires_after: - type: object - properties: - seconds: - type: integer - format: int32 - anchor: - $ref: '#/components/schemas/AzureFileExpiryAnchor' - required: - - seconds - - anchor - purpose: - type: string - enum: - - assistants - - batch - - fine-tune - - evals - description: 'The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `evals`: Used for eval data sets' - required: - - file - - expires_after - - purpose - OpenAI.CreateFineTuningCheckpointPermissionRequest: - type: object - required: - - project_ids - properties: - project_ids: - type: array - items: - type: string - description: The project identifiers to grant access to. - OpenAI.CreateFineTuningJobRequest: - type: object - required: - - model - - training_file - properties: - model: - anyOf: - - type: string - - type: string - enum: - - babbage-002 - - davinci-002 - - gpt-3.5-turbo - - gpt-4o-mini - description: |- - The name of the model to fine-tune. You can select one of the - [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). - x-oaiTypeLabel: string - training_file: - type: string - description: |- - The ID of an uploaded file that contains training data. - See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. - Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. - The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format. - See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. - hyperparameters: - allOf: - - $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestHyperparameters' - description: |- - The hyperparameters used for the fine-tuning job. - This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter. - deprecated: true - suffix: - anyOf: - - type: string - - type: 'null' - minLength: 1 - maxLength: 64 - description: |- - A string of up to 64 characters that will be added to your fine-tuned model name. - For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. - validation_file: - anyOf: - - type: string - - type: 'null' - description: |- - The ID of an uploaded file that contains validation data. - If you provide this file, the data is used to generate validation - metrics periodically during fine-tuning. These metrics can be viewed in - the fine-tuning results file. - The same data should not be present in both train and validation files. - Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. - See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. - integrations: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrations' - - type: 'null' - description: A list of integrations to enable for your fine-tuning job. - seed: - anyOf: - - type: integer - - type: 'null' - minimum: 0 - maximum: 2147483647 - description: |- - The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. - If a seed is not specified, one will be generated for you. - method: - $ref: '#/components/schemas/OpenAI.FineTuneMethod' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.CreateFineTuningJobRequestHyperparameters: - type: object - properties: - batch_size: - anyOf: - - type: string - enum: - - auto - - type: integer - default: auto - learning_rate_multiplier: - anyOf: - - type: string - enum: - - auto - - type: number - n_epochs: - anyOf: - - type: string - enum: - - auto - - type: integer - default: auto - OpenAI.CreateFineTuningJobRequestIntegrations: - type: object - required: - - type - - wandb - properties: - type: - type: string - enum: - - wandb - x-stainless-const: true - wandb: - $ref: '#/components/schemas/OpenAI.CreateFineTuningJobRequestIntegrationsWandb' - OpenAI.CreateFineTuningJobRequestIntegrationsWandb: - type: object - required: - - project - properties: - project: - type: string - name: - anyOf: - - type: string - - type: 'null' - entity: - anyOf: - - type: string - - type: 'null' - tags: - type: array - items: - type: string - OpenAI.CreateMessageRequest: - type: object - required: - - role - - content - properties: - role: - type: string - enum: - - user - - assistant - description: |- - The role of the entity that is creating the message. Allowed values include: - - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - content: - anyOf: - - type: string - - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.MessageContentImageFileObject' - - $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObject' - - $ref: '#/components/schemas/OpenAI.MessageRequestContentTextObject' - attachments: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateMessageRequestAttachments' - - type: 'null' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.CreateMessageRequestAttachments: - type: object - properties: - file_id: - type: string - tools: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.AssistantToolsCode' - - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly' - OpenAI.CreateResponse: - type: object - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - description: |- - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. - - The two categories of tools you can provide the model are: - - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like file search. - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code. - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - input: - $ref: '#/components/schemas/OpenAI.InputParam' - include: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - - type: 'null' - parallel_tool_calls: - anyOf: - - type: boolean - - type: 'null' - default: true - store: - anyOf: - - type: boolean - - type: 'null' - default: true - instructions: - anyOf: - - type: string - - type: 'null' - stream: - anyOf: - - type: boolean - - type: 'null' - stream_options: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseStreamOptions' - - type: 'null' - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationParam' - - type: 'null' - OpenAI.CreateRunRequest: - type: object - required: - - assistant_id - properties: - assistant_id: - type: string - description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - model: - type: string - description: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - x-oaiTypeLabel: string - reasoning_effort: - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - instructions: - anyOf: - - type: string - - type: 'null' - description: Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - additional_instructions: - anyOf: - - type: string - - type: 'null' - description: Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - additional_messages: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateMessageRequest' - - type: 'null' - description: Adds additional messages to the thread before creating the run. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.AssistantTool' - maxItems: 20 - description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - minimum: 0 - maximum: 2 - description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - minimum: 0 - maximum: 1 - description: |- - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - We generally recommend altering this or temperature but not both. - default: 1 - stream: - anyOf: - - type: boolean - - type: 'null' - description: 'If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.' - max_prompt_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 256 - description: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - max_completion_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 256 - description: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - truncation_strategy: - $ref: '#/components/schemas/OpenAI.TruncationObject' - tool_choice: - $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption' - parallel_tool_calls: - $ref: '#/components/schemas/OpenAI.ParallelToolCalls' - response_format: - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption' - OpenAI.CreateThreadAndRunRequest: - type: object - required: - - assistant_id - properties: - assistant_id: - type: string - description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - thread: - $ref: '#/components/schemas/OpenAI.CreateThreadRequest' - model: - type: string - description: The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - x-oaiTypeLabel: string - instructions: - anyOf: - - type: string - - type: 'null' - description: Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.AssistantTool' - maxItems: 20 - description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - tool_resources: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResources' - - type: 'null' - description: A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - minimum: 0 - maximum: 2 - description: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - minimum: 0 - maximum: 1 - description: |- - An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - We generally recommend altering this or temperature but not both. - default: 1 - stream: - anyOf: - - type: boolean - - type: 'null' - description: 'If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message.' - max_prompt_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 256 - description: The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - max_completion_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 256 - description: The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - truncation_strategy: - $ref: '#/components/schemas/OpenAI.TruncationObject' - tool_choice: - $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption' - parallel_tool_calls: - $ref: '#/components/schemas/OpenAI.ParallelToolCalls' - response_format: - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption' - OpenAI.CreateThreadAndRunRequestToolResources: - type: object - properties: - code_interpreter: - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter' - file_search: - $ref: '#/components/schemas/OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch' - OpenAI.CreateThreadAndRunRequestToolResourcesCodeInterpreter: - type: object - properties: - file_ids: - type: array - items: - type: string - maxItems: 20 - default: [] - OpenAI.CreateThreadAndRunRequestToolResourcesFileSearch: - type: object - properties: - vector_store_ids: - type: array - items: - type: string - maxItems: 1 - OpenAI.CreateThreadRequest: - type: object - properties: - messages: - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateMessageRequest' - description: A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. - tool_resources: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResources' - - type: 'null' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: |- - Options to create a new thread. If no thread is provided when running a - request, an empty thread will be created. - OpenAI.CreateThreadRequestToolResources: - type: object - properties: - code_interpreter: - $ref: '#/components/schemas/OpenAI.CreateThreadRequestToolResourcesCodeInterpreter' - file_search: - anyOf: - - {} - - {} - OpenAI.CreateThreadRequestToolResourcesCodeInterpreter: - type: object - properties: - file_ids: - type: array - items: - type: string - maxItems: 20 - OpenAI.CreateVectorStoreFileBatchRequest: - type: object - properties: - file_ids: - type: array - items: - type: string - minItems: 1 - maxItems: 500 - description: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. If `attributes` or `chunking_strategy` are provided, they will be applied to all files in the batch. Mutually exclusive with `files`. - files: - type: array - items: - $ref: '#/components/schemas/OpenAI.CreateVectorStoreFileRequest' - minItems: 1 - maxItems: 500 - description: A list of objects that each include a `file_id` plus optional `attributes` or `chunking_strategy`. Use this when you need to override metadata for specific files. The global `attributes` or `chunking_strategy` will be ignored and must be specified for each file. Mutually exclusive with `file_ids`. - chunking_strategy: - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' - attributes: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' - - type: 'null' - OpenAI.CreateVectorStoreFileRequest: - type: object - required: - - file_id - properties: - file_id: - type: string - description: A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. - chunking_strategy: - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' - attributes: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' - - type: 'null' - OpenAI.CreateVectorStoreRequest: - type: object - properties: - file_ids: - type: array - items: - type: string - maxItems: 500 - description: A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. - name: - type: string - description: The name of the vector store. - description: - type: string - description: A description for the vector store. Can be used to describe the vector store's purpose. - expires_after: - $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter' - chunking_strategy: - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.CustomGrammarFormatParam: - type: object - required: - - type - - syntax - - definition - properties: - type: - type: string - enum: - - grammar - description: Grammar format. Always `grammar`. - x-stainless-const: true - default: grammar - syntax: - allOf: - - $ref: '#/components/schemas/OpenAI.GrammarSyntax1' - description: The syntax of the grammar definition. One of `lark` or `regex`. - definition: - type: string - description: The grammar definition. - allOf: - - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat' - description: A grammar defined by the user. - title: Grammar format - OpenAI.CustomTextFormatParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - text - description: Unconstrained text format. Always `text`. - x-stainless-const: true - default: text - allOf: - - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat' - description: Unconstrained free-form text. - title: Text format - OpenAI.CustomToolChatCompletions: - type: object - required: - - type - - custom - properties: - type: - type: string - enum: - - custom - description: The type of the custom tool. Always `custom`. - x-stainless-const: true - custom: - allOf: - - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustom' - description: Properties of the custom tool. - title: Custom tool properties - description: A custom tool that processes input using a specified format. - title: Custom tool - OpenAI.CustomToolChatCompletionsCustom: - type: object - required: - - name - properties: - name: - type: string - description: - type: string - format: - anyOf: - - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatText' - - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammar' - OpenAI.CustomToolChatCompletionsCustomFormatGrammar: - type: object - required: - - type - - grammar - properties: - type: - type: string - enum: - - grammar - x-stainless-const: true - grammar: - allOf: - - $ref: '#/components/schemas/OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar' - title: Grammar format - OpenAI.CustomToolChatCompletionsCustomFormatGrammarGrammar: - type: object - required: - - definition - - syntax - properties: - definition: - type: string - syntax: - type: string - enum: - - lark - - regex - OpenAI.CustomToolChatCompletionsCustomFormatText: - type: object - required: - - type - properties: - type: - type: string - enum: - - text - x-stainless-const: true - OpenAI.CustomToolParam: - type: object - required: - - type - - name - properties: - type: - type: string - enum: - - custom - description: The type of the custom tool. Always `custom`. - x-stainless-const: true - default: custom - name: - type: string - description: The name of the custom tool, used to identify it in tool calls. - description: - type: string - description: Optional description of the custom tool, used to provide more context. - format: - allOf: - - $ref: '#/components/schemas/OpenAI.CustomToolParamFormat' - description: The input format for the custom tool. Default is unconstrained text. - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A custom tool that processes input using a specified format. Learn more about [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) - title: Custom tool - OpenAI.CustomToolParamFormat: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.CustomToolParamFormatType' - discriminator: - propertyName: type - mapping: - text: '#/components/schemas/OpenAI.CustomTextFormatParam' - grammar: '#/components/schemas/OpenAI.CustomGrammarFormatParam' - description: The input format for the custom tool. Default is unconstrained text. - OpenAI.CustomToolParamFormatType: - anyOf: - - type: string - - type: string - enum: - - text - - grammar - OpenAI.DeleteFileResponse: - type: object - required: - - id - - object - - deleted - properties: - id: - type: string - object: - type: string - enum: - - file - x-stainless-const: true - deleted: - type: boolean - OpenAI.DeleteFineTuningCheckpointPermissionResponse: - type: object - required: - - id - - object - - deleted - properties: - id: - type: string - description: The ID of the fine-tuned model checkpoint permission that was deleted. - object: - type: string - enum: - - checkpoint.permission - description: The object type, which is always "checkpoint.permission". - x-stainless-const: true - deleted: - type: boolean - description: Whether the fine-tuned model checkpoint permission was successfully deleted. - OpenAI.DeleteMessageResponse: - type: object - required: - - id - - deleted - - object - properties: - id: - type: string - deleted: - type: boolean - object: - type: string - enum: - - thread.message.deleted - x-stainless-const: true - OpenAI.DeleteModelResponse: - type: object - required: - - id - - deleted - - object - properties: - id: - type: string - deleted: - type: boolean - object: - type: string - OpenAI.DeleteThreadResponse: - type: object - required: - - id - - deleted - - object - properties: - id: - type: string - deleted: - type: boolean - object: - type: string - enum: - - thread.deleted - x-stainless-const: true - OpenAI.DeleteVectorStoreFileResponse: - type: object - required: - - id - - deleted - - object - properties: - id: - type: string - deleted: - type: boolean - object: - type: string - enum: - - vector_store.file.deleted - x-stainless-const: true - OpenAI.DeleteVectorStoreResponse: - type: object - required: - - id - - deleted - - object - properties: - id: - type: string - deleted: - type: boolean - object: - type: string - enum: - - vector_store.deleted - x-stainless-const: true - OpenAI.DeletedConversationResource: - type: object - required: - - object - - deleted - - id - properties: - object: - type: string - enum: - - conversation.deleted - x-stainless-const: true - default: conversation.deleted - deleted: - type: boolean - id: - type: string - OpenAI.DoubleClickAction: - type: object - required: - - type - - x - - 'y' - properties: - type: - type: string - enum: - - double_click - description: Specifies the event type. For a double click action, this property is always set to `double_click`. - x-stainless-const: true - default: double_click - x: - type: integer - description: The x-coordinate where the double click occurred. - 'y': - type: integer - description: The y-coordinate where the double click occurred. - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A double click action. - title: DoubleClick - OpenAI.Drag: - type: object - required: - - type - - path - properties: - type: - type: string - enum: - - drag - description: |- - Specifies the event type. For a drag action, this property is - always set to `drag`. - x-stainless-const: true - default: drag - path: - type: array - items: - $ref: '#/components/schemas/OpenAI.DragPoint' - description: |- - An array of coordinates representing the path of the drag action. Coordinates will appear as an array - of objects, eg - ``` - [ - { x: 100, y: 200 }, - { x: 200, y: 300 } - ] - ``` - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A drag action. - title: Drag - OpenAI.DragPoint: - type: object - required: - - x - - 'y' - properties: - x: - type: integer - description: The x-coordinate. - 'y': - type: integer - description: The y-coordinate. - description: 'An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`.' - title: Coordinate - OpenAI.EasyInputMessage: - type: object - required: - - role - - content - - type - properties: - role: - type: string - enum: - - user - - assistant - - system - - developer - description: |- - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. - content: - anyOf: - - type: string - - $ref: '#/components/schemas/OpenAI.InputMessageContentList' - description: |- - Text, image, or audio input to the model, used to generate a response. - Can also contain previous assistant responses. - type: - type: string - enum: - - message - description: The type of the message input. Always `message`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.InputItem' - description: |- - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. - title: Input message - OpenAI.Embedding: - type: object - required: - - index - - embedding - - object - properties: - index: - type: integer - description: The index of the embedding in the list of embeddings. - embedding: - type: array - items: - type: number - format: float - description: The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings). - object: - type: string - enum: - - embedding - description: The object type, which is always "embedding". - x-stainless-const: true - description: Represents an embedding vector returned by embedding endpoint. - x-oaiMeta: - name: The embedding object - example: | - { - "object": "embedding", - "embedding": [ - 0.0023064255, - -0.009327292, - .... (1536 floats total for ada-002) - -0.0028842222, - ], - "index": 0 - } - OpenAI.Eval: - type: object - required: - - object - - id - - name - - data_source_config - - testing_criteria - - created_at - - metadata - properties: - object: - type: string - enum: - - eval - description: The object type. - x-stainless-const: true - default: eval - id: - type: string - description: Unique identifier for the evaluation. - name: - type: string - description: The name of the evaluation. - data_source_config: - anyOf: - - $ref: '#/components/schemas/OpenAI.EvalCustomDataSourceConfig' - - $ref: '#/components/schemas/OpenAI.EvalLogsDataSourceConfig' - - $ref: '#/components/schemas/OpenAI.EvalStoredCompletionsDataSourceConfig' - description: Configuration of data sources used in runs of the evaluation. - testing_criteria: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalLabelModelGrader' - - $ref: '#/components/schemas/OpenAI.EvalGraderStringCheck' - - $ref: '#/components/schemas/OpenAI.EvalGraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.EvalGraderPython' - - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModel' - - $ref: '#/components/schemas/EvalGraderEndpoint' - description: A list of testing criteria. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the eval was created. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: |- - An Eval object with a data source config and testing criteria. - An Eval represents a task to be done for your LLM integration. - Like: - - Improve the quality of my chatbot - - See how well my chatbot handles customer support - - Check if o4-mini is better at my usecase than gpt-4o - title: Eval - x-oaiMeta: - name: The eval object - group: evals - example: | - { - "object": "eval", - "id": "eval_67abd54d9b0081909a86353f6fb9317a", - "data_source_config": { - "type": "custom", - "item_schema": { - "type": "object", - "properties": { - "label": {"type": "string"}, - }, - "required": ["label"] - }, - "include_sample_schema": true - }, - "testing_criteria": [ - { - "name": "My string check grader", - "type": "string_check", - "input": "{{sample.output_text}}", - "reference": "{{item.label}}", - "operation": "eq", - } - ], - "name": "External Data Eval", - "created_at": 1739314509, - "metadata": { - "test": "synthetics", - } - } - OpenAI.EvalApiError: - type: object - required: - - code - - message - properties: - code: - type: string - description: The error code. - message: - type: string - description: The error message. - description: An object representing an error response from the Eval API. - title: EvalApiError - x-oaiMeta: - name: The API error object - group: evals - example: | - { - "code": "internal_error", - "message": "The eval run failed due to an internal error." - } - OpenAI.EvalCustomDataSourceConfig: - type: object - required: - - type - - schema - properties: - type: - type: string - enum: - - custom - description: The type of data source. Always `custom`. - x-stainless-const: true - default: custom - schema: - type: object - unevaluatedProperties: {} - description: |- - The json schema for the run data source items. - Learn how to build JSON schemas [here](https://json-schema.org/). - description: |- - A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces. - The response schema defines the shape of the data that will be: - - Used to define your testing criteria and - - What data is required when creating a run - title: CustomDataSourceConfig - x-oaiMeta: - name: The eval custom data source config object - group: evals - example: | - { - "type": "custom", - "schema": { - "type": "object", - "properties": { - "item": { - "type": "object", - "properties": { - "label": {"type": "string"}, - }, - "required": ["label"] - } - }, - "required": ["item"] - } - } - OpenAI.EvalGraderPython: - type: object - required: - - type - - name - - source - properties: - type: - type: string - enum: - - python - description: The object type, which is always `python`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - source: - type: string - description: The source code of the python script. - image_tag: - type: string - description: The image tag to use for the python script. - pass_threshold: - type: number - description: The threshold for the score. - title: EvalGraderPython - OpenAI.EvalGraderScoreModel: - type: object - required: - - type - - name - - model - - input - properties: - type: - type: string - enum: - - score_model - description: The object type, which is always `score_model`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - model: - type: string - description: The model to use for the evaluation. - sampling_params: - allOf: - - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams' - description: The sampling parameters for the model. - input: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalItem' - description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings. - range: - type: array - items: - type: number - description: The range of the score. Defaults to `[0, 1]`. - pass_threshold: - type: number - description: The threshold for the score. - title: EvalGraderScoreModel - OpenAI.EvalGraderScoreModelSamplingParams: - type: object - properties: - seed: - anyOf: - - type: integer - - type: 'null' - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - temperature: - anyOf: - - type: number - - type: 'null' - max_completions_tokens: - anyOf: - - type: integer - - type: 'null' - reasoning_effort: - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - OpenAI.EvalGraderStringCheck: - type: object - required: - - type - - name - - input - - reference - - operation - properties: - type: - type: string - enum: - - string_check - description: The object type, which is always `string_check`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - input: - type: string - description: The input text. This may include template strings. - reference: - type: string - description: The reference text. This may include template strings. - operation: - type: string - enum: - - eq - - ne - - like - - ilike - description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. - title: StringCheckGrader - OpenAI.EvalGraderTextSimilarity: - type: object - required: - - type - - name - - input - - reference - - evaluation_metric - - pass_threshold - properties: - type: - type: string - enum: - - text_similarity - description: The type of grader. - x-stainless-const: true - default: text_similarity - name: - type: string - description: The name of the grader. - input: - type: string - description: The text being graded. - reference: - type: string - description: The text being graded against. - evaluation_metric: - type: string - enum: - - cosine - - fuzzy_match - - bleu - - gleu - - meteor - - rouge_1 - - rouge_2 - - rouge_3 - - rouge_4 - - rouge_5 - - rouge_l - description: |- - The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, - `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, - or `rouge_l`. - pass_threshold: - type: number - description: The threshold for the score. - title: EvalGraderTextSimilarity - OpenAI.EvalItem: - type: object - required: - - role - - content - properties: - role: - type: string - enum: - - user - - assistant - - system - - developer - description: |- - The role of the message input. One of `user`, `assistant`, `system`, or - `developer`. - content: - $ref: '#/components/schemas/OpenAI.EvalItemContent' - type: - type: string - enum: - - message - description: The type of the message input. Always `message`. - x-stainless-const: true - description: |- - A message input to the model with a role indicating instruction following - hierarchy. Instructions given with the `developer` or `system` role take - precedence over instructions given with the `user` role. Messages with the - `assistant` role are presumed to have been generated by the model in previous - interactions. - title: EvalItem - OpenAI.EvalItemContent: - anyOf: - - $ref: '#/components/schemas/OpenAI.EvalItemContentItem' - - $ref: '#/components/schemas/OpenAI.EvalItemContentArray' - description: Inputs to the model - can contain template strings. Supports text, output text, input images, and input audio, either as a single item or an array of items. - title: Eval content - OpenAI.EvalItemContentArray: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalItemContentItem' - description: |- - A list of inputs, each of which may be either an input text, output text, input - image, or input audio object. - title: An array of Input text, Output text, Input image, and Input audio - OpenAI.EvalItemContentItem: - anyOf: - - $ref: '#/components/schemas/OpenAI.EvalItemContentText' - - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' - description: 'A single content item: input text, output text, input image, or input audio.' - title: Eval content item - x-stainless-naming: - ruby: - model_name: GraderInputItem - OpenAI.EvalItemContentItemObject: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObjectType' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAI.EvalItemContentOutputText' - input_image: '#/components/schemas/OpenAI.EvalItemInputImage' - input_audio: '#/components/schemas/OpenAI.InputAudio' - input_text: '#/components/schemas/OpenAI.EvalItemContentItemObjectInputTextContent' - description: 'A single content item: input text, output text, input image, or input audio.' - title: Eval content item - x-stainless-naming: - ruby: - model_name: GraderInputItem - OpenAI.EvalItemContentItemObjectInputTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - input_text - description: The type of the input item. Always `input_text`. - x-stainless-const: true - default: input_text - text: - type: string - description: The text input to the model. - allOf: - - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' - description: A text input to the model. - title: Input text - OpenAI.EvalItemContentItemObjectType: - anyOf: - - type: string - - type: string - enum: - - input_text - - output_text - - input_image - - input_audio - OpenAI.EvalItemContentOutputText: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - output_text - description: The type of the output text. Always `output_text`. - x-stainless-const: true - text: - type: string - description: The text output from the model. - allOf: - - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' - description: A text output from the model. - title: Output text - OpenAI.EvalItemContentText: - type: string - description: A text input to the model. - title: Text input - OpenAI.EvalItemInputImage: - type: object - required: - - type - - image_url - properties: - type: - type: string - enum: - - input_image - description: The type of the image input. Always `input_image`. - x-stainless-const: true - image_url: - type: string - format: uri - description: The URL of the image input. - detail: - type: string - description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - allOf: - - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' - description: An image input block used within EvalItem content arrays. - title: Input image - OpenAI.EvalJsonlFileContentSource: - type: object - required: - - type - - content - properties: - type: - type: string - enum: - - file_content - description: The type of jsonl source. Always `file_content`. - x-stainless-const: true - default: file_content - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalJsonlFileContentSourceContent' - description: The content of the jsonl file. - title: EvalJsonlFileContentSource - OpenAI.EvalJsonlFileContentSourceContent: - type: object - required: - - item - properties: - item: - type: object - unevaluatedProperties: {} - sample: - type: object - unevaluatedProperties: {} - OpenAI.EvalJsonlFileIdSource: - type: object - required: - - type - - id - properties: - type: - type: string - enum: - - file_id - description: The type of jsonl source. Always `file_id`. - x-stainless-const: true - default: file_id - id: - type: string - description: The identifier of the file. - title: EvalJsonlFileIdSource - OpenAI.EvalList: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - enum: - - list - description: The type of this object. It is always set to "list". - x-stainless-const: true - default: list - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.Eval' - description: An array of eval objects. - first_id: - type: string - description: The identifier of the first eval in the data array. - last_id: - type: string - description: The identifier of the last eval in the data array. - has_more: - type: boolean - description: Indicates whether there are more evals available. - description: An object representing a list of evals. - title: EvalList - x-oaiMeta: - name: The eval list object - group: evals - example: | - { - "object": "list", - "data": [ - { - "object": "eval", - "id": "eval_67abd54d9b0081909a86353f6fb9317a", - "data_source_config": { - "type": "custom", - "schema": { - "type": "object", - "properties": { - "item": { - "type": "object", - "properties": { - "input": { - "type": "string" - }, - "ground_truth": { - "type": "string" - } - }, - "required": [ - "input", - "ground_truth" - ] - } - }, - "required": [ - "item" - ] - } - }, - "testing_criteria": [ - { - "name": "String check", - "id": "String check-2eaf2d8d-d649-4335-8148-9535a7ca73c2", - "type": "string_check", - "input": "{{item.input}}", - "reference": "{{item.ground_truth}}", - "operation": "eq" - } - ], - "name": "External Data Eval", - "created_at": 1739314509, - "metadata": {}, - } - ], - "first_id": "eval_67abd54d9b0081909a86353f6fb9317a", - "last_id": "eval_67abd54d9b0081909a86353f6fb9317a", - "has_more": true - } - OpenAI.EvalLogsDataSourceConfig: - type: object - required: - - type - - schema - properties: - type: - type: string - enum: - - logs - description: The type of data source. Always `logs`. - x-stainless-const: true - default: logs - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - schema: - type: object - unevaluatedProperties: {} - description: |- - The json schema for the run data source items. - Learn how to build JSON schemas [here](https://json-schema.org/). - description: |- - A LogsDataSourceConfig which specifies the metadata property of your logs query. - This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. - The schema returned by this data source config is used to defined what variables are available in your evals. - `item` and `sample` are both defined when using this data source config. - title: LogsDataSourceConfig - x-oaiMeta: - name: The logs data source object for evals - group: evals - example: | - { - "type": "logs", - "metadata": { - "language": "english" - }, - "schema": { - "type": "object", - "properties": { - "item": { - "type": "object" - }, - "sample": { - "type": "object" - } - }, - "required": [ - "item", - "sample" - } - } - OpenAI.EvalResponsesSource: - type: object - required: - - type - properties: - type: - type: string - enum: - - responses - description: The type of run data source. Always `responses`. - metadata: - anyOf: - - type: object - unevaluatedProperties: {} - - type: 'null' - model: - anyOf: - - type: string - - type: 'null' - instructions_search: - anyOf: - - type: string - - type: 'null' - created_after: - anyOf: - - type: integer - - type: 'null' - created_before: - anyOf: - - type: integer - - type: 'null' - reasoning_effort: - anyOf: - - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - top_p: - anyOf: - - type: number - - type: 'null' - users: - anyOf: - - type: array - items: - type: string - - type: 'null' - tools: - anyOf: - - type: array - items: - type: string - - type: 'null' - description: A EvalResponsesSource object describing a run data source configuration. - title: EvalResponsesSource - x-oaiMeta: - name: The run data source object used to configure an individual run - group: eval runs - example: | - { - "type": "responses", - "model": "gpt-4o-mini-2024-07-18", - "temperature": 0.7, - "top_p": 1.0, - "users": ["user1", "user2"], - "tools": ["tool1", "tool2"], - "instructions_search": "You are a coding assistant" - } - OpenAI.EvalRun: - type: object - required: - - object - - id - - eval_id - - status - - model - - name - - created_at - - report_url - - result_counts - - per_model_usage - - per_testing_criteria_results - - data_source - - metadata - - error - properties: - object: - type: string - enum: - - eval.run - description: The type of the object. Always "eval.run". - x-stainless-const: true - default: eval.run - id: - type: string - description: Unique identifier for the evaluation run. - eval_id: - type: string - description: The identifier of the associated evaluation. - status: - type: string - description: The status of the evaluation run. - model: - type: string - description: The model that is evaluated, if applicable. - name: - type: string - description: The name of the evaluation run. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) when the evaluation run was created. - report_url: - type: string - format: uri - description: The URL to the rendered evaluation run report on the UI dashboard. - result_counts: - allOf: - - $ref: '#/components/schemas/OpenAI.EvalRunResultCounts' - description: Counters summarizing the outcomes of the evaluation run. - per_model_usage: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRunPerModelUsage' - description: Usage statistics for each model during the evaluation run. - per_testing_criteria_results: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRunPerTestingCriteriaResults' - description: Results per testing criteria applied during the evaluation run. - data_source: - anyOf: - - $ref: '#/components/schemas/OpenAI.CreateEvalJsonlRunDataSource' - - $ref: '#/components/schemas/OpenAI.CreateEvalCompletionsRunDataSource' - - $ref: '#/components/schemas/OpenAI.CreateEvalResponsesRunDataSource' - description: Information about the run's data source. - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - error: - $ref: '#/components/schemas/OpenAI.EvalApiError' - description: A schema representing an evaluation run. - title: EvalRun - x-oaiMeta: - name: The eval run object - group: evals - example: | - { - "object": "eval.run", - "id": "evalrun_67e57965b480819094274e3a32235e4c", - "eval_id": "eval_67e579652b548190aaa83ada4b125f47", - "report_url": "https://platform.openai.com/evaluations/eval_67e579652b548190aaa83ada4b125f47?run_id=evalrun_67e57965b480819094274e3a32235e4c", - "status": "queued", - "model": "gpt-4o-mini", - "name": "gpt-4o-mini", - "created_at": 1743092069, - "result_counts": { - "total": 0, - "errored": 0, - "failed": 0, - "passed": 0 - }, - "per_model_usage": null, - "per_testing_criteria_results": null, - "data_source": { - "type": "completions", - "source": { - "type": "file_content", - "content": [ - { - "item": { - "input": "Tech Company Launches Advanced Artificial Intelligence Platform", - "ground_truth": "Technology" - } - }, - { - "item": { - "input": "Central Bank Increases Interest Rates Amid Inflation Concerns", - "ground_truth": "Markets" - } - }, - { - "item": { - "input": "International Summit Addresses Climate Change Strategies", - "ground_truth": "World" - } - }, - { - "item": { - "input": "Major Retailer Reports Record-Breaking Holiday Sales", - "ground_truth": "Business" - } - }, - { - "item": { - "input": "National Team Qualifies for World Championship Finals", - "ground_truth": "Sports" - } - }, - { - "item": { - "input": "Stock Markets Rally After Positive Economic Data Released", - "ground_truth": "Markets" - } - }, - { - "item": { - "input": "Global Manufacturer Announces Merger with Competitor", - "ground_truth": "Business" - } - }, - { - "item": { - "input": "Breakthrough in Renewable Energy Technology Unveiled", - "ground_truth": "Technology" - } - }, - { - "item": { - "input": "World Leaders Sign Historic Climate Agreement", - "ground_truth": "World" - } - }, - { - "item": { - "input": "Professional Athlete Sets New Record in Championship Event", - "ground_truth": "Sports" - } - }, - { - "item": { - "input": "Financial Institutions Adapt to New Regulatory Requirements", - "ground_truth": "Business" - } - }, - { - "item": { - "input": "Tech Conference Showcases Advances in Artificial Intelligence", - "ground_truth": "Technology" - } - }, - { - "item": { - "input": "Global Markets Respond to Oil Price Fluctuations", - "ground_truth": "Markets" - } - }, - { - "item": { - "input": "International Cooperation Strengthened Through New Treaty", - "ground_truth": "World" - } - }, - { - "item": { - "input": "Sports League Announces Revised Schedule for Upcoming Season", - "ground_truth": "Sports" - } - } - ] - }, - "input_messages": { - "type": "template", - "template": [ - { - "type": "message", - "role": "developer", - "content": { - "type": "input_text", - "text": "Categorize a given news headline into one of the following topics: Technology, Markets, World, Business, or Sports. - - # Steps - - 1. Analyze the content of the news headline to understand its primary focus. - 2. Extract the subject matter, identifying any key indicators or keywords. - 3. Use the identified indicators to determine the most suitable category out of the five options: Technology, Markets, World, Business, or Sports. - 4. Ensure only one category is selected per headline. - - # Output Format - - Respond with the chosen category as a single word. For instance: "Technology", "Markets", "World", "Business", or "Sports". - - # Examples - - **Input**: "Apple Unveils New iPhone Model, Featuring Advanced AI Features" - **Output**: "Technology" - - **Input**: "Global Stocks Mixed as Investors Await Central Bank Decisions" - **Output**: "Markets" - - **Input**: "War in Ukraine: Latest Updates on Negotiation Status" - **Output**: "World" - - **Input**: "Microsoft in Talks to Acquire Gaming Company for $2 Billion" - **Output**: "Business" - - **Input**: "Manchester United Secures Win in Premier League Football Match" - **Output**: "Sports" - - # Notes - - - If the headline appears to fit into more than one category, choose the most dominant theme. - - Keywords or phrases such as "stocks", "company acquisition", "match", or technological brands can be good indicators for classification. - " - } - }, - { - "type": "message", - "role": "user", - "content": { - "type": "input_text", - "text": "{{item.input}}" - } - } - ] - }, - "model": "gpt-4o-mini", - "sampling_params": { - "seed": 42, - "temperature": 1.0, - "top_p": 1.0, - "max_completions_tokens": 2048 - } - }, - "error": null, - "metadata": {} - } - OpenAI.EvalRunList: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - enum: - - list - description: The type of this object. It is always set to "list". - x-stainless-const: true - default: list - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRun' - description: An array of eval run objects. - first_id: - type: string - description: The identifier of the first eval run in the data array. - last_id: - type: string - description: The identifier of the last eval run in the data array. - has_more: - type: boolean - description: Indicates whether there are more evals available. - description: An object representing a list of runs for an evaluation. - title: EvalRunList - x-oaiMeta: - name: The eval run list object - group: evals - example: | - { - "object": "list", - "data": [ - { - "object": "eval.run", - "id": "evalrun_67b7fbdad46c819092f6fe7a14189620", - "eval_id": "eval_67b7fa9a81a88190ab4aa417e397ea21", - "report_url": "https://platform.openai.com/evaluations/eval_67b7fa9a81a88190ab4aa417e397ea21?run_id=evalrun_67b7fbdad46c819092f6fe7a14189620", - "status": "completed", - "model": "o3-mini", - "name": "Academic Assistant", - "created_at": 1740110812, - "result_counts": { - "total": 171, - "errored": 0, - "failed": 80, - "passed": 91 - }, - "per_model_usage": null, - "per_testing_criteria_results": [ - { - "testing_criteria": "String check grader", - "passed": 91, - "failed": 80 - } - ], - "run_data_source": { - "type": "completions", - "template_messages": [ - { - "type": "message", - "role": "system", - "content": { - "type": "input_text", - "text": "You are a helpful assistant." - } - }, - { - "type": "message", - "role": "user", - "content": { - "type": "input_text", - "text": "Hello, can you help me with my homework?" - } - } - ], - "datasource_reference": null, - "model": "o3-mini", - "max_completion_tokens": null, - "seed": null, - "temperature": null, - "top_p": null - }, - "error": null, - "metadata": {"test": "synthetics"} - } - ], - "first_id": "evalrun_67abd54d60ec8190832b46859da808f7", - "last_id": "evalrun_67abd54d60ec8190832b46859da808f7", - "has_more": false - } - OpenAI.EvalRunOutputItem: - type: object - required: - - object - - id - - run_id - - eval_id - - created_at - - status - - datasource_item_id - - datasource_item - - results - - sample - properties: - object: - type: string - enum: - - eval.run.output_item - description: The type of the object. Always "eval.run.output_item". - x-stainless-const: true - default: eval.run.output_item - id: - type: string - description: Unique identifier for the evaluation run output item. - run_id: - type: string - description: The identifier of the evaluation run associated with this output item. - eval_id: - type: string - description: The identifier of the evaluation group. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) when the evaluation run was created. - status: - type: string - description: The status of the evaluation run. - datasource_item_id: - type: integer - description: The identifier for the data source item. - datasource_item: - type: object - unevaluatedProperties: {} - description: Details of the input data source item. - results: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemResult' - description: A list of grader results for this output item. - sample: - allOf: - - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSample' - description: A sample containing the input and output of the evaluation run. - description: A schema representing an evaluation run output item. - title: EvalRunOutputItem - x-oaiMeta: - name: The eval run output item object - group: evals - example: | - { - "object": "eval.run.output_item", - "id": "outputitem_67abd55eb6548190bb580745d5644a33", - "run_id": "evalrun_67abd54d60ec8190832b46859da808f7", - "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a", - "created_at": 1739314509, - "status": "pass", - "datasource_item_id": 137, - "datasource_item": { - "teacher": "To grade essays, I only check for style, content, and grammar.", - "student": "I am a student who is trying to write the best essay." - }, - "results": [ - { - "name": "String Check Grader", - "type": "string-check-grader", - "score": 1.0, - "passed": true, - } - ], - "sample": { - "input": [ - { - "role": "system", - "content": "You are an evaluator bot..." - }, - { - "role": "user", - "content": "You are assessing..." - } - ], - "output": [ - { - "role": "assistant", - "content": "The rubric is not clear nor concise." - } - ], - "finish_reason": "stop", - "model": "gpt-4o-2024-08-06", - "usage": { - "total_tokens": 521, - "completion_tokens": 2, - "prompt_tokens": 519, - "cached_tokens": 0 - }, - "error": null, - "temperature": 1.0, - "max_completion_tokens": 2048, - "top_p": 1.0, - "seed": 42 - } - } - OpenAI.EvalRunOutputItemList: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - enum: - - list - description: The type of this object. It is always set to "list". - x-stainless-const: true - default: list - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItem' - description: An array of eval run output item objects. - first_id: - type: string - description: The identifier of the first eval run output item in the data array. - last_id: - type: string - description: The identifier of the last eval run output item in the data array. - has_more: - type: boolean - description: Indicates whether there are more eval run output items available. - description: An object representing a list of output items for an evaluation run. - title: EvalRunOutputItemList - x-oaiMeta: - name: The eval run output item list object - group: evals - example: | - { - "object": "list", - "data": [ - { - "object": "eval.run.output_item", - "id": "outputitem_67abd55eb6548190bb580745d5644a33", - "run_id": "evalrun_67abd54d60ec8190832b46859da808f7", - "eval_id": "eval_67abd54d9b0081909a86353f6fb9317a", - "created_at": 1739314509, - "status": "pass", - "datasource_item_id": 137, - "datasource_item": { - "teacher": "To grade essays, I only check for style, content, and grammar.", - "student": "I am a student who is trying to write the best essay." - }, - "results": [ - { - "name": "String Check Grader", - "type": "string-check-grader", - "score": 1.0, - "passed": true, - } - ], - "sample": { - "input": [ - { - "role": "system", - "content": "You are an evaluator bot..." - }, - { - "role": "user", - "content": "You are assessing..." - } - ], - "output": [ - { - "role": "assistant", - "content": "The rubric is not clear nor concise." - } - ], - "finish_reason": "stop", - "model": "gpt-4o-2024-08-06", - "usage": { - "total_tokens": 521, - "completion_tokens": 2, - "prompt_tokens": 519, - "cached_tokens": 0 - }, - "error": null, - "temperature": 1.0, - "max_completion_tokens": 2048, - "top_p": 1.0, - "seed": 42 - } - }, - ], - "first_id": "outputitem_67abd55eb6548190bb580745d5644a33", - "last_id": "outputitem_67abd55eb6548190bb580745d5644a33", - "has_more": false - } - OpenAI.EvalRunOutputItemResult: - type: object - required: - - name - - score - - passed - properties: - name: - type: string - description: The name of the grader. - type: - type: string - description: The grader type (for example, "string-check-grader"). - score: - type: number - description: The numeric score produced by the grader. - passed: - type: boolean - description: Whether the grader considered the output a pass. - sample: - anyOf: - - type: object - unevaluatedProperties: {} - - type: 'null' - description: Optional sample or intermediate data produced by the grader. - unevaluatedProperties: {} - description: A single grader result for an evaluation run output item. - title: EvalRunOutputItemResult - OpenAI.EvalRunOutputItemSample: - type: object - required: - - input - - output - - finish_reason - - model - - usage - - error - - temperature - - max_completion_tokens - - top_p - - seed - properties: - input: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleInput' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleOutput' - finish_reason: - type: string - model: - type: string - usage: - $ref: '#/components/schemas/OpenAI.EvalRunOutputItemSampleUsage' - error: - $ref: '#/components/schemas/OpenAI.EvalApiError' - temperature: - type: number - max_completion_tokens: - type: integer - top_p: - type: number - seed: - type: integer - OpenAI.EvalRunOutputItemSampleInput: - type: object - required: - - role - - content - properties: - role: - type: string - content: - type: string - OpenAI.EvalRunOutputItemSampleOutput: - type: object - properties: - role: - type: string - content: - type: string - OpenAI.EvalRunOutputItemSampleUsage: - type: object - required: - - total_tokens - - completion_tokens - - prompt_tokens - - cached_tokens - properties: - total_tokens: - type: integer - completion_tokens: - type: integer - prompt_tokens: - type: integer - cached_tokens: - type: integer - OpenAI.EvalRunPerModelUsage: - type: object - required: - - model_name - - invocation_count - - prompt_tokens - - completion_tokens - - total_tokens - - cached_tokens - properties: - model_name: - type: string - x-stainless-naming: - python: - property_name: run_model_name - invocation_count: - type: integer - prompt_tokens: - type: integer - completion_tokens: - type: integer - total_tokens: - type: integer - cached_tokens: - type: integer - OpenAI.EvalRunPerTestingCriteriaResults: - type: object - required: - - testing_criteria - - passed - - failed - properties: - testing_criteria: - type: string - passed: - type: integer - failed: - type: integer - OpenAI.EvalRunResultCounts: - type: object - required: - - total - - errored - - failed - - passed - properties: - total: - type: integer - errored: - type: integer - failed: - type: integer - passed: - type: integer - OpenAI.EvalStoredCompletionsDataSourceConfig: - type: object - required: - - type - - schema - properties: - type: - type: string - enum: - - stored_completions - description: The type of data source. Always `stored_completions`. - x-stainless-const: true - default: stored_completions - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - schema: - type: object - unevaluatedProperties: {} - description: |- - The json schema for the run data source items. - Learn how to build JSON schemas [here](https://json-schema.org/). - description: Deprecated in favor of LogsDataSourceConfig. - title: StoredCompletionsDataSourceConfig - deprecated: true - x-oaiMeta: - name: The stored completions data source object for evals - group: evals - example: | - { - "type": "stored_completions", - "metadata": { - "language": "english" - }, - "schema": { - "type": "object", - "properties": { - "item": { - "type": "object" - }, - "sample": { - "type": "object" - } - }, - "required": [ - "item", - "sample" - } - } - OpenAI.EvalStoredCompletionsSource: - type: object - required: - - type - properties: - type: - type: string - enum: - - stored_completions - description: The type of source. Always `stored_completions`. - x-stainless-const: true - default: stored_completions - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - model: - anyOf: - - type: string - - type: 'null' - created_after: - anyOf: - - type: integer - - type: 'null' - created_before: - anyOf: - - type: integer - - type: 'null' - limit: - anyOf: - - type: integer - - type: 'null' - description: A StoredCompletionsRunDataSource configuration describing a set of filters - title: StoredCompletionsRunDataSource - x-oaiMeta: - name: The stored completions data source object used to configure an individual run - group: eval runs - example: | - { - "type": "stored_completions", - "model": "gpt-4o", - "created_after": 1668124800, - "created_before": 1668124900, - "limit": 100, - "metadata": {} - } - OpenAI.FileCitationBody: - type: object - required: - - type - - file_id - - index - - filename - properties: - type: - type: string - enum: - - file_citation - description: The type of the file citation. Always `file_citation`. - x-stainless-const: true - default: file_citation - file_id: - type: string - description: The ID of the file. - index: - type: integer - description: The index of the file in the list of files. - filename: - type: string - description: The filename of the file cited. - allOf: - - $ref: '#/components/schemas/OpenAI.Annotation' - description: A citation to a file. - title: File citation - OpenAI.FilePath: - type: object - required: - - type - - file_id - - index - properties: - type: - type: string - enum: - - file_path - description: The type of the file path. Always `file_path`. - x-stainless-const: true - file_id: - type: string - description: The ID of the file. - index: - type: integer - description: The index of the file in the list of files. - allOf: - - $ref: '#/components/schemas/OpenAI.Annotation' - description: A path to a file. - title: File path - OpenAI.FileSearchRanker: - type: string - enum: - - auto - - default_2024_08_21 - description: The ranker to use for the file search. If not specified will use the `auto` ranker. - OpenAI.FileSearchRankingOptions: - type: object - required: - - score_threshold - properties: - ranker: - $ref: '#/components/schemas/OpenAI.FileSearchRanker' - score_threshold: - type: number - minimum: 0 - maximum: 1 - description: The score threshold for the file search. All values must be a floating point number between 0 and 1. - description: |- - The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - title: File search tool call ranking options - OpenAI.FileSearchTool: - type: object - required: - - type - - vector_store_ids - properties: - type: - type: string - enum: - - file_search - description: The type of the file search tool. Always `file_search`. - x-stainless-const: true - default: file_search - vector_store_ids: - type: array - items: - type: string - description: The IDs of the vector stores to search. - max_num_results: - type: integer - description: The maximum number of results to return. This number should be between 1 and 50 inclusive. - ranking_options: - allOf: - - $ref: '#/components/schemas/OpenAI.RankingOptions' - description: Ranking options for search. - filters: - anyOf: - - $ref: '#/components/schemas/OpenAI.Filters' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). - title: File search - OpenAI.FileSearchToolCallResults: - type: object - properties: - file_id: - type: string - text: - type: string - filename: - type: string - attributes: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' - - type: 'null' - score: - type: number - format: float - OpenAI.Filters: - anyOf: - - $ref: '#/components/schemas/OpenAI.ComparisonFilter' - - $ref: '#/components/schemas/OpenAI.CompoundFilter' - OpenAI.FineTuneDPOHyperparameters: - type: object - properties: - beta: - anyOf: - - type: string - enum: - - auto - - type: number - description: The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. - batch_size: - anyOf: - - type: string - enum: - - auto - - type: integer - description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. - default: auto - learning_rate_multiplier: - anyOf: - - type: string - enum: - - auto - - type: number - description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. - n_epochs: - anyOf: - - type: string - enum: - - auto - - type: integer - description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - default: auto - description: The hyperparameters used for the DPO fine-tuning job. - OpenAI.FineTuneDPOMethod: - type: object - properties: - hyperparameters: - $ref: '#/components/schemas/OpenAI.FineTuneDPOHyperparameters' - description: Configuration for the DPO fine-tuning method. - OpenAI.FineTuneMethod: - type: object - required: - - type - properties: - type: - type: string - enum: - - supervised - - dpo - - reinforcement - description: The type of method. Is either `supervised`, `dpo`, or `reinforcement`. - supervised: - $ref: '#/components/schemas/OpenAI.FineTuneSupervisedMethod' - dpo: - $ref: '#/components/schemas/OpenAI.FineTuneDPOMethod' - reinforcement: - $ref: '#/components/schemas/AzureFineTuneReinforcementMethod' - description: The method used for fine-tuning. - OpenAI.FineTuneReinforcementHyperparameters: - type: object - properties: - batch_size: - anyOf: - - type: string - enum: - - auto - - type: integer - description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. - default: auto - learning_rate_multiplier: - anyOf: - - type: string - enum: - - auto - - type: number - description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. - n_epochs: - anyOf: - - type: string - enum: - - auto - - type: integer - description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - default: auto - reasoning_effort: - type: string - enum: - - default - - low - - medium - - high - description: Level of reasoning effort. - default: default - compute_multiplier: - anyOf: - - type: string - enum: - - auto - - type: number - description: Multiplier on amount of compute used for exploring search space during training. - eval_interval: - anyOf: - - type: string - enum: - - auto - - type: integer - description: The number of training steps between evaluation runs. - default: auto - eval_samples: - anyOf: - - type: string - enum: - - auto - - type: integer - description: Number of evaluation samples to generate per training step. - default: auto - description: The hyperparameters used for the reinforcement fine-tuning job. - OpenAI.FineTuneSupervisedHyperparameters: - type: object - properties: - batch_size: - anyOf: - - type: string - enum: - - auto - - type: integer - description: Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. - default: auto - learning_rate_multiplier: - anyOf: - - type: string - enum: - - auto - - type: number - description: Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. - n_epochs: - anyOf: - - type: string - enum: - - auto - - type: integer - description: The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - default: auto - description: The hyperparameters used for the fine-tuning job. - OpenAI.FineTuneSupervisedMethod: - type: object - properties: - hyperparameters: - $ref: '#/components/schemas/OpenAI.FineTuneSupervisedHyperparameters' - description: Configuration for the supervised fine-tuning method. - OpenAI.FineTuningCheckpointPermission: - type: object - required: - - id - - created_at - - project_id - - object - properties: - id: - type: string - description: The permission identifier, which can be referenced in the API endpoints. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the permission was created. - project_id: - type: string - description: The project identifier that the permission is for. - object: - type: string - enum: - - checkpoint.permission - description: The object type, which is always "checkpoint.permission". - x-stainless-const: true - description: The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint. - title: FineTuningCheckpointPermission - x-oaiMeta: - name: The fine-tuned model checkpoint permission object - example: | - { - "object": "checkpoint.permission", - "id": "cp_zc4Q7MP6XxulcVzj4MZdwsAB", - "created_at": 1712211699, - "project_id": "proj_abGMw1llN8IrBb6SvvY5A1iH" - } - OpenAI.FineTuningIntegration: - type: object - required: - - type - - wandb - properties: - type: - type: string - enum: - - wandb - description: The type of the integration being enabled for the fine-tuning job - x-stainless-const: true - wandb: - allOf: - - $ref: '#/components/schemas/OpenAI.FineTuningIntegrationWandb' - description: |- - The settings for your integration with Weights and Biases. This payload specifies the project that - metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags - to your run, and set a default entity (team, username, etc) to be associated with your run. - title: Fine-Tuning Job Integration - OpenAI.FineTuningIntegrationWandb: - type: object - required: - - project - properties: - project: - type: string - name: - anyOf: - - type: string - - type: 'null' - entity: - anyOf: - - type: string - - type: 'null' - tags: - type: array - items: - type: string - OpenAI.FineTuningJob: - type: object - required: - - id - - created_at - - error - - fine_tuned_model - - finished_at - - hyperparameters - - model - - object - - organization_id - - result_files - - status - - trained_tokens - - training_file - - validation_file - - seed - properties: - id: - type: string - description: The object identifier, which can be referenced in the API endpoints. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the fine-tuning job was created. - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.FineTuningJobError' - - type: 'null' - fine_tuned_model: - anyOf: - - type: string - - type: 'null' - finished_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - hyperparameters: - allOf: - - $ref: '#/components/schemas/OpenAI.FineTuningJobHyperparameters' - description: The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs. - model: - type: string - description: The base model that is being fine-tuned. - object: - type: string - enum: - - fine_tuning.job - description: The object type, which is always "fine_tuning.job". - x-stainless-const: true - organization_id: - type: string - description: The organization that owns the fine-tuning job. - result_files: - type: array - items: - type: string - description: The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). - status: - type: string - enum: - - validating_files - - queued - - running - - succeeded - - failed - - cancelled - description: The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. - trained_tokens: - anyOf: - - type: integer - - type: 'null' - training_file: - type: string - description: The file ID used for training. You can retrieve the training data with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). - validation_file: - anyOf: - - type: string - - type: 'null' - integrations: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.FineTuningIntegration' - - type: 'null' - seed: - type: integer - description: The seed used for the fine-tuning job. - estimated_finish: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - method: - $ref: '#/components/schemas/OpenAI.FineTuneMethod' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. - title: FineTuningJob - x-oaiMeta: - name: The fine-tuning job object - example: | - { - "object": "fine_tuning.job", - "id": "ftjob-abc123", - "model": "davinci-002", - "created_at": 1692661014, - "finished_at": 1692661190, - "fine_tuned_model": "ft:davinci-002:my-org:custom_suffix:7q8mpxmy", - "organization_id": "org-123", - "result_files": [ - "file-abc123" - ], - "status": "succeeded", - "validation_file": null, - "training_file": "file-abc123", - "hyperparameters": { - "n_epochs": 4, - "batch_size": 1, - "learning_rate_multiplier": 1.0 - }, - "trained_tokens": 5768, - "integrations": [], - "seed": 0, - "estimated_finish": 0, - "method": { - "type": "supervised", - "supervised": { - "hyperparameters": { - "n_epochs": 4, - "batch_size": 1, - "learning_rate_multiplier": 1.0 - } - } - }, - "metadata": { - "key": "value" - } - } - OpenAI.FineTuningJobCheckpoint: - type: object - required: - - id - - created_at - - fine_tuned_model_checkpoint - - step_number - - metrics - - fine_tuning_job_id - - object - properties: - id: - type: string - description: The checkpoint identifier, which can be referenced in the API endpoints. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the checkpoint was created. - fine_tuned_model_checkpoint: - type: string - description: The name of the fine-tuned checkpoint model that is created. - step_number: - type: integer - description: The step number that the checkpoint was created at. - metrics: - allOf: - - $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpointMetrics' - description: Metrics at the step number during the fine-tuning job. - fine_tuning_job_id: - type: string - description: The name of the fine-tuning job that this checkpoint was created from. - object: - type: string - enum: - - fine_tuning.job.checkpoint - description: The object type, which is always "fine_tuning.job.checkpoint". - x-stainless-const: true - description: The `fine_tuning.job.checkpoint` object represents a model checkpoint for a fine-tuning job that is ready to use. - title: FineTuningJobCheckpoint - x-oaiMeta: - name: The fine-tuning job checkpoint object - example: | - { - "object": "fine_tuning.job.checkpoint", - "id": "ftckpt_qtZ5Gyk4BLq1SfLFWp3RtO3P", - "created_at": 1712211699, - "fine_tuned_model_checkpoint": "ft:gpt-4o-mini-2024-07-18:my-org:custom_suffix:9ABel2dg:ckpt-step-88", - "fine_tuning_job_id": "ftjob-fpbNQ3H1GrMehXRf8cO97xTN", - "metrics": { - "step": 88, - "train_loss": 0.478, - "train_mean_token_accuracy": 0.924, - "valid_loss": 10.112, - "valid_mean_token_accuracy": 0.145, - "full_valid_loss": 0.567, - "full_valid_mean_token_accuracy": 0.944 - }, - "step_number": 88 - } - OpenAI.FineTuningJobCheckpointMetrics: - type: object - properties: - step: - type: number - train_loss: - type: number - train_mean_token_accuracy: - type: number - valid_loss: - type: number - valid_mean_token_accuracy: - type: number - full_valid_loss: - type: number - full_valid_mean_token_accuracy: - type: number - OpenAI.FineTuningJobError: - type: object - required: - - code - - message - - param - properties: - code: - type: string - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - OpenAI.FineTuningJobEvent: - type: object - required: - - object - - id - - created_at - - level - - message - properties: - object: - type: string - enum: - - fine_tuning.job.event - description: The object type, which is always "fine_tuning.job.event". - x-stainless-const: true - id: - type: string - description: The object identifier. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the fine-tuning job was created. - level: - type: string - enum: - - info - - warn - - error - description: The log level of the event. - message: - type: string - description: The message of the event. - type: - type: string - enum: - - message - - metrics - description: The type of event. - data: - allOf: - - $ref: '#/components/schemas/OpenAI.FineTuningJobEventData' - description: The data associated with the event. - description: Fine-tuning job event object - x-oaiMeta: - name: The fine-tuning job event object - example: | - { - "object": "fine_tuning.job.event", - "id": "ftevent-abc123" - "created_at": 1677610602, - "level": "info", - "message": "Created fine-tuning job", - "data": {}, - "type": "message" - } - OpenAI.FineTuningJobEventData: - type: object - OpenAI.FineTuningJobHyperparameters: - type: object - properties: - batch_size: - anyOf: - - type: string - enum: - - auto - - type: integer - - type: 'null' - default: auto - learning_rate_multiplier: - anyOf: - - type: string - enum: - - auto - - type: number - n_epochs: - anyOf: - - type: string - enum: - - auto - - type: integer - default: auto - OpenAI.FunctionAndCustomToolCallOutput: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputType' - discriminator: - propertyName: type - mapping: - input_text: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputTextContent' - input_image: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputImageContent' - input_file: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutputInputFileContent' - OpenAI.FunctionAndCustomToolCallOutputInputFileContent: - type: object - required: - - type - properties: - type: - type: string - enum: - - input_file - description: The type of the input item. Always `input_file`. - x-stainless-const: true - default: input_file - file_id: - anyOf: - - type: string - - type: 'null' - filename: - type: string - description: The name of the file to be sent to the model. - file_url: - type: string - format: uri - description: The URL of the file to be sent to the model. - file_data: - type: string - description: The content of the file to be sent to the model. - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' - description: A file input to the model. - title: Input file - OpenAI.FunctionAndCustomToolCallOutputInputImageContent: - type: object - required: - - type - - detail - properties: - type: - type: string - enum: - - input_image - description: The type of the input item. Always `input_image`. - x-stainless-const: true - default: input_image - image_url: - anyOf: - - type: string - format: uri - - type: 'null' - file_id: - anyOf: - - type: string - - type: 'null' - detail: - allOf: - - $ref: '#/components/schemas/OpenAI.ImageDetail' - description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' - description: An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - title: Input image - OpenAI.FunctionAndCustomToolCallOutputInputTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - input_text - description: The type of the input item. Always `input_text`. - x-stainless-const: true - default: input_text - text: - type: string - description: The text input to the model. - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' - description: A text input to the model. - title: Input text - OpenAI.FunctionAndCustomToolCallOutputType: - anyOf: - - type: string - - type: string - enum: - - input_text - - input_image - - input_file - OpenAI.FunctionObject: - type: object - required: - - name - properties: - description: - type: string - description: A description of what the function does, used by the model to choose when and how to call the function. - name: - type: string - description: The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - parameters: - $ref: '#/components/schemas/OpenAI.FunctionParameters' - strict: - anyOf: - - type: boolean - - type: 'null' - OpenAI.FunctionParameters: - type: object - unevaluatedProperties: {} - description: |- - The parameters the functions accepts, described as a JSON Schema object. See the [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format. - Omitting `parameters` defines a function with an empty parameter list. - OpenAI.FunctionShellAction: - type: object - required: - - commands - - timeout_ms - - max_output_length - properties: - commands: - type: array - items: - type: string - timeout_ms: - anyOf: - - type: integer - - type: 'null' - max_output_length: - anyOf: - - type: integer - - type: 'null' - description: Execute a shell command. - title: Shell exec action - OpenAI.FunctionShellCallOutputContent: - type: object - required: - - stdout - - stderr - - outcome - properties: - stdout: - type: string - description: The standard output that was captured. - stderr: - type: string - description: The standard error output that was captured. - outcome: - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome' - description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - created_by: - type: string - description: The identifier of the actor that created the item. - description: The content of a shell tool call output that was emitted. - title: Shell call output content - OpenAI.FunctionShellCallOutputExitOutcome: - type: object - required: - - type - - exit_code - properties: - type: - type: string - enum: - - exit - description: The outcome type. Always `exit`. - x-stainless-const: true - default: exit - exit_code: - type: integer - description: Exit code from the shell process. - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome' - description: Indicates that the shell commands finished and returned an exit code. - title: Shell call exit outcome - OpenAI.FunctionShellCallOutputOutcome: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcomeType' - discriminator: - propertyName: type - mapping: - timeout: '#/components/schemas/OpenAI.FunctionShellCallOutputTimeoutOutcome' - exit: '#/components/schemas/OpenAI.FunctionShellCallOutputExitOutcome' - description: Represents either an exit outcome (with an exit code) or a timeout outcome for a shell call output chunk. - title: Shell call outcome - OpenAI.FunctionShellCallOutputOutcomeType: - anyOf: - - type: string - - type: string - enum: - - timeout - - exit - OpenAI.FunctionShellCallOutputTimeoutOutcome: - type: object - required: - - type - properties: - type: - type: string - enum: - - timeout - description: The outcome type. Always `timeout`. - x-stainless-const: true - default: timeout - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputOutcome' - description: Indicates that the shell call exceeded its configured time limit. - title: Shell call timeout outcome - OpenAI.FunctionShellToolParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - shell - description: The type of the shell tool. Always `shell`. - x-stainless-const: true - default: shell - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A tool that allows the model to execute shell commands. - title: Shell tool - OpenAI.FunctionTool: - type: object - required: - - type - - name - - parameters - - strict - properties: - type: - type: string - enum: - - function - description: The type of the function tool. Always `function`. - x-stainless-const: true - default: function - name: - type: string - description: The name of the function to call. - description: - anyOf: - - type: string - - type: 'null' - parameters: - anyOf: - - type: object - unevaluatedProperties: {} - - type: 'null' - strict: - anyOf: - - type: boolean - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). - title: Function - OpenAI.GraderMulti: - type: object - required: - - type - - name - - graders - - calculate_output - properties: - type: - type: string - enum: - - multi - description: The object type, which is always `multi`. - x-stainless-const: true - default: multi - name: - type: string - description: The name of the grader. - graders: - anyOf: - - $ref: '#/components/schemas/OpenAI.GraderStringCheck' - - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.GraderScoreModel' - - $ref: '#/components/schemas/GraderEndpoint' - calculate_output: - type: string - description: A formula to calculate the output based on grader results. - description: A MultiGrader object combines the output of multiple graders to produce a single score. - title: MultiGrader - x-oaiMeta: - name: Multi Grader - group: graders - example: | - { - "type": "multi", - "name": "example multi grader", - "graders": [ - { - "type": "text_similarity", - "name": "example text similarity grader", - "input": "The graded text", - "reference": "The reference text", - "evaluation_metric": "fuzzy_match" - }, - { - "type": "string_check", - "name": "Example string check grader", - "input": "{{sample.output_text}}", - "reference": "{{item.label}}", - "operation": "eq" - } - ], - "calculate_output": "0.5 * text_similarity_score + 0.5 * string_check_score)" - } - OpenAI.GraderPython: - type: object - required: - - type - - name - - source - properties: - type: - type: string - enum: - - python - description: The object type, which is always `python`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - source: - type: string - description: The source code of the python script. - image_tag: - type: string - description: The image tag to use for the python script. - description: A PythonGrader object that runs a python script on the input. - title: PythonGrader - x-oaiMeta: - name: Python Grader - group: graders - example: | - { - "type": "python", - "name": "Example python grader", - "image_tag": "2025-05-08", - "source": """ - def grade(sample: dict, item: dict) -> float: - """ - Returns 1.0 if `output_text` equals `label`, otherwise 0.0. - """ - output = sample.get("output_text") - label = item.get("label") - return 1.0 if output == label else 0.0 - """, - } - OpenAI.GraderScoreModel: - type: object - required: - - type - - name - - model - - input - properties: - type: - type: string - enum: - - score_model - description: The object type, which is always `score_model`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - model: - type: string - description: The model to use for the evaluation. - sampling_params: - allOf: - - $ref: '#/components/schemas/OpenAI.EvalGraderScoreModelSamplingParams' - description: The sampling parameters for the model. - input: - type: array - items: - $ref: '#/components/schemas/OpenAI.EvalItem' - description: The input messages evaluated by the grader. Supports text, output text, input image, and input audio content blocks, and may include template strings. - range: - type: array - items: - type: number - description: The range of the score. Defaults to `[0, 1]`. - description: A ScoreModelGrader object that uses a model to assign a score to the input. - title: ScoreModelGrader - x-oaiMeta: - name: Score Model Grader - group: graders - example: | - { - "type": "score_model", - "name": "Example score model grader", - "input": [ - { - "role": "user", - "content": [ - { - "type": "input_text", - "text": ( - "Score how close the reference answer is to the model answer. Score 1.0 if they are the same and 0.0 if they are different." - " Return just a floating point score - - " - " Reference answer: {{item.label}} - - " - " Model answer: {{sample.output_text}}" - ) - }, - { - "type": "input_image", - "image_url": "https://example.com/reference.png", - "file_id": null, - "detail": "auto" - } - ], - } - ], - "model": "gpt-5-mini", - "sampling_params": { - "temperature": 1, - "top_p": 1, - "seed": 42, - "max_completions_tokens": 32768, - "reasoning_effort": "medium" - }, - } - OpenAI.GraderStringCheck: - type: object - required: - - type - - name - - input - - reference - - operation - properties: - type: - type: string - enum: - - string_check - description: The object type, which is always `string_check`. - x-stainless-const: true - name: - type: string - description: The name of the grader. - input: - type: string - description: The input text. This may include template strings. - reference: - type: string - description: The reference text. This may include template strings. - operation: - type: string - enum: - - eq - - ne - - like - - ilike - description: The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. - description: A StringCheckGrader object that performs a string comparison between input and reference using a specified operation. - title: StringCheckGrader - x-oaiMeta: - name: String Check Grader - group: graders - example: | - { - "type": "string_check", - "name": "Example string check grader", - "input": "{{sample.output_text}}", - "reference": "{{item.label}}", - "operation": "eq" - } - OpenAI.GraderTextSimilarity: - type: object - required: - - type - - name - - input - - reference - - evaluation_metric - properties: - type: - type: string - enum: - - text_similarity - description: The type of grader. - x-stainless-const: true - default: text_similarity - name: - type: string - description: The name of the grader. - input: - type: string - description: The text being graded. - reference: - type: string - description: The text being graded against. - evaluation_metric: - type: string - enum: - - cosine - - fuzzy_match - - bleu - - gleu - - meteor - - rouge_1 - - rouge_2 - - rouge_3 - - rouge_4 - - rouge_5 - - rouge_l - description: |- - The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, - `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, - or `rouge_l`. - description: A TextSimilarityGrader object which grades text based on similarity metrics. - title: TextSimilarityGrader - x-oaiMeta: - name: Text Similarity Grader - group: graders - example: | - { - "type": "text_similarity", - "name": "Example text similarity grader", - "input": "{{sample.output_text}}", - "reference": "{{item.label}}", - "evaluation_metric": "fuzzy_match" - } - OpenAI.GrammarSyntax1: - type: string - enum: - - lark - - regex - OpenAI.HybridSearchOptions: - type: object - required: - - embedding_weight - - text_weight - properties: - embedding_weight: - type: number - description: The weight of the embedding in the reciprocal ranking fusion. - text_weight: - type: number - description: The weight of the text in the reciprocal ranking fusion. - OpenAI.ImageDetail: - type: string - enum: - - low - - high - - auto - OpenAI.ImageGenTool: - type: object - required: - - type - properties: - type: - type: string - enum: - - image_generation - description: The type of the image generation tool. Always `image_generation`. - x-stainless-const: true - default: image_generation - model: - anyOf: - - type: string - - type: string - enum: - - gpt-image-1 - - gpt-image-1-mini - default: gpt-image-1 - quality: - type: string - enum: - - low - - medium - - high - - auto - description: |- - The quality of the generated image. One of `low`, `medium`, `high`, - or `auto`. Default: `auto`. - default: auto - size: - type: string - enum: - - 1024x1024 - - 1024x1536 - - 1536x1024 - - auto - description: |- - The size of the generated image. One of `1024x1024`, `1024x1536`, - `1536x1024`, or `auto`. Default: `auto`. - default: auto - output_format: - type: string - enum: - - png - - webp - - jpeg - description: |- - The output format of the generated image. One of `png`, `webp`, or - `jpeg`. Default: `png`. - default: png - output_compression: - type: integer - minimum: 0 - maximum: 100 - description: 'Compression level for the output image. Default: 100.' - default: 100 - moderation: - type: string - enum: - - auto - - low - description: 'Moderation level for the generated image. Default: `auto`.' - default: auto - background: - type: string - enum: - - transparent - - opaque - - auto - description: |- - Background type for the generated image. One of `transparent`, - `opaque`, or `auto`. Default: `auto`. - default: auto - input_fidelity: - anyOf: - - $ref: '#/components/schemas/OpenAI.InputFidelity' - - type: 'null' - input_image_mask: - allOf: - - $ref: '#/components/schemas/OpenAI.ImageGenToolInputImageMask' - description: |- - Optional mask for inpainting. Contains `image_url` - (string, optional) and `file_id` (string, optional). - partial_images: - type: integer - minimum: 0 - maximum: 3 - description: Number of partial images to generate in streaming mode, from 0 (default value) to 3. - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A tool that generates images using the GPT image models. - title: Image generation tool - OpenAI.ImageGenToolInputImageMask: - type: object - properties: - image_url: - type: string - file_id: - type: string - OpenAI.IncludeEnum: - anyOf: - - type: string - - type: string - enum: - - file_search_call.results - - web_search_call.results - - web_search_call.action.sources - - message.input_image.image_url - - computer_call_output.output.image_url - - code_interpreter_call.outputs - - reasoning.encrypted_content - - message.output_text.logprobs - description: |- - Specify additional output data to include in the model response. Currently supported values are: - - `web_search_call.action.sources`: Include the sources of the web search tool call. - - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - - `computer_call_output.output.image_url`: Include image urls from the computer call output. - - `file_search_call.results`: Include the search results of the file search tool call. - - `message.input_image.image_url`: Include image urls from the input message. - - `message.output_text.logprobs`: Include logprobs with assistant messages. - - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). - OpenAI.InputAudio: - type: object - required: - - type - - input_audio - properties: - type: - type: string - enum: - - input_audio - description: The type of the input item. Always `input_audio`. - x-stainless-const: true - input_audio: - $ref: '#/components/schemas/OpenAI.InputAudioInputAudio' - allOf: - - $ref: '#/components/schemas/OpenAI.EvalItemContentItemObject' - description: An audio input to the model. - title: Input audio - OpenAI.InputAudioInputAudio: - type: object - required: - - data - - format - properties: - data: - type: string - format: - type: string - enum: - - mp3 - - wav - OpenAI.InputContent: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.InputContentType' - discriminator: - propertyName: type - mapping: - input_text: '#/components/schemas/OpenAI.InputContentInputTextContent' - input_image: '#/components/schemas/OpenAI.InputContentInputImageContent' - input_file: '#/components/schemas/OpenAI.InputContentInputFileContent' - OpenAI.InputContentInputFileContent: - type: object - required: - - type - properties: - type: - type: string - enum: - - input_file - description: The type of the input item. Always `input_file`. - x-stainless-const: true - default: input_file - file_id: - anyOf: - - type: string - - type: 'null' - filename: - type: string - description: The name of the file to be sent to the model. - file_url: - type: string - format: uri - description: The URL of the file to be sent to the model. - file_data: - type: string - description: The content of the file to be sent to the model. - allOf: - - $ref: '#/components/schemas/OpenAI.InputContent' - description: A file input to the model. - title: Input file - OpenAI.InputContentInputImageContent: - type: object - required: - - type - - detail - properties: - type: - type: string - enum: - - input_image - description: The type of the input item. Always `input_image`. - x-stainless-const: true - default: input_image - image_url: - anyOf: - - type: string - format: uri - - type: 'null' - file_id: - anyOf: - - type: string - - type: 'null' - detail: - allOf: - - $ref: '#/components/schemas/OpenAI.ImageDetail' - description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - allOf: - - $ref: '#/components/schemas/OpenAI.InputContent' - description: An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - title: Input image - OpenAI.InputContentInputTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - input_text - description: The type of the input item. Always `input_text`. - x-stainless-const: true - default: input_text - text: - type: string - description: The text input to the model. - allOf: - - $ref: '#/components/schemas/OpenAI.InputContent' - description: A text input to the model. - title: Input text - OpenAI.InputContentType: - anyOf: - - type: string - - type: string - enum: - - input_text - - input_image - - input_file - OpenAI.InputFidelity: - type: string - enum: - - high - - low - description: Control how much effort the model will exert to match the style and features, especially facial features, of input images. This parameter is only supported for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and `low`. Defaults to `low`. - OpenAI.InputFileContent: - type: object - required: - - type - properties: - type: - type: string - enum: - - input_file - description: The type of the input item. Always `input_file`. - x-stainless-const: true - default: input_file - file_id: - anyOf: - - type: string - - type: 'null' - filename: - type: string - description: The name of the file to be sent to the model. - file_url: - type: string - format: uri - description: The URL of the file to be sent to the model. - file_data: - type: string - description: The content of the file to be sent to the model. - description: A file input to the model. - title: Input file - OpenAI.InputImageContent: - type: object - required: - - type - - detail - properties: - type: - type: string - enum: - - input_image - description: The type of the input item. Always `input_image`. - x-stainless-const: true - default: input_image - image_url: - anyOf: - - type: string - format: uri - - type: 'null' - file_id: - anyOf: - - type: string - - type: 'null' - detail: - allOf: - - $ref: '#/components/schemas/OpenAI.ImageDetail' - description: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - description: An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). - title: Input image - OpenAI.InputItem: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.InputItemType' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAI.EasyInputMessage' - item_reference: '#/components/schemas/OpenAI.ItemReferenceParam' - OpenAI.InputItemType: - anyOf: - - type: string - - type: string - enum: - - message - - item_reference - OpenAI.InputMessageContentList: - type: array - items: - $ref: '#/components/schemas/OpenAI.InputContent' - description: |- - A list of one or many input items to the model, containing different content - types. - title: Input item content list - OpenAI.InputMessageResource: - type: object - required: - - type - - role - - content - - id - properties: - type: - type: string - enum: - - message - description: The type of the message input. Always set to `message`. - x-stainless-const: true - role: - type: string - enum: - - user - - system - - developer - description: The role of the message input. One of `user`, `system`, or `developer`. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - content: - $ref: '#/components/schemas/OpenAI.InputMessageContentList' - id: - type: string - description: The unique ID of the message input. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - OpenAI.InputParam: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - description: |- - Text, image, or file inputs to the model, used to generate a response. - Learn more: - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Image inputs](https://platform.openai.com/docs/guides/images) - - [File inputs](https://platform.openai.com/docs/guides/pdf-files) - - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) - - [Function calling](https://platform.openai.com/docs/guides/function-calling) - OpenAI.InputTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - input_text - description: The type of the input item. Always `input_text`. - x-stainless-const: true - default: input_text - text: - type: string - description: The text input to the model. - description: A text input to the model. - title: Input text - OpenAI.ItemReferenceParam: - type: object - required: - - type - - id - properties: - type: - type: string - enum: - - item_reference - description: The type of item to reference. Always `item_reference`. - x-stainless-const: true - default: item_reference - id: - type: string - description: The ID of the item to reference. - allOf: - - $ref: '#/components/schemas/OpenAI.InputItem' - description: An internal identifier for an item to reference. - title: Item reference - OpenAI.ItemResource: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ItemResourceType' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAI.InputMessageResource' - output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage' - file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall' - computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall' - computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutputResource' - web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall' - function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallResource' - function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutputResource' - image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall' - code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall' - local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall' - local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput' - shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall' - shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput' - apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall' - apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput' - mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools' - mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource' - mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall' - description: Content item used to generate a response. - OpenAI.ItemResourceApplyPatchToolCall: - type: object - required: - - type - - id - - call_id - - status - - operation - properties: - type: - type: string - enum: - - apply_patch_call - description: The type of the item. Always `apply_patch_call`. - x-stainless-const: true - default: apply_patch_call - id: - type: string - description: The unique ID of the apply patch tool call. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the apply patch tool call generated by the model. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus' - description: The status of the apply patch tool call. One of `in_progress` or `completed`. - operation: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' - description: One of the create_file, delete_file, or update_file operations applied via apply_patch. - created_by: - type: string - description: The ID of the entity that created this tool call. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A tool call that applies file diffs by creating, deleting, or updating files. - title: Apply patch tool call - OpenAI.ItemResourceApplyPatchToolCallOutput: - type: object - required: - - type - - id - - call_id - - status - properties: - type: - type: string - enum: - - apply_patch_call_output - description: The type of the item. Always `apply_patch_call_output`. - x-stainless-const: true - default: apply_patch_call_output - id: - type: string - description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the apply patch tool call generated by the model. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus' - description: The status of the apply patch tool call output. One of `completed` or `failed`. - output: - anyOf: - - type: string - - type: 'null' - created_by: - type: string - description: The ID of the entity that created this tool call output. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: The output emitted by an apply patch tool call. - title: Apply patch tool call output - OpenAI.ItemResourceCodeInterpreterToolCall: - type: object - required: - - type - - id - - status - - container_id - - code - - outputs - properties: - type: - type: string - enum: - - code_interpreter_call - description: The type of the code interpreter tool call. Always `code_interpreter_call`. - x-stainless-const: true - default: code_interpreter_call - id: - type: string - description: The unique ID of the code interpreter tool call. - status: - type: string - enum: - - in_progress - - completed - - incomplete - - interpreting - - failed - description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - container_id: - type: string - description: The ID of the container used to run the code. - code: - anyOf: - - type: string - - type: 'null' - outputs: - anyOf: - - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs' - - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A tool call to run code. - title: Code interpreter tool call - OpenAI.ItemResourceComputerToolCall: - type: object - required: - - type - - id - - call_id - - action - - pending_safety_checks - - status - properties: - type: - type: string - enum: - - computer_call - description: The type of the computer call. Always `computer_call`. - default: computer_call - id: - type: string - description: The unique ID of the computer call. - call_id: - type: string - description: An identifier used when responding to the tool call with output. - action: - $ref: '#/components/schemas/OpenAI.ComputerAction' - pending_safety_checks: - type: array - items: - $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' - description: The pending safety checks for the computer call. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: |- - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - title: Computer tool call - OpenAI.ItemResourceComputerToolCallOutputResource: - type: object - required: - - type - - call_id - - output - properties: - type: - type: string - enum: - - computer_call_output - description: The type of the computer tool call output. Always `computer_call_output`. - x-stainless-const: true - default: computer_call_output - id: - type: string - description: The ID of the computer tool call output. - call_id: - type: string - description: The ID of the computer tool call that produced the output. - acknowledged_safety_checks: - type: array - items: - $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' - description: |- - The safety checks reported by the API that have been acknowledged by the - developer. - output: - $ref: '#/components/schemas/OpenAI.ComputerScreenshotImage' - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - OpenAI.ItemResourceFileSearchToolCall: - type: object - required: - - id - - type - - status - - queries - properties: - id: - type: string - description: The unique ID of the file search tool call. - type: - type: string - enum: - - file_search_call - description: The type of the file search tool call. Always `file_search_call`. - x-stainless-const: true - status: - type: string - enum: - - in_progress - - searching - - completed - - incomplete - - failed - description: |- - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, - queries: - type: array - items: - type: string - description: The queries used to search for files. - results: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: |- - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - title: File search tool call - OpenAI.ItemResourceFunctionShellCall: - type: object - required: - - type - - id - - call_id - - action - - status - properties: - type: - type: string - enum: - - shell_call - description: The type of the item. Always `shell_call`. - x-stainless-const: true - default: shell_call - id: - type: string - description: The unique ID of the shell tool call. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the shell tool call generated by the model. - action: - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionShellAction' - description: The shell commands and limits that describe how to run the tool call. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.LocalShellCallStatus' - description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - created_by: - type: string - description: The ID of the entity that created this tool call. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A tool call that executes one or more shell commands in a managed environment. - title: Shell tool call - OpenAI.ItemResourceFunctionShellCallOutput: - type: object - required: - - type - - id - - call_id - - output - - max_output_length - properties: - type: - type: string - enum: - - shell_call_output - description: The type of the shell call output. Always `shell_call_output`. - x-stainless-const: true - default: shell_call_output - id: - type: string - description: The unique ID of the shell call output. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the shell tool call generated by the model. - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent' - description: An array of shell call output contents - max_output_length: - anyOf: - - type: integer - - type: 'null' - created_by: - type: string - description: The identifier of the actor that created the item. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: The output of a shell tool call that was emitted. - title: Shell call output - OpenAI.ItemResourceFunctionToolCallOutputResource: - type: object - required: - - type - - call_id - - output - properties: - id: - type: string - description: |- - The unique ID of the function tool call output. Populated when this item - is returned via API. - type: - type: string - enum: - - function_call_output - description: The type of the function tool call output. Always `function_call_output`. - x-stainless-const: true - call_id: - type: string - description: The unique ID of the function tool call generated by the model. - output: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.FunctionAndCustomToolCallOutput' - description: |- - The output from the function call generated by your code. - Can be a string or an list of output content. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - OpenAI.ItemResourceFunctionToolCallResource: - type: object - required: - - type - - call_id - - name - - arguments - properties: - id: - type: string - description: The unique ID of the function tool call. - type: - type: string - enum: - - function_call - description: The type of the function tool call. Always `function_call`. - x-stainless-const: true - call_id: - type: string - description: The unique ID of the function tool call generated by the model. - name: - type: string - description: The name of the function to run. - arguments: - type: string - description: A JSON string of the arguments to pass to the function. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - OpenAI.ItemResourceImageGenToolCall: - type: object - required: - - type - - id - - status - - result - properties: - type: - type: string - enum: - - image_generation_call - description: The type of the image generation call. Always `image_generation_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the image generation call. - status: - type: string - enum: - - in_progress - - completed - - generating - - failed - description: The status of the image generation call. - result: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: An image generation request made by the model. - title: Image generation call - OpenAI.ItemResourceLocalShellToolCall: - type: object - required: - - type - - id - - call_id - - action - - status - properties: - type: - type: string - enum: - - local_shell_call - description: The type of the local shell call. Always `local_shell_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the local shell call. - call_id: - type: string - description: The unique ID of the local shell tool call generated by the model. - action: - $ref: '#/components/schemas/OpenAI.LocalShellExecAction' - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: The status of the local shell call. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A tool call to run a command on the local shell. - title: Local shell call - OpenAI.ItemResourceLocalShellToolCallOutput: - type: object - required: - - type - - id - - output - properties: - type: - type: string - enum: - - local_shell_call_output - description: The type of the local shell tool call output. Always `local_shell_call_output`. - x-stainless-const: true - id: - type: string - description: The unique ID of the local shell tool call generated by the model. - output: - type: string - description: A JSON string of the output of the local shell tool call. - status: - anyOf: - - type: string - enum: - - in_progress - - completed - - incomplete - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: The output of a local shell tool call. - title: Local shell call output - OpenAI.ItemResourceMcpApprovalRequest: - type: object - required: - - type - - id - - server_label - - name - - arguments - properties: - type: - type: string - enum: - - mcp_approval_request - description: The type of the item. Always `mcp_approval_request`. - x-stainless-const: true - id: - type: string - description: The unique ID of the approval request. - server_label: - type: string - description: The label of the MCP server making the request. - name: - type: string - description: The name of the tool to run. - arguments: - type: string - description: A JSON string of arguments for the tool. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A request for human approval of a tool invocation. - title: MCP approval request - OpenAI.ItemResourceMcpApprovalResponseResource: - type: object - required: - - type - - id - - approval_request_id - - approve - properties: - type: - type: string - enum: - - mcp_approval_response - description: The type of the item. Always `mcp_approval_response`. - x-stainless-const: true - id: - type: string - description: The unique ID of the approval response - approval_request_id: - type: string - description: The ID of the approval request being answered. - approve: - type: boolean - description: Whether the request was approved. - reason: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A response to an MCP approval request. - title: MCP approval response - OpenAI.ItemResourceMcpListTools: - type: object - required: - - type - - id - - server_label - - tools - properties: - type: - type: string - enum: - - mcp_list_tools - description: The type of the item. Always `mcp_list_tools`. - x-stainless-const: true - id: - type: string - description: The unique ID of the list. - server_label: - type: string - description: The label of the MCP server. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.MCPListToolsTool' - description: The tools available on the server. - error: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A list of tools available on an MCP server. - title: MCP list tools - OpenAI.ItemResourceMcpToolCall: - type: object - required: - - type - - id - - server_label - - name - - arguments - properties: - type: - type: string - enum: - - mcp_call - description: The type of the item. Always `mcp_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the tool call. - server_label: - type: string - description: The label of the MCP server running the tool. - name: - type: string - description: The name of the tool that was run. - arguments: - type: string - description: A JSON string of the arguments passed to the tool. - output: - anyOf: - - type: string - - type: 'null' - error: - anyOf: - - type: string - - type: 'null' - status: - allOf: - - $ref: '#/components/schemas/OpenAI.MCPToolCallStatus' - description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - approval_request_id: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: An invocation of a tool on an MCP server. - title: MCP tool call - OpenAI.ItemResourceOutputMessage: - type: object - required: - - id - - type - - role - - content - - status - properties: - id: - type: string - description: The unique ID of the output message. - x-stainless-go-json: omitzero - type: - type: string - enum: - - output_message - description: The type of the output message. Always `message`. - x-stainless-const: true - role: - type: string - enum: - - assistant - description: The role of the output message. Always `assistant`. - x-stainless-const: true - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputMessageContent' - description: The content of the output message. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: An output message from the model. - title: Output message - OpenAI.ItemResourceType: - anyOf: - - type: string - - type: string - enum: - - message - - output_message - - file_search_call - - computer_call - - computer_call_output - - web_search_call - - function_call - - function_call_output - - image_generation_call - - code_interpreter_call - - local_shell_call - - local_shell_call_output - - shell_call - - shell_call_output - - apply_patch_call - - apply_patch_call_output - - mcp_list_tools - - mcp_approval_request - - mcp_approval_response - - mcp_call - OpenAI.ItemResourceWebSearchToolCall: - type: object - required: - - id - - type - - status - - action - properties: - id: - type: string - description: The unique ID of the web search tool call. - type: - type: string - enum: - - web_search_call - description: The type of the web search tool call. Always `web_search_call`. - x-stainless-const: true - status: - type: string - enum: - - in_progress - - searching - - completed - - failed - description: The status of the web search tool call. - action: - anyOf: - - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch' - - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage' - - $ref: '#/components/schemas/OpenAI.WebSearchActionFind' - description: |- - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). - allOf: - - $ref: '#/components/schemas/OpenAI.ItemResource' - description: |- - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - title: Web search tool call - OpenAI.KeyPressAction: - type: object - required: - - type - - keys - properties: - type: - type: string - enum: - - keypress - description: Specifies the event type. For a keypress action, this property is always set to `keypress`. - x-stainless-const: true - default: keypress - keys: - type: array - items: - type: string - description: The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a key. - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A collection of keypresses the model would like to perform. - title: KeyPress - OpenAI.ListBatchesResponse: - type: object - required: - - data - - has_more - - object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.Batch' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - object: - type: string - enum: - - list - x-stainless-const: true - OpenAI.ListFilesResponse: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.OpenAIFile' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - OpenAI.ListFineTuningCheckpointPermissionResponse: - type: object - required: - - data - - object - - has_more - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.FineTuningCheckpointPermission' - object: - type: string - enum: - - list - x-stainless-const: true - first_id: - anyOf: - - type: string - - type: 'null' - last_id: - anyOf: - - type: string - - type: 'null' - has_more: - type: boolean - OpenAI.ListFineTuningJobCheckpointsResponse: - type: object - required: - - data - - object - - has_more - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.FineTuningJobCheckpoint' - object: - type: string - enum: - - list - x-stainless-const: true - first_id: - anyOf: - - type: string - - type: 'null' - last_id: - anyOf: - - type: string - - type: 'null' - has_more: - type: boolean - OpenAI.ListFineTuningJobEventsResponse: - type: object - required: - - data - - object - - has_more - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.FineTuningJobEvent' - object: - type: string - enum: - - list - x-stainless-const: true - has_more: - type: boolean - OpenAI.ListMessagesResponse: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.MessageObject' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - OpenAI.ListModelsResponse: - type: object - required: - - object - - data - properties: - object: - type: string - enum: - - list - x-stainless-const: true - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.Model' - OpenAI.ListPaginatedFineTuningJobsResponse: - type: object - required: - - data - - has_more - - object - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.FineTuningJob' - has_more: - type: boolean - object: - type: string - enum: - - list - x-stainless-const: true - OpenAI.ListRunStepsResponse: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.RunStepObject' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - OpenAI.ListRunsResponse: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.RunObject' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - OpenAI.ListVectorStoreFilesResponse: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.VectorStoreFileObject' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - OpenAI.ListVectorStoresResponse: - type: object - required: - - object - - data - - first_id - - last_id - - has_more - properties: - object: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.VectorStoreObject' - first_id: - type: string - last_id: - type: string - has_more: - type: boolean - OpenAI.LocalShellCallStatus: - type: string - enum: - - in_progress - - completed - - incomplete - OpenAI.LocalShellExecAction: - type: object - required: - - type - - command - - env - properties: - type: - type: string - enum: - - exec - description: The type of the local shell action. Always `exec`. - x-stainless-const: true - default: exec - command: - type: array - items: - type: string - description: The command to run. - timeout_ms: - anyOf: - - type: integer - - type: 'null' - working_directory: - anyOf: - - type: string - - type: 'null' - env: - type: object - unevaluatedProperties: - type: string - description: Environment variables to set for the command. - x-oaiTypeLabel: map - user: - anyOf: - - type: string - - type: 'null' - description: Execute a shell command on the server. - title: Local shell exec action - OpenAI.LocalShellToolParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - local_shell - description: The type of the local shell tool. Always `local_shell`. - x-stainless-const: true - default: local_shell - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: A tool that allows the model to execute shell commands in a local environment. - title: Local shell tool - OpenAI.LogProb: - type: object - required: - - token - - logprob - - bytes - - top_logprobs - properties: - token: - type: string - logprob: - type: number - bytes: - type: array - items: - type: integer - top_logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.TopLogProb' - description: The log probability of a token. - title: Log probability - OpenAI.MCPListToolsTool: - type: object - required: - - name - - input_schema - properties: - name: - type: string - description: The name of the tool. - description: - anyOf: - - type: string - - type: 'null' - input_schema: - allOf: - - $ref: '#/components/schemas/OpenAI.MCPListToolsToolInputSchema' - description: The JSON schema describing the tool's input. - annotations: - anyOf: - - $ref: '#/components/schemas/OpenAI.MCPListToolsToolAnnotations' - - type: 'null' - description: A tool available on an MCP server. - title: MCP list tools tool - OpenAI.MCPListToolsToolAnnotations: - type: object - OpenAI.MCPListToolsToolInputSchema: - type: object - OpenAI.MCPTool: - type: object - required: - - type - - server_label - properties: - type: - type: string - enum: - - mcp - description: The type of the MCP tool. Always `mcp`. - x-stainless-const: true - server_label: - type: string - description: A label for this MCP server, used to identify it in tool calls. - server_url: - type: string - format: uri - description: |- - The URL for the MCP server. One of `server_url` or `connector_id` must be - provided. - connector_id: - type: string - enum: - - connector_dropbox - - connector_gmail - - connector_googlecalendar - - connector_googledrive - - connector_microsoftteams - - connector_outlookcalendar - - connector_outlookemail - - connector_sharepoint - description: |- - Identifier for service connectors, like those available in ChatGPT. One of - `server_url` or `connector_id` must be provided. Learn more about service - connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). - Currently supported `connector_id` values are: - - Dropbox: `connector_dropbox` - - Gmail: `connector_gmail` - - Google Calendar: `connector_googlecalendar` - - Google Drive: `connector_googledrive` - - Microsoft Teams: `connector_microsoftteams` - - Outlook Calendar: `connector_outlookcalendar` - - Outlook Email: `connector_outlookemail` - - SharePoint: `connector_sharepoint` - authorization: - type: string - description: |- - An OAuth access token that can be used with a remote MCP server, either - with a custom MCP server URL or a service connector. Your application - must handle the OAuth authorization flow and provide the token here. - server_description: - type: string - description: Optional description of the MCP server, used to provide more context. - headers: - anyOf: - - type: object - unevaluatedProperties: - type: string - - type: 'null' - allowed_tools: - anyOf: - - type: array - items: - type: string - - $ref: '#/components/schemas/OpenAI.MCPToolFilter' - - type: 'null' - require_approval: - anyOf: - - $ref: '#/components/schemas/OpenAI.MCPToolRequireApproval' - - type: string - enum: - - always - - never - - type: 'null' - default: always - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: |- - Give the model access to additional tools via remote Model Context Protocol - (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). - title: MCP tool - OpenAI.MCPToolCallStatus: - type: string - enum: - - in_progress - - completed - - incomplete - - calling - - failed - OpenAI.MCPToolFilter: - type: object - properties: - tool_names: - type: array - items: - type: string - description: List of allowed tool names. - title: MCP allowed tools - read_only: - type: boolean - description: |- - Indicates whether or not a tool modifies data or is read-only. If an - MCP server is [annotated with `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), - it will match this filter. - description: A filter object to specify which tools are allowed. - title: MCP tool filter - OpenAI.MCPToolRequireApproval: - type: object - properties: - always: - $ref: '#/components/schemas/OpenAI.MCPToolFilter' - never: - $ref: '#/components/schemas/OpenAI.MCPToolFilter' - OpenAI.MessageContent: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.MessageContentType' - discriminator: - propertyName: type - mapping: - image_url: '#/components/schemas/OpenAI.MessageContentImageUrlObject' - text: '#/components/schemas/OpenAI.MessageContentTextObject' - refusal: '#/components/schemas/OpenAI.MessageContentRefusalObject' - OpenAI.MessageContentImageFileObject: - type: object - required: - - type - - image_file - properties: - type: - type: string - enum: - - image_file - description: Always `image_file`. - x-stainless-const: true - image_file: - $ref: '#/components/schemas/OpenAI.MessageContentImageFileObjectImageFile' - allOf: - - $ref: '#/components/schemas/OpenAI.MessageContent' - description: References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. - title: Image file - OpenAI.MessageContentImageFileObjectImageFile: - type: object - required: - - file_id - properties: - file_id: - type: string - detail: - type: string - enum: - - auto - - low - - high - default: auto - OpenAI.MessageContentImageUrlObject: - type: object - required: - - type - - image_url - properties: - type: - type: string - enum: - - image_url - description: The type of the content part. - x-stainless-const: true - image_url: - $ref: '#/components/schemas/OpenAI.MessageContentImageUrlObjectImageUrl' - allOf: - - $ref: '#/components/schemas/OpenAI.MessageContent' - description: References an image URL in the content of a message. - title: Image URL - OpenAI.MessageContentImageUrlObjectImageUrl: - type: object - required: - - url - properties: - url: - type: string - format: uri - detail: - type: string - enum: - - auto - - low - - high - default: auto - OpenAI.MessageContentRefusalObject: - type: object - required: - - type - - refusal - properties: - type: - type: string - enum: - - refusal - description: Always `refusal`. - x-stainless-const: true - refusal: - type: string - allOf: - - $ref: '#/components/schemas/OpenAI.MessageContent' - description: The refusal content generated by the assistant. - title: Refusal - OpenAI.MessageContentTextAnnotationsFileCitationObject: - type: object - required: - - type - - text - - file_citation - - start_index - - end_index - properties: - type: - type: string - enum: - - file_citation - description: Always `file_citation`. - x-stainless-const: true - text: - type: string - description: The text in the message content that needs to be replaced. - file_citation: - $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation' - start_index: - type: integer - minimum: 0 - end_index: - type: integer - minimum: 0 - allOf: - - $ref: '#/components/schemas/OpenAI.TextAnnotation' - description: A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. - title: File citation - OpenAI.MessageContentTextAnnotationsFileCitationObjectFileCitation: - type: object - required: - - file_id - properties: - file_id: - type: string - OpenAI.MessageContentTextAnnotationsFilePathObject: - type: object - required: - - type - - text - - file_path - - start_index - - end_index - properties: - type: - type: string - enum: - - file_path - description: Always `file_path`. - x-stainless-const: true - text: - type: string - description: The text in the message content that needs to be replaced. - file_path: - $ref: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath' - start_index: - type: integer - minimum: 0 - end_index: - type: integer - minimum: 0 - allOf: - - $ref: '#/components/schemas/OpenAI.TextAnnotation' - description: A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - title: File path - OpenAI.MessageContentTextAnnotationsFilePathObjectFilePath: - type: object - required: - - file_id - properties: - file_id: - type: string - OpenAI.MessageContentTextObject: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - description: Always `text`. - x-stainless-const: true - text: - $ref: '#/components/schemas/OpenAI.MessageContentTextObjectText' - allOf: - - $ref: '#/components/schemas/OpenAI.MessageContent' - description: The text content that is part of a message. - title: Text - OpenAI.MessageContentTextObjectText: - type: object - required: - - value - - annotations - properties: - value: - type: string - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAI.TextAnnotation' - OpenAI.MessageContentType: - anyOf: - - type: string - - type: string - enum: - - image_file - - image_url - - text - - refusal - OpenAI.MessageObject: - type: object - required: - - id - - object - - created_at - - thread_id - - status - - incomplete_details - - completed_at - - incomplete_at - - role - - content - - assistant_id - - run_id - - attachments - - metadata - properties: - id: - type: string - description: The identifier, which can be referenced in API endpoints. - object: - type: string - enum: - - thread.message - description: The object type, which is always `thread.message`. - x-stainless-const: true - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the message was created. - thread_id: - type: string - description: The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - status: - type: string - enum: - - in_progress - - incomplete - - completed - description: The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.MessageObjectIncompleteDetails' - - type: 'null' - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - incomplete_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - role: - type: string - enum: - - user - - assistant - description: The entity that produced the message. One of `user` or `assistant`. - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.MessageContent' - description: The content of the message in array of text and/or images. - assistant_id: - anyOf: - - type: string - - type: 'null' - run_id: - anyOf: - - type: string - - type: 'null' - attachments: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.MessageObjectAttachments' - - type: 'null' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). - title: The message object - x-oaiMeta: - name: The message object - beta: true - example: | - { - "id": "msg_abc123", - "object": "thread.message", - "created_at": 1698983503, - "thread_id": "thread_abc123", - "role": "assistant", - "content": [ - { - "type": "text", - "text": { - "value": "Hi! How can I help you today?", - "annotations": [] - } - } - ], - "assistant_id": "asst_abc123", - "run_id": "run_abc123", - "attachments": [], - "metadata": {} - } - OpenAI.MessageObjectAttachments: - type: object - properties: - file_id: - type: string - tools: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.AssistantToolsCode' - - $ref: '#/components/schemas/OpenAI.AssistantToolsFileSearchTypeOnly' - OpenAI.MessageObjectIncompleteDetails: - type: object - required: - - reason - properties: - reason: - type: string - enum: - - content_filter - - max_tokens - - run_cancelled - - run_expired - - run_failed - OpenAI.MessageRequestContentTextObject: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - description: Always `text`. - x-stainless-const: true - text: - type: string - description: Text content to be sent to the model - description: The text content that is part of a message. - title: Text - OpenAI.MessageRole: - type: string - enum: - - unknown - - user - - assistant - - system - - critic - - discriminator - - developer - - tool - OpenAI.MessageStatus: - type: string - enum: - - in_progress - - completed - - incomplete - OpenAI.Metadata: - type: object - unevaluatedProperties: - type: string - description: |- - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - x-oaiTypeLabel: map - OpenAI.Model: - type: object - required: - - id - - created - - object - - owned_by - properties: - id: - type: string - description: The model identifier, which can be referenced in the API endpoints. - created: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) when the model was created. - object: - type: string - enum: - - model - description: The object type, which is always "model". - x-stainless-const: true - owned_by: - type: string - description: The organization that owns the model. - description: Describes an OpenAI model offering that can be used with the API. - title: Model - x-oaiMeta: - name: The model object - example: | - { - "id": "VAR_chat_model_id", - "object": "model", - "created": 1686935002, - "owned_by": "openai" - } - OpenAI.ModifyMessageRequest: - type: object - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.ModifyRunRequest: - type: object - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.ModifyThreadRequest: - type: object - properties: - tool_resources: - anyOf: - - $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResources' - - type: 'null' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.ModifyThreadRequestToolResources: - type: object - properties: - code_interpreter: - $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter' - file_search: - $ref: '#/components/schemas/OpenAI.ModifyThreadRequestToolResourcesFileSearch' - OpenAI.ModifyThreadRequestToolResourcesCodeInterpreter: - type: object - properties: - file_ids: - type: array - items: - type: string - maxItems: 20 - OpenAI.ModifyThreadRequestToolResourcesFileSearch: - type: object - properties: - vector_store_ids: - type: array - items: - type: string - maxItems: 1 - OpenAI.Move: - type: object - required: - - type - - x - - 'y' - properties: - type: - type: string - enum: - - move - description: |- - Specifies the event type. For a move action, this property is - always set to `move`. - x-stainless-const: true - default: move - x: - type: integer - description: The x-coordinate to move to. - 'y': - type: integer - description: The y-coordinate to move to. - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A mouse move action. - title: Move - OpenAI.NoiseReductionType: - type: string - enum: - - near_field - - far_field - description: Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. - OpenAI.OpenAIFile: - type: object - required: - - id - - bytes - - created_at - - filename - - object - - purpose - - status - properties: - id: - type: string - description: The file identifier, which can be referenced in the API endpoints. - bytes: - type: integer - description: The size of the file, in bytes. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the file was created. - expires_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the file will expire. - filename: - type: string - description: The name of the file. - object: - type: string - enum: - - file - description: The object type, which is always `file`. - x-stainless-const: true - status_details: - type: string - description: Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. - deprecated: true - purpose: - type: string - enum: - - assistants - - assistants_output - - batch - - batch_output - - fine-tune - - fine-tune-results - - evals - description: The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune` and `fine-tune-results`. - status: - type: string - enum: - - uploaded - - pending - - running - - processed - - error - - deleting - - deleted - description: The `File` object represents a document that has been uploaded to OpenAI. - title: OpenAIFile - x-oaiMeta: - name: The file object - example: | - { - "id": "file-abc123", - "object": "file", - "bytes": 120000, - "created_at": 1677610602, - "expires_at": 1680202602, - "filename": "salesOverview.pdf", - "purpose": "assistants", - } - OpenAI.OtherChunkingStrategyResponseParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - other - description: Always `other`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse' - description: This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API. - title: Other Chunking Strategy - OpenAI.OutputContent: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.OutputContentType' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent' - refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent' - OpenAI.OutputContentOutputTextContent: - type: object - required: - - type - - text - - annotations - properties: - type: - type: string - enum: - - output_text - description: The type of the output text. Always `output_text`. - x-stainless-const: true - default: output_text - text: - type: string - description: The text output from the model. - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAI.Annotation' - description: The annotations of the text output. - logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.LogProb' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputContent' - description: A text output from the model. - title: Output text - OpenAI.OutputContentRefusalContent: - type: object - required: - - type - - refusal - properties: - type: - type: string - enum: - - refusal - description: The type of the refusal. Always `refusal`. - x-stainless-const: true - default: refusal - refusal: - type: string - description: The refusal explanation from the model. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputContent' - description: A refusal from the model. - title: Refusal - OpenAI.OutputContentType: - anyOf: - - type: string - - type: string - enum: - - output_text - - refusal - - reasoning_text - OpenAI.OutputItem: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.OutputItemType' - discriminator: - propertyName: type - mapping: - output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage' - file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall' - function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall' - web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall' - computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall' - reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem' - compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody' - image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall' - code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall' - local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall' - shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall' - shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput' - apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall' - apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput' - mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall' - mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools' - mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest' - custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCall' - OpenAI.OutputItemApplyPatchToolCall: - type: object - required: - - type - - id - - call_id - - status - - operation - properties: - type: - type: string - enum: - - apply_patch_call - description: The type of the item. Always `apply_patch_call`. - x-stainless-const: true - default: apply_patch_call - id: - type: string - description: The unique ID of the apply patch tool call. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the apply patch tool call generated by the model. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchCallStatus' - description: The status of the apply patch tool call. One of `in_progress` or `completed`. - operation: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchFileOperation' - description: One of the create_file, delete_file, or update_file operations applied via apply_patch. - created_by: - type: string - description: The ID of the entity that created this tool call. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A tool call that applies file diffs by creating, deleting, or updating files. - title: Apply patch tool call - OpenAI.OutputItemApplyPatchToolCallOutput: - type: object - required: - - type - - id - - call_id - - status - properties: - type: - type: string - enum: - - apply_patch_call_output - description: The type of the item. Always `apply_patch_call_output`. - x-stainless-const: true - default: apply_patch_call_output - id: - type: string - description: The unique ID of the apply patch tool call output. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the apply patch tool call generated by the model. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.ApplyPatchCallOutputStatus' - description: The status of the apply patch tool call output. One of `completed` or `failed`. - output: - anyOf: - - type: string - - type: 'null' - created_by: - type: string - description: The ID of the entity that created this tool call output. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: The output emitted by an apply patch tool call. - title: Apply patch tool call output - OpenAI.OutputItemCodeInterpreterToolCall: - type: object - required: - - type - - id - - status - - container_id - - code - - outputs - properties: - type: - type: string - enum: - - code_interpreter_call - description: The type of the code interpreter tool call. Always `code_interpreter_call`. - x-stainless-const: true - default: code_interpreter_call - id: - type: string - description: The unique ID of the code interpreter tool call. - status: - type: string - enum: - - in_progress - - completed - - incomplete - - interpreting - - failed - description: The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - container_id: - type: string - description: The ID of the container used to run the code. - code: - anyOf: - - type: string - - type: 'null' - outputs: - anyOf: - - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputLogs' - - $ref: '#/components/schemas/OpenAI.CodeInterpreterOutputImage' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A tool call to run code. - title: Code interpreter tool call - OpenAI.OutputItemCompactionBody: - type: object - required: - - type - - id - - encrypted_content - properties: - type: - type: string - enum: - - compaction - description: The type of the item. Always `compaction`. - x-stainless-const: true - default: compaction - id: - type: string - description: The unique ID of the compaction item. - encrypted_content: - type: string - description: The encrypted content that was produced by compaction. - created_by: - type: string - description: The identifier of the actor that created the item. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A compaction item generated by the [`v1/responses/compact` API](https://platform.openai.com/docs/api-reference/responses/compact). - title: Compaction item - OpenAI.OutputItemComputerToolCall: - type: object - required: - - type - - id - - call_id - - action - - pending_safety_checks - - status - properties: - type: - type: string - enum: - - computer_call - description: The type of the computer call. Always `computer_call`. - default: computer_call - id: - type: string - description: The unique ID of the computer call. - call_id: - type: string - description: An identifier used when responding to the tool call with output. - action: - $ref: '#/components/schemas/OpenAI.ComputerAction' - pending_safety_checks: - type: array - items: - $ref: '#/components/schemas/OpenAI.ComputerCallSafetyCheckParam' - description: The pending safety checks for the computer call. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - A tool call to a computer use tool. See the - [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. - title: Computer tool call - OpenAI.OutputItemCustomToolCall: - type: object - required: - - type - - call_id - - name - - input - properties: - type: - type: string - enum: - - custom_tool_call - description: The type of the custom tool call. Always `custom_tool_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the custom tool call in the OpenAI platform. - call_id: - type: string - description: An identifier used to map this custom tool call to a tool call output. - name: - type: string - description: The name of the custom tool being called. - input: - type: string - description: The input for the custom tool call generated by the model. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A call to a custom tool created by the model. - title: Custom tool call - OpenAI.OutputItemFileSearchToolCall: - type: object - required: - - id - - type - - status - - queries - properties: - id: - type: string - description: The unique ID of the file search tool call. - type: - type: string - enum: - - file_search_call - description: The type of the file search tool call. Always `file_search_call`. - x-stainless-const: true - status: - type: string - enum: - - in_progress - - searching - - completed - - incomplete - - failed - description: |- - The status of the file search tool call. One of `in_progress`, - `searching`, `incomplete` or `failed`, - queries: - type: array - items: - type: string - description: The queries used to search for files. - results: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.FileSearchToolCallResults' - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - The results of a file search tool call. See the - [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - title: File search tool call - OpenAI.OutputItemFunctionShellCall: - type: object - required: - - type - - id - - call_id - - action - - status - properties: - type: - type: string - enum: - - shell_call - description: The type of the item. Always `shell_call`. - x-stainless-const: true - default: shell_call - id: - type: string - description: The unique ID of the shell tool call. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the shell tool call generated by the model. - action: - allOf: - - $ref: '#/components/schemas/OpenAI.FunctionShellAction' - description: The shell commands and limits that describe how to run the tool call. - status: - allOf: - - $ref: '#/components/schemas/OpenAI.LocalShellCallStatus' - description: The status of the shell call. One of `in_progress`, `completed`, or `incomplete`. - created_by: - type: string - description: The ID of the entity that created this tool call. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A tool call that executes one or more shell commands in a managed environment. - title: Shell tool call - OpenAI.OutputItemFunctionShellCallOutput: - type: object - required: - - type - - id - - call_id - - output - - max_output_length - properties: - type: - type: string - enum: - - shell_call_output - description: The type of the shell call output. Always `shell_call_output`. - x-stainless-const: true - default: shell_call_output - id: - type: string - description: The unique ID of the shell call output. Populated when this item is returned via API. - call_id: - type: string - description: The unique ID of the shell tool call generated by the model. - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.FunctionShellCallOutputContent' - description: An array of shell call output contents - max_output_length: - anyOf: - - type: integer - - type: 'null' - created_by: - type: string - description: The identifier of the actor that created the item. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: The output of a shell tool call that was emitted. - title: Shell call output - OpenAI.OutputItemFunctionToolCall: - type: object - required: - - type - - call_id - - name - - arguments - properties: - id: - type: string - description: The unique ID of the function tool call. - type: - type: string - enum: - - function_call - description: The type of the function tool call. Always `function_call`. - x-stainless-const: true - call_id: - type: string - description: The unique ID of the function tool call generated by the model. - name: - type: string - description: The name of the function to run. - arguments: - type: string - description: A JSON string of the arguments to pass to the function. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - A tool call to run a function. See the - [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. - title: Function tool call - OpenAI.OutputItemImageGenToolCall: - type: object - required: - - type - - id - - status - - result - properties: - type: - type: string - enum: - - image_generation_call - description: The type of the image generation call. Always `image_generation_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the image generation call. - status: - type: string - enum: - - in_progress - - completed - - generating - - failed - description: The status of the image generation call. - result: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: An image generation request made by the model. - title: Image generation call - OpenAI.OutputItemLocalShellToolCall: - type: object - required: - - type - - id - - call_id - - action - - status - properties: - type: - type: string - enum: - - local_shell_call - description: The type of the local shell call. Always `local_shell_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the local shell call. - call_id: - type: string - description: The unique ID of the local shell tool call generated by the model. - action: - $ref: '#/components/schemas/OpenAI.LocalShellExecAction' - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: The status of the local shell call. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A tool call to run a command on the local shell. - title: Local shell call - OpenAI.OutputItemMcpApprovalRequest: - type: object - required: - - type - - id - - server_label - - name - - arguments - properties: - type: - type: string - enum: - - mcp_approval_request - description: The type of the item. Always `mcp_approval_request`. - x-stainless-const: true - id: - type: string - description: The unique ID of the approval request. - server_label: - type: string - description: The label of the MCP server making the request. - name: - type: string - description: The name of the tool to run. - arguments: - type: string - description: A JSON string of arguments for the tool. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A request for human approval of a tool invocation. - title: MCP approval request - OpenAI.OutputItemMcpListTools: - type: object - required: - - type - - id - - server_label - - tools - properties: - type: - type: string - enum: - - mcp_list_tools - description: The type of the item. Always `mcp_list_tools`. - x-stainless-const: true - id: - type: string - description: The unique ID of the list. - server_label: - type: string - description: The label of the MCP server. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.MCPListToolsTool' - description: The tools available on the server. - error: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: A list of tools available on an MCP server. - title: MCP list tools - OpenAI.OutputItemMcpToolCall: - type: object - required: - - type - - id - - server_label - - name - - arguments - properties: - type: - type: string - enum: - - mcp_call - description: The type of the item. Always `mcp_call`. - x-stainless-const: true - id: - type: string - description: The unique ID of the tool call. - server_label: - type: string - description: The label of the MCP server running the tool. - name: - type: string - description: The name of the tool that was run. - arguments: - type: string - description: A JSON string of the arguments passed to the tool. - output: - anyOf: - - type: string - - type: 'null' - error: - anyOf: - - type: string - - type: 'null' - status: - allOf: - - $ref: '#/components/schemas/OpenAI.MCPToolCallStatus' - description: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - approval_request_id: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: An invocation of a tool on an MCP server. - title: MCP tool call - OpenAI.OutputItemOutputMessage: - type: object - required: - - id - - type - - role - - content - - status - properties: - id: - type: string - description: The unique ID of the output message. - x-stainless-go-json: omitzero - type: - type: string - enum: - - output_message - description: The type of the output message. Always `message`. - x-stainless-const: true - role: - type: string - enum: - - assistant - description: The role of the output message. Always `assistant`. - x-stainless-const: true - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputMessageContent' - description: The content of the output message. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the message input. One of `in_progress`, `completed`, or - `incomplete`. Populated when input items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: An output message from the model. - title: Output message - OpenAI.OutputItemReasoningItem: - type: object - required: - - type - - id - - summary - properties: - type: - type: string - enum: - - reasoning - description: The type of the object. Always `reasoning`. - x-stainless-const: true - id: - type: string - description: The unique identifier of the reasoning content. - encrypted_content: - anyOf: - - type: string - - type: 'null' - summary: - type: array - items: - $ref: '#/components/schemas/OpenAI.Summary' - description: Reasoning summary content. - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.ReasoningTextContent' - description: Reasoning text content. - status: - type: string - enum: - - in_progress - - completed - - incomplete - description: |- - The status of the item. One of `in_progress`, `completed`, or - `incomplete`. Populated when items are returned via API. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - A description of the chain of thought used by a reasoning model while generating - a response. Be sure to include these items in your `input` to the Responses API - for subsequent turns of a conversation if you are manually - [managing context](https://platform.openai.com/docs/guides/conversation-state). - title: Reasoning - OpenAI.OutputItemType: - anyOf: - - type: string - - type: string - enum: - - output_message - - file_search_call - - function_call - - web_search_call - - computer_call - - reasoning - - compaction - - image_generation_call - - code_interpreter_call - - local_shell_call - - shell_call - - shell_call_output - - apply_patch_call - - apply_patch_call_output - - mcp_call - - mcp_list_tools - - mcp_approval_request - - custom_tool_call - OpenAI.OutputItemWebSearchToolCall: - type: object - required: - - id - - type - - status - - action - properties: - id: - type: string - description: The unique ID of the web search tool call. - type: - type: string - enum: - - web_search_call - description: The type of the web search tool call. Always `web_search_call`. - x-stainless-const: true - status: - type: string - enum: - - in_progress - - searching - - completed - - failed - description: The status of the web search tool call. - action: - anyOf: - - $ref: '#/components/schemas/OpenAI.WebSearchActionSearch' - - $ref: '#/components/schemas/OpenAI.WebSearchActionOpenPage' - - $ref: '#/components/schemas/OpenAI.WebSearchActionFind' - description: |- - An object describing the specific action taken in this web search call. - Includes details on how the model used the web (search, open_page, find). - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - The results of a web search tool call. See the - [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - title: Web search tool call - OpenAI.OutputMessageContent: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.OutputMessageContentType' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAI.OutputMessageContentOutputTextContent' - refusal: '#/components/schemas/OpenAI.OutputMessageContentRefusalContent' - OpenAI.OutputMessageContentOutputTextContent: - type: object - required: - - type - - text - - annotations - properties: - type: - type: string - enum: - - output_text - description: The type of the output text. Always `output_text`. - x-stainless-const: true - default: output_text - text: - type: string - description: The text output from the model. - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAI.Annotation' - description: The annotations of the text output. - logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.LogProb' - allOf: - - $ref: '#/components/schemas/OpenAI.OutputMessageContent' - description: A text output from the model. - title: Output text - OpenAI.OutputMessageContentRefusalContent: - type: object - required: - - type - - refusal - properties: - type: - type: string - enum: - - refusal - description: The type of the refusal. Always `refusal`. - x-stainless-const: true - default: refusal - refusal: - type: string - description: The refusal explanation from the model. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputMessageContent' - description: A refusal from the model. - title: Refusal - OpenAI.OutputMessageContentType: - anyOf: - - type: string - - type: string - enum: - - output_text - - refusal - OpenAI.OutputTextContent: - type: object - required: - - type - - text - - annotations - properties: - type: - type: string - enum: - - output_text - description: The type of the output text. Always `output_text`. - x-stainless-const: true - default: output_text - text: - type: string - description: The text output from the model. - annotations: - type: array - items: - $ref: '#/components/schemas/OpenAI.Annotation' - description: The annotations of the text output. - logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.LogProb' - description: A text output from the model. - title: Output text - OpenAI.ParallelToolCalls: - type: boolean - description: Whether to enable [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) during tool use. - OpenAI.PredictionContent: - type: object - required: - - type - - content - properties: - type: - type: string - enum: - - content - description: |- - The type of the predicted content you want to provide. This type is - currently always `content`. - x-stainless-const: true - content: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.ChatCompletionRequestMessageContentPartText' - description: |- - The content that should be matched when generating a model response. - If generated tokens would match this content, the entire model response - can be returned much more quickly. - description: |- - Static predicted output content, such as the content of a text file that is - being regenerated. - title: Static Content - OpenAI.Prompt: - type: object - required: - - id - properties: - id: - type: string - description: The unique identifier of the prompt template to use. - version: - anyOf: - - type: string - - type: 'null' - variables: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables' - - type: 'null' - description: |- - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - OpenAI.RankerVersionType: - type: string - enum: - - auto - - default-2024-11-15 - OpenAI.RankingOptions: - type: object - properties: - ranker: - allOf: - - $ref: '#/components/schemas/OpenAI.RankerVersionType' - description: The ranker to use for the file search. - score_threshold: - type: number - description: The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. - hybrid_search: - allOf: - - $ref: '#/components/schemas/OpenAI.HybridSearchOptions' - description: Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled. - OpenAI.RealtimeAudioFormats: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormatsType' - discriminator: - propertyName: type - mapping: - audio/pcm: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcm' - audio/pcmu: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcmu' - audio/pcma: '#/components/schemas/OpenAI.RealtimeAudioFormatsAudioPcma' - OpenAI.RealtimeAudioFormatsAudioPcm: - type: object - required: - - type - properties: - type: - type: string - enum: - - audio/pcm - rate: - type: number - enum: - - 24000 - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - OpenAI.RealtimeAudioFormatsAudioPcma: - type: object - required: - - type - properties: - type: - type: string - enum: - - audio/pcma - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - OpenAI.RealtimeAudioFormatsAudioPcmu: - type: object - required: - - type - properties: - type: - type: string - enum: - - audio/pcmu - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - OpenAI.RealtimeAudioFormatsType: - anyOf: - - type: string - - type: string - enum: - - audio/pcm - - audio/pcmu - - audio/pcma - OpenAI.RealtimeCallCreateRequest: - type: object - properties: - sdp: - type: string - description: WebRTC Session Description Protocol (SDP) offer generated by the caller. - session: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGA' - description: |- - Optional session configuration to apply before the realtime session is - created. Use the same parameters you would send in a [`create client secret`](https://platform.openai.com/docs/api-reference/realtime-sessions/create-realtime-client-secret) - request. - required: - - sdp - OpenAI.RealtimeCallReferRequest: - type: object - required: - - target_uri - properties: - target_uri: - type: string - description: |- - URI that should appear in the SIP Refer-To header. Supports values like - `tel:+14155550123` or `sip:agent\@example.com`. - description: |- - Parameters required to transfer a SIP call to a new destination using the - Realtime API. - title: Realtime call refer request - OpenAI.RealtimeCallRejectRequest: - type: object - properties: - status_code: - type: integer - description: |- - SIP response code to send back to the caller. Defaults to `603` (Decline) - when omitted. - description: Parameters used to decline an incoming SIP call handled by the Realtime API. - title: Realtime call reject request - OpenAI.RealtimeCreateClientSecretRequest: - type: object - properties: - expires_after: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeCreateClientSecretRequestExpiresAfter' - description: |- - Configuration for the client secret expiration. Expiration refers to the time after which - a client secret will no longer be valid for creating sessions. The session itself may - continue after that time once started. A secret can be used to create multiple sessions - until it expires. - title: Client secret expiration - session: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion' - description: |- - Session configuration to use for the client secret. Choose either a realtime - session or a transcription session. - description: |- - Create a session and client secret for the Realtime API. The request can specify - either a realtime or a transcription session configuration. - [Learn more about the Realtime API](https://platform.openai.com/docs/guides/realtime). - title: Realtime client secret creation request - OpenAI.RealtimeCreateClientSecretRequestExpiresAfter: - type: object - properties: - anchor: - type: string - enum: - - created_at - x-stainless-const: true - default: created_at - seconds: - type: integer - minimum: 10 - maximum: 7200 - default: 600 - OpenAI.RealtimeCreateClientSecretResponse: - type: object - required: - - value - - expires_at - - session - properties: - value: - type: string - description: The generated client secret value. - expires_at: - type: integer - format: unixtime - description: Expiration timestamp for the client secret, in seconds since epoch. - session: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion' - description: The session configuration for either a realtime or transcription session. - description: Response from creating a session and client secret for the Realtime API. - title: Realtime session and client secret - x-oaiMeta: - name: Session response object - group: realtime - example: | - { - "value": "ek_68af296e8e408191a1120ab6383263c2", - "expires_at": 1756310470, - "session": { - "type": "realtime", - "object": "realtime.session", - "id": "sess_C9CiUVUzUzYIssh3ELY1d", - "model": "gpt-realtime-2025-08-25", - "output_modalities": [ - "audio" - ], - "instructions": "You are a friendly assistant.", - "tools": [], - "tool_choice": "auto", - "max_output_tokens": "inf", - "tracing": null, - "truncation": "auto", - "prompt": null, - "expires_at": 0, - "audio": { - "input": { - "format": { - "type": "audio/pcm", - "rate": 24000 - }, - "transcription": null, - "noise_reduction": null, - "turn_detection": { - "type": "server_vad", - "threshold": 0.5, - "prefix_padding_ms": 300, - "silence_duration_ms": 200, - "idle_timeout_ms": null, - "create_response": true, - "interrupt_response": true - } - }, - "output": { - "format": { - "type": "audio/pcm", - "rate": 24000 - }, - "voice": "alloy", - "speed": 1.0 - } - }, - "include": null - } - } - OpenAI.RealtimeFunctionTool: - type: object - properties: - type: - type: string - enum: - - function - description: The type of the tool, i.e. `function`. - x-stainless-const: true - name: - type: string - description: The name of the function. - description: - type: string - description: |- - The description of the function, including guidance on when and how - to call it, and guidance about what to tell the user when calling - (if anything). - parameters: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeFunctionToolParameters' - description: Parameters of the function in JSON Schema. - title: Function tool - OpenAI.RealtimeFunctionToolParameters: - type: object - OpenAI.RealtimeSessionCreateRequest: - type: object - required: - - client_secret - - type - properties: - client_secret: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestClientSecret' - description: Ephemeral key returned by the API. - modalities: - type: array - items: - type: string - enum: - - text - - audio - description: |- - The set of modalities the model can respond with. To disable audio, - set this to ["text"]. - default: - - text - - audio - instructions: - type: string - description: |- - The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. - Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session. - voice: - allOf: - - $ref: '#/components/schemas/OpenAI.VoiceIdsShared' - description: The voice the model uses to respond. Supported built-in voices are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, `shimmer`, `verse`, `marin`, and `cedar`. Voice cannot be changed during the session once the model has responded with audio at least once. - input_audio_format: - type: string - description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - output_audio_format: - type: string - description: The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - input_audio_transcription: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestInputAudioTranscription' - description: |- - Configuration for input audio transcription, defaults to off and can be - set to `null` to turn off once on. Input audio transcription is not native - to the model, since the model consumes audio directly. Transcription runs - asynchronously and should be treated as rough guidance - rather than the representation understood by the model. - speed: - type: number - minimum: 0.25 - maximum: 1.5 - description: |- - The speed of the model's spoken response. 1.0 is the default speed. 0.25 is - the minimum speed. 1.5 is the maximum speed. This value can only be changed - in between model turns, not while a response is in progress. - default: 1 - tracing: - anyOf: - - type: string - enum: - - auto - - type: object - properties: - workflow_name: - type: string - group_id: - type: string - metadata: - type: object - unevaluatedProperties: {} - description: |- - Configuration options for tracing. Set to null to disable tracing. Once - tracing is enabled for a session, the configuration cannot be modified. - `auto` will create a trace for the session with default values for the - workflow name, group id, and metadata. - title: Tracing Configuration - default: auto - turn_detection: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTurnDetection' - description: |- - Configuration for turn detection. Can be set to `null` to turn off. Server - VAD means that the model will detect the start and end of speech based on - audio volume and respond at the end of user speech. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestTools' - description: Tools (functions) available to the model. - tool_choice: - type: string - description: |- - How the model chooses tools. Options are `auto`, `none`, `required`, or - specify a function. - temperature: - type: number - description: Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - max_response_output_tokens: - anyOf: - - type: integer - - type: string - enum: - - inf - description: |- - Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to - limit output tokens, or `inf` for the maximum available tokens for a - given model. Defaults to `inf`. - truncation: - $ref: '#/components/schemas/OpenAI.RealtimeTruncation' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - type: - type: string - enum: - - realtime - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion' - description: |- - A new Realtime session configuration, with an ephemeral key. Default TTL - for keys is one minute. - x-oaiMeta: - name: The session object - group: realtime - example: | - { - "id": "sess_001", - "object": "realtime.session", - "model": "gpt-realtime-2025-08-25", - "modalities": ["audio", "text"], - "instructions": "You are a friendly assistant.", - "voice": "alloy", - "input_audio_format": "pcm16", - "output_audio_format": "pcm16", - "input_audio_transcription": { - "model": "whisper-1" - }, - "turn_detection": null, - "tools": [], - "tool_choice": "none", - "temperature": 0.7, - "speed": 1.1, - "tracing": "auto", - "max_response_output_tokens": 200, - "truncation": "auto", - "prompt": null, - "client_secret": { - "value": "ek_abc123", - "expires_at": 1234567890 - } - } - OpenAI.RealtimeSessionCreateRequestClientSecret: - type: object - required: - - value - - expires_at - properties: - value: - type: string - expires_at: - type: integer - format: unixtime - OpenAI.RealtimeSessionCreateRequestGA: - type: object - required: - - type - properties: - type: - type: string - enum: - - realtime - description: The type of session to create. Always `realtime` for the Realtime API. - x-stainless-const: true - output_modalities: - type: array - items: - type: string - enum: - - text - - audio - description: |- - The set of modalities the model can respond with. It defaults to `["audio"]`, indicating - that the model will respond with audio plus a transcript. `["text"]` can be used to make - the model respond with text only. It is not possible to request both `text` and `audio` at the same time. - default: - - audio - model: - type: string - description: The Realtime model used for this session. - instructions: - type: string - description: |- - The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. - Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session. - audio: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudio' - description: Configuration for input and output audio. - include: - type: array - items: - type: string - enum: - - item.input_audio_transcription.logprobs - description: |- - Additional fields to include in server outputs. - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription. - tracing: - anyOf: - - type: string - enum: - - auto - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGATracing' - - type: 'null' - description: |- - Realtime API can write session traces to the [Traces Dashboard](/logs?api=traces). Set to null to disable tracing. Once - tracing is enabled for a session, the configuration cannot be modified. - `auto` will create a trace for the session with default values for the - workflow name, group id, and metadata. - title: Tracing Configuration - default: auto - tools: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool' - - $ref: '#/components/schemas/OpenAI.MCPTool' - description: Tools available to the model. - tool_choice: - anyOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceOptions' - - $ref: '#/components/schemas/OpenAI.ToolChoiceFunction' - - $ref: '#/components/schemas/OpenAI.ToolChoiceMCP' - description: |- - How the model chooses tools. Provide one of the string modes or force a specific - function/MCP tool. - default: auto - max_output_tokens: - anyOf: - - type: integer - - type: string - enum: - - inf - description: |- - Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to - limit output tokens, or `inf` for the maximum available tokens for a - given model. Defaults to `inf`. - truncation: - $ref: '#/components/schemas/OpenAI.RealtimeTruncation' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - description: Realtime session object configuration. - title: Realtime session configuration - OpenAI.RealtimeSessionCreateRequestGAAudio: - type: object - properties: - input: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInput' - output: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioOutput' - OpenAI.RealtimeSessionCreateRequestGAAudioInput: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - transcription: - $ref: '#/components/schemas/OpenAI.AudioTranscription' - noise_reduction: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction' - turn_detection: - $ref: '#/components/schemas/OpenAI.RealtimeTurnDetection' - OpenAI.RealtimeSessionCreateRequestGAAudioInputNoiseReduction: - type: object - properties: - type: - $ref: '#/components/schemas/OpenAI.NoiseReductionType' - OpenAI.RealtimeSessionCreateRequestGAAudioOutput: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - voice: - $ref: '#/components/schemas/OpenAI.VoiceIdsShared' - speed: - type: number - minimum: 0.25 - maximum: 1.5 - default: 1 - OpenAI.RealtimeSessionCreateRequestGATracing: - type: object - properties: - workflow_name: - type: string - group_id: - type: string - metadata: - type: object - unevaluatedProperties: {} - OpenAI.RealtimeSessionCreateRequestInputAudioTranscription: - type: object - properties: - model: - type: string - OpenAI.RealtimeSessionCreateRequestTools: - type: object - properties: - type: - type: string - enum: - - function - x-stainless-const: true - name: - type: string - description: - type: string - parameters: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestToolsParameters' - OpenAI.RealtimeSessionCreateRequestToolsParameters: - type: object - OpenAI.RealtimeSessionCreateRequestTurnDetection: - type: object - properties: - type: - type: string - threshold: - type: number - prefix_padding_ms: - type: integer - silence_duration_ms: - type: integer - OpenAI.RealtimeSessionCreateRequestUnion: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnionType' - discriminator: - propertyName: type - mapping: - realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateRequest' - transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequest' - OpenAI.RealtimeSessionCreateRequestUnionType: - anyOf: - - type: string - - type: string - enum: - - realtime - - transcription - OpenAI.RealtimeSessionCreateResponse: - type: object - required: - - type - properties: - id: - type: string - description: Unique identifier for the session that looks like `sess_1234567890abcdef`. - object: - type: string - description: The object type. Always `realtime.session`. - expires_at: - type: integer - format: unixtime - description: Expiration timestamp for the session, in seconds since epoch. - include: - type: array - items: - type: string - enum: - - item.input_audio_transcription.logprobs - description: |- - Additional fields to include in server outputs. - - `item.input_audio_transcription.logprobs`: Include logprobs for input audio transcription. - model: - type: string - description: The Realtime model used for this session. - output_modalities: - type: array - items: - type: string - enum: - - text - - audio - description: |- - The set of modalities the model can respond with. To disable audio, - set this to ["text"]. - instructions: - type: string - description: |- - The default system instructions (i.e. system message) prepended to model - calls. This field allows the client to guide the model on desired - responses. The model can be instructed on response content and format, - (e.g. "be extremely succinct", "act friendly", "here are examples of good - responses") and on audio behavior (e.g. "talk quickly", "inject emotion - into your voice", "laugh frequently"). The instructions are not guaranteed - to be followed by the model, but they provide guidance to the model on the - desired behavior. - Note that the server sets default instructions which will be used if this - field is not set and are visible in the `session.created` event at the - start of the session. - audio: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudio' - description: Configuration for input and output audio for the session. - tracing: - anyOf: - - type: string - enum: - - auto - - type: object - properties: - workflow_name: - type: string - group_id: - type: string - metadata: - type: object - unevaluatedProperties: {} - description: |- - Configuration options for tracing. Set to null to disable tracing. Once - tracing is enabled for a session, the configuration cannot be modified. - `auto` will create a trace for the session with default values for the - workflow name, group id, and metadata. - title: Tracing Configuration - default: auto - turn_detection: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseTurnDetection' - description: |- - Configuration for turn detection. Can be set to `null` to turn off. Server - VAD means that the model will detect the start and end of speech based on - audio volume and respond at the end of user speech. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.RealtimeFunctionTool' - description: Tools (functions) available to the model. - tool_choice: - type: string - description: |- - How the model chooses tools. Options are `auto`, `none`, `required`, or - specify a function. - max_output_tokens: - anyOf: - - type: integer - - type: string - enum: - - inf - description: |- - Maximum number of output tokens for a single assistant response, - inclusive of tool calls. Provide an integer between 1 and 4096 to - limit output tokens, or `inf` for the maximum available tokens for a - given model. Defaults to `inf`. - type: - type: string - enum: - - realtime - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion' - description: A Realtime session configuration object. - title: Realtime session configuration object - x-oaiMeta: - name: The session object - group: realtime - example: | - { - "id": "sess_001", - "object": "realtime.session", - "expires_at": 1742188264, - "model": "gpt-realtime", - "output_modalities": ["audio"], - "instructions": "You are a friendly assistant.", - "tools": [], - "tool_choice": "none", - "max_output_tokens": "inf", - "tracing": "auto", - "truncation": "auto", - "prompt": null, - "audio": { - "input": { - "format": { - "type": "audio/pcm", - "rate": 24000 - }, - "transcription": { "model": "whisper-1" }, - "noise_reduction": null, - "turn_detection": null - }, - "output": { - "format": { - "type": "audio/pcm", - "rate": 24000 - }, - "voice": "alloy", - "speed": 1.0 - } - } - } - OpenAI.RealtimeSessionCreateResponseAudio: - type: object - properties: - input: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInput' - output: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioOutput' - OpenAI.RealtimeSessionCreateResponseAudioInput: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - transcription: - $ref: '#/components/schemas/OpenAI.AudioTranscription' - noise_reduction: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction' - turn_detection: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection' - OpenAI.RealtimeSessionCreateResponseAudioInputNoiseReduction: - type: object - properties: - type: - $ref: '#/components/schemas/OpenAI.NoiseReductionType' - OpenAI.RealtimeSessionCreateResponseAudioInputTurnDetection: - type: object - properties: - type: - type: string - threshold: - type: number - prefix_padding_ms: - type: integer - silence_duration_ms: - type: integer - OpenAI.RealtimeSessionCreateResponseAudioOutput: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.RealtimeAudioFormats' - voice: - $ref: '#/components/schemas/OpenAI.VoiceIdsShared' - speed: - type: number - OpenAI.RealtimeSessionCreateResponseTurnDetection: - type: object - properties: - type: - type: string - threshold: - type: number - prefix_padding_ms: - type: integer - silence_duration_ms: - type: integer - OpenAI.RealtimeSessionCreateResponseUnion: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnionType' - discriminator: - propertyName: type - mapping: - realtime: '#/components/schemas/OpenAI.RealtimeSessionCreateResponse' - transcription: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponse' - OpenAI.RealtimeSessionCreateResponseUnionType: - anyOf: - - type: string - - type: string - enum: - - realtime - - transcription - OpenAI.RealtimeTranscriptionSessionCreateRequest: - type: object - required: - - type - properties: - turn_detection: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection' - description: Configuration for turn detection. Can be set to `null` to turn off. Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. - input_audio_noise_reduction: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction' - description: |- - Configuration for input audio noise reduction. This can be set to `null` to turn off. - Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. - Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. - input_audio_format: - type: string - enum: - - pcm16 - - g711_ulaw - - g711_alaw - description: |- - The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, - single channel (mono), and little-endian byte order. - default: pcm16 - input_audio_transcription: - allOf: - - $ref: '#/components/schemas/OpenAI.AudioTranscription' - description: Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. - include: - type: array - items: - type: string - enum: - - item.input_audio_transcription.logprobs - description: |- - The set of items to include in the transcription. Current available items are: - `item.input_audio_transcription.logprobs` - type: - type: string - enum: - - transcription - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateRequestUnion' - description: Realtime transcription session object configuration. - title: Realtime transcription session configuration - OpenAI.RealtimeTranscriptionSessionCreateRequestInputAudioNoiseReduction: - type: object - properties: - type: - $ref: '#/components/schemas/OpenAI.NoiseReductionType' - OpenAI.RealtimeTranscriptionSessionCreateRequestTurnDetection: - type: object - properties: - type: - type: string - enum: - - server_vad - threshold: - type: number - prefix_padding_ms: - type: integer - silence_duration_ms: - type: integer - OpenAI.RealtimeTranscriptionSessionCreateResponse: - type: object - required: - - client_secret - - type - properties: - client_secret: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret' - description: |- - Ephemeral key returned by the API. Only present when the session is - created on the server via REST API. - modalities: - type: array - items: - type: string - enum: - - text - - audio - description: |- - The set of modalities the model can respond with. To disable audio, - set this to ["text"]. - input_audio_format: - type: string - description: The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - input_audio_transcription: - allOf: - - $ref: '#/components/schemas/OpenAI.AudioTranscription' - description: Configuration of the transcription model. - turn_detection: - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection' - description: |- - Configuration for turn detection. Can be set to `null` to turn off. Server - VAD means that the model will detect the start and end of speech based on - audio volume and respond at the end of user speech. - type: - type: string - enum: - - transcription - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.RealtimeSessionCreateResponseUnion' - description: |- - A new Realtime transcription session configuration. - When a session is created on the server via REST API, the session object - also contains an ephemeral key. Default TTL for keys is 10 minutes. This - property is not present when a session is updated via the WebSocket API. - x-oaiMeta: - name: The transcription session object - group: realtime - example: | - { - "id": "sess_BBwZc7cFV3XizEyKGDCGL", - "object": "realtime.transcription_session", - "expires_at": 1742188264, - "modalities": ["audio", "text"], - "turn_detection": { - "type": "server_vad", - "threshold": 0.5, - "prefix_padding_ms": 300, - "silence_duration_ms": 200 - }, - "input_audio_format": "pcm16", - "input_audio_transcription": { - "model": "gpt-4o-transcribe", - "language": null, - "prompt": "" - }, - "client_secret": null - } - OpenAI.RealtimeTranscriptionSessionCreateResponseClientSecret: - type: object - required: - - value - - expires_at - properties: - value: - type: string - expires_at: - type: integer - format: unixtime - OpenAI.RealtimeTranscriptionSessionCreateResponseTurnDetection: - type: object - properties: - type: - type: string - threshold: - type: number - prefix_padding_ms: - type: integer - silence_duration_ms: - type: integer - OpenAI.RealtimeTruncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: object - properties: - type: - type: string - enum: - - retention_ratio - x-stainless-const: true - retention_ratio: - type: number - minimum: 0 - maximum: 1 - token_limits: - $ref: '#/components/schemas/OpenAI.TokenLimits' - required: - - type - - retention_ratio - description: |- - When the number of tokens in a conversation exceeds the model's input token limit, the conversation be truncated, meaning messages (starting from the oldest) will not be included in the model's context. A 32k context model with 4,096 max output tokens can only include 28,224 tokens in the context before truncation occurs. - Clients can configure truncation behavior to truncate with a lower max token limit, which is an effective way to control token usage and cost. - Truncation will reduce the number of cached tokens on the next turn (busting the cache), since messages are dropped from the beginning of the context. However, clients can also configure truncation to retain messages up to a fraction of the maximum context size, which will reduce the need for future truncations and thus improve the cache rate. - Truncation can be disabled entirely, which means the server will never truncate but would instead return an error if the conversation exceeds the model's input token limit. - title: Realtime Truncation Controls - OpenAI.RealtimeTurnDetection: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.RealtimeTurnDetectionType' - discriminator: - propertyName: type - OpenAI.RealtimeTurnDetectionType: - type: string - OpenAI.Reasoning: - type: object - properties: - effort: - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - summary: - anyOf: - - type: string - enum: - - auto - - concise - - detailed - - type: 'null' - generate_summary: - anyOf: - - type: string - enum: - - auto - - concise - - detailed - - type: 'null' - description: |- - **gpt-5 and o-series models only** - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - title: Reasoning - OpenAI.ReasoningEffort: - anyOf: - - type: string - enum: - - none - - minimal - - low - - medium - - high - - xhigh - - type: 'null' - description: |- - Constrains effort on reasoning for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - reasoning effort can result in faster responses and fewer tokens used - on reasoning in a response. - - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. - - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - - `xhigh` is supported for all models after `gpt-5.1-codex-max`. - OpenAI.ReasoningTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - reasoning_text - description: The type of the reasoning text. Always `reasoning_text`. - x-stainless-const: true - default: reasoning_text - text: - type: string - description: The reasoning text from the model. - allOf: - - $ref: '#/components/schemas/OpenAI.OutputContent' - description: Reasoning text from the model. - title: ReasoningTextContent - OpenAI.RefusalContent: - type: object - required: - - type - - refusal - properties: - type: - type: string - enum: - - refusal - description: The type of the refusal. Always `refusal`. - x-stainless-const: true - default: refusal - refusal: - type: string - description: The refusal explanation from the model. - description: A refusal from the model. - title: Refusal - OpenAI.Response: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - title: The response object - OpenAI.ResponseAudioDeltaEvent: - type: object - required: - - type - - sequence_number - - delta - properties: - type: - type: string - enum: - - response.audio.delta - description: The type of the event. Always `response.audio.delta`. - x-stainless-const: true - sequence_number: - type: integer - description: A sequence number for this chunk of the stream response. - delta: - type: string - contentEncoding: base64 - description: A chunk of Base64 encoded response audio bytes. - description: Emitted when there is a partial audio response. - x-oaiMeta: - name: response.audio.delta - group: responses - example: | - { - "type": "response.audio.delta", - "response_id": "resp_123", - "delta": "base64encoded...", - "sequence_number": 1 - } - OpenAI.ResponseAudioTranscriptDeltaEvent: - type: object - required: - - type - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.audio.transcript.delta - description: The type of the event. Always `response.audio.transcript.delta`. - x-stainless-const: true - delta: - type: string - description: The partial transcript of the audio response. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when there is a partial transcript of audio. - x-oaiMeta: - name: response.audio.transcript.delta - group: responses - example: | - { - "type": "response.audio.transcript.delta", - "response_id": "resp_123", - "delta": " ... partial transcript ... ", - "sequence_number": 1 - } - OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent: - type: object - required: - - type - - output_index - - item_id - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.code_interpreter_call_code.delta - description: The type of the event. Always `response.code_interpreter_call_code.delta`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response for which the code is being streamed. - item_id: - type: string - description: The unique identifier of the code interpreter tool call item. - delta: - type: string - description: The partial code snippet being streamed by the code interpreter. - sequence_number: - type: integer - description: The sequence number of this event, used to order streaming events. - description: Emitted when a partial code snippet is streamed by the code interpreter. - x-oaiMeta: - name: response.code_interpreter_call_code.delta - group: responses - example: | - { - "type": "response.code_interpreter_call_code.delta", - "output_index": 0, - "item_id": "ci_12345", - "delta": "print('Hello, world')", - "sequence_number": 1 - } - OpenAI.ResponseCodeInterpreterCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.code_interpreter_call.in_progress - description: The type of the event. Always `response.code_interpreter_call.in_progress`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response for which the code interpreter call is in progress. - item_id: - type: string - description: The unique identifier of the code interpreter tool call item. - sequence_number: - type: integer - description: The sequence number of this event, used to order streaming events. - description: Emitted when a code interpreter call is in progress. - x-oaiMeta: - name: response.code_interpreter_call.in_progress - group: responses - example: | - { - "type": "response.code_interpreter_call.in_progress", - "output_index": 0, - "item_id": "ci_12345", - "sequence_number": 1 - } - OpenAI.ResponseCodeInterpreterCallInterpretingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.code_interpreter_call.interpreting - description: The type of the event. Always `response.code_interpreter_call.interpreting`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response for which the code interpreter is interpreting code. - item_id: - type: string - description: The unique identifier of the code interpreter tool call item. - sequence_number: - type: integer - description: The sequence number of this event, used to order streaming events. - description: Emitted when the code interpreter is actively interpreting the code snippet. - x-oaiMeta: - name: response.code_interpreter_call.interpreting - group: responses - example: | - { - "type": "response.code_interpreter_call.interpreting", - "output_index": 4, - "item_id": "ci_12345", - "sequence_number": 1 - } - OpenAI.ResponseContentPartAddedEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - part - - sequence_number - properties: - type: - type: string - enum: - - response.content_part.added - description: The type of the event. Always `response.content_part.added`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the content part was added to. - output_index: - type: integer - description: The index of the output item that the content part was added to. - content_index: - type: integer - description: The index of the content part that was added. - part: - allOf: - - $ref: '#/components/schemas/OpenAI.OutputContent' - description: The content part that was added. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a new content part is added. - x-oaiMeta: - name: response.content_part.added - group: responses - example: | - { - "type": "response.content_part.added", - "item_id": "msg_123", - "output_index": 0, - "content_index": 0, - "part": { - "type": "output_text", - "text": "", - "annotations": [] - }, - "sequence_number": 1 - } - OpenAI.ResponseCreatedEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.created - description: The type of the event. Always `response.created`. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that was created. - sequence_number: - type: integer - description: The sequence number for this event. - description: An event that is emitted when a response is created. - x-oaiMeta: - name: response.created - group: responses - example: | - { - "type": "response.created", - "response": { - "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", - "object": "response", - "created_at": 1741487325, - "status": "in_progress", - "completed_at": null, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-2024-08-06", - "output": [], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - }, - "sequence_number": 1 - } - OpenAI.ResponseCustomToolCallInputDeltaEvent: - type: object - required: - - type - - sequence_number - - output_index - - item_id - - delta - properties: - type: - type: string - enum: - - response.custom_tool_call_input.delta - description: The event type identifier. - x-stainless-const: true - sequence_number: - type: integer - description: The sequence number of this event. - output_index: - type: integer - description: The index of the output this delta applies to. - item_id: - type: string - description: Unique identifier for the API item associated with this event. - delta: - type: string - description: The incremental input data (delta) for the custom tool call. - description: Event representing a delta (partial update) to the input of a custom tool call. - title: ResponseCustomToolCallInputDelta - x-oaiMeta: - name: response.custom_tool_call_input.delta - group: responses - example: | - { - "type": "response.custom_tool_call_input.delta", - "output_index": 0, - "item_id": "ctc_1234567890abcdef", - "delta": "partial input text" - } - OpenAI.ResponseError: - type: object - required: - - code - - message - properties: - code: - $ref: '#/components/schemas/OpenAI.ResponseErrorCode' - message: - type: string - description: A human-readable description of the error. - description: An error object returned when the model fails to generate a Response. - OpenAI.ResponseErrorCode: - type: string - enum: - - server_error - - rate_limit_exceeded - - invalid_prompt - - vector_store_timeout - - invalid_image - - invalid_image_format - - invalid_base64_image - - invalid_image_url - - image_too_large - - image_too_small - - image_parse_error - - image_content_policy_violation - - invalid_image_mode - - image_file_too_large - - unsupported_image_media_type - - empty_image_file - - failed_to_download_image - - image_file_not_found - description: The error code for the response. - OpenAI.ResponseErrorEvent: - type: object - required: - - type - - code - - message - - param - - sequence_number - properties: - type: - type: string - enum: - - error - description: The type of the event. Always `error`. - x-stainless-const: true - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - description: The error message. - param: - anyOf: - - type: string - - type: 'null' - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when an error occurs. - x-oaiMeta: - name: error - group: responses - example: | - { - "type": "error", - "code": "ERR_SOMETHING", - "message": "Something went wrong", - "param": null, - "sequence_number": 1 - } - OpenAI.ResponseFailedEvent: - type: object - required: - - type - - sequence_number - - response - properties: - type: - type: string - enum: - - response.failed - description: The type of the event. Always `response.failed`. - x-stainless-const: true - sequence_number: - type: integer - description: The sequence number of this event. - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that failed. - description: An event that is emitted when a response fails. - x-oaiMeta: - name: response.failed - group: responses - example: | - { - "type": "response.failed", - "response": { - "id": "resp_123", - "object": "response", - "created_at": 1740855869, - "status": "failed", - "completed_at": null, - "error": { - "code": "server_error", - "message": "The model failed to generate a response." - }, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-mini-2024-07-18", - "output": [], - "previous_response_id": null, - "reasoning_effort": null, - "store": false, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - } - } - OpenAI.ResponseFileSearchCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.file_search_call.in_progress - description: The type of the event. Always `response.file_search_call.in_progress`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the file search call is initiated. - item_id: - type: string - description: The ID of the output item that the file search call is initiated. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a file search call is initiated. - x-oaiMeta: - name: response.file_search_call.in_progress - group: responses - example: | - { - "type": "response.file_search_call.in_progress", - "output_index": 0, - "item_id": "fs_123", - "sequence_number": 1 - } - OpenAI.ResponseFileSearchCallSearchingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.file_search_call.searching - description: The type of the event. Always `response.file_search_call.searching`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the file search call is searching. - item_id: - type: string - description: The ID of the output item that the file search call is initiated. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a file search is currently searching. - x-oaiMeta: - name: response.file_search_call.searching - group: responses - example: | - { - "type": "response.file_search_call.searching", - "output_index": 0, - "item_id": "fs_123", - "sequence_number": 1 - } - OpenAI.ResponseFormatJsonObject: - type: object - required: - - type - properties: - type: - type: string - enum: - - json_object - description: The type of response format being defined. Always `json_object`. - x-stainless-const: true - description: |- - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - title: JSON object - OpenAI.ResponseFormatJsonSchema: - type: object - required: - - type - - json_schema - properties: - type: - type: string - enum: - - json_schema - description: The type of response format being defined. Always `json_schema`. - x-stainless-const: true - json_schema: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaJsonSchema' - description: Structured Outputs configuration options, including a JSON Schema. - title: JSON schema - allOf: - - $ref: '#/components/schemas/OpenAI.CreateChatCompletionRequestResponseFormat' - description: |- - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - title: JSON schema - OpenAI.ResponseFormatJsonSchemaJsonSchema: - type: object - required: - - name - properties: - description: - type: string - name: - type: string - schema: - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema' - strict: - anyOf: - - type: boolean - - type: 'null' - OpenAI.ResponseFormatJsonSchemaSchema: - type: object - unevaluatedProperties: {} - description: |- - The schema for the response format, described as a JSON Schema object. - Learn how to build JSON schemas [here](https://json-schema.org/). - title: JSON schema - OpenAI.ResponseFormatText: - type: object - required: - - type - properties: - type: - type: string - enum: - - text - description: The type of response format being defined. Always `text`. - x-stainless-const: true - description: Default response format. Used to generate text responses. - title: Text - OpenAI.ResponseFunctionCallArgumentsDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - - delta - properties: - type: - type: string - enum: - - response.function_call_arguments.delta - description: The type of the event. Always `response.function_call_arguments.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the function-call arguments delta is added to. - output_index: - type: integer - description: The index of the output item that the function-call arguments delta is added to. - sequence_number: - type: integer - description: The sequence number of this event. - delta: - type: string - description: The function-call arguments delta that is added. - description: Emitted when there is a partial function-call arguments delta. - x-oaiMeta: - name: response.function_call_arguments.delta - group: responses - example: | - { - "type": "response.function_call_arguments.delta", - "item_id": "item-abc", - "output_index": 0, - "delta": "{ "arg":" - "sequence_number": 1 - } - OpenAI.ResponseImageGenCallGeneratingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.image_generation_call.generating - description: The type of the event. Always 'response.image_generation_call.generating'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the image generation item being processed. - sequence_number: - type: integer - description: The sequence number of the image generation item being processed. - description: Emitted when an image generation tool call is actively generating an image (intermediate state). - title: ResponseImageGenCallGeneratingEvent - x-oaiMeta: - name: response.image_generation_call.generating - group: responses - example: | - { - "type": "response.image_generation_call.generating", - "output_index": 0, - "item_id": "item-123", - "sequence_number": 0 - } - OpenAI.ResponseImageGenCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.image_generation_call.in_progress - description: The type of the event. Always 'response.image_generation_call.in_progress'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the image generation item being processed. - sequence_number: - type: integer - description: The sequence number of the image generation item being processed. - description: Emitted when an image generation tool call is in progress. - title: ResponseImageGenCallInProgressEvent - x-oaiMeta: - name: response.image_generation_call.in_progress - group: responses - example: | - { - "type": "response.image_generation_call.in_progress", - "output_index": 0, - "item_id": "item-123", - "sequence_number": 0 - } - OpenAI.ResponseImageGenCallPartialImageEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - - partial_image_index - - partial_image_b64 - properties: - type: - type: string - enum: - - response.image_generation_call.partial_image - description: The type of the event. Always 'response.image_generation_call.partial_image'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the image generation item being processed. - sequence_number: - type: integer - description: The sequence number of the image generation item being processed. - partial_image_index: - type: integer - description: 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). - partial_image_b64: - type: string - description: Base64-encoded partial image data, suitable for rendering as an image. - description: Emitted when a partial image is available during image generation streaming. - title: ResponseImageGenCallPartialImageEvent - x-oaiMeta: - name: response.image_generation_call.partial_image - group: responses - example: | - { - "type": "response.image_generation_call.partial_image", - "output_index": 0, - "item_id": "item-123", - "sequence_number": 0, - "partial_image_index": 0, - "partial_image_b64": "..." - } - OpenAI.ResponseInProgressEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.in_progress - description: The type of the event. Always `response.in_progress`. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that is in progress. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when the response is in progress. - x-oaiMeta: - name: response.in_progress - group: responses - example: | - { - "type": "response.in_progress", - "response": { - "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", - "object": "response", - "created_at": 1741487325, - "status": "in_progress", - "completed_at": null, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-2024-08-06", - "output": [], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - }, - "sequence_number": 1 - } - OpenAI.ResponseIncompleteDetails: - type: object - properties: - reason: - type: string - enum: - - max_output_tokens - - content_filter - OpenAI.ResponseIncompleteEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.incomplete - description: The type of the event. Always `response.incomplete`. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that was incomplete. - sequence_number: - type: integer - description: The sequence number of this event. - description: An event that is emitted when a response finishes as incomplete. - x-oaiMeta: - name: response.incomplete - group: responses - example: | - { - "type": "response.incomplete", - "response": { - "id": "resp_123", - "object": "response", - "created_at": 1740855869, - "status": "incomplete", - "completed_at": null, - "error": null, - "incomplete_details": { - "reason": "max_tokens" - }, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-mini-2024-07-18", - "output": [], - "previous_response_id": null, - "reasoning_effort": null, - "store": false, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - }, - "sequence_number": 1 - } - OpenAI.ResponseItemList: - type: object - required: - - object - - data - - has_more - - first_id - - last_id - properties: - object: - type: string - enum: - - list - description: The type of object returned, must be `list`. - x-stainless-const: true - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A list of items used to generate this response. - has_more: - type: boolean - description: Whether there are more items available. - first_id: - type: string - description: The ID of the first item in the list. - last_id: - type: string - description: The ID of the last item in the list. - description: A list of Response items. - x-oaiMeta: - name: The input item list - group: responses - example: | - { - "object": "list", - "data": [ - { - "id": "msg_abc123", - "type": "message", - "role": "user", - "content": [ - { - "type": "input_text", - "text": "Tell me a three sentence bedtime story about a unicorn." - } - ] - } - ], - "first_id": "msg_abc123", - "last_id": "msg_abc123", - "has_more": false - } - OpenAI.ResponseLogProb: - type: object - required: - - token - - logprob - properties: - token: - type: string - description: A possible text token. - logprob: - type: number - description: The log probability of this token. - top_logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs' - description: The log probability of the top 20 most likely tokens. - description: |- - A logprob is the logarithmic probability that the model assigns to producing - a particular token at a given position in the sequence. Less-negative (higher) - logprob values indicate greater model confidence in that token choice. - OpenAI.ResponseLogProbTopLogprobs: - type: object - properties: - token: - type: string - logprob: - type: number - OpenAI.ResponseMCPCallArgumentsDeltaEvent: - type: object - required: - - type - - output_index - - item_id - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_call_arguments.delta - description: The type of the event. Always 'response.mcp_call_arguments.delta'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the MCP tool call item being processed. - delta: - type: string - description: A JSON string containing the partial update to the arguments for the MCP tool call. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call. - title: ResponseMCPCallArgumentsDeltaEvent - x-oaiMeta: - name: response.mcp_call_arguments.delta - group: responses - example: | - { - "type": "response.mcp_call_arguments.delta", - "output_index": 0, - "item_id": "item-abc", - "delta": "{", - "sequence_number": 1 - } - OpenAI.ResponseMCPCallFailedEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_call.failed - description: The type of the event. Always 'response.mcp_call.failed'. - x-stainless-const: true - item_id: - type: string - description: The ID of the MCP tool call item that failed. - output_index: - type: integer - description: The index of the output item that failed. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when an MCP tool call has failed. - title: ResponseMCPCallFailedEvent - x-oaiMeta: - name: response.mcp_call.failed - group: responses - example: | - { - "type": "response.mcp_call.failed", - "sequence_number": 1, - "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90", - "output_index": 0 - } - OpenAI.ResponseMCPCallInProgressEvent: - type: object - required: - - type - - sequence_number - - output_index - - item_id - properties: - type: - type: string - enum: - - response.mcp_call.in_progress - description: The type of the event. Always 'response.mcp_call.in_progress'. - x-stainless-const: true - sequence_number: - type: integer - description: The sequence number of this event. - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the MCP tool call item being processed. - description: Emitted when an MCP tool call is in progress. - title: ResponseMCPCallInProgressEvent - x-oaiMeta: - name: response.mcp_call.in_progress - group: responses - example: | - { - "type": "response.mcp_call.in_progress", - "sequence_number": 1, - "output_index": 0, - "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90" - } - OpenAI.ResponseMCPListToolsFailedEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_list_tools.failed - description: The type of the event. Always 'response.mcp_list_tools.failed'. - x-stainless-const: true - item_id: - type: string - description: The ID of the MCP tool call item that failed. - output_index: - type: integer - description: The index of the output item that failed. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when the attempt to list available MCP tools has failed. - title: ResponseMCPListToolsFailedEvent - x-oaiMeta: - name: response.mcp_list_tools.failed - group: responses - example: | - { - "type": "response.mcp_list_tools.failed", - "sequence_number": 1, - "output_index": 0, - "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" - } - OpenAI.ResponseMCPListToolsInProgressEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_list_tools.in_progress - description: The type of the event. Always 'response.mcp_list_tools.in_progress'. - x-stainless-const: true - item_id: - type: string - description: The ID of the MCP tool call item that is being processed. - output_index: - type: integer - description: The index of the output item that is being processed. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when the system is in the process of retrieving the list of available MCP tools. - title: ResponseMCPListToolsInProgressEvent - x-oaiMeta: - name: response.mcp_list_tools.in_progress - group: responses - example: | - { - "type": "response.mcp_list_tools.in_progress", - "sequence_number": 1, - "output_index": 0, - "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" - } - OpenAI.ResponseModalities: - anyOf: - - type: array - items: - type: string - enum: - - text - - audio - - type: 'null' - description: |- - Output types that you would like the model to generate. - Most models are capable of generating text, which is the default: - `["text"]` - The `gpt-4o-audio-preview` model can also be used to - [generate audio](https://platform.openai.com/docs/guides/audio). To request that this model generate - both text and audio responses, you can use: - `["text", "audio"]` - OpenAI.ResponseOutputItemAddedEvent: - type: object - required: - - type - - output_index - - sequence_number - - item - properties: - type: - type: string - enum: - - response.output_item.added - description: The type of the event. Always `response.output_item.added`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that was added. - sequence_number: - type: integer - description: The sequence number of this event. - item: - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: The output item that was added. - description: Emitted when a new output item is added. - x-oaiMeta: - name: response.output_item.added - group: responses - example: | - { - "type": "response.output_item.added", - "output_index": 0, - "item": { - "id": "msg_123", - "status": "in_progress", - "type": "message", - "role": "assistant", - "content": [] - }, - "sequence_number": 1 - } - OpenAI.ResponseOutputTextAnnotationAddedEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - annotation_index - - sequence_number - - annotation - properties: - type: - type: string - enum: - - response.output_text.annotation.added - description: The type of the event. Always 'response.output_text.annotation.added'. - x-stainless-const: true - item_id: - type: string - description: The unique identifier of the item to which the annotation is being added. - output_index: - type: integer - description: The index of the output item in the response's output array. - content_index: - type: integer - description: The index of the content part within the output item. - annotation_index: - type: integer - description: The index of the annotation within the content part. - sequence_number: - type: integer - description: The sequence number of this event. - annotation: - allOf: - - $ref: '#/components/schemas/OpenAI.Annotation' - description: The annotation object being added. (See annotation schema for details.) - description: Emitted when an annotation is added to output text content. - title: ResponseOutputTextAnnotationAddedEvent - x-oaiMeta: - name: response.output_text.annotation.added - group: responses - example: | - { - "type": "response.output_text.annotation.added", - "item_id": "item-abc", - "output_index": 0, - "content_index": 0, - "annotation_index": 0, - "annotation": { - "type": "text_annotation", - "text": "This is a test annotation", - "start": 0, - "end": 10 - }, - "sequence_number": 1 - } - OpenAI.ResponsePromptVariables: - type: object - unevaluatedProperties: - anyOf: - - type: string - - $ref: '#/components/schemas/OpenAI.InputTextContent' - - $ref: '#/components/schemas/OpenAI.InputImageContent' - - $ref: '#/components/schemas/OpenAI.InputFileContent' - description: |- - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. - title: Prompt Variables - x-oaiExpandable: true - x-oaiTypeLabel: map - OpenAI.ResponseQueuedEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.queued - description: The type of the event. Always 'response.queued'. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The full response object that is queued. - sequence_number: - type: integer - description: The sequence number for this event. - description: Emitted when a response is queued and waiting to be processed. - title: ResponseQueuedEvent - x-oaiMeta: - name: response.queued - group: responses - example: | - { - "type": "response.queued", - "response": { - "id": "res_123", - "status": "queued", - "created_at": "2021-01-01T00:00:00Z", - "updated_at": "2021-01-01T00:00:00Z" - }, - "sequence_number": 1 - } - OpenAI.ResponseReasoningSummaryPartAddedEvent: - type: object - required: - - type - - item_id - - output_index - - summary_index - - sequence_number - - part - properties: - type: - type: string - enum: - - response.reasoning_summary_part.added - description: The type of the event. Always `response.reasoning_summary_part.added`. - x-stainless-const: true - item_id: - type: string - description: The ID of the item this summary part is associated with. - output_index: - type: integer - description: The index of the output item this summary part is associated with. - summary_index: - type: integer - description: The index of the summary part within the reasoning summary. - sequence_number: - type: integer - description: The sequence number of this event. - part: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart' - description: The summary part that was added. - description: Emitted when a new reasoning summary part is added. - x-oaiMeta: - name: response.reasoning_summary_part.added - group: responses - example: | - { - "type": "response.reasoning_summary_part.added", - "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", - "output_index": 0, - "summary_index": 0, - "part": { - "type": "summary_text", - "text": "" - }, - "sequence_number": 1 - } - OpenAI.ResponseReasoningSummaryPartAddedEventPart: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - summary_text - x-stainless-const: true - text: - type: string - OpenAI.ResponseReasoningSummaryTextDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - summary_index - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.reasoning_summary_text.delta - description: The type of the event. Always `response.reasoning_summary_text.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the item this summary text delta is associated with. - output_index: - type: integer - description: The index of the output item this summary text delta is associated with. - summary_index: - type: integer - description: The index of the summary part within the reasoning summary. - delta: - type: string - description: The text delta that was added to the summary. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a delta is added to a reasoning summary text. - x-oaiMeta: - name: response.reasoning_summary_text.delta - group: responses - example: | - { - "type": "response.reasoning_summary_text.delta", - "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", - "output_index": 0, - "summary_index": 0, - "delta": "**Responding to a greeting** - - The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!", - "sequence_number": 1 - } - OpenAI.ResponseReasoningTextDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.reasoning_text.delta - description: The type of the event. Always `response.reasoning_text.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the item this reasoning text delta is associated with. - output_index: - type: integer - description: The index of the output item this reasoning text delta is associated with. - content_index: - type: integer - description: The index of the reasoning content part this delta is associated with. - delta: - type: string - description: The text delta that was added to the reasoning content. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a delta is added to a reasoning text. - x-oaiMeta: - name: response.reasoning_text.delta - group: responses - example: | - { - "type": "response.reasoning_text.delta", - "item_id": "rs_123", - "output_index": 0, - "content_index": 0, - "delta": "The", - "sequence_number": 1 - } - OpenAI.ResponseRefusalDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.refusal.delta - description: The type of the event. Always `response.refusal.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the refusal text is added to. - output_index: - type: integer - description: The index of the output item that the refusal text is added to. - content_index: - type: integer - description: The index of the content part that the refusal text is added to. - delta: - type: string - description: The refusal text that is added. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when there is a partial refusal text. - x-oaiMeta: - name: response.refusal.delta - group: responses - example: | - { - "type": "response.refusal.delta", - "item_id": "msg_123", - "output_index": 0, - "content_index": 0, - "delta": "refusal text so far", - "sequence_number": 1 - } - OpenAI.ResponseStreamOptions: - type: object - properties: - include_obfuscation: - type: boolean - description: |- - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. - description: 'Options for streaming responses. Only set this when you set `stream: true`.' - OpenAI.ResponseTextDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - delta - - sequence_number - - logprobs - properties: - type: - type: string - enum: - - response.output_text.delta - description: The type of the event. Always `response.output_text.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the text delta was added to. - output_index: - type: integer - description: The index of the output item that the text delta was added to. - content_index: - type: integer - description: The index of the content part that the text delta was added to. - delta: - type: string - description: The text delta that was added. - sequence_number: - type: integer - description: The sequence number for this event. - logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.ResponseLogProb' - description: The log probabilities of the tokens in the delta. - description: Emitted when there is an additional text delta. - x-oaiMeta: - name: response.output_text.delta - group: responses - example: | - { - "type": "response.output_text.delta", - "item_id": "msg_123", - "output_index": 0, - "content_index": 0, - "delta": "In", - "sequence_number": 1 - } - OpenAI.ResponseTextParam: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' - verbosity: - $ref: '#/components/schemas/OpenAI.Verbosity' - description: |- - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - OpenAI.ResponseUsage: - type: object - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - properties: - input_tokens: - type: integer - description: The number of input tokens. - input_tokens_details: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails' - description: A detailed breakdown of the input tokens. - output_tokens: - type: integer - description: The number of output tokens. - output_tokens_details: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails' - description: A detailed breakdown of the output tokens. - total_tokens: - type: integer - description: The total number of tokens used. - description: |- - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. - OpenAI.ResponseUsageInputTokensDetails: - type: object - required: - - cached_tokens - properties: - cached_tokens: - type: integer - OpenAI.ResponseUsageOutputTokensDetails: - type: object - required: - - reasoning_tokens - properties: - reasoning_tokens: - type: integer - OpenAI.ResponseWebSearchCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.web_search_call.in_progress - description: The type of the event. Always `response.web_search_call.in_progress`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the web search call is associated with. - item_id: - type: string - description: Unique ID for the output item associated with the web search call. - sequence_number: - type: integer - description: The sequence number of the web search call being processed. - description: 'Note: web_search is not yet available via Azure OpenAI.' - x-oaiMeta: - name: response.web_search_call.in_progress - group: responses - example: | - { - "type": "response.web_search_call.in_progress", - "output_index": 0, - "item_id": "ws_123", - "sequence_number": 0 - } - OpenAI.ResponseWebSearchCallSearchingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.web_search_call.searching - description: The type of the event. Always `response.web_search_call.searching`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the web search call is associated with. - item_id: - type: string - description: Unique ID for the output item associated with the web search call. - sequence_number: - type: integer - description: The sequence number of the web search call being processed. - description: 'Note: web_search is not yet available via Azure OpenAI.' - x-oaiMeta: - name: response.web_search_call.searching - group: responses - example: | - { - "type": "response.web_search_call.searching", - "output_index": 0, - "item_id": "ws_123", - "sequence_number": 0 - } - OpenAI.RunCompletionUsage: - type: object - required: - - completion_tokens - - prompt_tokens - - total_tokens - properties: - completion_tokens: - type: integer - description: Number of completion tokens used over the course of the run. - prompt_tokens: - type: integer - description: Number of prompt tokens used over the course of the run. - total_tokens: - type: integer - description: Total number of tokens used (prompt + completion). - description: Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). - OpenAI.RunGraderRequest: - type: object - required: - - grader - - model_sample - properties: - grader: - anyOf: - - $ref: '#/components/schemas/OpenAI.GraderStringCheck' - - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.GraderPython' - - $ref: '#/components/schemas/OpenAI.GraderScoreModel' - - $ref: '#/components/schemas/OpenAI.GraderMulti' - - $ref: '#/components/schemas/GraderEndpoint' - description: The grader used for the fine-tuning job. - item: - allOf: - - $ref: '#/components/schemas/OpenAI.RunGraderRequestItem' - description: |- - The dataset item provided to the grader. This will be used to populate - the `item` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. - model_sample: - type: string - description: |- - The model sample to be evaluated. This value will be used to populate - the `sample` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. - The `output_json` variable will be populated if the model sample is a - valid JSON string. - title: RunGraderRequest - OpenAI.RunGraderRequestItem: - type: object - OpenAI.RunGraderResponse: - type: object - required: - - reward - - metadata - - sub_rewards - - model_grader_token_usage_per_model - properties: - reward: - type: number - metadata: - $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadata' - sub_rewards: - type: object - unevaluatedProperties: {} - model_grader_token_usage_per_model: - type: object - unevaluatedProperties: {} - OpenAI.RunGraderResponseMetadata: - type: object - required: - - name - - type - - errors - - execution_time - - scores - - token_usage - - sampled_model_name - properties: - name: - type: string - type: - type: string - errors: - $ref: '#/components/schemas/OpenAI.RunGraderResponseMetadataErrors' - execution_time: - type: number - scores: - type: object - unevaluatedProperties: {} - token_usage: - anyOf: - - type: integer - - type: 'null' - sampled_model_name: - anyOf: - - type: string - - type: 'null' - OpenAI.RunGraderResponseMetadataErrors: - type: object - required: - - formula_parse_error - - sample_parse_error - - truncated_observation_error - - unresponsive_reward_error - - invalid_variable_error - - other_error - - python_grader_server_error - - python_grader_server_error_type - - python_grader_runtime_error - - python_grader_runtime_error_details - - model_grader_server_error - - model_grader_refusal_error - - model_grader_parse_error - - model_grader_server_error_details - properties: - formula_parse_error: - type: boolean - sample_parse_error: - type: boolean - truncated_observation_error: - type: boolean - unresponsive_reward_error: - type: boolean - invalid_variable_error: - type: boolean - other_error: - type: boolean - python_grader_server_error: - type: boolean - python_grader_server_error_type: - anyOf: - - type: string - - type: 'null' - python_grader_runtime_error: - type: boolean - python_grader_runtime_error_details: - anyOf: - - type: string - - type: 'null' - model_grader_server_error: - type: boolean - model_grader_refusal_error: - type: boolean - model_grader_parse_error: - type: boolean - model_grader_server_error_details: - anyOf: - - type: string - - type: 'null' - OpenAI.RunObject: - type: object - required: - - id - - object - - created_at - - thread_id - - assistant_id - - status - - required_action - - last_error - - expires_at - - started_at - - cancelled_at - - failed_at - - completed_at - - incomplete_details - - model - - instructions - - tools - - metadata - - usage - - max_prompt_tokens - - max_completion_tokens - - truncation_strategy - - tool_choice - - parallel_tool_calls - - response_format - properties: - id: - type: string - description: The identifier, which can be referenced in API endpoints. - object: - type: string - enum: - - thread.run - description: The object type, which is always `thread.run`. - x-stainless-const: true - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the run was created. - thread_id: - type: string - description: The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - assistant_id: - type: string - description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - status: - $ref: '#/components/schemas/OpenAI.RunStatus' - required_action: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunObjectRequiredAction' - - type: 'null' - description: Details on the action required to continue the run. Will be `null` if no action is required. - last_error: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunObjectLastError' - - type: 'null' - description: The last error associated with this run. Will be `null` if there are no errors. - expires_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - description: The Unix timestamp (in seconds) for when the run will expire. - started_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - description: The Unix timestamp (in seconds) for when the run was started. - cancelled_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - description: The Unix timestamp (in seconds) for when the run was cancelled. - failed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - description: The Unix timestamp (in seconds) for when the run failed. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - description: The Unix timestamp (in seconds) for when the run was completed. - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunObjectIncompleteDetails' - - type: 'null' - description: Details on why the run is incomplete. Will be `null` if the run is not incomplete. - model: - type: string - description: The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - instructions: - type: string - description: The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - tools: - type: array - items: - $ref: '#/components/schemas/OpenAI.AssistantTool' - maxItems: 20 - description: The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - default: [] - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - usage: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunCompletionUsage' - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - description: The sampling temperature used for this run. If not set, defaults to 1. - top_p: - anyOf: - - type: number - - type: 'null' - description: The nucleus sampling value used for this run. If not set, defaults to 1. - max_prompt_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 256 - description: The maximum number of prompt tokens specified to have been used over the course of the run. - max_completion_tokens: - anyOf: - - type: integer - - type: 'null' - minimum: 256 - description: The maximum number of completion tokens specified to have been used over the course of the run. - truncation_strategy: - $ref: '#/components/schemas/OpenAI.TruncationObject' - tool_choice: - $ref: '#/components/schemas/OpenAI.AssistantsApiToolChoiceOption' - parallel_tool_calls: - $ref: '#/components/schemas/OpenAI.ParallelToolCalls' - response_format: - $ref: '#/components/schemas/OpenAI.AssistantsApiResponseFormatOption' - description: Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). - title: A run on a thread - x-oaiMeta: - name: The run object - beta: true - example: | - { - "id": "run_abc123", - "object": "thread.run", - "created_at": 1698107661, - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "status": "completed", - "started_at": 1699073476, - "expires_at": null, - "cancelled_at": null, - "failed_at": null, - "completed_at": 1699073498, - "last_error": null, - "model": "gpt-4o", - "instructions": null, - "tools": [{"type": "file_search"}, {"type": "code_interpreter"}], - "metadata": {}, - "incomplete_details": null, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - }, - "temperature": 1.0, - "top_p": 1.0, - "max_prompt_tokens": 1000, - "max_completion_tokens": 1000, - "truncation_strategy": { - "type": "auto", - "last_messages": null - }, - "response_format": "auto", - "tool_choice": "auto", - "parallel_tool_calls": true - } - OpenAI.RunObjectIncompleteDetails: - type: object - properties: - reason: - type: string - enum: - - max_completion_tokens - - max_prompt_tokens - OpenAI.RunObjectLastError: - type: object - required: - - code - - message - properties: - code: - type: string - enum: - - server_error - - rate_limit_exceeded - - invalid_prompt - message: - type: string - OpenAI.RunObjectRequiredAction: - type: object - required: - - type - - submit_tool_outputs - properties: - type: - type: string - enum: - - submit_tool_outputs - x-stainless-const: true - submit_tool_outputs: - $ref: '#/components/schemas/OpenAI.RunObjectRequiredActionSubmitToolOutputs' - OpenAI.RunObjectRequiredActionSubmitToolOutputs: - type: object - required: - - tool_calls - properties: - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAI.RunToolCallObject' - OpenAI.RunStatus: - type: string - enum: - - queued - - in_progress - - requires_action - - cancelling - - cancelled - - failed - - completed - - incomplete - - expired - description: The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. - OpenAI.RunStepCompletionUsage: - type: object - required: - - completion_tokens - - prompt_tokens - - total_tokens - properties: - completion_tokens: - type: integer - description: Number of completion tokens used over the course of the run step. - prompt_tokens: - type: integer - description: Number of prompt tokens used over the course of the run step. - total_tokens: - type: integer - description: Total number of tokens used (prompt + completion). - description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. - OpenAI.RunStepDetailsMessageCreationObject: - type: object - required: - - type - - message_creation - properties: - type: - type: string - enum: - - message_creation - description: Always `message_creation`. - x-stainless-const: true - message_creation: - $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObjectMessageCreation' - description: Details of the message creation by the run step. - title: Message creation - OpenAI.RunStepDetailsMessageCreationObjectMessageCreation: - type: object - required: - - message_id - properties: - message_id: - type: string - OpenAI.RunStepDetailsToolCall: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallType' - discriminator: - propertyName: type - mapping: - code_interpreter: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObject' - file_search: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObject' - function: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObject' - OpenAI.RunStepDetailsToolCallType: - anyOf: - - type: string - - type: string - enum: - - code_interpreter - - file_search - - function - OpenAI.RunStepDetailsToolCallsCodeObject: - type: object - required: - - id - - type - - code_interpreter - properties: - id: - type: string - description: The ID of the tool call. - type: - type: string - enum: - - code_interpreter - description: The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - x-stainless-const: true - code_interpreter: - allOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter' - description: The Code Interpreter tool call definition. - allOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' - description: Details of the Code Interpreter tool call the run step was involved in. - title: Code Interpreter tool call - OpenAI.RunStepDetailsToolCallsCodeObjectCodeInterpreter: - type: object - required: - - input - - outputs - properties: - input: - type: string - outputs: - type: array - items: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject' - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObject' - OpenAI.RunStepDetailsToolCallsCodeOutputImageObject: - type: object - required: - - type - - image - properties: - type: - type: string - enum: - - image - description: Always `image`. - x-stainless-const: true - image: - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage' - title: Code Interpreter image output - x-stainless-naming: - java: - type_name: ImageOutput - kotlin: - type_name: ImageOutput - OpenAI.RunStepDetailsToolCallsCodeOutputImageObjectImage: - type: object - required: - - file_id - properties: - file_id: - type: string - OpenAI.RunStepDetailsToolCallsCodeOutputLogsObject: - type: object - required: - - type - - logs - properties: - type: - type: string - enum: - - logs - description: Always `logs`. - x-stainless-const: true - logs: - type: string - description: The text output from the Code Interpreter tool call. - description: Text output from the Code Interpreter tool call as part of a run step. - title: Code Interpreter log output - x-stainless-naming: - java: - type_name: LogsOutput - kotlin: - type_name: LogsOutput - OpenAI.RunStepDetailsToolCallsFileSearchObject: - type: object - required: - - id - - type - - file_search - properties: - id: - type: string - description: The ID of the tool call object. - type: - type: string - enum: - - file_search - description: The type of tool call. This is always going to be `file_search` for this type of tool call. - x-stainless-const: true - file_search: - allOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch' - description: For now, this is always going to be an empty object. - x-oaiTypeLabel: map - allOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' - title: File search tool call - OpenAI.RunStepDetailsToolCallsFileSearchObjectFileSearch: - type: object - properties: - ranking_options: - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject' - results: - type: array - items: - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObject' - OpenAI.RunStepDetailsToolCallsFileSearchRankingOptionsObject: - type: object - required: - - ranker - - score_threshold - properties: - ranker: - $ref: '#/components/schemas/OpenAI.FileSearchRanker' - score_threshold: - type: number - minimum: 0 - maximum: 1 - description: The score threshold for the file search. All values must be a floating point number between 0 and 1. - description: The ranking options for the file search. - title: File search tool call ranking options - OpenAI.RunStepDetailsToolCallsFileSearchResultObject: - type: object - required: - - file_id - - file_name - - score - properties: - file_id: - type: string - description: The ID of the file that result was found in. - file_name: - type: string - description: The name of the file that result was found in. - score: - type: number - minimum: 0 - maximum: 1 - description: The score of the result. All values must be a floating point number between 0 and 1. - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent' - description: The content of the result that was found. The content is only included if requested via the include query parameter. - description: A result instance of the file search. - title: File search tool call result - x-oaiTypeLabel: map - OpenAI.RunStepDetailsToolCallsFileSearchResultObjectContent: - type: object - properties: - type: - type: string - enum: - - text - x-stainless-const: true - text: - type: string - OpenAI.RunStepDetailsToolCallsFunctionObject: - type: object - required: - - id - - type - - function - properties: - id: - type: string - description: The ID of the tool call object. - type: - type: string - enum: - - function - description: The type of tool call. This is always going to be `function` for this type of tool call. - x-stainless-const: true - function: - allOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsFunctionObjectFunction' - description: The definition of the function that was called. - allOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' - title: Function tool call - OpenAI.RunStepDetailsToolCallsFunctionObjectFunction: - type: object - required: - - name - - arguments - - output - properties: - name: - type: string - arguments: - type: string - output: - anyOf: - - type: string - - type: 'null' - OpenAI.RunStepDetailsToolCallsObject: - type: object - required: - - type - - tool_calls - properties: - type: - type: string - enum: - - tool_calls - description: Always `tool_calls`. - x-stainless-const: true - tool_calls: - type: array - items: - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCall' - description: 'An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`.' - description: Details of the tool call. - title: Tool calls - OpenAI.RunStepObject: - type: object - required: - - id - - object - - created_at - - assistant_id - - thread_id - - run_id - - type - - status - - step_details - - last_error - - expired_at - - cancelled_at - - failed_at - - completed_at - - metadata - - usage - properties: - id: - type: string - description: The identifier of the run step, which can be referenced in API endpoints. - object: - type: string - enum: - - thread.run.step - description: The object type, which is always `thread.run.step`. - x-stainless-const: true - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the run step was created. - assistant_id: - type: string - description: The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - thread_id: - type: string - description: The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - run_id: - type: string - description: The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - type: - type: string - enum: - - message_creation - - tool_calls - description: The type of run step, which can be either `message_creation` or `tool_calls`. - status: - type: string - enum: - - in_progress - - cancelled - - failed - - completed - - expired - description: The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. - step_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunStepDetailsMessageCreationObject' - - $ref: '#/components/schemas/OpenAI.RunStepDetailsToolCallsObject' - description: The details of the run step. - last_error: - anyOf: - - $ref: '#/components/schemas/OpenAI.RunStepObjectLastError' - - type: 'null' - expired_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - cancelled_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - failed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - usage: - $ref: '#/components/schemas/OpenAI.RunStepCompletionUsage' - description: Represents a step in execution of a run. - title: Run steps - x-oaiMeta: - name: The run step object - beta: true - example: | - { - "id": "step_abc123", - "object": "thread.run.step", - "created_at": 1699063291, - "run_id": "run_abc123", - "assistant_id": "asst_abc123", - "thread_id": "thread_abc123", - "type": "message_creation", - "status": "completed", - "cancelled_at": null, - "completed_at": 1699063291, - "expired_at": null, - "failed_at": null, - "last_error": null, - "step_details": { - "type": "message_creation", - "message_creation": { - "message_id": "msg_abc123" - } - }, - "usage": { - "prompt_tokens": 123, - "completion_tokens": 456, - "total_tokens": 579 - } - } - OpenAI.RunStepObjectLastError: - type: object - required: - - code - - message - properties: - code: - type: string - enum: - - server_error - - rate_limit_exceeded - message: - type: string - OpenAI.RunToolCallObject: - type: object - required: - - id - - type - - function - properties: - id: - type: string - description: The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. - type: - type: string - enum: - - function - description: The type of tool call the output is required for. For now, this is always `function`. - x-stainless-const: true - function: - allOf: - - $ref: '#/components/schemas/OpenAI.RunToolCallObjectFunction' - description: The function definition. - description: Tool call objects - OpenAI.RunToolCallObjectFunction: - type: object - required: - - name - - arguments - properties: - name: - type: string - arguments: - type: string - OpenAI.Screenshot: - type: object - required: - - type - properties: - type: - type: string - enum: - - screenshot - description: |- - Specifies the event type. For a screenshot action, this property is - always set to `screenshot`. - x-stainless-const: true - default: screenshot - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A screenshot action. - title: Screenshot - OpenAI.Scroll: - type: object - required: - - type - - x - - 'y' - - scroll_x - - scroll_y - properties: - type: - type: string - enum: - - scroll - description: |- - Specifies the event type. For a scroll action, this property is - always set to `scroll`. - x-stainless-const: true - default: scroll - x: - type: integer - description: The x-coordinate where the scroll occurred. - 'y': - type: integer - description: The y-coordinate where the scroll occurred. - scroll_x: - type: integer - description: The horizontal scroll distance. - scroll_y: - type: integer - description: The vertical scroll distance. - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A scroll action. - title: Scroll - OpenAI.SearchContextSize: - type: string - enum: - - low - - medium - - high - OpenAI.SpecificApplyPatchParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - apply_patch - description: The tool to call. Always `apply_patch`. - x-stainless-const: true - default: apply_patch - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: Forces the model to call the apply_patch tool when executing a tool call. - title: Specific apply patch tool choice - OpenAI.SpecificFunctionShellParam: - type: object - required: - - type - properties: - type: - type: string - enum: - - shell - description: The tool to call. Always `shell`. - x-stainless-const: true - default: shell - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: Forces the model to call the shell tool when a tool call is required. - title: Specific shell tool choice - OpenAI.StaticChunkingStrategy: - type: object - required: - - max_chunk_size_tokens - - chunk_overlap_tokens - properties: - max_chunk_size_tokens: - type: integer - minimum: 100 - maximum: 4096 - description: The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - chunk_overlap_tokens: - type: integer - description: |- - The number of tokens that overlap between chunks. The default value is `400`. - Note that the overlap must not exceed half of `max_chunk_size_tokens`. - OpenAI.StaticChunkingStrategyRequestParam: - type: object - required: - - type - - static - properties: - type: - type: string - enum: - - static - description: Always `static`. - x-stainless-const: true - static: - $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy' - allOf: - - $ref: '#/components/schemas/OpenAI.ChunkingStrategyRequestParam' - description: Customize your own chunking strategy by setting chunk size and chunk overlap. - title: Static Chunking Strategy - OpenAI.StaticChunkingStrategyResponseParam: - type: object - required: - - type - - static - properties: - type: - type: string - enum: - - static - description: Always `static`. - x-stainless-const: true - static: - $ref: '#/components/schemas/OpenAI.StaticChunkingStrategy' - allOf: - - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse' - title: Static Chunking Strategy - OpenAI.StopConfiguration: - anyOf: - - anyOf: - - type: string - - type: 'null' - - type: array - items: - type: string - - type: 'null' - description: |- - Not supported with latest reasoning models `o3` and `o4-mini`. - Up to 4 sequences where the API will stop generating further tokens. The - returned text will not contain the stop sequence. - OpenAI.SubmitToolOutputsRunRequest: - type: object - required: - - tool_outputs - properties: - tool_outputs: - type: array - items: - $ref: '#/components/schemas/OpenAI.SubmitToolOutputsRunRequestToolOutputs' - description: A list of tools for which the outputs are being submitted. - stream: - anyOf: - - type: boolean - - type: 'null' - OpenAI.SubmitToolOutputsRunRequestToolOutputs: - type: object - properties: - tool_call_id: - type: string - output: - type: string - OpenAI.Summary: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - summary_text - description: The type of the object. Always `summary_text`. - x-stainless-const: true - default: summary_text - text: - type: string - description: A summary of the reasoning output from the model so far. - description: A summary text from the model. - title: Summary text - OpenAI.SummaryTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - summary_text - description: The type of the object. Always `summary_text`. - x-stainless-const: true - default: summary_text - text: - type: string - description: A summary of the reasoning output from the model so far. - description: A summary text from the model. - title: Summary text - OpenAI.TextAnnotation: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.TextAnnotationType' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFileCitationObject' - file_path: '#/components/schemas/OpenAI.MessageContentTextAnnotationsFilePathObject' - OpenAI.TextAnnotationType: - anyOf: - - type: string - - type: string - enum: - - file_citation - - file_path - OpenAI.TextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - x-stainless-const: true - default: text - text: - type: string - description: A text content. - title: Text Content - OpenAI.TextResponseFormatConfiguration: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType' - discriminator: - propertyName: type - mapping: - json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema' - text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText' - json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject' - description: |- - An object specifying the format that the model must output. - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The default format is `{ "type": "text" }` with no additional options. - *Not recommended for gpt-4o and newer models:** - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. - OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject: - type: object - required: - - type - properties: - type: - type: string - enum: - - json_object - description: The type of response format being defined. Always `json_object`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' - description: |- - JSON object response format. An older method of generating JSON responses. - Using `json_schema` is recommended for models that support it. Note that the - model will not generate JSON without a system or user message instructing it - to do so. - title: JSON object - OpenAI.TextResponseFormatConfigurationResponseFormatText: - type: object - required: - - type - properties: - type: - type: string - enum: - - text - description: The type of response format being defined. Always `text`. - x-stainless-const: true - allOf: - - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' - description: Default response format. Used to generate text responses. - title: Text - OpenAI.TextResponseFormatConfigurationType: - anyOf: - - type: string - - type: string - enum: - - text - - json_schema - - json_object - OpenAI.TextResponseFormatJsonSchema: - type: object - required: - - type - - name - - schema - properties: - type: - type: string - enum: - - json_schema - description: The type of response format being defined. Always `json_schema`. - x-stainless-const: true - description: - type: string - description: |- - A description of what the response format is for, used by the model to - determine how to respond in the format. - name: - type: string - description: |- - The name of the response format. Must be a-z, A-Z, 0-9, or contain - underscores and dashes, with a maximum length of 64. - schema: - $ref: '#/components/schemas/OpenAI.ResponseFormatJsonSchemaSchema' - strict: - anyOf: - - type: boolean - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' - description: |- - JSON Schema response format. Used to generate structured JSON responses. - Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). - title: JSON schema - OpenAI.ThreadObject: - type: object - required: - - id - - object - - created_at - - tool_resources - - metadata - properties: - id: - type: string - description: The identifier, which can be referenced in API endpoints. - object: - type: string - enum: - - thread - description: The object type, which is always `thread`. - x-stainless-const: true - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the thread was created. - tool_resources: - anyOf: - - $ref: '#/components/schemas/OpenAI.ThreadObjectToolResources' - - type: 'null' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). - title: Thread - x-oaiMeta: - name: The thread object - beta: true - example: | - { - "id": "thread_abc123", - "object": "thread", - "created_at": 1698107661, - "metadata": {} - } - OpenAI.ThreadObjectToolResources: - type: object - properties: - code_interpreter: - $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesCodeInterpreter' - file_search: - $ref: '#/components/schemas/OpenAI.ThreadObjectToolResourcesFileSearch' - OpenAI.ThreadObjectToolResourcesCodeInterpreter: - type: object - properties: - file_ids: - type: array - items: - type: string - maxItems: 20 - OpenAI.ThreadObjectToolResourcesFileSearch: - type: object - properties: - vector_store_ids: - type: array - items: - type: string - maxItems: 1 - OpenAI.TokenLimits: - type: object - properties: - post_instructions: - type: integer - minimum: 0 - OpenAI.Tool: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ToolType' - discriminator: - propertyName: type - mapping: - code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool' - function: '#/components/schemas/OpenAI.FunctionTool' - file_search: '#/components/schemas/OpenAI.FileSearchTool' - computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool' - web_search: '#/components/schemas/OpenAI.WebSearchTool' - mcp: '#/components/schemas/OpenAI.MCPTool' - image_generation: '#/components/schemas/OpenAI.ImageGenTool' - local_shell: '#/components/schemas/OpenAI.LocalShellToolParam' - shell: '#/components/schemas/OpenAI.FunctionShellToolParam' - custom: '#/components/schemas/OpenAI.CustomToolParam' - web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool' - apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam' - description: A tool that can be used to generate a response. - OpenAI.ToolChoiceAllowed: - type: object - required: - - type - - mode - - tools - properties: - type: - type: string - enum: - - allowed_tools - description: Allowed tool configuration type. Always `allowed_tools`. - x-stainless-const: true - mode: - type: string - enum: - - auto - - required - description: |- - Constrains the tools available to the model to a pre-defined set. - `auto` allows the model to pick from among the allowed tools and generate a - message. - `required` requires the model to call one or more of the allowed tools. - tools: - type: array - items: - type: object - unevaluatedProperties: {} - description: |- - A list of tool definitions that the model should be allowed to call. - For the Responses API, the list of tool definitions might look like: - ```json - [ - { "type": "function", "name": "get_weather" }, - { "type": "mcp", "server_label": "deepwiki" }, - { "type": "image_generation" } - ] - ``` - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: Constrains the tools available to the model to a pre-defined set. - title: Allowed tools - OpenAI.ToolChoiceCodeInterpreter: - type: object - required: - - type - properties: - type: - type: string - enum: - - code_interpreter - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: |- - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - OpenAI.ToolChoiceComputerUsePreview: - type: object - required: - - type - properties: - type: - type: string - enum: - - computer_use_preview - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: |- - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - OpenAI.ToolChoiceCustom: - type: object - required: - - type - - name - properties: - type: - type: string - enum: - - custom - description: For custom tool calling, the type is always `custom`. - x-stainless-const: true - name: - type: string - description: The name of the custom tool to call. - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: Use this option to force the model to call a specific custom tool. - title: Custom tool - OpenAI.ToolChoiceFileSearch: - type: object - required: - - type - properties: - type: - type: string - enum: - - file_search - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: |- - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - OpenAI.ToolChoiceFunction: - type: object - required: - - type - - name - properties: - type: - type: string - enum: - - function - description: For function calling, the type is always `function`. - x-stainless-const: true - name: - type: string - description: The name of the function to call. - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: Use this option to force the model to call a specific function. - title: Function tool - OpenAI.ToolChoiceImageGeneration: - type: object - required: - - type - properties: - type: - type: string - enum: - - image_generation - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: |- - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - OpenAI.ToolChoiceMCP: - type: object - required: - - type - - server_label - properties: - type: - type: string - enum: - - mcp - description: For MCP tools, the type is always `mcp`. - x-stainless-const: true - server_label: - type: string - description: The label of the MCP server to use. - name: - anyOf: - - type: string - - type: 'null' - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: Use this option to force the model to call a specific tool on a remote MCP server. - title: MCP tool - OpenAI.ToolChoiceOptions: - type: string - enum: - - none - - auto - - required - description: |- - Controls which (if any) tool is called by the model. - `none` means the model will not call any tool and instead generates a message. - `auto` means the model can pick between generating a message or calling one or - more tools. - `required` means the model must call one or more tools. - title: Tool choice mode - OpenAI.ToolChoiceParam: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ToolChoiceParamType' - discriminator: - propertyName: type - mapping: - allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed' - mcp: '#/components/schemas/OpenAI.ToolChoiceMCP' - custom: '#/components/schemas/OpenAI.ToolChoiceCustom' - apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam' - shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam' - file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch' - web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview' - computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview' - web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311' - image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration' - code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter' - description: |- - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. - OpenAI.ToolChoiceParamType: - anyOf: - - type: string - - type: string - enum: - - allowed_tools - - function - - mcp - - custom - - apply_patch - - shell - - file_search - - web_search_preview - - computer_use_preview - - web_search_preview_2025_03_11 - - image_generation - - code_interpreter - OpenAI.ToolChoiceWebSearchPreview: - type: object - required: - - type - properties: - type: - type: string - enum: - - web_search_preview - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: 'Note: web_search is not yet available via Azure OpenAI.' - OpenAI.ToolChoiceWebSearchPreview20250311: - type: object - required: - - type - properties: - type: - type: string - enum: - - web_search_preview_2025_03_11 - allOf: - - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - description: |- - Indicates that the model should use a built-in tool to generate a response. - [Learn more about built-in tools](https://platform.openai.com/docs/guides/tools). - OpenAI.ToolType: - anyOf: - - type: string - - type: string - enum: - - function - - file_search - - computer_use_preview - - web_search - - mcp - - code_interpreter - - image_generation - - local_shell - - shell - - custom - - web_search_preview - - apply_patch - OpenAI.ToolsArray: - type: array - items: - $ref: '#/components/schemas/OpenAI.Tool' - description: |- - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. - We support the following categories of tools: - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. - OpenAI.TopLogProb: - type: object - required: - - token - - logprob - - bytes - properties: - token: - type: string - logprob: - type: number - bytes: - type: array - items: - type: integer - description: The top log probability of a token. - title: Top log probability - OpenAI.TranscriptionSegment: - type: object - required: - - id - - seek - - start - - end - - text - - tokens - - temperature - - avg_logprob - - compression_ratio - - no_speech_prob - properties: - id: - type: integer - description: Unique identifier of the segment. - seek: - type: integer - description: Seek offset of the segment. - start: - type: number - format: float - description: Start time of the segment in seconds. - end: - type: number - format: float - description: End time of the segment in seconds. - text: - type: string - description: Text content of the segment. - tokens: - type: array - items: - type: integer - description: Array of token IDs for the text content. - temperature: - type: number - format: float - description: Temperature parameter used for generating the segment. - avg_logprob: - type: number - format: float - description: Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. - compression_ratio: - type: number - format: float - description: Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. - no_speech_prob: - type: number - format: float - description: Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent. - OpenAI.TranscriptionWord: - type: object - required: - - word - - start - - end - properties: - word: - type: string - description: The text content of the word. - start: - type: number - format: float - description: Start time of the word in seconds. - end: - type: number - format: float - description: End time of the word in seconds. - OpenAI.TruncationObject: - type: object - required: - - type - properties: - type: - type: string - enum: - - auto - - last_messages - description: The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - last_messages: - anyOf: - - type: integer - - type: 'null' - description: Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. - title: Thread Truncation Controls - OpenAI.Type: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - type - description: |- - Specifies the event type. For a type action, this property is - always set to `type`. - x-stainless-const: true - default: type - text: - type: string - description: The text to type. - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: An action to type in text. - title: Type - OpenAI.UpdateConversationBody: - type: object - required: - - metadata - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: |- - Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format, and querying for objects via API or the dashboard. - Keys are strings with a maximum length of 64 characters. Values are strings with a maximum length of 512 characters. - OpenAI.UpdateVectorStoreFileAttributesRequest: - type: object - required: - - attributes - properties: - attributes: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' - - type: 'null' - x-oaiMeta: - name: Update vector store file attributes request - OpenAI.UpdateVectorStoreRequest: - type: object - properties: - name: - anyOf: - - type: string - - type: 'null' - description: The name of the vector store. - expires_after: - $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter' - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - OpenAI.UrlCitationBody: - type: object - required: - - type - - url - - start_index - - end_index - - title - properties: - type: - type: string - enum: - - url_citation - description: The type of the URL citation. Always `url_citation`. - x-stainless-const: true - default: url_citation - url: - type: string - format: uri - description: The URL of the web resource. - start_index: - type: integer - description: The index of the first character of the URL citation in the message. - end_index: - type: integer - description: The index of the last character of the URL citation in the message. - title: - type: string - description: The title of the web resource. - allOf: - - $ref: '#/components/schemas/OpenAI.Annotation' - description: A citation for a web resource used to generate a model response. - title: URL citation - OpenAI.ValidateGraderResponse: - type: object - properties: - grader: - anyOf: - - $ref: '#/components/schemas/OpenAI.GraderStringCheck' - - $ref: '#/components/schemas/OpenAI.GraderTextSimilarity' - - $ref: '#/components/schemas/OpenAI.GraderPython' - - $ref: '#/components/schemas/OpenAI.GraderScoreModel' - - $ref: '#/components/schemas/OpenAI.GraderMulti' - - $ref: '#/components/schemas/GraderEndpoint' - description: The grader used for the fine-tuning job. - title: ValidateGraderResponse - OpenAI.VectorStoreExpirationAfter: - type: object - required: - - anchor - - days - properties: - anchor: - type: string - enum: - - last_active_at - description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.' - x-stainless-const: true - days: - type: integer - minimum: 1 - maximum: 365 - description: The number of days after the anchor time that the vector store will expire. - description: The expiration policy for a vector store. - title: Vector store expiration policy - OpenAI.VectorStoreFileAttributes: - type: object - unevaluatedProperties: - anyOf: - - type: string - - type: number - - type: boolean - description: |- - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. Keys are strings - with a maximum length of 64 characters. Values are strings with a maximum - length of 512 characters, booleans, or numbers. - x-oaiTypeLabel: map - OpenAI.VectorStoreFileBatchObject: - type: object - required: - - id - - object - - created_at - - vector_store_id - - status - - file_counts - properties: - id: - type: string - description: The identifier, which can be referenced in API endpoints. - object: - type: string - enum: - - vector_store.files_batch - description: The object type, which is always `vector_store.file_batch`. - x-stainless-const: true - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the vector store files batch was created. - vector_store_id: - type: string - description: The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. - status: - type: string - enum: - - in_progress - - completed - - cancelled - - failed - description: The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. - file_counts: - $ref: '#/components/schemas/OpenAI.VectorStoreFileBatchObjectFileCounts' - description: A batch of files attached to a vector store. - title: Vector store file batch - x-oaiMeta: - name: The vector store files batch object - beta: true - example: | - { - "id": "vsfb_123", - "object": "vector_store.files_batch", - "created_at": 1698107661, - "vector_store_id": "vs_abc123", - "status": "completed", - "file_counts": { - "in_progress": 0, - "completed": 100, - "failed": 0, - "cancelled": 0, - "total": 100 - } - } - OpenAI.VectorStoreFileBatchObjectFileCounts: - type: object - required: - - in_progress - - completed - - failed - - cancelled - - total - properties: - in_progress: - type: integer - completed: - type: integer - failed: - type: integer - cancelled: - type: integer - total: - type: integer - OpenAI.VectorStoreFileObject: - type: object - required: - - id - - object - - usage_bytes - - created_at - - vector_store_id - - status - - last_error - properties: - id: - type: string - description: The identifier, which can be referenced in API endpoints. - object: - type: string - enum: - - vector_store.file - description: The object type, which is always `vector_store.file`. - x-stainless-const: true - usage_bytes: - type: integer - description: The total vector store usage in bytes. Note that this may be different from the original file size. - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the vector store file was created. - vector_store_id: - type: string - description: The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. - status: - type: string - enum: - - in_progress - - completed - - cancelled - - failed - description: The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. - last_error: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileObjectLastError' - - type: 'null' - chunking_strategy: - $ref: '#/components/schemas/OpenAI.ChunkingStrategyResponse' - attributes: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' - - type: 'null' - description: A list of files attached to a vector store. - title: Vector store files - x-oaiMeta: - name: The vector store file object - beta: true - example: | - { - "id": "file-abc123", - "object": "vector_store.file", - "usage_bytes": 1234, - "created_at": 1698107661, - "vector_store_id": "vs_abc123", - "status": "completed", - "last_error": null, - "chunking_strategy": { - "type": "static", - "static": { - "max_chunk_size_tokens": 800, - "chunk_overlap_tokens": 400 - } - } - } - OpenAI.VectorStoreFileObjectLastError: - type: object - required: - - code - - message - properties: - code: - type: string - enum: - - server_error - - unsupported_file - - invalid_file - message: - type: string - OpenAI.VectorStoreObject: - type: object - required: - - id - - object - - created_at - - name - - usage_bytes - - file_counts - - status - - last_active_at - - metadata - properties: - id: - type: string - description: The identifier, which can be referenced in API endpoints. - object: - type: string - enum: - - vector_store - description: The object type, which is always `vector_store`. - x-stainless-const: true - created_at: - type: integer - format: unixtime - description: The Unix timestamp (in seconds) for when the vector store was created. - name: - type: string - description: The name of the vector store. - usage_bytes: - type: integer - description: The total number of bytes used by the files in the vector store. - file_counts: - $ref: '#/components/schemas/OpenAI.VectorStoreObjectFileCounts' - status: - type: string - enum: - - expired - - in_progress - - completed - description: The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. - expires_after: - $ref: '#/components/schemas/OpenAI.VectorStoreExpirationAfter' - expires_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - last_active_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - description: A vector store is a collection of processed files can be used by the `file_search` tool. - title: Vector store - x-oaiMeta: - name: The vector store object - example: | - { - "id": "vs_123", - "object": "vector_store", - "created_at": 1698107661, - "usage_bytes": 123456, - "last_active_at": 1698107661, - "name": "my_vector_store", - "status": "completed", - "file_counts": { - "in_progress": 0, - "completed": 100, - "cancelled": 0, - "failed": 0, - "total": 100 - }, - "last_used_at": 1698107661 - } - OpenAI.VectorStoreObjectFileCounts: - type: object - required: - - in_progress - - completed - - failed - - cancelled - - total - properties: - in_progress: - type: integer - completed: - type: integer - failed: - type: integer - cancelled: - type: integer - total: - type: integer - OpenAI.VectorStoreSearchRequest: - type: object - required: - - query - properties: - query: - anyOf: - - type: string - - type: array - items: - type: string - description: A query string for a search - rewrite_query: - type: boolean - description: Whether to rewrite the natural language query for vector search. - max_num_results: - type: integer - minimum: 1 - maximum: 50 - description: The maximum number of results to return. This number should be between 1 and 50 inclusive. - default: 10 - filters: - anyOf: - - $ref: '#/components/schemas/OpenAI.ComparisonFilter' - - $ref: '#/components/schemas/OpenAI.CompoundFilter' - description: A filter to apply based on file attributes. - ranking_options: - allOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreSearchRequestRankingOptions' - description: Ranking options for search. - x-oaiMeta: - name: Vector store search request - OpenAI.VectorStoreSearchRequestRankingOptions: - type: object - properties: - ranker: - type: string - enum: - - none - - auto - - default-2024-11-15 - default: auto - score_threshold: - type: number - minimum: 0 - maximum: 1 - OpenAI.VectorStoreSearchResultContentObject: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - text - description: The type of content. - text: - type: string - description: The text content returned from search. - x-oaiMeta: - name: Vector store search result content object - OpenAI.VectorStoreSearchResultItem: - type: object - required: - - file_id - - filename - - score - - attributes - - content - properties: - file_id: - type: string - description: The ID of the vector store file. - filename: - type: string - description: The name of the vector store file. - score: - type: number - minimum: 0 - maximum: 1 - description: The similarity score for the result. - attributes: - anyOf: - - $ref: '#/components/schemas/OpenAI.VectorStoreFileAttributes' - - type: 'null' - content: - type: array - items: - $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultContentObject' - description: Content chunks from the file. - x-oaiMeta: - name: Vector store search result item - OpenAI.VectorStoreSearchResultsPage: - type: object - required: - - object - - search_query - - data - - has_more - - next_page - properties: - object: - type: string - enum: - - vector_store.search_results.page - description: The object type, which is always `vector_store.search_results.page` - x-stainless-const: true - search_query: - type: array - items: - type: string - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.VectorStoreSearchResultItem' - description: The list of search result items. - has_more: - type: boolean - description: Indicates if there are more results to fetch. - next_page: - anyOf: - - type: string - - type: 'null' - x-oaiMeta: - name: Vector store search results page - OpenAI.Verbosity: - anyOf: - - type: string - enum: - - low - - medium - - high - - type: 'null' - description: |- - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. - OpenAI.VoiceIdsShared: - anyOf: - - type: string - - type: string - enum: - - alloy - - ash - - ballad - - coral - - echo - - sage - - shimmer - - verse - - marin - - cedar - OpenAI.Wait: - type: object - required: - - type - properties: - type: - type: string - enum: - - wait - description: |- - Specifies the event type. For a wait action, this property is - always set to `wait`. - x-stainless-const: true - default: wait - allOf: - - $ref: '#/components/schemas/OpenAI.ComputerAction' - description: A wait action. - title: Wait - OpenAI.WebSearchActionFind: - type: object - required: - - type - - url - - pattern - properties: - type: - type: string - enum: - - find_in_page - description: The action type. - x-stainless-const: true - url: - type: string - format: uri - description: The URL of the page searched for the pattern. - pattern: - type: string - description: The pattern or text to search for within the page. - description: 'Action type "find": Searches for a pattern within a loaded page.' - title: Find action - OpenAI.WebSearchActionOpenPage: - type: object - required: - - type - - url - properties: - type: - type: string - enum: - - open_page - description: The action type. - x-stainless-const: true - url: - type: string - format: uri - description: The URL opened by the model. - description: Action type "open_page" - Opens a specific URL from search results. - title: Open page action - OpenAI.WebSearchActionSearch: - type: object - required: - - type - - query - properties: - type: - type: string - enum: - - search - description: The action type. - x-stainless-const: true - query: - type: string - description: '[DEPRECATED] The search query.' - deprecated: true - queries: - type: array - items: - type: string - description: The search queries. - title: Search queries - sources: - type: array - items: - $ref: '#/components/schemas/OpenAI.WebSearchActionSearchSources' - description: The sources used in the search. - title: Web search sources - description: Action type "search" - Performs a web search query. - title: Search action - OpenAI.WebSearchActionSearchSources: - type: object - required: - - type - - url - properties: - type: - type: string - enum: - - url - x-stainless-const: true - url: - type: string - OpenAI.WebSearchApproximateLocation: - type: object - properties: - type: - type: string - enum: - - approximate - description: The type of location approximation. Always `approximate`. - x-stainless-const: true - default: approximate - country: - anyOf: - - type: string - - type: 'null' - region: - anyOf: - - type: string - - type: 'null' - city: - anyOf: - - type: string - - type: 'null' - timezone: - anyOf: - - type: string - - type: 'null' - description: The approximate location of the user. - title: Web search approximate location - OpenAI.WebSearchPreviewTool: - type: object - required: - - type - properties: - type: - type: string - enum: - - web_search_preview - description: The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - x-stainless-const: true - default: web_search_preview - user_location: - anyOf: - - $ref: '#/components/schemas/OpenAI.ApproximateLocation' - - type: 'null' - search_context_size: - allOf: - - $ref: '#/components/schemas/OpenAI.SearchContextSize' - description: High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: 'Note: web_search is not yet available via Azure OpenAI.' - title: Web search preview - OpenAI.WebSearchTool: - type: object - required: - - type - properties: - type: - type: string - enum: - - web_search - description: The type of the web search tool. One of `web_search` or `web_search_2025_08_26`. - default: web_search - filters: - anyOf: - - $ref: '#/components/schemas/OpenAI.WebSearchToolFilters' - - type: 'null' - user_location: - anyOf: - - $ref: '#/components/schemas/OpenAI.WebSearchApproximateLocation' - - type: 'null' - search_context_size: - type: string - enum: - - low - - medium - - high - description: High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - default: medium - allOf: - - $ref: '#/components/schemas/OpenAI.Tool' - description: 'Note: web_search is not yet available via Azure OpenAI.' - title: Web search - OpenAI.WebSearchToolFilters: - type: object - properties: - allowed_domains: - anyOf: - - type: array - items: - type: string - - type: 'null' - Order: - type: string - enum: - - asc - - desc - ResponseFormatJSONSchemaRequest: - type: object - required: - - type - - json_schema - properties: - type: - type: string - enum: - - json_schema - description: Type of response format - json_schema: - type: object - unevaluatedProperties: {} - description: JSON Schema for the response format - SpeechGenerationResponse: - type: object - required: - - audio - properties: - audio: - type: string - contentEncoding: base64 - description: The generated audio, generated in the requested audio output format. - description: A representation of a response for a text-to-speech operation. - SpeechGenerationResponseFormat: - oneOf: - - type: string - - type: string - enum: - - mp3 - - opus - - aac - - flac - - wav - - pcm - description: The supported audio output formats for text-to-speech. - SpeechVoice: - anyOf: - - type: string - - type: string - enum: - - alloy - - echo - - fable - - onyx - - nova - - shimmer - description: The available voices for text-to-speech. - VideoContent: - type: object - required: - - content - properties: - content: - type: string - contentEncoding: base64 - VideoContentVariant: - anyOf: - - type: string - enum: - - video - - thumbnail - - spritesheet - - type: string - description: Selectable asset variants for downloaded content. - VideoIdParameter: - type: object - required: - - video-id - properties: - video-id: - type: string - description: The ID of the video to use for the Azure OpenAI request. - VideoList: - type: object - required: - - object - - data - - has_more - properties: - object: - type: string - enum: - - list - data: - type: array - items: - $ref: '#/components/schemas/VideoResource' - description: The list of video generation jobs. - has_more: - type: boolean - description: A flag indicating whether there are more jobs available after the list. - first_id: - type: string - description: The ID of the first video in the current page, if available. - last_id: - type: string - description: The ID of the last video in the current page, if available. - description: A list of video generation jobs. - VideoResource: - type: object - required: - - id - - object - - model - - status - - progress - - created_at - - size - - seconds - properties: - id: - type: string - description: Unique identifier for the video job. - object: - type: string - description: The object type, which is always `video`. - model: - type: string - description: The video generation model deployment that produced the job. - status: - allOf: - - $ref: '#/components/schemas/VideoStatus' - description: Current lifecycle status of the video job. - progress: - type: integer - format: int32 - description: Approximate completion percentage for the generation task. - created_at: - type: integer - format: unixtime - description: Unix timestamp (seconds) for when the job was created. - completed_at: - type: integer - format: unixtime - description: Unix timestamp (seconds) for when the job completed, if finished. - expires_at: - type: integer - format: unixtime - description: Unix timestamp (seconds) for when the video generation expires (and will be deleted). - size: - allOf: - - $ref: '#/components/schemas/VideoSize' - description: The resolution of the generated video. - seconds: - allOf: - - $ref: '#/components/schemas/VideoSeconds' - description: Duration of the generated clip in seconds. - remixed_from_video_id: - type: string - description: Identifier of the source video if this video is a remix. - error: - allOf: - - $ref: '#/components/schemas/Error' - description: Error payload that explains why generation failed, if applicable. - description: Structured information describing a generated video job. - VideoSeconds: - anyOf: - - type: string - enum: - - '4' - - '8' - - '12' - - type: string - description: Supported clip durations, measured in seconds. - VideoSize: - anyOf: - - type: string - enum: - - 720x1280 - - 1280x720 - - 1024x1792 - - 1792x1024 - - type: string - description: Output dimensions formatted as `{width}x{height}`. - VideoStatus: - anyOf: - - type: string - enum: - - queued - - in_progress - - completed - - failed - - type: string - description: Lifecycle state of a generated video. - securitySchemes: - ApiKeyAuth: - type: apiKey - in: header - name: api-key - ApiKeyAuth_: - type: apiKey - in: header - name: authorization - OAuth2Auth: - type: oauth2 - flows: - implicit: - authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize - scopes: - https://cognitiveservices.azure.com/.default: '' -servers: - - url: '{endpoint}/openai/v1' - description: Azure AI Foundry Models APIs - variables: - endpoint: - default: '' - description: |- - A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname. - For example: - https://westus.api.cognitive.microsoft.com). \ No newline at end of file diff --git a/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml b/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml index 91e6d2957..b9ed1665b 100644 --- a/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml +++ b/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml @@ -5,4 +5,8 @@ inverseOperationIds: - cancelResponse - listInputItems unusedComponents: - - schemas \ No newline at end of file + - schemas + +# npx openapi-format foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml --no-sort \ +# -o foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml \ +# --filterFile foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml \ No newline at end of file From eaf74ba5f2f921c81cd06fe4c5c89fd4c9cfe0ad Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 17 Mar 2026 15:29:20 +0100 Subject: [PATCH 06/31] Initial setup --- foundation-models/openai-responses/pom.xml | 131 +++++++++++------- .../responses/OpenAiResponsesClient.java | 84 +++++++++++ .../OpenAiResponsesClientException.java | 27 ++++ .../responses/OpenAiResponsesError.java | 29 ++++ .../responses/OpenAiResponseClientTest.java | 27 ++++ 5 files changed, 249 insertions(+), 49 deletions(-) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java create mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index daa4120a6..931733742 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -52,55 +52,88 @@ com.sap.ai.sdk core - - - - generate - - false - - generate - - - - - - com.sap.cloud.sdk.datamodel - openapi-generator-maven-plugin + + com.openai + openai-java + 4.28.0 + + + com.google.code.findbugs + jsr305 + + + com.fasterxml.jackson.core + jackson-annotations + + + org.projectlombok + lombok + provided + + + org.junit.jupiter + junit-jupiter-api + test + + + org.junit.jupiter + junit-jupiter-params + test + + + org.assertj + assertj-core + test + + + + + generate + + false + + generate + + + + + + com.sap.cloud.sdk.datamodel + openapi-generator-maven-plugin + + ${project.basedir}/src/main/java + true + COMPILE + true + + + + openai + + generate + + generate-sources - ${project.basedir}/src/main/java - true - COMPILE - true + ${project.basedir}/src/main/resources/spec/azure-responses-only.yaml + com.sap.ai.sdk.foundationmodels.openai.responses.generated.model + com.sap.ai.sdk.foundationmodels.openai.responses.generated.client + true + + apache-httpclient + create + protected + true + true + true + true + - - - openai - - generate - - generate-sources - - ${project.basedir}/src/main/resources/spec/azure-responses-only.yaml - com.sap.ai.sdk.foundationmodels.openai.responses.generated.model - com.sap.ai.sdk.foundationmodels.openai.responses.generated.client - true - - apache-httpclient - create - protected - true - true - true - true - - - - - - - - - + + + + + + + - + diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java new file mode 100644 index 000000000..f3ccafe4d --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java @@ -0,0 +1,84 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import static com.sap.ai.sdk.core.JacksonConfiguration.getDefaultObjectMapper; +import static com.sap.ai.sdk.foundationmodels.openai.responses.OpenAiResponsesClientException.FACTORY; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.core.AiModel; +import com.sap.ai.sdk.core.common.ClientResponseHandler; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; +import java.io.IOException; +import javax.annotation.Nonnull; +import org.apache.hc.client5.http.classic.methods.HttpPost; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.io.entity.StringEntity; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; + +/** + * Client for interacting with the OpenAI Responses API. + * + *

This client provides access to OpenAI's Responses API, which is a newer API that supersedes + * the legacy Chat Completions API. It supports both synchronous and streaming responses. + * + * @since 1.17.0 + */ +public class OpenAiResponsesClient { + private final Destination destination; + private static final String DEFAULT_SCENARIO = "foundation-models"; + private static final ObjectMapper JACKSON = getDefaultObjectMapper(); + + /** Creates a new OpenAI Responses API client using the default resource group. */ + public OpenAiResponsesClient() { + destination = + new AiCoreService() + .getInferenceDestination() + .forModel( + new AiModel() { + @Override + public @NonNull String name() { + return "gpt-4o"; + } + + @Override + public @Nullable String version() { + return "latest"; + } + }); + } + + /** + * Creates a response synchronously for the given request. + * + * @param request The request configuration for the response + * @return The complete response from the model + * @throws OpenAiResponsesClientException if the request fails + */ + @Nonnull + public Response createResponse(@Nonnull final ResponseCreateParams request) + throws OpenAiResponsesClientException { + return execute("/responses", request); + } + + @Nonnull + private Response execute(@Nonnull final String path, @Nonnull final ResponseCreateParams request) + throws OpenAiResponsesClientException { + try { + final var httpPost = new HttpPost(path); + String json = JACKSON.writeValueAsString(request); + httpPost.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); + + final var client = ApacheHttpClient5Accessor.getHttpClient(destination); + + return client.execute( + httpPost, + new ClientResponseHandler<>(Response.class, OpenAiResponsesError.class, FACTORY)); + } catch (final IOException e) { + throw new OpenAiResponsesClientException("Failed to serialize request", e); + } + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java new file mode 100644 index 000000000..814d1b9c3 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java @@ -0,0 +1,27 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import com.google.common.annotations.Beta; +import com.openai.models.responses.Response; +import com.sap.ai.sdk.core.common.ClientException; +import com.sap.ai.sdk.core.common.ClientExceptionFactory; +import javax.annotation.Nullable; +import lombok.experimental.StandardException; + +@StandardException +public class OpenAiResponsesClientException extends ClientException { + + static final ClientExceptionFactory + FACTORY = + (message, error, cause) -> + new OpenAiResponsesClientException(message, cause).setClientError(error); + + @Beta + @Nullable + public Response getErrorResponse() { + final var clientError = super.getClientError(); + if (clientError instanceof OpenAiResponsesError openAiError) { + return openAiError.getErrorResponse(); + } + return null; + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java new file mode 100644 index 000000000..44f98533b --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java @@ -0,0 +1,29 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseError; +import com.sap.ai.sdk.core.common.ClientError; +import javax.annotation.Nonnull; +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Value; + +/** + * Wrapper for Azure OpenAI Responses API error responses. + * + *

This class wraps Azure's {@link ResponseError} and provides deserialization support using + * Azure's JSON framework. + * + * @since 1.17.0 + */ +@Value +@AllArgsConstructor(onConstructor = @__({@JsonCreator}), access = AccessLevel.PROTECTED) +public class OpenAiResponsesError implements ClientError { + Response errorResponse; + + @Nonnull + public String getMessage() { + return errorResponse.error().get().message(); + } +} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java new file mode 100644 index 000000000..42107d8e1 --- /dev/null +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java @@ -0,0 +1,27 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.openai.models.ChatModel; +import com.openai.models.responses.ResponseCreateParams; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +class OpenAiResponseClientTest { + private static final OpenAiResponsesClient client = new OpenAiResponsesClient(); + + @Test + @Disabled("Integration test - requires actual API credentials") + void createResponse() { + final ResponseCreateParams request = + ResponseCreateParams.builder() + .model(ChatModel.GPT_4O) + .input("List 5 famous late twentieth century novels.") + .build(); + + final var response = client.createResponse(request); + + assertThat(response).isNotNull(); + assertThat(response.output()).isNotEmpty(); + } +} From 372769eecbe58579382f38c77d4c440de5a815de Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Wed, 18 Mar 2026 16:46:22 +0100 Subject: [PATCH 07/31] Successful PoC with OpenAI Models --- foundation-models/openai-responses/pom.xml | 98 +- .../responses/OpenAiResponsesClient.java | 21 +- .../OpenAiResponsesClientException.java | 1 + .../generated/client/ResponsesApi.java | 413 ---- .../model/AzureAIFoundryModelsApiVersion.java | 64 - .../AzureContentFilterBlocklistResult.java | 254 --- ...tentFilterBlocklistResultDetailsInner.java | 244 -- .../AzureContentFilterCompletionTextSpan.java | 264 --- ...lterCompletionTextSpanDetectionResult.java | 345 --- .../AzureContentFilterCustomTopicResult.java | 252 --- ...ntFilterCustomTopicResultDetailsInner.java | 244 -- .../AzureContentFilterDetectionResult.java | 244 -- .../AzureContentFilterForResponsesAPI.java | 369 --- ...rsonallyIdentifiableInformationResult.java | 371 ---- .../AzureContentFilterResultOffsets.java | 294 --- ...reContentFilterResultsForResponsesAPI.java | 885 -------- ...tentFilterResultsForResponsesAPIError.java | 248 --- ...sForResponsesAPIProtectedMaterialCode.java | 314 --- ...onsesAPIProtectedMaterialCodeCitation.java | 240 -- .../AzureContentFilterSeverityResult.java | 309 --- .../model/AzurePiiSubCategoryResult.java | 344 --- .../model/CreateResponse200Response.java | 1975 ----------------- ...CreateResponse200ResponseInstructions.java | 58 - .../model/CreateResponseDefaultResponse.java | 345 --- .../model/GetResponseDefaultResponse.java | 340 --- .../generated/model/OpenAIAnnotation.java | 188 -- .../generated/model/OpenAIAnnotationType.java | 33 - .../model/OpenAIConversationParam.java | 58 - .../model/OpenAIConversationParam2.java | 185 -- .../model/OpenAIConversationReference.java | 190 -- .../generated/model/OpenAICreateResponse.java | 1392 ------------ .../generated/model/OpenAIImageDetail.java | 66 - .../generated/model/OpenAIIncludeEnum.java | 46 - .../model/OpenAIInputFileContent.java | 390 ---- .../model/OpenAIInputImageContent.java | 371 ---- .../generated/model/OpenAIInputItem.java | 188 -- .../generated/model/OpenAIInputItemType.java | 33 - .../generated/model/OpenAIInputParam.java | 61 - .../model/OpenAIInputTextContent.java | 289 --- .../generated/model/OpenAIItemResource.java | 188 -- .../model/OpenAIItemResourceType.java | 33 - .../generated/model/OpenAIOutputContent.java | 189 -- .../model/OpenAIOutputContentType.java | 33 - .../generated/model/OpenAIOutputItem.java | 188 -- .../generated/model/OpenAIOutputItemType.java | 33 - .../generated/model/OpenAIPrompt.java | 266 --- .../generated/model/OpenAIReasoning.java | 369 --- .../model/OpenAIReasoningEffort.java | 72 - .../generated/model/OpenAIResponse.java | 1947 ---------------- .../model/OpenAIResponseAudioDeltaEvent.java | 351 --- ...enAIResponseAudioTranscriptDeltaEvent.java | 356 --- ...onseCodeInterpreterCallCodeDeltaEvent.java | 477 ---- ...nseCodeInterpreterCallInProgressEvent.java | 434 ---- ...eCodeInterpreterCallInterpretingEvent.java | 436 ---- .../OpenAIResponseContentPartAddedEvent.java | 508 ----- .../model/OpenAIResponseCreatedEvent.java | 347 --- ...ResponseCustomToolCallInputDeltaEvent.java | 462 ---- .../generated/model/OpenAIResponseError.java | 233 -- .../model/OpenAIResponseErrorCode.java | 96 - .../model/OpenAIResponseErrorEvent.java | 444 ---- .../model/OpenAIResponseFailedEvent.java | 345 --- ...ResponseFileSearchCallInProgressEvent.java | 412 ---- ...IResponseFileSearchCallSearchingEvent.java | 412 ---- ...sponseFunctionCallArgumentsDeltaEvent.java | 469 ---- ...AIResponseImageGenCallGeneratingEvent.java | 413 ---- ...AIResponseImageGenCallInProgressEvent.java | 411 ---- ...ResponseImageGenCallPartialImageEvent.java | 534 ----- .../model/OpenAIResponseInProgressEvent.java | 351 --- .../OpenAIResponseIncompleteDetails.java | 235 -- .../model/OpenAIResponseIncompleteEvent.java | 351 --- .../model/OpenAIResponseInstructions.java | 55 - .../model/OpenAIResponseItemList.java | 471 ---- .../model/OpenAIResponseLogProb.java | 295 --- .../OpenAIResponseLogProbTopLogprobs.java | 215 -- ...nAIResponseMCPCallArgumentsDeltaEvent.java | 463 ---- .../OpenAIResponseMCPCallFailedEvent.java | 402 ---- .../OpenAIResponseMCPCallInProgressEvent.java | 405 ---- ...OpenAIResponseMCPListToolsFailedEvent.java | 406 ---- ...AIResponseMCPListToolsInProgressEvent.java | 410 ---- .../OpenAIResponseOutputItemAddedEvent.java | 404 ---- ...esponseOutputTextAnnotationAddedEvent.java | 585 ----- .../model/OpenAIResponseQueuedEvent.java | 345 --- ...esponseReasoningSummaryPartAddedEvent.java | 522 ----- ...nseReasoningSummaryPartAddedEventPart.java | 307 --- ...esponseReasoningSummaryTextDeltaEvent.java | 521 ----- ...OpenAIResponseReasoningTextDeltaEvent.java | 510 ----- .../OpenAIResponseRefusalDeltaEvent.java | 505 ----- .../model/OpenAIResponseStreamOptions.java | 191 -- .../model/OpenAIResponseTextDeltaEvent.java | 594 ----- .../model/OpenAIResponseTextParam.java | 214 -- .../generated/model/OpenAIResponseUsage.java | 407 ---- ...OpenAIResponseUsageInputTokensDetails.java | 192 -- ...penAIResponseUsageOutputTokensDetails.java | 198 -- ...IResponseWebSearchCallInProgressEvent.java | 412 ---- ...AIResponseWebSearchCallSearchingEvent.java | 410 ---- ...OpenAITextResponseFormatConfiguration.java | 206 -- ...AITextResponseFormatConfigurationType.java | 36 - .../responses/generated/model/OpenAITool.java | 188 -- .../model/OpenAIToolChoiceParam.java | 192 -- .../model/OpenAIToolChoiceParamType.java | 33 - .../generated/model/OpenAIToolType.java | 33 - .../generated/model/OpenAIVerbosity.java | 66 - .../responses/OpenAiResponseClientTest.java | 74 +- 103 files changed, 132 insertions(+), 33556 deletions(-) delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index 931733742..4423caeb3 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -85,55 +85,55 @@ assertj-core test - - - - generate - - false - - generate - - - - - - com.sap.cloud.sdk.datamodel - openapi-generator-maven-plugin - - ${project.basedir}/src/main/java - true - COMPILE - true - - - - openai - - generate - - generate-sources + + + + generate + + false + + generate + + + + + + com.sap.cloud.sdk.datamodel + openapi-generator-maven-plugin - ${project.basedir}/src/main/resources/spec/azure-responses-only.yaml - com.sap.ai.sdk.foundationmodels.openai.responses.generated.model - com.sap.ai.sdk.foundationmodels.openai.responses.generated.client - true - - apache-httpclient - create - protected - true - true - true - true - + ${project.basedir}/src/main/java + true + COMPILE + true - - - - - - - + + + openai + + generate + + generate-sources + + ${project.basedir}/src/main/resources/spec/azure-responses-only.yaml + com.sap.ai.sdk.foundationmodels.openai.responses.generated.model + com.sap.ai.sdk.foundationmodels.openai.responses.generated.client + true + + apache-httpclient + create + protected + true + true + true + true + + + + + + + + + - + diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java index f3ccafe4d..0ae67a54d 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java @@ -1,9 +1,10 @@ package com.sap.ai.sdk.foundationmodels.openai.responses; -import static com.sap.ai.sdk.core.JacksonConfiguration.getDefaultObjectMapper; import static com.sap.ai.sdk.foundationmodels.openai.responses.OpenAiResponsesClientException.FACTORY; import com.fasterxml.jackson.databind.ObjectMapper; +import com.openai.core.ObjectMappers; +import com.openai.models.ChatModel; import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; import com.sap.ai.sdk.core.AiCoreService; @@ -16,8 +17,6 @@ import org.apache.hc.client5.http.classic.methods.HttpPost; import org.apache.hc.core5.http.ContentType; import org.apache.hc.core5.http.io.entity.StringEntity; -import org.jspecify.annotations.NonNull; -import org.jspecify.annotations.Nullable; /** * Client for interacting with the OpenAI Responses API. @@ -29,8 +28,7 @@ */ public class OpenAiResponsesClient { private final Destination destination; - private static final String DEFAULT_SCENARIO = "foundation-models"; - private static final ObjectMapper JACKSON = getDefaultObjectMapper(); + private static final ObjectMapper JACKSON = ObjectMappers.jsonMapper(); /** Creates a new OpenAI Responses API client using the default resource group. */ public OpenAiResponsesClient() { @@ -40,12 +38,12 @@ public OpenAiResponsesClient() { .forModel( new AiModel() { @Override - public @NonNull String name() { - return "gpt-4o"; + public @Nonnull String name() { + return ChatModel.GPT_5.asString(); } @Override - public @Nullable String version() { + public @Nonnull String version() { return "latest"; } }); @@ -61,7 +59,7 @@ public OpenAiResponsesClient() { @Nonnull public Response createResponse(@Nonnull final ResponseCreateParams request) throws OpenAiResponsesClientException { - return execute("/responses", request); + return execute("/v1/responses", request); } @Nonnull @@ -69,14 +67,15 @@ private Response execute(@Nonnull final String path, @Nonnull final ResponseCrea throws OpenAiResponsesClientException { try { final var httpPost = new HttpPost(path); - String json = JACKSON.writeValueAsString(request); + String json = JACKSON.writeValueAsString(request._body()); httpPost.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); final var client = ApacheHttpClient5Accessor.getHttpClient(destination); return client.execute( httpPost, - new ClientResponseHandler<>(Response.class, OpenAiResponsesError.class, FACTORY)); + new ClientResponseHandler<>(Response.class, OpenAiResponsesError.class, FACTORY) + .objectMapper(ObjectMappers.jsonMapper())); } catch (final IOException e) { throw new OpenAiResponsesClientException("Failed to serialize request", e); } diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java index 814d1b9c3..0af548de0 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java @@ -2,6 +2,7 @@ import com.google.common.annotations.Beta; import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseError; import com.sap.ai.sdk.core.common.ClientException; import com.sap.ai.sdk.core.common.ClientExceptionFactory; import javax.annotation.Nullable; diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java deleted file mode 100644 index 7c1ead00c..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/client/ResponsesApi.java +++ /dev/null @@ -1,413 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.client; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.AzureAIFoundryModelsApiVersion; -import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.CreateResponse200Response; -import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAICreateResponse; -import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAIIncludeEnum; -import com.sap.ai.sdk.foundationmodels.openai.responses.generated.model.OpenAIResponseItemList; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import com.sap.cloud.sdk.services.openapi.apache.ApiClient; -import com.sap.cloud.sdk.services.openapi.apache.BaseApi; -import com.sap.cloud.sdk.services.openapi.apache.Pair; -import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * Azure AI Foundry Models Service in version v1. - * - *

No description provided (generated by Openapi Generator - * https://github.com/openapitools/openapi-generator) - */ -public class ResponsesApi extends BaseApi { - - /** Instantiates this API class to invoke operations on the Azure AI Foundry Models Service */ - public ResponsesApi() {} - - /** - * Instantiates this API class to invoke operations on the Azure AI Foundry Models Service. - * - * @param httpDestination The destination that API should be used with - */ - public ResponsesApi(@Nonnull final Destination httpDestination) { - super(httpDestination); - } - - /** - * Instantiates this API class to invoke operations on the Azure AI Foundry Models Service based - * on a given {@link ApiClient}. - * - * @param apiClient ApiClient to invoke the API on - */ - public ResponsesApi(@Nonnull final ApiClient apiClient) { - super(apiClient); - } - - /** - * Cancels a model response with the given ID. Only responses created with the background - * parameter set to true can be cancelled. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId (required) The value for the parameter responseId - * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to - * use for this request. `v1` if not otherwise specified. - * @return CreateResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CreateResponse200Response cancelResponse( - @Nonnull final String responseId, @Nullable final AzureAIFoundryModelsApiVersion apiVersion) - throws OpenApiRequestException { - - // verify the required parameter 'responseId' is set - if (responseId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'responseId' when calling cancelResponse") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/responses/{response_id}/cancel" - .replaceAll( - "\\{" + "response_id" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(responseId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() {}; - - return apiClient.invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - null, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - * Cancels a model response with the given ID. Only responses created with the background - * parameter set to true can be cancelled. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId The value for the parameter responseId - * @return CreateResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CreateResponse200Response cancelResponse(@Nonnull final String responseId) - throws OpenApiRequestException { - return cancelResponse(responseId, null); - } - - /** - * Creates a model response. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param openAICreateResponse (required) The value for the parameter openAICreateResponse - * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to - * use for this request. `v1` if not otherwise specified. - * @return CreateResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CreateResponse200Response createResponse( - @Nonnull final OpenAICreateResponse openAICreateResponse, - @Nullable final AzureAIFoundryModelsApiVersion apiVersion) - throws OpenApiRequestException { - - // verify the required parameter 'openAICreateResponse' is set - if (openAICreateResponse == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'openAICreateResponse' when calling createResponse") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = "/responses"; - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); - - final String[] localVarAccepts = {"application/json", "text/event-stream"}; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {"application/json"}; - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() {}; - - return apiClient.invokeAPI( - localVarPath, - "POST", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - openAICreateResponse, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - * Creates a model response. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param openAICreateResponse The value for the parameter openAICreateResponse - * @return CreateResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CreateResponse200Response createResponse( - @Nonnull final OpenAICreateResponse openAICreateResponse) throws OpenApiRequestException { - return createResponse(openAICreateResponse, null); - } - - /** - * Retrieves a model response with the given ID. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId (required) The value for the parameter responseId - * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to - * use for this request. `v1` if not otherwise specified. - * @param include (optional) Additional fields to include in the response. See the include - * parameter for Response creation above for more information. - * @param stream (optional) If set to true, the model response data will be streamed to the client - * as it is generated using server-sent events. - * @param startingAfter (optional) The sequence number of the event after which to start - * streaming. - * @param includeObfuscation (optional, default to true) When true, stream obfuscation will be - * enabled. Stream obfuscation adds random characters to an `obfuscation` field on - * streaming delta events to normalize payload sizes as a mitigation to certain side-channel - * attacks. These obfuscation fields are included by default, but add a small amount of - * overhead to the data stream. You can set `include_obfuscation` to false to - * optimize for bandwidth if you trust the network links between your application and the - * OpenAI API. - * @return CreateResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CreateResponse200Response getResponse( - @Nullable final String responseId, - @Nullable final AzureAIFoundryModelsApiVersion apiVersion, - @Nullable final List include, - @Nullable final Boolean stream, - @Nullable final Integer startingAfter, - @Nullable final Boolean includeObfuscation) - throws OpenApiRequestException { - - // verify the required parameter 'responseId' is set - if (responseId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'responseId' when calling getResponse") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/responses/{response_id}" - .replaceAll( - "\\{" + "response_id" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(responseId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); - localVarCollectionQueryParams.addAll(ApiClient.parameterToPairs("multi", "include[]", include)); - localVarQueryParams.addAll(ApiClient.parameterToPair("stream", stream)); - localVarQueryParams.addAll(ApiClient.parameterToPair("starting_after", startingAfter)); - localVarQueryParams.addAll( - ApiClient.parameterToPair("include_obfuscation", includeObfuscation)); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() {}; - - return apiClient.invokeAPI( - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - null, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - * Retrieves a model response with the given ID. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId The value for the parameter responseId - * @return CreateResponse200Response - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public CreateResponse200Response getResponse(@Nullable final String responseId) - throws OpenApiRequestException { - return getResponse(responseId, null, null, null, null, null); - } - - /** - * Returns a list of input items for a given response. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId (required) The value for the parameter responseId - * @param apiVersion (optional, default to v1) The explicit Azure AI Foundry Models API version to - * use for this request. `v1` if not otherwise specified. - * @param limit (optional, default to 20) A limit on the number of objects to be returned. Limit - * can range between 1 and 100, and the default is 20. - * @param order (optional) Sort order by the `created_at` timestamp of the objects. - * `asc` for ascending order and`desc` for descending order. - * @param after (optional) A cursor for use in pagination. `after` is an object ID that - * defines your place in the list. For instance, if you make a list request and receive 100 - * objects, ending with obj_foo, your subsequent call can include after=obj_foo in order - * to fetch the next page of the list. - * @param before (optional) A cursor for use in pagination. `before` is an object ID - * that defines your place in the list. For instance, if you make a list request and receive - * 100 objects, ending with obj_foo, your subsequent call can include before=obj_foo in - * order to fetch the previous page of the list. - * @return OpenAIResponseItemList - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public OpenAIResponseItemList listInputItems( - @Nonnull final String responseId, - @Nullable final AzureAIFoundryModelsApiVersion apiVersion, - @Nullable final Integer limit, - @Nullable final String order, - @Nullable final String after, - @Nullable final String before) - throws OpenApiRequestException { - - // verify the required parameter 'responseId' is set - if (responseId == null) { - throw new OpenApiRequestException( - "Missing the required parameter 'responseId' when calling listInputItems") - .statusCode(400); - } - - // create path and map variables - final String localVarPath = - "/responses/{response_id}/input_items" - .replaceAll( - "\\{" + "response_id" + "\\}", - ApiClient.escapeString(ApiClient.parameterToString(responseId))); - - final StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - final List localVarQueryParams = new ArrayList(); - final List localVarCollectionQueryParams = new ArrayList(); - final Map localVarHeaderParams = new HashMap(); - final Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiClient.parameterToPair("api-version", apiVersion)); - localVarQueryParams.addAll(ApiClient.parameterToPair("limit", limit)); - localVarQueryParams.addAll(ApiClient.parameterToPair("order", order)); - localVarQueryParams.addAll(ApiClient.parameterToPair("after", after)); - localVarQueryParams.addAll(ApiClient.parameterToPair("before", before)); - - final String[] localVarAccepts = {"application/json"}; - final String localVarAccept = ApiClient.selectHeaderAccept(localVarAccepts); - final String[] localVarContentTypes = {}; - - final String localVarContentType = ApiClient.selectHeaderContentType(localVarContentTypes); - - final TypeReference localVarReturnType = - new TypeReference() {}; - - return apiClient.invokeAPI( - localVarPath, - "GET", - localVarQueryParams, - localVarCollectionQueryParams, - localVarQueryStringJoiner.toString(), - null, - localVarHeaderParams, - localVarFormParams, - localVarAccept, - localVarContentType, - localVarReturnType); - } - - /** - * Returns a list of input items for a given response. - * - *

200 - The request has succeeded. - * - *

0 - An unexpected error response. - * - * @param responseId The value for the parameter responseId - * @return OpenAIResponseItemList - * @throws OpenApiRequestException if an error occurs while attempting to invoke the API - */ - @Nonnull - public OpenAIResponseItemList listInputItems(@Nonnull final String responseId) - throws OpenApiRequestException { - return listInputItems(responseId, null, null, null, null, null); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java deleted file mode 100644 index 813c5d762..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureAIFoundryModelsApiVersion.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** Gets or Sets AzureAIFoundryModelsApiVersion */ -public enum AzureAIFoundryModelsApiVersion { - V1("v1"), - - PREVIEW("preview"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - AzureAIFoundryModelsApiVersion(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static AzureAIFoundryModelsApiVersion fromValue(@Nonnull final String value) { - for (final AzureAIFoundryModelsApiVersion b : AzureAIFoundryModelsApiVersion.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java deleted file mode 100644 index 376b278e2..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResult.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A collection of true/false filtering results for configured custom blocklists. */ -// CHECKSTYLE:OFF -public class AzureContentFilterBlocklistResult -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("details") - private List details = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterBlocklistResult. */ - protected AzureContentFilterBlocklistResult() {} - - /** - * Set the filtered of this {@link AzureContentFilterBlocklistResult} instance and return the same - * instance. - * - * @param filtered A value indicating whether any of the detailed blocklists resulted in a - * filtering action. - * @return The same instance of this {@link AzureContentFilterBlocklistResult} class - */ - @Nonnull - public AzureContentFilterBlocklistResult filtered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * A value indicating whether any of the detailed blocklists resulted in a filtering action. - * - * @return filtered The filtered of this {@link AzureContentFilterBlocklistResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterBlocklistResult} instance. - * - * @param filtered A value indicating whether any of the detailed blocklists resulted in a - * filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the details of this {@link AzureContentFilterBlocklistResult} instance and return the same - * instance. - * - * @param details The pairs of individual blocklist IDs and whether they resulted in a filtering - * action. - * @return The same instance of this {@link AzureContentFilterBlocklistResult} class - */ - @Nonnull - public AzureContentFilterBlocklistResult details( - @Nullable final List details) { - this.details = details; - return this; - } - - /** - * Add one details instance to this {@link AzureContentFilterBlocklistResult}. - * - * @param detailsItem The details that should be added - * @return The same instance of type {@link AzureContentFilterBlocklistResult} - */ - @Nonnull - public AzureContentFilterBlocklistResult addDetailsItem( - @Nonnull final AzureContentFilterBlocklistResultDetailsInner detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * The pairs of individual blocklist IDs and whether they resulted in a filtering action. - * - * @return details The details of this {@link AzureContentFilterBlocklistResult} instance. - */ - @Nonnull - public List getDetails() { - return details; - } - - /** - * Set the details of this {@link AzureContentFilterBlocklistResult} instance. - * - * @param details The pairs of individual blocklist IDs and whether they resulted in a filtering - * action. - */ - public void setDetails( - @Nullable final List details) { - this.details = details; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterBlocklistResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentFilterBlocklistResult} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterBlocklistResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterBlocklistResult} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (details != null) declaredFields.put("details", details); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterBlocklistResult} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterBlocklistResult azureContentFilterBlocklistResult = - (AzureContentFilterBlocklistResult) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterBlocklistResult.cloudSdkCustomFields) - && Objects.equals(this.filtered, azureContentFilterBlocklistResult.filtered) - && Objects.equals(this.details, azureContentFilterBlocklistResult.details); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, details, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterBlocklistResult {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterBlocklistResult} instance with all required arguments. - */ - public static Builder create() { - return (filtered) -> new AzureContentFilterBlocklistResult().filtered(filtered); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterBlocklistResult} instance. - * - * @param filtered A value indicating whether any of the detailed blocklists resulted in a - * filtering action. - * @return The AzureContentFilterBlocklistResult instance. - */ - AzureContentFilterBlocklistResult filtered(@Nonnull final Boolean filtered); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java deleted file mode 100644 index c6c8bf9fc..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterBlocklistResultDetailsInner.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterBlocklistResultDetailsInner */ -// CHECKSTYLE:OFF -public class AzureContentFilterBlocklistResultDetailsInner -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("id") - private String id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterBlocklistResultDetailsInner. */ - protected AzureContentFilterBlocklistResultDetailsInner() {} - - /** - * Set the filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} instance and - * return the same instance. - * - * @param filtered A value indicating whether the blocklist produced a filtering action. - * @return The same instance of this {@link AzureContentFilterBlocklistResultDetailsInner} class - */ - @Nonnull - public AzureContentFilterBlocklistResultDetailsInner filtered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * A value indicating whether the blocklist produced a filtering action. - * - * @return filtered The filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} - * instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. - * - * @param filtered A value indicating whether the blocklist produced a filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance and return - * the same instance. - * - * @param id The ID of the custom blocklist evaluated. - * @return The same instance of this {@link AzureContentFilterBlocklistResultDetailsInner} class - */ - @Nonnull - public AzureContentFilterBlocklistResultDetailsInner id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * The ID of the custom blocklist evaluated. - * - * @return id The id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. - * - * @param id The ID of the custom blocklist evaluated. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterBlocklistResultDetailsInner}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterBlocklistResultDetailsInner} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterBlocklistResultDetailsInner has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterBlocklistResultDetailsInner} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (id != null) declaredFields.put("id", id); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterBlocklistResultDetailsInner} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterBlocklistResultDetailsInner - azureContentFilterBlocklistResultDetailsInner = - (AzureContentFilterBlocklistResultDetailsInner) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterBlocklistResultDetailsInner.cloudSdkCustomFields) - && Objects.equals(this.filtered, azureContentFilterBlocklistResultDetailsInner.filtered) - && Objects.equals(this.id, azureContentFilterBlocklistResultDetailsInner.id); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterBlocklistResultDetailsInner {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterBlocklistResultDetailsInner} instance with all required arguments. - */ - public static Builder create() { - return (filtered) -> - (id) -> new AzureContentFilterBlocklistResultDetailsInner().filtered(filtered).id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. - * - * @param filtered A value indicating whether the blocklist produced a filtering action. - * @return The AzureContentFilterBlocklistResultDetailsInner builder. - */ - Builder1 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the id of this {@link AzureContentFilterBlocklistResultDetailsInner} instance. - * - * @param id The ID of the custom blocklist evaluated. - * @return The AzureContentFilterBlocklistResultDetailsInner instance. - */ - AzureContentFilterBlocklistResultDetailsInner id(@Nonnull final String id); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java deleted file mode 100644 index 3319f856b..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpan.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A representation of a span of completion text as used by Azure OpenAI content filter results. */ -// CHECKSTYLE:OFF -public class AzureContentFilterCompletionTextSpan -// CHECKSTYLE:ON -{ - @JsonProperty("completion_start_offset") - private Integer completionStartOffset; - - @JsonProperty("completion_end_offset") - private Integer completionEndOffset; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterCompletionTextSpan. */ - protected AzureContentFilterCompletionTextSpan() {} - - /** - * Set the completionStartOffset of this {@link AzureContentFilterCompletionTextSpan} instance and - * return the same instance. - * - * @param completionStartOffset Offset of the UTF32 code point which begins the span. - * @return The same instance of this {@link AzureContentFilterCompletionTextSpan} class - */ - @Nonnull - public AzureContentFilterCompletionTextSpan completionStartOffset( - @Nonnull final Integer completionStartOffset) { - this.completionStartOffset = completionStartOffset; - return this; - } - - /** - * Offset of the UTF32 code point which begins the span. - * - * @return completionStartOffset The completionStartOffset of this {@link - * AzureContentFilterCompletionTextSpan} instance. - */ - @Nonnull - public Integer getCompletionStartOffset() { - return completionStartOffset; - } - - /** - * Set the completionStartOffset of this {@link AzureContentFilterCompletionTextSpan} instance. - * - * @param completionStartOffset Offset of the UTF32 code point which begins the span. - */ - public void setCompletionStartOffset(@Nonnull final Integer completionStartOffset) { - this.completionStartOffset = completionStartOffset; - } - - /** - * Set the completionEndOffset of this {@link AzureContentFilterCompletionTextSpan} instance and - * return the same instance. - * - * @param completionEndOffset Offset of the first UTF32 code point which is excluded from the - * span. This field is always equal to completion_start_offset for empty spans. This field is - * always larger than completion_start_offset for non-empty spans. - * @return The same instance of this {@link AzureContentFilterCompletionTextSpan} class - */ - @Nonnull - public AzureContentFilterCompletionTextSpan completionEndOffset( - @Nonnull final Integer completionEndOffset) { - this.completionEndOffset = completionEndOffset; - return this; - } - - /** - * Offset of the first UTF32 code point which is excluded from the span. This field is always - * equal to completion_start_offset for empty spans. This field is always larger than - * completion_start_offset for non-empty spans. - * - * @return completionEndOffset The completionEndOffset of this {@link - * AzureContentFilterCompletionTextSpan} instance. - */ - @Nonnull - public Integer getCompletionEndOffset() { - return completionEndOffset; - } - - /** - * Set the completionEndOffset of this {@link AzureContentFilterCompletionTextSpan} instance. - * - * @param completionEndOffset Offset of the first UTF32 code point which is excluded from the - * span. This field is always equal to completion_start_offset for empty spans. This field is - * always larger than completion_start_offset for non-empty spans. - */ - public void setCompletionEndOffset(@Nonnull final Integer completionEndOffset) { - this.completionEndOffset = completionEndOffset; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterCompletionTextSpan}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterCompletionTextSpan} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterCompletionTextSpan has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterCompletionTextSpan} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (completionStartOffset != null) - declaredFields.put("completionStartOffset", completionStartOffset); - if (completionEndOffset != null) declaredFields.put("completionEndOffset", completionEndOffset); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterCompletionTextSpan} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterCompletionTextSpan azureContentFilterCompletionTextSpan = - (AzureContentFilterCompletionTextSpan) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterCompletionTextSpan.cloudSdkCustomFields) - && Objects.equals( - this.completionStartOffset, azureContentFilterCompletionTextSpan.completionStartOffset) - && Objects.equals( - this.completionEndOffset, azureContentFilterCompletionTextSpan.completionEndOffset); - } - - @Override - public int hashCode() { - return Objects.hash(completionStartOffset, completionEndOffset, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterCompletionTextSpan {\n"); - sb.append(" completionStartOffset: ") - .append(toIndentedString(completionStartOffset)) - .append("\n"); - sb.append(" completionEndOffset: ") - .append(toIndentedString(completionEndOffset)) - .append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterCompletionTextSpan} instance with all required arguments. - */ - public static Builder create() { - return (completionStartOffset) -> - (completionEndOffset) -> - new AzureContentFilterCompletionTextSpan() - .completionStartOffset(completionStartOffset) - .completionEndOffset(completionEndOffset); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the completionStartOffset of this {@link AzureContentFilterCompletionTextSpan} instance. - * - * @param completionStartOffset Offset of the UTF32 code point which begins the span. - * @return The AzureContentFilterCompletionTextSpan builder. - */ - Builder1 completionStartOffset(@Nonnull final Integer completionStartOffset); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the completionEndOffset of this {@link AzureContentFilterCompletionTextSpan} instance. - * - * @param completionEndOffset Offset of the first UTF32 code point which is excluded from the - * span. This field is always equal to completion_start_offset for empty spans. This field - * is always larger than completion_start_offset for non-empty spans. - * @return The AzureContentFilterCompletionTextSpan instance. - */ - AzureContentFilterCompletionTextSpan completionEndOffset( - @Nonnull final Integer completionEndOffset); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java deleted file mode 100644 index 265965eec..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCompletionTextSpanDetectionResult.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterCompletionTextSpanDetectionResult */ -// CHECKSTYLE:OFF -public class AzureContentFilterCompletionTextSpanDetectionResult -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("detected") - private Boolean detected; - - @JsonProperty("details") - private List details = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterCompletionTextSpanDetectionResult. */ - protected AzureContentFilterCompletionTextSpanDetectionResult() {} - - /** - * Set the filtered of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance - * and return the same instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The same instance of this {@link AzureContentFilterCompletionTextSpanDetectionResult} - * class - */ - @Nonnull - public AzureContentFilterCompletionTextSpanDetectionResult filtered( - @Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * Whether the content detection resulted in a content filtering action. - * - * @return filtered The filtered of this {@link - * AzureContentFilterCompletionTextSpanDetectionResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the detected of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance - * and return the same instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The same instance of this {@link AzureContentFilterCompletionTextSpanDetectionResult} - * class - */ - @Nonnull - public AzureContentFilterCompletionTextSpanDetectionResult detected( - @Nonnull final Boolean detected) { - this.detected = detected; - return this; - } - - /** - * Whether the labeled content category was detected in the content. - * - * @return detected The detected of this {@link - * AzureContentFilterCompletionTextSpanDetectionResult} instance. - */ - @Nonnull - public Boolean isDetected() { - return detected; - } - - /** - * Set the detected of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. - * - * @param detected Whether the labeled content category was detected in the content. - */ - public void setDetected(@Nonnull final Boolean detected) { - this.detected = detected; - } - - /** - * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance - * and return the same instance. - * - * @param details Detailed information about the detected completion text spans. - * @return The same instance of this {@link AzureContentFilterCompletionTextSpanDetectionResult} - * class - */ - @Nonnull - public AzureContentFilterCompletionTextSpanDetectionResult details( - @Nonnull final List details) { - this.details = details; - return this; - } - - /** - * Add one details instance to this {@link AzureContentFilterCompletionTextSpanDetectionResult}. - * - * @param detailsItem The details that should be added - * @return The same instance of type {@link AzureContentFilterCompletionTextSpanDetectionResult} - */ - @Nonnull - public AzureContentFilterCompletionTextSpanDetectionResult addDetailsItem( - @Nonnull final AzureContentFilterCompletionTextSpan detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * Detailed information about the detected completion text spans. - * - * @return details The details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} - * instance. - */ - @Nonnull - public List getDetails() { - return details; - } - - /** - * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. - * - * @param details Detailed information about the detected completion text spans. - */ - public void setDetails(@Nonnull final List details) { - this.details = details; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterCompletionTextSpanDetectionResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterCompletionTextSpanDetectionResult} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterCompletionTextSpanDetectionResult has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * AzureContentFilterCompletionTextSpanDetectionResult} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (detected != null) declaredFields.put("detected", detected); - if (details != null) declaredFields.put("details", details); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link - * AzureContentFilterCompletionTextSpanDetectionResult} instance. If the map previously contained - * a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterCompletionTextSpanDetectionResult - azureContentFilterCompletionTextSpanDetectionResult = - (AzureContentFilterCompletionTextSpanDetectionResult) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterCompletionTextSpanDetectionResult.cloudSdkCustomFields) - && Objects.equals( - this.filtered, azureContentFilterCompletionTextSpanDetectionResult.filtered) - && Objects.equals( - this.detected, azureContentFilterCompletionTextSpanDetectionResult.detected) - && Objects.equals( - this.details, azureContentFilterCompletionTextSpanDetectionResult.details); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, detected, details, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterCompletionTextSpanDetectionResult {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterCompletionTextSpanDetectionResult} instance with all required arguments. - */ - public static Builder create() { - return (filtered) -> - (detected) -> - (details) -> - new AzureContentFilterCompletionTextSpanDetectionResult() - .filtered(filtered) - .detected(detected) - .details(details); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterCompletionTextSpanDetectionResult} - * instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The AzureContentFilterCompletionTextSpanDetectionResult builder. - */ - Builder1 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the detected of this {@link AzureContentFilterCompletionTextSpanDetectionResult} - * instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The AzureContentFilterCompletionTextSpanDetectionResult builder. - */ - Builder2 detected(@Nonnull final Boolean detected); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. - * - * @param details Detailed information about the detected completion text spans. - * @return The AzureContentFilterCompletionTextSpanDetectionResult instance. - */ - AzureContentFilterCompletionTextSpanDetectionResult details( - @Nonnull final List details); - - /** - * Set the details of this {@link AzureContentFilterCompletionTextSpanDetectionResult} instance. - * - * @param details Detailed information about the detected completion text spans. - * @return The AzureContentFilterCompletionTextSpanDetectionResult instance. - */ - default AzureContentFilterCompletionTextSpanDetectionResult details( - @Nonnull final AzureContentFilterCompletionTextSpan... details) { - return details(Arrays.asList(details)); - } - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java deleted file mode 100644 index aef180317..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResult.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A collection of true/false filtering results for configured custom topics. */ -// CHECKSTYLE:OFF -public class AzureContentFilterCustomTopicResult -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("details") - private List details = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterCustomTopicResult. */ - protected AzureContentFilterCustomTopicResult() {} - - /** - * Set the filtered of this {@link AzureContentFilterCustomTopicResult} instance and return the - * same instance. - * - * @param filtered A value indicating whether any of the detailed topics resulted in a filtering - * action. - * @return The same instance of this {@link AzureContentFilterCustomTopicResult} class - */ - @Nonnull - public AzureContentFilterCustomTopicResult filtered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * A value indicating whether any of the detailed topics resulted in a filtering action. - * - * @return filtered The filtered of this {@link AzureContentFilterCustomTopicResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterCustomTopicResult} instance. - * - * @param filtered A value indicating whether any of the detailed topics resulted in a filtering - * action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the details of this {@link AzureContentFilterCustomTopicResult} instance and return the - * same instance. - * - * @param details The pairs of individual topic IDs and whether they are detected. - * @return The same instance of this {@link AzureContentFilterCustomTopicResult} class - */ - @Nonnull - public AzureContentFilterCustomTopicResult details( - @Nullable final List details) { - this.details = details; - return this; - } - - /** - * Add one details instance to this {@link AzureContentFilterCustomTopicResult}. - * - * @param detailsItem The details that should be added - * @return The same instance of type {@link AzureContentFilterCustomTopicResult} - */ - @Nonnull - public AzureContentFilterCustomTopicResult addDetailsItem( - @Nonnull final AzureContentFilterCustomTopicResultDetailsInner detailsItem) { - if (this.details == null) { - this.details = new ArrayList<>(); - } - this.details.add(detailsItem); - return this; - } - - /** - * The pairs of individual topic IDs and whether they are detected. - * - * @return details The details of this {@link AzureContentFilterCustomTopicResult} instance. - */ - @Nonnull - public List getDetails() { - return details; - } - - /** - * Set the details of this {@link AzureContentFilterCustomTopicResult} instance. - * - * @param details The pairs of individual topic IDs and whether they are detected. - */ - public void setDetails( - @Nullable final List details) { - this.details = details; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterCustomTopicResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentFilterCustomTopicResult} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterCustomTopicResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterCustomTopicResult} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (details != null) declaredFields.put("details", details); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterCustomTopicResult} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterCustomTopicResult azureContentFilterCustomTopicResult = - (AzureContentFilterCustomTopicResult) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterCustomTopicResult.cloudSdkCustomFields) - && Objects.equals(this.filtered, azureContentFilterCustomTopicResult.filtered) - && Objects.equals(this.details, azureContentFilterCustomTopicResult.details); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, details, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterCustomTopicResult {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" details: ").append(toIndentedString(details)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterCustomTopicResult} instance with all required arguments. - */ - public static Builder create() { - return (filtered) -> new AzureContentFilterCustomTopicResult().filtered(filtered); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterCustomTopicResult} instance. - * - * @param filtered A value indicating whether any of the detailed topics resulted in a filtering - * action. - * @return The AzureContentFilterCustomTopicResult instance. - */ - AzureContentFilterCustomTopicResult filtered(@Nonnull final Boolean filtered); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java deleted file mode 100644 index 32a38eea5..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterCustomTopicResultDetailsInner.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterCustomTopicResultDetailsInner */ -// CHECKSTYLE:OFF -public class AzureContentFilterCustomTopicResultDetailsInner -// CHECKSTYLE:ON -{ - @JsonProperty("detected") - private Boolean detected; - - @JsonProperty("id") - private String id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterCustomTopicResultDetailsInner. */ - protected AzureContentFilterCustomTopicResultDetailsInner() {} - - /** - * Set the detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance and - * return the same instance. - * - * @param detected A value indicating whether the topic is detected. - * @return The same instance of this {@link AzureContentFilterCustomTopicResultDetailsInner} class - */ - @Nonnull - public AzureContentFilterCustomTopicResultDetailsInner detected(@Nonnull final Boolean detected) { - this.detected = detected; - return this; - } - - /** - * A value indicating whether the topic is detected. - * - * @return detected The detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} - * instance. - */ - @Nonnull - public Boolean isDetected() { - return detected; - } - - /** - * Set the detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. - * - * @param detected A value indicating whether the topic is detected. - */ - public void setDetected(@Nonnull final Boolean detected) { - this.detected = detected; - } - - /** - * Set the id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance and return - * the same instance. - * - * @param id The ID of the custom topic evaluated. - * @return The same instance of this {@link AzureContentFilterCustomTopicResultDetailsInner} class - */ - @Nonnull - public AzureContentFilterCustomTopicResultDetailsInner id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * The ID of the custom topic evaluated. - * - * @return id The id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. - * - * @param id The ID of the custom topic evaluated. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterCustomTopicResultDetailsInner}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterCustomTopicResultDetailsInner} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterCustomTopicResultDetailsInner has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterCustomTopicResultDetailsInner} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (detected != null) declaredFields.put("detected", detected); - if (id != null) declaredFields.put("id", id); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterCustomTopicResultDetailsInner} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterCustomTopicResultDetailsInner - azureContentFilterCustomTopicResultDetailsInner = - (AzureContentFilterCustomTopicResultDetailsInner) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterCustomTopicResultDetailsInner.cloudSdkCustomFields) - && Objects.equals(this.detected, azureContentFilterCustomTopicResultDetailsInner.detected) - && Objects.equals(this.id, azureContentFilterCustomTopicResultDetailsInner.id); - } - - @Override - public int hashCode() { - return Objects.hash(detected, id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterCustomTopicResultDetailsInner {\n"); - sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterCustomTopicResultDetailsInner} instance with all required arguments. - */ - public static Builder create() { - return (detected) -> - (id) -> new AzureContentFilterCustomTopicResultDetailsInner().detected(detected).id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the detected of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. - * - * @param detected A value indicating whether the topic is detected. - * @return The AzureContentFilterCustomTopicResultDetailsInner builder. - */ - Builder1 detected(@Nonnull final Boolean detected); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the id of this {@link AzureContentFilterCustomTopicResultDetailsInner} instance. - * - * @param id The ID of the custom topic evaluated. - * @return The AzureContentFilterCustomTopicResultDetailsInner instance. - */ - AzureContentFilterCustomTopicResultDetailsInner id(@Nonnull final String id); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java deleted file mode 100644 index 5bb299bd2..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterDetectionResult.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * A labeled content filter result item that indicates whether the content was detected and whether - * the content was filtered. - */ -// CHECKSTYLE:OFF -public class AzureContentFilterDetectionResult -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("detected") - private Boolean detected; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterDetectionResult. */ - protected AzureContentFilterDetectionResult() {} - - /** - * Set the filtered of this {@link AzureContentFilterDetectionResult} instance and return the same - * instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The same instance of this {@link AzureContentFilterDetectionResult} class - */ - @Nonnull - public AzureContentFilterDetectionResult filtered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * Whether the content detection resulted in a content filtering action. - * - * @return filtered The filtered of this {@link AzureContentFilterDetectionResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterDetectionResult} instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the detected of this {@link AzureContentFilterDetectionResult} instance and return the same - * instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The same instance of this {@link AzureContentFilterDetectionResult} class - */ - @Nonnull - public AzureContentFilterDetectionResult detected(@Nonnull final Boolean detected) { - this.detected = detected; - return this; - } - - /** - * Whether the labeled content category was detected in the content. - * - * @return detected The detected of this {@link AzureContentFilterDetectionResult} instance. - */ - @Nonnull - public Boolean isDetected() { - return detected; - } - - /** - * Set the detected of this {@link AzureContentFilterDetectionResult} instance. - * - * @param detected Whether the labeled content category was detected in the content. - */ - public void setDetected(@Nonnull final Boolean detected) { - this.detected = detected; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterDetectionResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentFilterDetectionResult} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterDetectionResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterDetectionResult} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (detected != null) declaredFields.put("detected", detected); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterDetectionResult} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterDetectionResult azureContentFilterDetectionResult = - (AzureContentFilterDetectionResult) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterDetectionResult.cloudSdkCustomFields) - && Objects.equals(this.filtered, azureContentFilterDetectionResult.filtered) - && Objects.equals(this.detected, azureContentFilterDetectionResult.detected); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, detected, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterDetectionResult {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterDetectionResult} instance with all required arguments. - */ - public static Builder create() { - return (filtered) -> - (detected) -> new AzureContentFilterDetectionResult().filtered(filtered).detected(detected); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterDetectionResult} instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The AzureContentFilterDetectionResult builder. - */ - Builder1 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the detected of this {@link AzureContentFilterDetectionResult} instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The AzureContentFilterDetectionResult instance. - */ - AzureContentFilterDetectionResult detected(@Nonnull final Boolean detected); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java deleted file mode 100644 index 9cf835684..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterForResponsesAPI.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterForResponsesAPI */ -// CHECKSTYLE:OFF -public class AzureContentFilterForResponsesAPI -// CHECKSTYLE:ON -{ - @JsonProperty("blocked") - private Boolean blocked; - - @JsonProperty("source_type") - private String sourceType; - - @JsonProperty("content_filter_results") - private AzureContentFilterResultsForResponsesAPI contentFilterResults; - - @JsonProperty("content_filter_offsets") - private AzureContentFilterResultOffsets contentFilterOffsets; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterForResponsesAPI. */ - protected AzureContentFilterForResponsesAPI() {} - - /** - * Set the blocked of this {@link AzureContentFilterForResponsesAPI} instance and return the same - * instance. - * - * @param blocked Indicate if the response is blocked. - * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterForResponsesAPI blocked(@Nonnull final Boolean blocked) { - this.blocked = blocked; - return this; - } - - /** - * Indicate if the response is blocked. - * - * @return blocked The blocked of this {@link AzureContentFilterForResponsesAPI} instance. - */ - @Nonnull - public Boolean isBlocked() { - return blocked; - } - - /** - * Set the blocked of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param blocked Indicate if the response is blocked. - */ - public void setBlocked(@Nonnull final Boolean blocked) { - this.blocked = blocked; - } - - /** - * Set the sourceType of this {@link AzureContentFilterForResponsesAPI} instance and return the - * same instance. - * - * @param sourceType The name of the source type of the message. - * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterForResponsesAPI sourceType(@Nonnull final String sourceType) { - this.sourceType = sourceType; - return this; - } - - /** - * The name of the source type of the message. - * - * @return sourceType The sourceType of this {@link AzureContentFilterForResponsesAPI} instance. - */ - @Nonnull - public String getSourceType() { - return sourceType; - } - - /** - * Set the sourceType of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param sourceType The name of the source type of the message. - */ - public void setSourceType(@Nonnull final String sourceType) { - this.sourceType = sourceType; - } - - /** - * Set the contentFilterResults of this {@link AzureContentFilterForResponsesAPI} instance and - * return the same instance. - * - * @param contentFilterResults A content filter result for a single response item produced by a - * generative AI system. - * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterForResponsesAPI contentFilterResults( - @Nonnull final AzureContentFilterResultsForResponsesAPI contentFilterResults) { - this.contentFilterResults = contentFilterResults; - return this; - } - - /** - * A content filter result for a single response item produced by a generative AI system. - * - * @return contentFilterResults The contentFilterResults of this {@link - * AzureContentFilterForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI getContentFilterResults() { - return contentFilterResults; - } - - /** - * Set the contentFilterResults of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param contentFilterResults A content filter result for a single response item produced by a - * generative AI system. - */ - public void setContentFilterResults( - @Nonnull final AzureContentFilterResultsForResponsesAPI contentFilterResults) { - this.contentFilterResults = contentFilterResults; - } - - /** - * Set the contentFilterOffsets of this {@link AzureContentFilterForResponsesAPI} instance and - * return the same instance. - * - * @param contentFilterOffsets The contentFilterOffsets of this {@link - * AzureContentFilterForResponsesAPI} - * @return The same instance of this {@link AzureContentFilterForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterForResponsesAPI contentFilterOffsets( - @Nonnull final AzureContentFilterResultOffsets contentFilterOffsets) { - this.contentFilterOffsets = contentFilterOffsets; - return this; - } - - /** - * Get contentFilterOffsets - * - * @return contentFilterOffsets The contentFilterOffsets of this {@link - * AzureContentFilterForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterResultOffsets getContentFilterOffsets() { - return contentFilterOffsets; - } - - /** - * Set the contentFilterOffsets of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param contentFilterOffsets The contentFilterOffsets of this {@link - * AzureContentFilterForResponsesAPI} - */ - public void setContentFilterOffsets( - @Nonnull final AzureContentFilterResultOffsets contentFilterOffsets) { - this.contentFilterOffsets = contentFilterOffsets; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterForResponsesAPI}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentFilterForResponsesAPI} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterForResponsesAPI has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterForResponsesAPI} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (blocked != null) declaredFields.put("blocked", blocked); - if (sourceType != null) declaredFields.put("sourceType", sourceType); - if (contentFilterResults != null) - declaredFields.put("contentFilterResults", contentFilterResults); - if (contentFilterOffsets != null) - declaredFields.put("contentFilterOffsets", contentFilterOffsets); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterForResponsesAPI} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterForResponsesAPI azureContentFilterForResponsesAPI = - (AzureContentFilterForResponsesAPI) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterForResponsesAPI.cloudSdkCustomFields) - && Objects.equals(this.blocked, azureContentFilterForResponsesAPI.blocked) - && Objects.equals(this.sourceType, azureContentFilterForResponsesAPI.sourceType) - && Objects.equals( - this.contentFilterResults, azureContentFilterForResponsesAPI.contentFilterResults) - && Objects.equals( - this.contentFilterOffsets, azureContentFilterForResponsesAPI.contentFilterOffsets); - } - - @Override - public int hashCode() { - return Objects.hash( - blocked, sourceType, contentFilterResults, contentFilterOffsets, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterForResponsesAPI {\n"); - sb.append(" blocked: ").append(toIndentedString(blocked)).append("\n"); - sb.append(" sourceType: ").append(toIndentedString(sourceType)).append("\n"); - sb.append(" contentFilterResults: ") - .append(toIndentedString(contentFilterResults)) - .append("\n"); - sb.append(" contentFilterOffsets: ") - .append(toIndentedString(contentFilterOffsets)) - .append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterForResponsesAPI} instance with all required arguments. - */ - public static Builder create() { - return (blocked) -> - (sourceType) -> - (contentFilterResults) -> - (contentFilterOffsets) -> - new AzureContentFilterForResponsesAPI() - .blocked(blocked) - .sourceType(sourceType) - .contentFilterResults(contentFilterResults) - .contentFilterOffsets(contentFilterOffsets); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the blocked of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param blocked Indicate if the response is blocked. - * @return The AzureContentFilterForResponsesAPI builder. - */ - Builder1 blocked(@Nonnull final Boolean blocked); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the sourceType of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param sourceType The name of the source type of the message. - * @return The AzureContentFilterForResponsesAPI builder. - */ - Builder2 sourceType(@Nonnull final String sourceType); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the contentFilterResults of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param contentFilterResults A content filter result for a single response item produced by a - * generative AI system. - * @return The AzureContentFilterForResponsesAPI builder. - */ - Builder3 contentFilterResults( - @Nonnull final AzureContentFilterResultsForResponsesAPI contentFilterResults); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the contentFilterOffsets of this {@link AzureContentFilterForResponsesAPI} instance. - * - * @param contentFilterOffsets The contentFilterOffsets of this {@link - * AzureContentFilterForResponsesAPI} - * @return The AzureContentFilterForResponsesAPI instance. - */ - AzureContentFilterForResponsesAPI contentFilterOffsets( - @Nonnull final AzureContentFilterResultOffsets contentFilterOffsets); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java deleted file mode 100644 index 6ddd0091e..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterPersonallyIdentifiableInformationResult.java +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterPersonallyIdentifiableInformationResult */ -// CHECKSTYLE:OFF -public class AzureContentFilterPersonallyIdentifiableInformationResult -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("detected") - private Boolean detected; - - @JsonProperty("redacted_text") - private String redactedText; - - @JsonProperty("sub_categories") - private List subCategories = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterPersonallyIdentifiableInformationResult. */ - protected AzureContentFilterPersonallyIdentifiableInformationResult() {} - - /** - * Set the filtered of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance and return the same instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The same instance of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} class - */ - @Nonnull - public AzureContentFilterPersonallyIdentifiableInformationResult filtered( - @Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * Whether the content detection resulted in a content filtering action. - * - * @return filtered The filtered of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the detected of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance and return the same instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The same instance of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} class - */ - @Nonnull - public AzureContentFilterPersonallyIdentifiableInformationResult detected( - @Nonnull final Boolean detected) { - this.detected = detected; - return this; - } - - /** - * Whether the labeled content category was detected in the content. - * - * @return detected The detected of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance. - */ - @Nonnull - public Boolean isDetected() { - return detected; - } - - /** - * Set the detected of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance. - * - * @param detected Whether the labeled content category was detected in the content. - */ - public void setDetected(@Nonnull final Boolean detected) { - this.detected = detected; - } - - /** - * Set the redactedText of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance and return the same instance. - * - * @param redactedText The redacted text with PII information removed or masked. - * @return The same instance of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} class - */ - @Nonnull - public AzureContentFilterPersonallyIdentifiableInformationResult redactedText( - @Nullable final String redactedText) { - this.redactedText = redactedText; - return this; - } - - /** - * The redacted text with PII information removed or masked. - * - * @return redactedText The redactedText of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance. - */ - @Nonnull - public String getRedactedText() { - return redactedText; - } - - /** - * Set the redactedText of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance. - * - * @param redactedText The redacted text with PII information removed or masked. - */ - public void setRedactedText(@Nullable final String redactedText) { - this.redactedText = redactedText; - } - - /** - * Set the subCategories of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance and return the same instance. - * - * @param subCategories Detailed results for individual PIIHarmSubCategory(s). - * @return The same instance of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} class - */ - @Nonnull - public AzureContentFilterPersonallyIdentifiableInformationResult subCategories( - @Nullable final List subCategories) { - this.subCategories = subCategories; - return this; - } - - /** - * Add one subCategories instance to this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult}. - * - * @param subCategoriesItem The subCategories that should be added - * @return The same instance of type {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} - */ - @Nonnull - public AzureContentFilterPersonallyIdentifiableInformationResult addSubCategoriesItem( - @Nonnull final AzurePiiSubCategoryResult subCategoriesItem) { - if (this.subCategories == null) { - this.subCategories = new ArrayList<>(); - } - this.subCategories.add(subCategoriesItem); - return this; - } - - /** - * Detailed results for individual PIIHarmSubCategory(s). - * - * @return subCategories The subCategories of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance. - */ - @Nonnull - public List getSubCategories() { - return subCategories; - } - - /** - * Set the subCategories of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance. - * - * @param subCategories Detailed results for individual PIIHarmSubCategory(s). - */ - public void setSubCategories(@Nullable final List subCategories) { - this.subCategories = subCategories; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterPersonallyIdentifiableInformationResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterPersonallyIdentifiableInformationResult has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (detected != null) declaredFields.put("detected", detected); - if (redactedText != null) declaredFields.put("redactedText", redactedText); - if (subCategories != null) declaredFields.put("subCategories", subCategories); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterPersonallyIdentifiableInformationResult - azureContentFilterPersonallyIdentifiableInformationResult = - (AzureContentFilterPersonallyIdentifiableInformationResult) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterPersonallyIdentifiableInformationResult.cloudSdkCustomFields) - && Objects.equals( - this.filtered, azureContentFilterPersonallyIdentifiableInformationResult.filtered) - && Objects.equals( - this.detected, azureContentFilterPersonallyIdentifiableInformationResult.detected) - && Objects.equals( - this.redactedText, - azureContentFilterPersonallyIdentifiableInformationResult.redactedText) - && Objects.equals( - this.subCategories, - azureContentFilterPersonallyIdentifiableInformationResult.subCategories); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, detected, redactedText, subCategories, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterPersonallyIdentifiableInformationResult {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); - sb.append(" redactedText: ").append(toIndentedString(redactedText)).append("\n"); - sb.append(" subCategories: ").append(toIndentedString(subCategories)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterPersonallyIdentifiableInformationResult} instance with all required - * arguments. - */ - public static Builder create() { - return (filtered) -> - (detected) -> - new AzureContentFilterPersonallyIdentifiableInformationResult() - .filtered(filtered) - .detected(detected); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The AzureContentFilterPersonallyIdentifiableInformationResult builder. - */ - Builder1 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the detected of this {@link AzureContentFilterPersonallyIdentifiableInformationResult} - * instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The AzureContentFilterPersonallyIdentifiableInformationResult instance. - */ - AzureContentFilterPersonallyIdentifiableInformationResult detected( - @Nonnull final Boolean detected); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java deleted file mode 100644 index 7dcb1bc28..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultOffsets.java +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterResultOffsets */ -// CHECKSTYLE:OFF -public class AzureContentFilterResultOffsets -// CHECKSTYLE:ON -{ - @JsonProperty("start_offset") - private Integer startOffset; - - @JsonProperty("end_offset") - private Integer endOffset; - - @JsonProperty("check_offset") - private Integer checkOffset; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterResultOffsets. */ - protected AzureContentFilterResultOffsets() {} - - /** - * Set the startOffset of this {@link AzureContentFilterResultOffsets} instance and return the - * same instance. - * - * @param startOffset The startOffset of this {@link AzureContentFilterResultOffsets} - * @return The same instance of this {@link AzureContentFilterResultOffsets} class - */ - @Nonnull - public AzureContentFilterResultOffsets startOffset(@Nonnull final Integer startOffset) { - this.startOffset = startOffset; - return this; - } - - /** - * Get startOffset - * - * @return startOffset The startOffset of this {@link AzureContentFilterResultOffsets} instance. - */ - @Nonnull - public Integer getStartOffset() { - return startOffset; - } - - /** - * Set the startOffset of this {@link AzureContentFilterResultOffsets} instance. - * - * @param startOffset The startOffset of this {@link AzureContentFilterResultOffsets} - */ - public void setStartOffset(@Nonnull final Integer startOffset) { - this.startOffset = startOffset; - } - - /** - * Set the endOffset of this {@link AzureContentFilterResultOffsets} instance and return the same - * instance. - * - * @param endOffset The endOffset of this {@link AzureContentFilterResultOffsets} - * @return The same instance of this {@link AzureContentFilterResultOffsets} class - */ - @Nonnull - public AzureContentFilterResultOffsets endOffset(@Nonnull final Integer endOffset) { - this.endOffset = endOffset; - return this; - } - - /** - * Get endOffset - * - * @return endOffset The endOffset of this {@link AzureContentFilterResultOffsets} instance. - */ - @Nonnull - public Integer getEndOffset() { - return endOffset; - } - - /** - * Set the endOffset of this {@link AzureContentFilterResultOffsets} instance. - * - * @param endOffset The endOffset of this {@link AzureContentFilterResultOffsets} - */ - public void setEndOffset(@Nonnull final Integer endOffset) { - this.endOffset = endOffset; - } - - /** - * Set the checkOffset of this {@link AzureContentFilterResultOffsets} instance and return the - * same instance. - * - * @param checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} - * @return The same instance of this {@link AzureContentFilterResultOffsets} class - */ - @Nonnull - public AzureContentFilterResultOffsets checkOffset(@Nonnull final Integer checkOffset) { - this.checkOffset = checkOffset; - return this; - } - - /** - * Get checkOffset - * - * @return checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} instance. - */ - @Nonnull - public Integer getCheckOffset() { - return checkOffset; - } - - /** - * Set the checkOffset of this {@link AzureContentFilterResultOffsets} instance. - * - * @param checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} - */ - public void setCheckOffset(@Nonnull final Integer checkOffset) { - this.checkOffset = checkOffset; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzureContentFilterResultOffsets}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentFilterResultOffsets} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterResultOffsets has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterResultOffsets} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (startOffset != null) declaredFields.put("startOffset", startOffset); - if (endOffset != null) declaredFields.put("endOffset", endOffset); - if (checkOffset != null) declaredFields.put("checkOffset", checkOffset); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterResultOffsets} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterResultOffsets azureContentFilterResultOffsets = - (AzureContentFilterResultOffsets) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterResultOffsets.cloudSdkCustomFields) - && Objects.equals(this.startOffset, azureContentFilterResultOffsets.startOffset) - && Objects.equals(this.endOffset, azureContentFilterResultOffsets.endOffset) - && Objects.equals(this.checkOffset, azureContentFilterResultOffsets.checkOffset); - } - - @Override - public int hashCode() { - return Objects.hash(startOffset, endOffset, checkOffset, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultOffsets {\n"); - sb.append(" startOffset: ").append(toIndentedString(startOffset)).append("\n"); - sb.append(" endOffset: ").append(toIndentedString(endOffset)).append("\n"); - sb.append(" checkOffset: ").append(toIndentedString(checkOffset)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterResultOffsets} instance with all required arguments. - */ - public static Builder create() { - return (startOffset) -> - (endOffset) -> - (checkOffset) -> - new AzureContentFilterResultOffsets() - .startOffset(startOffset) - .endOffset(endOffset) - .checkOffset(checkOffset); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the startOffset of this {@link AzureContentFilterResultOffsets} instance. - * - * @param startOffset The startOffset of this {@link AzureContentFilterResultOffsets} - * @return The AzureContentFilterResultOffsets builder. - */ - Builder1 startOffset(@Nonnull final Integer startOffset); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the endOffset of this {@link AzureContentFilterResultOffsets} instance. - * - * @param endOffset The endOffset of this {@link AzureContentFilterResultOffsets} - * @return The AzureContentFilterResultOffsets builder. - */ - Builder2 endOffset(@Nonnull final Integer endOffset); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the checkOffset of this {@link AzureContentFilterResultOffsets} instance. - * - * @param checkOffset The checkOffset of this {@link AzureContentFilterResultOffsets} - * @return The AzureContentFilterResultOffsets instance. - */ - AzureContentFilterResultOffsets checkOffset(@Nonnull final Integer checkOffset); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java deleted file mode 100644 index a5b0e21ae..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPI.java +++ /dev/null @@ -1,885 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** AzureContentFilterResultsForResponsesAPI */ -// CHECKSTYLE:OFF -public class AzureContentFilterResultsForResponsesAPI -// CHECKSTYLE:ON -{ - @JsonProperty("sexual") - private AzureContentFilterSeverityResult sexual; - - @JsonProperty("hate") - private AzureContentFilterSeverityResult hate; - - @JsonProperty("violence") - private AzureContentFilterSeverityResult violence; - - @JsonProperty("self_harm") - private AzureContentFilterSeverityResult selfHarm; - - @JsonProperty("profanity") - private AzureContentFilterDetectionResult profanity; - - @JsonProperty("custom_blocklists") - private AzureContentFilterBlocklistResult customBlocklists; - - @JsonProperty("custom_topics") - private AzureContentFilterCustomTopicResult customTopics; - - @JsonProperty("error") - private AzureContentFilterResultsForResponsesAPIError error; - - @JsonProperty("jailbreak") - private AzureContentFilterDetectionResult jailbreak; - - @JsonProperty("task_adherence") - private AzureContentFilterDetectionResult taskAdherence; - - @JsonProperty("protected_material_text") - private AzureContentFilterDetectionResult protectedMaterialText; - - @JsonProperty("protected_material_code") - private AzureContentFilterResultsForResponsesAPIProtectedMaterialCode protectedMaterialCode; - - @JsonProperty("ungrounded_material") - private AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial; - - @JsonProperty("personally_identifiable_information") - private AzureContentFilterPersonallyIdentifiableInformationResult - personallyIdentifiableInformation; - - @JsonProperty("indirect_attack") - private AzureContentFilterDetectionResult indirectAttack; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterResultsForResponsesAPI. */ - protected AzureContentFilterResultsForResponsesAPI() {} - - /** - * Set the sexual of this {@link AzureContentFilterResultsForResponsesAPI} instance and return the - * same instance. - * - * @param sexual A content filter category for language related to anatomical organs and genitals, - * romantic relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical - * sexual acts, including those portrayed as an assault or a forced sexual violent act against - * one's will, prostitution, pornography, and abuse. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI sexual( - @Nullable final AzureContentFilterSeverityResult sexual) { - this.sexual = sexual; - return this; - } - - /** - * A content filter category for language related to anatomical organs and genitals, romantic - * relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, - * including those portrayed as an assault or a forced sexual violent act against one's will, - * prostitution, pornography, and abuse. - * - * @return sexual The sexual of this {@link AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterSeverityResult getSexual() { - return sexual; - } - - /** - * Set the sexual of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param sexual A content filter category for language related to anatomical organs and genitals, - * romantic relationships, acts portrayed in erotic or affectionate terms, pregnancy, physical - * sexual acts, including those portrayed as an assault or a forced sexual violent act against - * one's will, prostitution, pornography, and abuse. - */ - public void setSexual(@Nullable final AzureContentFilterSeverityResult sexual) { - this.sexual = sexual; - } - - /** - * Set the hate of this {@link AzureContentFilterResultsForResponsesAPI} instance and return the - * same instance. - * - * @param hate A content filter category that can refer to any content that attacks or uses - * pejorative or discriminatory language with reference to a person or identity group based on - * certain differentiating attributes of these groups including but not limited to race, - * ethnicity, nationality, gender identity and expression, sexual orientation, religion, - * immigration status, ability status, personal appearance, and body size. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI hate( - @Nullable final AzureContentFilterSeverityResult hate) { - this.hate = hate; - return this; - } - - /** - * A content filter category that can refer to any content that attacks or uses pejorative or - * discriminatory language with reference to a person or identity group based on certain - * differentiating attributes of these groups including but not limited to race, ethnicity, - * nationality, gender identity and expression, sexual orientation, religion, immigration status, - * ability status, personal appearance, and body size. - * - * @return hate The hate of this {@link AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterSeverityResult getHate() { - return hate; - } - - /** - * Set the hate of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param hate A content filter category that can refer to any content that attacks or uses - * pejorative or discriminatory language with reference to a person or identity group based on - * certain differentiating attributes of these groups including but not limited to race, - * ethnicity, nationality, gender identity and expression, sexual orientation, religion, - * immigration status, ability status, personal appearance, and body size. - */ - public void setHate(@Nullable final AzureContentFilterSeverityResult hate) { - this.hate = hate; - } - - /** - * Set the violence of this {@link AzureContentFilterResultsForResponsesAPI} instance and return - * the same instance. - * - * @param violence A content filter category for language related to physical actions intended to - * hurt, injure, damage, or kill someone or something; describes weapons, guns and related - * entities, such as manufactures, associations, legislation, and so on. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI violence( - @Nullable final AzureContentFilterSeverityResult violence) { - this.violence = violence; - return this; - } - - /** - * A content filter category for language related to physical actions intended to hurt, injure, - * damage, or kill someone or something; describes weapons, guns and related entities, such as - * manufactures, associations, legislation, and so on. - * - * @return violence The violence of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - */ - @Nonnull - public AzureContentFilterSeverityResult getViolence() { - return violence; - } - - /** - * Set the violence of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param violence A content filter category for language related to physical actions intended to - * hurt, injure, damage, or kill someone or something; describes weapons, guns and related - * entities, such as manufactures, associations, legislation, and so on. - */ - public void setViolence(@Nullable final AzureContentFilterSeverityResult violence) { - this.violence = violence; - } - - /** - * Set the selfHarm of this {@link AzureContentFilterResultsForResponsesAPI} instance and return - * the same instance. - * - * @param selfHarm A content filter category that describes language related to physical actions - * intended to purposely hurt, injure, damage one's body or kill oneself. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI selfHarm( - @Nullable final AzureContentFilterSeverityResult selfHarm) { - this.selfHarm = selfHarm; - return this; - } - - /** - * A content filter category that describes language related to physical actions intended to - * purposely hurt, injure, damage one's body or kill oneself. - * - * @return selfHarm The selfHarm of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - */ - @Nonnull - public AzureContentFilterSeverityResult getSelfHarm() { - return selfHarm; - } - - /** - * Set the selfHarm of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param selfHarm A content filter category that describes language related to physical actions - * intended to purposely hurt, injure, damage one's body or kill oneself. - */ - public void setSelfHarm(@Nullable final AzureContentFilterSeverityResult selfHarm) { - this.selfHarm = selfHarm; - } - - /** - * Set the profanity of this {@link AzureContentFilterResultsForResponsesAPI} instance and return - * the same instance. - * - * @param profanity A detection result that identifies whether crude, vulgar, or otherwise - * objection language is present in the content. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI profanity( - @Nullable final AzureContentFilterDetectionResult profanity) { - this.profanity = profanity; - return this; - } - - /** - * A detection result that identifies whether crude, vulgar, or otherwise objection language is - * present in the content. - * - * @return profanity The profanity of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - */ - @Nonnull - public AzureContentFilterDetectionResult getProfanity() { - return profanity; - } - - /** - * Set the profanity of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param profanity A detection result that identifies whether crude, vulgar, or otherwise - * objection language is present in the content. - */ - public void setProfanity(@Nullable final AzureContentFilterDetectionResult profanity) { - this.profanity = profanity; - } - - /** - * Set the customBlocklists of this {@link AzureContentFilterResultsForResponsesAPI} instance and - * return the same instance. - * - * @param customBlocklists A collection of binary filtering outcomes for configured custom - * blocklists. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI customBlocklists( - @Nullable final AzureContentFilterBlocklistResult customBlocklists) { - this.customBlocklists = customBlocklists; - return this; - } - - /** - * A collection of binary filtering outcomes for configured custom blocklists. - * - * @return customBlocklists The customBlocklists of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterBlocklistResult getCustomBlocklists() { - return customBlocklists; - } - - /** - * Set the customBlocklists of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param customBlocklists A collection of binary filtering outcomes for configured custom - * blocklists. - */ - public void setCustomBlocklists( - @Nullable final AzureContentFilterBlocklistResult customBlocklists) { - this.customBlocklists = customBlocklists; - } - - /** - * Set the customTopics of this {@link AzureContentFilterResultsForResponsesAPI} instance and - * return the same instance. - * - * @param customTopics A collection of binary filtering outcomes for configured custom topics. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI customTopics( - @Nullable final AzureContentFilterCustomTopicResult customTopics) { - this.customTopics = customTopics; - return this; - } - - /** - * A collection of binary filtering outcomes for configured custom topics. - * - * @return customTopics The customTopics of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - */ - @Nonnull - public AzureContentFilterCustomTopicResult getCustomTopics() { - return customTopics; - } - - /** - * Set the customTopics of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param customTopics A collection of binary filtering outcomes for configured custom topics. - */ - public void setCustomTopics(@Nullable final AzureContentFilterCustomTopicResult customTopics) { - this.customTopics = customTopics; - } - - /** - * Set the error of this {@link AzureContentFilterResultsForResponsesAPI} instance and return the - * same instance. - * - * @param error The error of this {@link AzureContentFilterResultsForResponsesAPI} - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI error( - @Nullable final AzureContentFilterResultsForResponsesAPIError error) { - this.error = error; - return this; - } - - /** - * Get error - * - * @return error The error of this {@link AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIError getError() { - return error; - } - - /** - * Set the error of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param error The error of this {@link AzureContentFilterResultsForResponsesAPI} - */ - public void setError(@Nullable final AzureContentFilterResultsForResponsesAPIError error) { - this.error = error; - } - - /** - * Set the jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} instance and return - * the same instance. - * - * @param jailbreak A detection result that describes user prompt injection attacks, where - * malicious users deliberately exploit system vulnerabilities to elicit unauthorized behavior - * from the LLM. This could lead to inappropriate content generation or violations of - * system-imposed restrictions. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI jailbreak( - @Nonnull final AzureContentFilterDetectionResult jailbreak) { - this.jailbreak = jailbreak; - return this; - } - - /** - * A detection result that describes user prompt injection attacks, where malicious users - * deliberately exploit system vulnerabilities to elicit unauthorized behavior from the LLM. This - * could lead to inappropriate content generation or violations of system-imposed restrictions. - * - * @return jailbreak The jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - */ - @Nonnull - public AzureContentFilterDetectionResult getJailbreak() { - return jailbreak; - } - - /** - * Set the jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param jailbreak A detection result that describes user prompt injection attacks, where - * malicious users deliberately exploit system vulnerabilities to elicit unauthorized behavior - * from the LLM. This could lead to inappropriate content generation or violations of - * system-imposed restrictions. - */ - public void setJailbreak(@Nonnull final AzureContentFilterDetectionResult jailbreak) { - this.jailbreak = jailbreak; - } - - /** - * Set the taskAdherence of this {@link AzureContentFilterResultsForResponsesAPI} instance and - * return the same instance. - * - * @param taskAdherence A detection result that indicates if the execution flow still sticks the - * plan. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI taskAdherence( - @Nonnull final AzureContentFilterDetectionResult taskAdherence) { - this.taskAdherence = taskAdherence; - return this; - } - - /** - * A detection result that indicates if the execution flow still sticks the plan. - * - * @return taskAdherence The taskAdherence of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterDetectionResult getTaskAdherence() { - return taskAdherence; - } - - /** - * Set the taskAdherence of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param taskAdherence A detection result that indicates if the execution flow still sticks the - * plan. - */ - public void setTaskAdherence(@Nonnull final AzureContentFilterDetectionResult taskAdherence) { - this.taskAdherence = taskAdherence; - } - - /** - * Set the protectedMaterialText of this {@link AzureContentFilterResultsForResponsesAPI} instance - * and return the same instance. - * - * @param protectedMaterialText A detection result that describes a match against text protected - * under copyright or other status. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI protectedMaterialText( - @Nullable final AzureContentFilterDetectionResult protectedMaterialText) { - this.protectedMaterialText = protectedMaterialText; - return this; - } - - /** - * A detection result that describes a match against text protected under copyright or other - * status. - * - * @return protectedMaterialText The protectedMaterialText of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterDetectionResult getProtectedMaterialText() { - return protectedMaterialText; - } - - /** - * Set the protectedMaterialText of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - * - * @param protectedMaterialText A detection result that describes a match against text protected - * under copyright or other status. - */ - public void setProtectedMaterialText( - @Nullable final AzureContentFilterDetectionResult protectedMaterialText) { - this.protectedMaterialText = protectedMaterialText; - } - - /** - * Set the protectedMaterialCode of this {@link AzureContentFilterResultsForResponsesAPI} instance - * and return the same instance. - * - * @param protectedMaterialCode The protectedMaterialCode of this {@link - * AzureContentFilterResultsForResponsesAPI} - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI protectedMaterialCode( - @Nullable - final AzureContentFilterResultsForResponsesAPIProtectedMaterialCode - protectedMaterialCode) { - this.protectedMaterialCode = protectedMaterialCode; - return this; - } - - /** - * Get protectedMaterialCode - * - * @return protectedMaterialCode The protectedMaterialCode of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode getProtectedMaterialCode() { - return protectedMaterialCode; - } - - /** - * Set the protectedMaterialCode of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. - * - * @param protectedMaterialCode The protectedMaterialCode of this {@link - * AzureContentFilterResultsForResponsesAPI} - */ - public void setProtectedMaterialCode( - @Nullable - final AzureContentFilterResultsForResponsesAPIProtectedMaterialCode - protectedMaterialCode) { - this.protectedMaterialCode = protectedMaterialCode; - } - - /** - * Set the ungroundedMaterial of this {@link AzureContentFilterResultsForResponsesAPI} instance - * and return the same instance. - * - * @param ungroundedMaterial The ungroundedMaterial of this {@link - * AzureContentFilterResultsForResponsesAPI} - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI ungroundedMaterial( - @Nullable final AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial) { - this.ungroundedMaterial = ungroundedMaterial; - return this; - } - - /** - * Get ungroundedMaterial - * - * @return ungroundedMaterial The ungroundedMaterial of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterCompletionTextSpanDetectionResult getUngroundedMaterial() { - return ungroundedMaterial; - } - - /** - * Set the ungroundedMaterial of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param ungroundedMaterial The ungroundedMaterial of this {@link - * AzureContentFilterResultsForResponsesAPI} - */ - public void setUngroundedMaterial( - @Nullable final AzureContentFilterCompletionTextSpanDetectionResult ungroundedMaterial) { - this.ungroundedMaterial = ungroundedMaterial; - } - - /** - * Set the personallyIdentifiableInformation of this {@link - * AzureContentFilterResultsForResponsesAPI} instance and return the same instance. - * - * @param personallyIdentifiableInformation A detection result that describes matches against - * Personal Identifiable Information with configurable subcategories. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI personallyIdentifiableInformation( - @Nullable - final AzureContentFilterPersonallyIdentifiableInformationResult - personallyIdentifiableInformation) { - this.personallyIdentifiableInformation = personallyIdentifiableInformation; - return this; - } - - /** - * A detection result that describes matches against Personal Identifiable Information with - * configurable subcategories. - * - * @return personallyIdentifiableInformation The personallyIdentifiableInformation of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterPersonallyIdentifiableInformationResult - getPersonallyIdentifiableInformation() { - return personallyIdentifiableInformation; - } - - /** - * Set the personallyIdentifiableInformation of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - * - * @param personallyIdentifiableInformation A detection result that describes matches against - * Personal Identifiable Information with configurable subcategories. - */ - public void setPersonallyIdentifiableInformation( - @Nullable - final AzureContentFilterPersonallyIdentifiableInformationResult - personallyIdentifiableInformation) { - this.personallyIdentifiableInformation = personallyIdentifiableInformation; - } - - /** - * Set the indirectAttack of this {@link AzureContentFilterResultsForResponsesAPI} instance and - * return the same instance. - * - * @param indirectAttack A detection result that describes attacks on systems powered by - * Generative AI models that can happen every time an application processes information that - * wasn’t directly authored by either the developer of the application or the user. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPI} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPI indirectAttack( - @Nullable final AzureContentFilterDetectionResult indirectAttack) { - this.indirectAttack = indirectAttack; - return this; - } - - /** - * A detection result that describes attacks on systems powered by Generative AI models that can - * happen every time an application processes information that wasn’t directly authored by either - * the developer of the application or the user. - * - * @return indirectAttack The indirectAttack of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - */ - @Nonnull - public AzureContentFilterDetectionResult getIndirectAttack() { - return indirectAttack; - } - - /** - * Set the indirectAttack of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param indirectAttack A detection result that describes attacks on systems powered by - * Generative AI models that can happen every time an application processes information that - * wasn’t directly authored by either the developer of the application or the user. - */ - public void setIndirectAttack(@Nullable final AzureContentFilterDetectionResult indirectAttack) { - this.indirectAttack = indirectAttack; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultsForResponsesAPI}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultsForResponsesAPI} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterResultsForResponsesAPI has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterResultsForResponsesAPI} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (sexual != null) declaredFields.put("sexual", sexual); - if (hate != null) declaredFields.put("hate", hate); - if (violence != null) declaredFields.put("violence", violence); - if (selfHarm != null) declaredFields.put("selfHarm", selfHarm); - if (profanity != null) declaredFields.put("profanity", profanity); - if (customBlocklists != null) declaredFields.put("customBlocklists", customBlocklists); - if (customTopics != null) declaredFields.put("customTopics", customTopics); - if (error != null) declaredFields.put("error", error); - if (jailbreak != null) declaredFields.put("jailbreak", jailbreak); - if (taskAdherence != null) declaredFields.put("taskAdherence", taskAdherence); - if (protectedMaterialText != null) - declaredFields.put("protectedMaterialText", protectedMaterialText); - if (protectedMaterialCode != null) - declaredFields.put("protectedMaterialCode", protectedMaterialCode); - if (ungroundedMaterial != null) declaredFields.put("ungroundedMaterial", ungroundedMaterial); - if (personallyIdentifiableInformation != null) - declaredFields.put("personallyIdentifiableInformation", personallyIdentifiableInformation); - if (indirectAttack != null) declaredFields.put("indirectAttack", indirectAttack); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterResultsForResponsesAPI} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterResultsForResponsesAPI azureContentFilterResultsForResponsesAPI = - (AzureContentFilterResultsForResponsesAPI) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterResultsForResponsesAPI.cloudSdkCustomFields) - && Objects.equals(this.sexual, azureContentFilterResultsForResponsesAPI.sexual) - && Objects.equals(this.hate, azureContentFilterResultsForResponsesAPI.hate) - && Objects.equals(this.violence, azureContentFilterResultsForResponsesAPI.violence) - && Objects.equals(this.selfHarm, azureContentFilterResultsForResponsesAPI.selfHarm) - && Objects.equals(this.profanity, azureContentFilterResultsForResponsesAPI.profanity) - && Objects.equals( - this.customBlocklists, azureContentFilterResultsForResponsesAPI.customBlocklists) - && Objects.equals(this.customTopics, azureContentFilterResultsForResponsesAPI.customTopics) - && Objects.equals(this.error, azureContentFilterResultsForResponsesAPI.error) - && Objects.equals(this.jailbreak, azureContentFilterResultsForResponsesAPI.jailbreak) - && Objects.equals( - this.taskAdherence, azureContentFilterResultsForResponsesAPI.taskAdherence) - && Objects.equals( - this.protectedMaterialText, - azureContentFilterResultsForResponsesAPI.protectedMaterialText) - && Objects.equals( - this.protectedMaterialCode, - azureContentFilterResultsForResponsesAPI.protectedMaterialCode) - && Objects.equals( - this.ungroundedMaterial, azureContentFilterResultsForResponsesAPI.ungroundedMaterial) - && Objects.equals( - this.personallyIdentifiableInformation, - azureContentFilterResultsForResponsesAPI.personallyIdentifiableInformation) - && Objects.equals( - this.indirectAttack, azureContentFilterResultsForResponsesAPI.indirectAttack); - } - - @Override - public int hashCode() { - return Objects.hash( - sexual, - hate, - violence, - selfHarm, - profanity, - customBlocklists, - customTopics, - error, - jailbreak, - taskAdherence, - protectedMaterialText, - protectedMaterialCode, - ungroundedMaterial, - personallyIdentifiableInformation, - indirectAttack, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultsForResponsesAPI {\n"); - sb.append(" sexual: ").append(toIndentedString(sexual)).append("\n"); - sb.append(" hate: ").append(toIndentedString(hate)).append("\n"); - sb.append(" violence: ").append(toIndentedString(violence)).append("\n"); - sb.append(" selfHarm: ").append(toIndentedString(selfHarm)).append("\n"); - sb.append(" profanity: ").append(toIndentedString(profanity)).append("\n"); - sb.append(" customBlocklists: ").append(toIndentedString(customBlocklists)).append("\n"); - sb.append(" customTopics: ").append(toIndentedString(customTopics)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" jailbreak: ").append(toIndentedString(jailbreak)).append("\n"); - sb.append(" taskAdherence: ").append(toIndentedString(taskAdherence)).append("\n"); - sb.append(" protectedMaterialText: ") - .append(toIndentedString(protectedMaterialText)) - .append("\n"); - sb.append(" protectedMaterialCode: ") - .append(toIndentedString(protectedMaterialCode)) - .append("\n"); - sb.append(" ungroundedMaterial: ").append(toIndentedString(ungroundedMaterial)).append("\n"); - sb.append(" personallyIdentifiableInformation: ") - .append(toIndentedString(personallyIdentifiableInformation)) - .append("\n"); - sb.append(" indirectAttack: ").append(toIndentedString(indirectAttack)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterResultsForResponsesAPI} instance with all required arguments. - */ - public static Builder create() { - return (jailbreak) -> - (taskAdherence) -> - new AzureContentFilterResultsForResponsesAPI() - .jailbreak(jailbreak) - .taskAdherence(taskAdherence); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the jailbreak of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param jailbreak A detection result that describes user prompt injection attacks, where - * malicious users deliberately exploit system vulnerabilities to elicit unauthorized - * behavior from the LLM. This could lead to inappropriate content generation or violations - * of system-imposed restrictions. - * @return The AzureContentFilterResultsForResponsesAPI builder. - */ - Builder1 jailbreak(@Nonnull final AzureContentFilterDetectionResult jailbreak); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the taskAdherence of this {@link AzureContentFilterResultsForResponsesAPI} instance. - * - * @param taskAdherence A detection result that indicates if the execution flow still sticks the - * plan. - * @return The AzureContentFilterResultsForResponsesAPI instance. - */ - AzureContentFilterResultsForResponsesAPI taskAdherence( - @Nonnull final AzureContentFilterDetectionResult taskAdherence); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java deleted file mode 100644 index 09a47973b..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIError.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * If present, details about an error that prevented content filtering from completing its - * evaluation. - */ -// CHECKSTYLE:OFF -public class AzureContentFilterResultsForResponsesAPIError -// CHECKSTYLE:ON -{ - @JsonProperty("code") - private Integer code; - - @JsonProperty("message") - private String message; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterResultsForResponsesAPIError. */ - protected AzureContentFilterResultsForResponsesAPIError() {} - - /** - * Set the code of this {@link AzureContentFilterResultsForResponsesAPIError} instance and return - * the same instance. - * - * @param code A distinct, machine-readable code associated with the error. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPIError} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIError code(@Nonnull final Integer code) { - this.code = code; - return this; - } - - /** - * A distinct, machine-readable code associated with the error. - * - * @return code The code of this {@link AzureContentFilterResultsForResponsesAPIError} instance. - */ - @Nonnull - public Integer getCode() { - return code; - } - - /** - * Set the code of this {@link AzureContentFilterResultsForResponsesAPIError} instance. - * - * @param code A distinct, machine-readable code associated with the error. - */ - public void setCode(@Nonnull final Integer code) { - this.code = code; - } - - /** - * Set the message of this {@link AzureContentFilterResultsForResponsesAPIError} instance and - * return the same instance. - * - * @param message A human-readable message associated with the error. - * @return The same instance of this {@link AzureContentFilterResultsForResponsesAPIError} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIError message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * A human-readable message associated with the error. - * - * @return message The message of this {@link AzureContentFilterResultsForResponsesAPIError} - * instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link AzureContentFilterResultsForResponsesAPIError} instance. - * - * @param message A human-readable message associated with the error. - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultsForResponsesAPIError}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultsForResponsesAPIError} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterResultsForResponsesAPIError has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterResultsForResponsesAPIError} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (code != null) declaredFields.put("code", code); - if (message != null) declaredFields.put("message", message); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterResultsForResponsesAPIError} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterResultsForResponsesAPIError - azureContentFilterResultsForResponsesAPIError = - (AzureContentFilterResultsForResponsesAPIError) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterResultsForResponsesAPIError.cloudSdkCustomFields) - && Objects.equals(this.code, azureContentFilterResultsForResponsesAPIError.code) - && Objects.equals(this.message, azureContentFilterResultsForResponsesAPIError.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultsForResponsesAPIError {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterResultsForResponsesAPIError} instance with all required arguments. - */ - public static Builder create() { - return (code) -> - (message) -> - new AzureContentFilterResultsForResponsesAPIError().code(code).message(message); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the code of this {@link AzureContentFilterResultsForResponsesAPIError} instance. - * - * @param code A distinct, machine-readable code associated with the error. - * @return The AzureContentFilterResultsForResponsesAPIError builder. - */ - Builder1 code(@Nonnull final Integer code); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link AzureContentFilterResultsForResponsesAPIError} instance. - * - * @param message A human-readable message associated with the error. - * @return The AzureContentFilterResultsForResponsesAPIError instance. - */ - AzureContentFilterResultsForResponsesAPIError message(@Nonnull final String message); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java deleted file mode 100644 index 02a74973c..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCode.java +++ /dev/null @@ -1,314 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * A detection result that describes a match against licensed code or other protected source - * material. - */ -// CHECKSTYLE:OFF -public class AzureContentFilterResultsForResponsesAPIProtectedMaterialCode -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("detected") - private Boolean detected; - - @JsonProperty("citation") - private AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation citation; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterResultsForResponsesAPIProtectedMaterialCode. */ - protected AzureContentFilterResultsForResponsesAPIProtectedMaterialCode() {} - - /** - * Set the filtered of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * instance and return the same instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The same instance of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode filtered( - @Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * Whether the content detection resulted in a content filtering action. - * - * @return filtered The filtered of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the detected of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * instance and return the same instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The same instance of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode detected( - @Nonnull final Boolean detected) { - this.detected = detected; - return this; - } - - /** - * Whether the labeled content category was detected in the content. - * - * @return detected The detected of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. - */ - @Nonnull - public Boolean isDetected() { - return detected; - } - - /** - * Set the detected of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * instance. - * - * @param detected Whether the labeled content category was detected in the content. - */ - public void setDetected(@Nonnull final Boolean detected) { - this.detected = detected; - } - - /** - * Set the citation of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * instance and return the same instance. - * - * @param citation The citation of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * @return The same instance of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCode citation( - @Nullable - final AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation citation) { - this.citation = citation; - return this; - } - - /** - * Get citation - * - * @return citation The citation of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation getCitation() { - return citation; - } - - /** - * Set the citation of this {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - * instance. - * - * @param citation The citation of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} - */ - public void setCitation( - @Nullable - final AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation citation) { - this.citation = citation; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterResultsForResponsesAPIProtectedMaterialCode has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (detected != null) declaredFields.put("detected", detected); - if (citation != null) declaredFields.put("citation", citation); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterResultsForResponsesAPIProtectedMaterialCode - azureContentFilterResultsForResponsesAPIProtectedMaterialCode = - (AzureContentFilterResultsForResponsesAPIProtectedMaterialCode) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterResultsForResponsesAPIProtectedMaterialCode.cloudSdkCustomFields) - && Objects.equals( - this.filtered, azureContentFilterResultsForResponsesAPIProtectedMaterialCode.filtered) - && Objects.equals( - this.detected, azureContentFilterResultsForResponsesAPIProtectedMaterialCode.detected) - && Objects.equals( - this.citation, azureContentFilterResultsForResponsesAPIProtectedMaterialCode.citation); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, detected, citation, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultsForResponsesAPIProtectedMaterialCode {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); - sb.append(" citation: ").append(toIndentedString(citation)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance with all required - * arguments. - */ - public static Builder create() { - return (filtered) -> - (detected) -> - new AzureContentFilterResultsForResponsesAPIProtectedMaterialCode() - .filtered(filtered) - .detected(detected); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. - * - * @param filtered Whether the content detection resulted in a content filtering action. - * @return The AzureContentFilterResultsForResponsesAPIProtectedMaterialCode builder. - */ - Builder1 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the detected of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCode} instance. - * - * @param detected Whether the labeled content category was detected in the content. - * @return The AzureContentFilterResultsForResponsesAPIProtectedMaterialCode instance. - */ - AzureContentFilterResultsForResponsesAPIProtectedMaterialCode detected( - @Nonnull final Boolean detected); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java deleted file mode 100644 index 772d4e0ac..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.net.URI; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** If available, the citation details describing the associated license and its location. */ -// CHECKSTYLE:OFF -public class AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation -// CHECKSTYLE:ON -{ - @JsonProperty("license") - private String license; - - @JsonProperty("URL") - private URI URL; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** - * Default constructor for AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation. - */ - protected AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation() {} - - /** - * Set the license of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance and return the - * same instance. - * - * @param license The name or identifier of the license associated with the detection. - * @return The same instance of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation license( - @Nullable final String license) { - this.license = license; - return this; - } - - /** - * The name or identifier of the license associated with the detection. - * - * @return license The license of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. - */ - @Nonnull - public String getLicense() { - return license; - } - - /** - * Set the license of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. - * - * @param license The name or identifier of the license associated with the detection. - */ - public void setLicense(@Nullable final String license) { - this.license = license; - } - - /** - * Set the URL of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance and return the - * same instance. - * - * @param URL The URL associated with the license. - * @return The same instance of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} class - */ - @Nonnull - public AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation URL( - @Nullable final URI URL) { - this.URL = URL; - return this; - } - - /** - * The URL associated with the license. - * - * @return URL The URL of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. - */ - @Nonnull - public URI getURL() { - return URL; - } - - /** - * Set the URL of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. - * - * @param URL The URL associated with the license. - */ - public void setURL(@Nullable final URI URL) { - this.URL = URL; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (license != null) declaredFields.put("license", license); - if (URL != null) declaredFields.put("URL", URL); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link - * AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation - azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation = - (AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation) o; - return Objects.equals( - this.cloudSdkCustomFields, - azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation - .cloudSdkCustomFields) - && Objects.equals( - this.license, - azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.license) - && Objects.equals( - this.URL, azureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation.URL); - } - - @Override - public int hashCode() { - return Objects.hash(license, URL, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation {\n"); - sb.append(" license: ").append(toIndentedString(license)).append("\n"); - sb.append(" URL: ").append(toIndentedString(URL)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a new {@link AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation} - * instance. No arguments are required. - */ - public static AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation create() { - return new AzureContentFilterResultsForResponsesAPIProtectedMaterialCodeCitation(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java deleted file mode 100644 index 1cc724c53..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzureContentFilterSeverityResult.java +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * A labeled content filter result item that indicates whether the content was filtered and what the - * qualitative severity level of the content was, as evaluated against content filter configuration - * for the category. - */ -// CHECKSTYLE:OFF -public class AzureContentFilterSeverityResult -// CHECKSTYLE:ON -{ - @JsonProperty("filtered") - private Boolean filtered; - - /** The labeled severity of the content. */ - public enum SeverityEnum { - /** The SAFE option of this AzureContentFilterSeverityResult */ - SAFE("safe"), - - /** The LOW option of this AzureContentFilterSeverityResult */ - LOW("low"), - - /** The MEDIUM option of this AzureContentFilterSeverityResult */ - MEDIUM("medium"), - - /** The HIGH option of this AzureContentFilterSeverityResult */ - HIGH("high"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this AzureContentFilterSeverityResult */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - SeverityEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type AzureContentFilterSeverityResult - */ - @JsonCreator - @Nonnull - public static SeverityEnum fromValue(@Nonnull final String value) { - for (SeverityEnum b : SeverityEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("severity") - private SeverityEnum severity; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzureContentFilterSeverityResult. */ - protected AzureContentFilterSeverityResult() {} - - /** - * Set the filtered of this {@link AzureContentFilterSeverityResult} instance and return the same - * instance. - * - * @param filtered Whether the content severity resulted in a content filtering action. - * @return The same instance of this {@link AzureContentFilterSeverityResult} class - */ - @Nonnull - public AzureContentFilterSeverityResult filtered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * Whether the content severity resulted in a content filtering action. - * - * @return filtered The filtered of this {@link AzureContentFilterSeverityResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzureContentFilterSeverityResult} instance. - * - * @param filtered Whether the content severity resulted in a content filtering action. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the severity of this {@link AzureContentFilterSeverityResult} instance and return the same - * instance. - * - * @param severity The labeled severity of the content. - * @return The same instance of this {@link AzureContentFilterSeverityResult} class - */ - @Nonnull - public AzureContentFilterSeverityResult severity(@Nonnull final SeverityEnum severity) { - this.severity = severity; - return this; - } - - /** - * The labeled severity of the content. - * - * @return severity The severity of this {@link AzureContentFilterSeverityResult} instance. - */ - @Nonnull - public SeverityEnum getSeverity() { - return severity; - } - - /** - * Set the severity of this {@link AzureContentFilterSeverityResult} instance. - * - * @param severity The labeled severity of the content. - */ - public void setSeverity(@Nonnull final SeverityEnum severity) { - this.severity = severity; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzureContentFilterSeverityResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzureContentFilterSeverityResult} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzureContentFilterSeverityResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzureContentFilterSeverityResult} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (filtered != null) declaredFields.put("filtered", filtered); - if (severity != null) declaredFields.put("severity", severity); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzureContentFilterSeverityResult} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzureContentFilterSeverityResult azureContentFilterSeverityResult = - (AzureContentFilterSeverityResult) o; - return Objects.equals( - this.cloudSdkCustomFields, azureContentFilterSeverityResult.cloudSdkCustomFields) - && Objects.equals(this.filtered, azureContentFilterSeverityResult.filtered) - && Objects.equals(this.severity, azureContentFilterSeverityResult.severity); - } - - @Override - public int hashCode() { - return Objects.hash(filtered, severity, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzureContentFilterSeverityResult {\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzureContentFilterSeverityResult} instance with all required arguments. - */ - public static Builder create() { - return (filtered) -> - (severity) -> new AzureContentFilterSeverityResult().filtered(filtered).severity(severity); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the filtered of this {@link AzureContentFilterSeverityResult} instance. - * - * @param filtered Whether the content severity resulted in a content filtering action. - * @return The AzureContentFilterSeverityResult builder. - */ - Builder1 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the severity of this {@link AzureContentFilterSeverityResult} instance. - * - * @param severity The labeled severity of the content. - * @return The AzureContentFilterSeverityResult instance. - */ - AzureContentFilterSeverityResult severity(@Nonnull final SeverityEnum severity); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java deleted file mode 100644 index 4446c0365..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/AzurePiiSubCategoryResult.java +++ /dev/null @@ -1,344 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Result details for individual PIIHarmSubCategory(s). */ -// CHECKSTYLE:OFF -public class AzurePiiSubCategoryResult -// CHECKSTYLE:ON -{ - @JsonProperty("sub_category") - private String subCategory; - - @JsonProperty("filtered") - private Boolean filtered; - - @JsonProperty("detected") - private Boolean detected; - - @JsonProperty("redacted") - private Boolean redacted; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for AzurePiiSubCategoryResult. */ - protected AzurePiiSubCategoryResult() {} - - /** - * Set the subCategory of this {@link AzurePiiSubCategoryResult} instance and return the same - * instance. - * - * @param subCategory The PIIHarmSubCategory that was evaluated. - * @return The same instance of this {@link AzurePiiSubCategoryResult} class - */ - @Nonnull - public AzurePiiSubCategoryResult subCategory(@Nonnull final String subCategory) { - this.subCategory = subCategory; - return this; - } - - /** - * The PIIHarmSubCategory that was evaluated. - * - * @return subCategory The subCategory of this {@link AzurePiiSubCategoryResult} instance. - */ - @Nonnull - public String getSubCategory() { - return subCategory; - } - - /** - * Set the subCategory of this {@link AzurePiiSubCategoryResult} instance. - * - * @param subCategory The PIIHarmSubCategory that was evaluated. - */ - public void setSubCategory(@Nonnull final String subCategory) { - this.subCategory = subCategory; - } - - /** - * Set the filtered of this {@link AzurePiiSubCategoryResult} instance and return the same - * instance. - * - * @param filtered Whether the content detection resulted in a content filtering action for this - * subcategory. - * @return The same instance of this {@link AzurePiiSubCategoryResult} class - */ - @Nonnull - public AzurePiiSubCategoryResult filtered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - return this; - } - - /** - * Whether the content detection resulted in a content filtering action for this subcategory. - * - * @return filtered The filtered of this {@link AzurePiiSubCategoryResult} instance. - */ - @Nonnull - public Boolean isFiltered() { - return filtered; - } - - /** - * Set the filtered of this {@link AzurePiiSubCategoryResult} instance. - * - * @param filtered Whether the content detection resulted in a content filtering action for this - * subcategory. - */ - public void setFiltered(@Nonnull final Boolean filtered) { - this.filtered = filtered; - } - - /** - * Set the detected of this {@link AzurePiiSubCategoryResult} instance and return the same - * instance. - * - * @param detected Whether the labeled content subcategory was detected in the content. - * @return The same instance of this {@link AzurePiiSubCategoryResult} class - */ - @Nonnull - public AzurePiiSubCategoryResult detected(@Nonnull final Boolean detected) { - this.detected = detected; - return this; - } - - /** - * Whether the labeled content subcategory was detected in the content. - * - * @return detected The detected of this {@link AzurePiiSubCategoryResult} instance. - */ - @Nonnull - public Boolean isDetected() { - return detected; - } - - /** - * Set the detected of this {@link AzurePiiSubCategoryResult} instance. - * - * @param detected Whether the labeled content subcategory was detected in the content. - */ - public void setDetected(@Nonnull final Boolean detected) { - this.detected = detected; - } - - /** - * Set the redacted of this {@link AzurePiiSubCategoryResult} instance and return the same - * instance. - * - * @param redacted Whether the content was redacted for this subcategory. - * @return The same instance of this {@link AzurePiiSubCategoryResult} class - */ - @Nonnull - public AzurePiiSubCategoryResult redacted(@Nonnull final Boolean redacted) { - this.redacted = redacted; - return this; - } - - /** - * Whether the content was redacted for this subcategory. - * - * @return redacted The redacted of this {@link AzurePiiSubCategoryResult} instance. - */ - @Nonnull - public Boolean isRedacted() { - return redacted; - } - - /** - * Set the redacted of this {@link AzurePiiSubCategoryResult} instance. - * - * @param redacted Whether the content was redacted for this subcategory. - */ - public void setRedacted(@Nonnull final Boolean redacted) { - this.redacted = redacted; - } - - /** - * Get the names of the unrecognizable properties of the {@link AzurePiiSubCategoryResult}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link AzurePiiSubCategoryResult} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "AzurePiiSubCategoryResult has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link AzurePiiSubCategoryResult} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (subCategory != null) declaredFields.put("subCategory", subCategory); - if (filtered != null) declaredFields.put("filtered", filtered); - if (detected != null) declaredFields.put("detected", detected); - if (redacted != null) declaredFields.put("redacted", redacted); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link AzurePiiSubCategoryResult} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final AzurePiiSubCategoryResult azurePiiSubCategoryResult = (AzurePiiSubCategoryResult) o; - return Objects.equals(this.cloudSdkCustomFields, azurePiiSubCategoryResult.cloudSdkCustomFields) - && Objects.equals(this.subCategory, azurePiiSubCategoryResult.subCategory) - && Objects.equals(this.filtered, azurePiiSubCategoryResult.filtered) - && Objects.equals(this.detected, azurePiiSubCategoryResult.detected) - && Objects.equals(this.redacted, azurePiiSubCategoryResult.redacted); - } - - @Override - public int hashCode() { - return Objects.hash(subCategory, filtered, detected, redacted, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class AzurePiiSubCategoryResult {\n"); - sb.append(" subCategory: ").append(toIndentedString(subCategory)).append("\n"); - sb.append(" filtered: ").append(toIndentedString(filtered)).append("\n"); - sb.append(" detected: ").append(toIndentedString(detected)).append("\n"); - sb.append(" redacted: ").append(toIndentedString(redacted)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * AzurePiiSubCategoryResult} instance with all required arguments. - */ - public static Builder create() { - return (subCategory) -> - (filtered) -> - (detected) -> - (redacted) -> - new AzurePiiSubCategoryResult() - .subCategory(subCategory) - .filtered(filtered) - .detected(detected) - .redacted(redacted); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the subCategory of this {@link AzurePiiSubCategoryResult} instance. - * - * @param subCategory The PIIHarmSubCategory that was evaluated. - * @return The AzurePiiSubCategoryResult builder. - */ - Builder1 subCategory(@Nonnull final String subCategory); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the filtered of this {@link AzurePiiSubCategoryResult} instance. - * - * @param filtered Whether the content detection resulted in a content filtering action for this - * subcategory. - * @return The AzurePiiSubCategoryResult builder. - */ - Builder2 filtered(@Nonnull final Boolean filtered); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the detected of this {@link AzurePiiSubCategoryResult} instance. - * - * @param detected Whether the labeled content subcategory was detected in the content. - * @return The AzurePiiSubCategoryResult builder. - */ - Builder3 detected(@Nonnull final Boolean detected); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the redacted of this {@link AzurePiiSubCategoryResult} instance. - * - * @param redacted Whether the content was redacted for this subcategory. - * @return The AzurePiiSubCategoryResult instance. - */ - AzurePiiSubCategoryResult redacted(@Nonnull final Boolean redacted); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java deleted file mode 100644 index f309ccd2e..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200Response.java +++ /dev/null @@ -1,1975 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** CreateResponse200Response */ -// CHECKSTYLE:OFF -public class CreateResponse200Response -// CHECKSTYLE:ON -{ - @JsonProperty("metadata") - private Object metadata; - - @JsonProperty("top_logprobs") - private Integer topLogprobs; - - @JsonProperty("temperature") - private BigDecimal temperature; - - @JsonProperty("top_p") - private BigDecimal topP; - - @JsonProperty("user") - private String user; - - @JsonProperty("safety_identifier") - private String safetyIdentifier; - - @JsonProperty("prompt_cache_key") - private String promptCacheKey; - - /** Gets or Sets promptCacheRetention */ - public enum PromptCacheRetentionEnum { - /** The IN_MEMORY option of this CreateResponse200Response */ - IN_MEMORY("in-memory"), - - /** The _24H option of this CreateResponse200Response */ - _24H("24h"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PromptCacheRetentionEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type CreateResponse200Response - */ - @JsonCreator - @Nullable - public static PromptCacheRetentionEnum fromValue(@Nonnull final String value) { - for (PromptCacheRetentionEnum b : PromptCacheRetentionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("prompt_cache_retention") - private PromptCacheRetentionEnum promptCacheRetention; - - @JsonProperty("previous_response_id") - private String previousResponseId; - - @JsonProperty("model") - private String model; - - @JsonProperty("reasoning") - private OpenAIReasoning reasoning; - - @JsonProperty("background") - private Boolean background; - - @JsonProperty("max_output_tokens") - private Integer maxOutputTokens; - - @JsonProperty("max_tool_calls") - private Integer maxToolCalls; - - @JsonProperty("text") - private OpenAIResponseTextParam text; - - @JsonProperty("tools") - private List tools = new ArrayList<>(); - - @JsonProperty("tool_choice") - private OpenAIToolChoiceParam toolChoice; - - @JsonProperty("prompt") - private OpenAIPrompt prompt; - - /** Gets or Sets truncation */ - public enum TruncationEnum { - /** The AUTO option of this CreateResponse200Response */ - AUTO("auto"), - - /** The DISABLED option of this CreateResponse200Response */ - DISABLED("disabled"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TruncationEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type CreateResponse200Response - */ - @JsonCreator - @Nullable - public static TruncationEnum fromValue(@Nonnull final String value) { - for (TruncationEnum b : TruncationEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("truncation") - private TruncationEnum truncation; - - @JsonProperty("id") - private String id; - - /** The object type of this resource - always set to `response`. */ - public enum ObjectEnum { - /** The RESPONSE option of this CreateResponse200Response */ - RESPONSE("response"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ObjectEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type CreateResponse200Response - */ - @JsonCreator - @Nonnull - public static ObjectEnum fromValue(@Nonnull final String value) { - for (ObjectEnum b : ObjectEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("object") - private ObjectEnum _object; - - /** - * The status of the response generation. One of `completed`, `failed`, - * `in_progress`, `cancelled`, `queued`, or `incomplete`. - */ - public enum StatusEnum { - /** The COMPLETED option of this CreateResponse200Response */ - COMPLETED("completed"), - - /** The FAILED option of this CreateResponse200Response */ - FAILED("failed"), - - /** The IN_PROGRESS option of this CreateResponse200Response */ - IN_PROGRESS("in_progress"), - - /** The CANCELLED option of this CreateResponse200Response */ - CANCELLED("cancelled"), - - /** The QUEUED option of this CreateResponse200Response */ - QUEUED("queued"), - - /** The INCOMPLETE option of this CreateResponse200Response */ - INCOMPLETE("incomplete"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this CreateResponse200Response */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type CreateResponse200Response - */ - @JsonCreator - @Nonnull - public static StatusEnum fromValue(@Nonnull final String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("created_at") - private Integer createdAt; - - @JsonProperty("completed_at") - private OffsetDateTime completedAt; - - @JsonProperty("error") - private OpenAIResponseError error; - - @JsonProperty("incomplete_details") - private OpenAIResponseIncompleteDetails incompleteDetails; - - @JsonProperty("output") - private List output = new ArrayList<>(); - - @JsonProperty("instructions") - private CreateResponse200ResponseInstructions instructions; - - @JsonProperty("output_text") - private String outputText; - - @JsonProperty("usage") - private OpenAIResponseUsage usage; - - @JsonProperty("parallel_tool_calls") - private Boolean parallelToolCalls = true; - - @JsonProperty("conversation") - private OpenAIConversationReference conversation; - - @JsonProperty("content_filters") - private List contentFilters = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CreateResponse200Response. */ - protected CreateResponse200Response() {} - - /** - * Set the metadata of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful - * for storing additional information about the object in a structured format, and querying - * for objects via API or the dashboard. Keys are strings with a maximum length of 64 - * characters. Values are strings with a maximum length of 512 characters. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response metadata(@Nullable final Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing - * additional information about the object in a structured format, and querying for objects via - * API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are - * strings with a maximum length of 512 characters. - * - * @return metadata The metadata of this {@link CreateResponse200Response} instance. - */ - @Nullable - public Object getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link CreateResponse200Response} instance. - * - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful - * for storing additional information about the object in a structured format, and querying - * for objects via API or the dashboard. Keys are strings with a maximum length of 64 - * characters. Values are strings with a maximum length of 512 characters. - */ - public void setMetadata(@Nullable final Object metadata) { - this.metadata = metadata; - } - - /** - * Set the topLogprobs of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param topLogprobs The topLogprobs of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response topLogprobs(@Nullable final Integer topLogprobs) { - this.topLogprobs = topLogprobs; - return this; - } - - /** - * Get topLogprobs - * - * @return topLogprobs The topLogprobs of this {@link CreateResponse200Response} instance. - */ - @Nullable - public Integer getTopLogprobs() { - return topLogprobs; - } - - /** - * Set the topLogprobs of this {@link CreateResponse200Response} instance. - * - * @param topLogprobs The topLogprobs of this {@link CreateResponse200Response} - */ - public void setTopLogprobs(@Nullable final Integer topLogprobs) { - this.topLogprobs = topLogprobs; - } - - /** - * Set the temperature of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param temperature The temperature of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response temperature(@Nullable final BigDecimal temperature) { - this.temperature = temperature; - return this; - } - - /** - * Get temperature - * - * @return temperature The temperature of this {@link CreateResponse200Response} instance. - */ - @Nullable - public BigDecimal getTemperature() { - return temperature; - } - - /** - * Set the temperature of this {@link CreateResponse200Response} instance. - * - * @param temperature The temperature of this {@link CreateResponse200Response} - */ - public void setTemperature(@Nullable final BigDecimal temperature) { - this.temperature = temperature; - } - - /** - * Set the topP of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param topP The topP of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response topP(@Nullable final BigDecimal topP) { - this.topP = topP; - return this; - } - - /** - * Get topP - * - * @return topP The topP of this {@link CreateResponse200Response} instance. - */ - @Nullable - public BigDecimal getTopP() { - return topP; - } - - /** - * Set the topP of this {@link CreateResponse200Response} instance. - * - * @param topP The topP of this {@link CreateResponse200Response} - */ - public void setTopP(@Nullable final BigDecimal topP) { - this.topP = topP; - } - - /** - * Set the user of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param user This field is being replaced by `safety_identifier` and - * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching - * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by - * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response user(@Nullable final String user) { - this.user = user; - return this; - } - - /** - * This field is being replaced by `safety_identifier` and `prompt_cache_key`. - * Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier - * for your end-users. Used to boost cache hit rates by better bucketing similar requests and to - * help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * @return user The user of this {@link CreateResponse200Response} instance. - * @deprecated - */ - @Deprecated - @Nonnull - public String getUser() { - return user; - } - - /** - * Set the user of this {@link CreateResponse200Response} instance. - * - * @param user This field is being replaced by `safety_identifier` and - * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching - * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by - * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - */ - public void setUser(@Nullable final String user) { - this.user = user; - } - - /** - * Set the safetyIdentifier of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param safetyIdentifier A stable identifier used to help detect users of your application that - * may be violating OpenAI's usage policies. The IDs should be a string that uniquely - * identifies each user. We recommend hashing their username or email address, in order to - * avoid sending us any identifying information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response safetyIdentifier(@Nullable final String safetyIdentifier) { - this.safetyIdentifier = safetyIdentifier; - return this; - } - - /** - * A stable identifier used to help detect users of your application that may be violating - * OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We - * recommend hashing their username or email address, in order to avoid sending us any identifying - * information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * @return safetyIdentifier The safetyIdentifier of this {@link CreateResponse200Response} - * instance. - */ - @Nonnull - public String getSafetyIdentifier() { - return safetyIdentifier; - } - - /** - * Set the safetyIdentifier of this {@link CreateResponse200Response} instance. - * - * @param safetyIdentifier A stable identifier used to help detect users of your application that - * may be violating OpenAI's usage policies. The IDs should be a string that uniquely - * identifies each user. We recommend hashing their username or email address, in order to - * avoid sending us any identifying information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - */ - public void setSafetyIdentifier(@Nullable final String safetyIdentifier) { - this.safetyIdentifier = safetyIdentifier; - } - - /** - * Set the promptCacheKey of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your - * cache hit rates. Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response promptCacheKey(@Nullable final String promptCacheKey) { - this.promptCacheKey = promptCacheKey; - return this; - } - - /** - * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. - * Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - * - * @return promptCacheKey The promptCacheKey of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public String getPromptCacheKey() { - return promptCacheKey; - } - - /** - * Set the promptCacheKey of this {@link CreateResponse200Response} instance. - * - * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your - * cache hit rates. Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - */ - public void setPromptCacheKey(@Nullable final String promptCacheKey) { - this.promptCacheKey = promptCacheKey; - } - - /** - * Set the promptCacheRetention of this {@link CreateResponse200Response} instance and return the - * same instance. - * - * @param promptCacheRetention The promptCacheRetention of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response promptCacheRetention( - @Nullable final PromptCacheRetentionEnum promptCacheRetention) { - this.promptCacheRetention = promptCacheRetention; - return this; - } - - /** - * Get promptCacheRetention - * - * @return promptCacheRetention The promptCacheRetention of this {@link CreateResponse200Response} - * instance. - */ - @Nullable - public PromptCacheRetentionEnum getPromptCacheRetention() { - return promptCacheRetention; - } - - /** - * Set the promptCacheRetention of this {@link CreateResponse200Response} instance. - * - * @param promptCacheRetention The promptCacheRetention of this {@link CreateResponse200Response} - */ - public void setPromptCacheRetention( - @Nullable final PromptCacheRetentionEnum promptCacheRetention) { - this.promptCacheRetention = promptCacheRetention; - } - - /** - * Set the previousResponseId of this {@link CreateResponse200Response} instance and return the - * same instance. - * - * @param previousResponseId The previousResponseId of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response previousResponseId(@Nullable final String previousResponseId) { - this.previousResponseId = previousResponseId; - return this; - } - - /** - * Get previousResponseId - * - * @return previousResponseId The previousResponseId of this {@link CreateResponse200Response} - * instance. - */ - @Nullable - public String getPreviousResponseId() { - return previousResponseId; - } - - /** - * Set the previousResponseId of this {@link CreateResponse200Response} instance. - * - * @param previousResponseId The previousResponseId of this {@link CreateResponse200Response} - */ - public void setPreviousResponseId(@Nullable final String previousResponseId) { - this.previousResponseId = previousResponseId; - } - - /** - * Set the model of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. - * OpenAI offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model - * guide](https://platform.openai.com/docs/models) to browse and compare available models. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response model(@Nullable final String model) { - this.model = model; - return this; - } - - /** - * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - * offers a wide range of models with different capabilities, performance characteristics, and - * price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and - * compare available models. - * - * @return model The model of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public String getModel() { - return model; - } - - /** - * Set the model of this {@link CreateResponse200Response} instance. - * - * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. - * OpenAI offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model - * guide](https://platform.openai.com/docs/models) to browse and compare available models. - */ - public void setModel(@Nullable final String model) { - this.model = model; - } - - /** - * Set the reasoning of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param reasoning The reasoning of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response reasoning(@Nullable final OpenAIReasoning reasoning) { - this.reasoning = reasoning; - return this; - } - - /** - * Get reasoning - * - * @return reasoning The reasoning of this {@link CreateResponse200Response} instance. - */ - @Nullable - public OpenAIReasoning getReasoning() { - return reasoning; - } - - /** - * Set the reasoning of this {@link CreateResponse200Response} instance. - * - * @param reasoning The reasoning of this {@link CreateResponse200Response} - */ - public void setReasoning(@Nullable final OpenAIReasoning reasoning) { - this.reasoning = reasoning; - } - - /** - * Set the background of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param background The background of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response background(@Nullable final Boolean background) { - this.background = background; - return this; - } - - /** - * Get background - * - * @return background The background of this {@link CreateResponse200Response} instance. - */ - @Nullable - public Boolean isBackground() { - return background; - } - - /** - * Set the background of this {@link CreateResponse200Response} instance. - * - * @param background The background of this {@link CreateResponse200Response} - */ - public void setBackground(@Nullable final Boolean background) { - this.background = background; - } - - /** - * Set the maxOutputTokens of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param maxOutputTokens The maxOutputTokens of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response maxOutputTokens(@Nullable final Integer maxOutputTokens) { - this.maxOutputTokens = maxOutputTokens; - return this; - } - - /** - * Get maxOutputTokens - * - * @return maxOutputTokens The maxOutputTokens of this {@link CreateResponse200Response} instance. - */ - @Nullable - public Integer getMaxOutputTokens() { - return maxOutputTokens; - } - - /** - * Set the maxOutputTokens of this {@link CreateResponse200Response} instance. - * - * @param maxOutputTokens The maxOutputTokens of this {@link CreateResponse200Response} - */ - public void setMaxOutputTokens(@Nullable final Integer maxOutputTokens) { - this.maxOutputTokens = maxOutputTokens; - } - - /** - * Set the maxToolCalls of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param maxToolCalls The maxToolCalls of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response maxToolCalls(@Nullable final Integer maxToolCalls) { - this.maxToolCalls = maxToolCalls; - return this; - } - - /** - * Get maxToolCalls - * - * @return maxToolCalls The maxToolCalls of this {@link CreateResponse200Response} instance. - */ - @Nullable - public Integer getMaxToolCalls() { - return maxToolCalls; - } - - /** - * Set the maxToolCalls of this {@link CreateResponse200Response} instance. - * - * @param maxToolCalls The maxToolCalls of this {@link CreateResponse200Response} - */ - public void setMaxToolCalls(@Nullable final Integer maxToolCalls) { - this.maxToolCalls = maxToolCalls; - } - - /** - * Set the text of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param text The text of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response text(@Nullable final OpenAIResponseTextParam text) { - this.text = text; - return this; - } - - /** - * Get text - * - * @return text The text of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public OpenAIResponseTextParam getText() { - return text; - } - - /** - * Set the text of this {@link CreateResponse200Response} instance. - * - * @param text The text of this {@link CreateResponse200Response} - */ - public void setText(@Nullable final OpenAIResponseTextParam text) { - this.text = text; - } - - /** - * Set the tools of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param tools An array of tools the model may call while generating a response. You can specify - * which tool to use by setting the `tool_choice` parameter. We support the - * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that - * extend the model's capabilities, like [web - * search](https://platform.openai.com/docs/guides/tools-web-search) or [file - * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: - * Integrations with third-party systems via custom MCP servers or predefined connectors such - * as Google Drive and SharePoint. Learn more about [MCP - * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own - * code with strongly typed arguments and outputs. Learn more about [function - * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom - * tools to call your own code. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response tools(@Nullable final List tools) { - this.tools = tools; - return this; - } - - /** - * Add one tools instance to this {@link CreateResponse200Response}. - * - * @param toolsItem The tools that should be added - * @return The same instance of type {@link CreateResponse200Response} - */ - @Nonnull - public CreateResponse200Response addToolsItem(@Nonnull final OpenAITool toolsItem) { - if (this.tools == null) { - this.tools = new ArrayList<>(); - } - this.tools.add(toolsItem); - return this; - } - - /** - * An array of tools the model may call while generating a response. You can specify which tool to - * use by setting the `tool_choice` parameter. We support the following categories of - * tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's - * capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) or - * [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: Integrations - * with third-party systems via custom MCP servers or predefined connectors such as Google Drive - * and SharePoint. Learn more about [MCP - * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own code - * with strongly typed arguments and outputs. Learn more about [function - * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom - * tools to call your own code. - * - * @return tools The tools of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public List getTools() { - return tools; - } - - /** - * Set the tools of this {@link CreateResponse200Response} instance. - * - * @param tools An array of tools the model may call while generating a response. You can specify - * which tool to use by setting the `tool_choice` parameter. We support the - * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that - * extend the model's capabilities, like [web - * search](https://platform.openai.com/docs/guides/tools-web-search) or [file - * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: - * Integrations with third-party systems via custom MCP servers or predefined connectors such - * as Google Drive and SharePoint. Learn more about [MCP - * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own - * code with strongly typed arguments and outputs. Learn more about [function - * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom - * tools to call your own code. - */ - public void setTools(@Nullable final List tools) { - this.tools = tools; - } - - /** - * Set the toolChoice of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param toolChoice The toolChoice of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response toolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { - this.toolChoice = toolChoice; - return this; - } - - /** - * Get toolChoice - * - * @return toolChoice The toolChoice of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public OpenAIToolChoiceParam getToolChoice() { - return toolChoice; - } - - /** - * Set the toolChoice of this {@link CreateResponse200Response} instance. - * - * @param toolChoice The toolChoice of this {@link CreateResponse200Response} - */ - public void setToolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { - this.toolChoice = toolChoice; - } - - /** - * Set the prompt of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param prompt The prompt of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response prompt(@Nullable final OpenAIPrompt prompt) { - this.prompt = prompt; - return this; - } - - /** - * Get prompt - * - * @return prompt The prompt of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public OpenAIPrompt getPrompt() { - return prompt; - } - - /** - * Set the prompt of this {@link CreateResponse200Response} instance. - * - * @param prompt The prompt of this {@link CreateResponse200Response} - */ - public void setPrompt(@Nullable final OpenAIPrompt prompt) { - this.prompt = prompt; - } - - /** - * Set the truncation of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param truncation The truncation of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response truncation(@Nullable final TruncationEnum truncation) { - this.truncation = truncation; - return this; - } - - /** - * Get truncation - * - * @return truncation The truncation of this {@link CreateResponse200Response} instance. - */ - @Nullable - public TruncationEnum getTruncation() { - return truncation; - } - - /** - * Set the truncation of this {@link CreateResponse200Response} instance. - * - * @param truncation The truncation of this {@link CreateResponse200Response} - */ - public void setTruncation(@Nullable final TruncationEnum truncation) { - this.truncation = truncation; - } - - /** - * Set the id of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param id Unique identifier for this Response. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * Unique identifier for this Response. - * - * @return id The id of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link CreateResponse200Response} instance. - * - * @param id Unique identifier for this Response. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the _object of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param _object The object type of this resource - always set to `response`. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response _object(@Nonnull final ObjectEnum _object) { - this._object = _object; - return this; - } - - /** - * The object type of this resource - always set to `response`. - * - * @return _object The _object of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public ObjectEnum getObject() { - return _object; - } - - /** - * Set the _object of this {@link CreateResponse200Response} instance. - * - * @param _object The object type of this resource - always set to `response`. - */ - public void setObject(@Nonnull final ObjectEnum _object) { - this._object = _object; - } - - /** - * Set the status of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param status The status of the response generation. One of `completed`, - * `failed`, `in_progress`, `cancelled`, `queued`, or - * `incomplete`. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response status(@Nullable final StatusEnum status) { - this.status = status; - return this; - } - - /** - * The status of the response generation. One of `completed`, `failed`, - * `in_progress`, `cancelled`, `queued`, or `incomplete`. - * - * @return status The status of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public StatusEnum getStatus() { - return status; - } - - /** - * Set the status of this {@link CreateResponse200Response} instance. - * - * @param status The status of the response generation. One of `completed`, - * `failed`, `in_progress`, `cancelled`, `queued`, or - * `incomplete`. - */ - public void setStatus(@Nullable final StatusEnum status) { - this.status = status; - } - - /** - * Set the createdAt of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param createdAt Unix timestamp (in seconds) of when this Response was created. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response createdAt(@Nonnull final Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Unix timestamp (in seconds) of when this Response was created. - * - * @return createdAt The createdAt of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public Integer getCreatedAt() { - return createdAt; - } - - /** - * Set the createdAt of this {@link CreateResponse200Response} instance. - * - * @param createdAt Unix timestamp (in seconds) of when this Response was created. - */ - public void setCreatedAt(@Nonnull final Integer createdAt) { - this.createdAt = createdAt; - } - - /** - * Set the completedAt of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param completedAt The completedAt of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response completedAt(@Nullable final OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - /** - * Get completedAt - * - * @return completedAt The completedAt of this {@link CreateResponse200Response} instance. - */ - @Nullable - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - /** - * Set the completedAt of this {@link CreateResponse200Response} instance. - * - * @param completedAt The completedAt of this {@link CreateResponse200Response} - */ - public void setCompletedAt(@Nullable final OffsetDateTime completedAt) { - this.completedAt = completedAt; - } - - /** - * Set the error of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param error The error of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response error(@Nullable final OpenAIResponseError error) { - this.error = error; - return this; - } - - /** - * Get error - * - * @return error The error of this {@link CreateResponse200Response} instance. - */ - @Nullable - public OpenAIResponseError getError() { - return error; - } - - /** - * Set the error of this {@link CreateResponse200Response} instance. - * - * @param error The error of this {@link CreateResponse200Response} - */ - public void setError(@Nullable final OpenAIResponseError error) { - this.error = error; - } - - /** - * Set the incompleteDetails of this {@link CreateResponse200Response} instance and return the - * same instance. - * - * @param incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response incompleteDetails( - @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { - this.incompleteDetails = incompleteDetails; - return this; - } - - /** - * Get incompleteDetails - * - * @return incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} - * instance. - */ - @Nullable - public OpenAIResponseIncompleteDetails getIncompleteDetails() { - return incompleteDetails; - } - - /** - * Set the incompleteDetails of this {@link CreateResponse200Response} instance. - * - * @param incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} - */ - public void setIncompleteDetails( - @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { - this.incompleteDetails = incompleteDetails; - } - - /** - * Set the output of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param output An array of content items generated by the model. - The length and order of items - * in the `output` array is dependent on the model's response. - Rather than - * accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response output(@Nonnull final List output) { - this.output = output; - return this; - } - - /** - * Add one output instance to this {@link CreateResponse200Response}. - * - * @param outputItem The output that should be added - * @return The same instance of type {@link CreateResponse200Response} - */ - @Nonnull - public CreateResponse200Response addOutputItem(@Nonnull final OpenAIOutputItem outputItem) { - if (this.output == null) { - this.output = new ArrayList<>(); - } - this.output.add(outputItem); - return this; - } - - /** - * An array of content items generated by the model. - The length and order of items in the - * `output` array is dependent on the model's response. - Rather than accessing the - * first item in the `output` array and assuming it's an `assistant` - * message with the content generated by the model, you might consider using the - * `output_text` property where supported in SDKs. - * - * @return output The output of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public List getOutput() { - return output; - } - - /** - * Set the output of this {@link CreateResponse200Response} instance. - * - * @param output An array of content items generated by the model. - The length and order of items - * in the `output` array is dependent on the model's response. - Rather than - * accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - */ - public void setOutput(@Nonnull final List output) { - this.output = output; - } - - /** - * Set the instructions of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param instructions The instructions of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response instructions( - @Nullable final CreateResponse200ResponseInstructions instructions) { - this.instructions = instructions; - return this; - } - - /** - * Get instructions - * - * @return instructions The instructions of this {@link CreateResponse200Response} instance. - */ - @Nullable - public CreateResponse200ResponseInstructions getInstructions() { - return instructions; - } - - /** - * Set the instructions of this {@link CreateResponse200Response} instance. - * - * @param instructions The instructions of this {@link CreateResponse200Response} - */ - public void setInstructions(@Nullable final CreateResponse200ResponseInstructions instructions) { - this.instructions = instructions; - } - - /** - * Set the outputText of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param outputText The outputText of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response outputText(@Nullable final String outputText) { - this.outputText = outputText; - return this; - } - - /** - * Get outputText - * - * @return outputText The outputText of this {@link CreateResponse200Response} instance. - */ - @Nullable - public String getOutputText() { - return outputText; - } - - /** - * Set the outputText of this {@link CreateResponse200Response} instance. - * - * @param outputText The outputText of this {@link CreateResponse200Response} - */ - public void setOutputText(@Nullable final String outputText) { - this.outputText = outputText; - } - - /** - * Set the usage of this {@link CreateResponse200Response} instance and return the same instance. - * - * @param usage The usage of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response usage(@Nullable final OpenAIResponseUsage usage) { - this.usage = usage; - return this; - } - - /** - * Get usage - * - * @return usage The usage of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public OpenAIResponseUsage getUsage() { - return usage; - } - - /** - * Set the usage of this {@link CreateResponse200Response} instance. - * - * @param usage The usage of this {@link CreateResponse200Response} - */ - public void setUsage(@Nullable final OpenAIResponseUsage usage) { - this.usage = usage; - } - - /** - * Set the parallelToolCalls of this {@link CreateResponse200Response} instance and return the - * same instance. - * - * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response parallelToolCalls(@Nonnull final Boolean parallelToolCalls) { - this.parallelToolCalls = parallelToolCalls; - return this; - } - - /** - * Whether to allow the model to run tool calls in parallel. - * - * @return parallelToolCalls The parallelToolCalls of this {@link CreateResponse200Response} - * instance. - */ - @Nonnull - public Boolean isParallelToolCalls() { - return parallelToolCalls; - } - - /** - * Set the parallelToolCalls of this {@link CreateResponse200Response} instance. - * - * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. - */ - public void setParallelToolCalls(@Nonnull final Boolean parallelToolCalls) { - this.parallelToolCalls = parallelToolCalls; - } - - /** - * Set the conversation of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param conversation The conversation of this {@link CreateResponse200Response} - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response conversation( - @Nullable final OpenAIConversationReference conversation) { - this.conversation = conversation; - return this; - } - - /** - * Get conversation - * - * @return conversation The conversation of this {@link CreateResponse200Response} instance. - */ - @Nullable - public OpenAIConversationReference getConversation() { - return conversation; - } - - /** - * Set the conversation of this {@link CreateResponse200Response} instance. - * - * @param conversation The conversation of this {@link CreateResponse200Response} - */ - public void setConversation(@Nullable final OpenAIConversationReference conversation) { - this.conversation = conversation; - } - - /** - * Set the contentFilters of this {@link CreateResponse200Response} instance and return the same - * instance. - * - * @param contentFilters The content filter results from RAI. - * @return The same instance of this {@link CreateResponse200Response} class - */ - @Nonnull - public CreateResponse200Response contentFilters( - @Nonnull final List contentFilters) { - this.contentFilters = contentFilters; - return this; - } - - /** - * Add one contentFilters instance to this {@link CreateResponse200Response}. - * - * @param contentFiltersItem The contentFilters that should be added - * @return The same instance of type {@link CreateResponse200Response} - */ - @Nonnull - public CreateResponse200Response addContentFiltersItem( - @Nonnull final AzureContentFilterForResponsesAPI contentFiltersItem) { - if (this.contentFilters == null) { - this.contentFilters = new ArrayList<>(); - } - this.contentFilters.add(contentFiltersItem); - return this; - } - - /** - * The content filter results from RAI. - * - * @return contentFilters The contentFilters of this {@link CreateResponse200Response} instance. - */ - @Nonnull - public List getContentFilters() { - return contentFilters; - } - - /** - * Set the contentFilters of this {@link CreateResponse200Response} instance. - * - * @param contentFilters The content filter results from RAI. - */ - public void setContentFilters( - @Nonnull final List contentFilters) { - this.contentFilters = contentFilters; - } - - /** - * Get the names of the unrecognizable properties of the {@link CreateResponse200Response}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CreateResponse200Response} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CreateResponse200Response has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link CreateResponse200Response} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (metadata != null) declaredFields.put("metadata", metadata); - if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); - if (temperature != null) declaredFields.put("temperature", temperature); - if (topP != null) declaredFields.put("topP", topP); - if (user != null) declaredFields.put("user", user); - if (safetyIdentifier != null) declaredFields.put("safetyIdentifier", safetyIdentifier); - if (promptCacheKey != null) declaredFields.put("promptCacheKey", promptCacheKey); - if (promptCacheRetention != null) - declaredFields.put("promptCacheRetention", promptCacheRetention); - if (previousResponseId != null) declaredFields.put("previousResponseId", previousResponseId); - if (model != null) declaredFields.put("model", model); - if (reasoning != null) declaredFields.put("reasoning", reasoning); - if (background != null) declaredFields.put("background", background); - if (maxOutputTokens != null) declaredFields.put("maxOutputTokens", maxOutputTokens); - if (maxToolCalls != null) declaredFields.put("maxToolCalls", maxToolCalls); - if (text != null) declaredFields.put("text", text); - if (tools != null) declaredFields.put("tools", tools); - if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); - if (prompt != null) declaredFields.put("prompt", prompt); - if (truncation != null) declaredFields.put("truncation", truncation); - if (id != null) declaredFields.put("id", id); - if (_object != null) declaredFields.put("_object", _object); - if (status != null) declaredFields.put("status", status); - if (createdAt != null) declaredFields.put("createdAt", createdAt); - if (completedAt != null) declaredFields.put("completedAt", completedAt); - if (error != null) declaredFields.put("error", error); - if (incompleteDetails != null) declaredFields.put("incompleteDetails", incompleteDetails); - if (output != null) declaredFields.put("output", output); - if (instructions != null) declaredFields.put("instructions", instructions); - if (outputText != null) declaredFields.put("outputText", outputText); - if (usage != null) declaredFields.put("usage", usage); - if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); - if (conversation != null) declaredFields.put("conversation", conversation); - if (contentFilters != null) declaredFields.put("contentFilters", contentFilters); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link CreateResponse200Response} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CreateResponse200Response createResponse200Response = (CreateResponse200Response) o; - return Objects.equals(this.cloudSdkCustomFields, createResponse200Response.cloudSdkCustomFields) - && Objects.equals(this.metadata, createResponse200Response.metadata) - && Objects.equals(this.topLogprobs, createResponse200Response.topLogprobs) - && Objects.equals(this.temperature, createResponse200Response.temperature) - && Objects.equals(this.topP, createResponse200Response.topP) - && Objects.equals(this.user, createResponse200Response.user) - && Objects.equals(this.safetyIdentifier, createResponse200Response.safetyIdentifier) - && Objects.equals(this.promptCacheKey, createResponse200Response.promptCacheKey) - && Objects.equals(this.promptCacheRetention, createResponse200Response.promptCacheRetention) - && Objects.equals(this.previousResponseId, createResponse200Response.previousResponseId) - && Objects.equals(this.model, createResponse200Response.model) - && Objects.equals(this.reasoning, createResponse200Response.reasoning) - && Objects.equals(this.background, createResponse200Response.background) - && Objects.equals(this.maxOutputTokens, createResponse200Response.maxOutputTokens) - && Objects.equals(this.maxToolCalls, createResponse200Response.maxToolCalls) - && Objects.equals(this.text, createResponse200Response.text) - && Objects.equals(this.tools, createResponse200Response.tools) - && Objects.equals(this.toolChoice, createResponse200Response.toolChoice) - && Objects.equals(this.prompt, createResponse200Response.prompt) - && Objects.equals(this.truncation, createResponse200Response.truncation) - && Objects.equals(this.id, createResponse200Response.id) - && Objects.equals(this._object, createResponse200Response._object) - && Objects.equals(this.status, createResponse200Response.status) - && Objects.equals(this.createdAt, createResponse200Response.createdAt) - && Objects.equals(this.completedAt, createResponse200Response.completedAt) - && Objects.equals(this.error, createResponse200Response.error) - && Objects.equals(this.incompleteDetails, createResponse200Response.incompleteDetails) - && Objects.equals(this.output, createResponse200Response.output) - && Objects.equals(this.instructions, createResponse200Response.instructions) - && Objects.equals(this.outputText, createResponse200Response.outputText) - && Objects.equals(this.usage, createResponse200Response.usage) - && Objects.equals(this.parallelToolCalls, createResponse200Response.parallelToolCalls) - && Objects.equals(this.conversation, createResponse200Response.conversation) - && Objects.equals(this.contentFilters, createResponse200Response.contentFilters); - } - - @Override - public int hashCode() { - return Objects.hash( - metadata, - topLogprobs, - temperature, - topP, - user, - safetyIdentifier, - promptCacheKey, - promptCacheRetention, - previousResponseId, - model, - reasoning, - background, - maxOutputTokens, - maxToolCalls, - text, - tools, - toolChoice, - prompt, - truncation, - id, - _object, - status, - createdAt, - completedAt, - error, - incompleteDetails, - output, - instructions, - outputText, - usage, - parallelToolCalls, - conversation, - contentFilters, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CreateResponse200Response {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); - sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); - sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).append("\n"); - sb.append(" safetyIdentifier: ").append(toIndentedString(safetyIdentifier)).append("\n"); - sb.append(" promptCacheKey: ").append(toIndentedString(promptCacheKey)).append("\n"); - sb.append(" promptCacheRetention: ") - .append(toIndentedString(promptCacheRetention)) - .append("\n"); - sb.append(" previousResponseId: ").append(toIndentedString(previousResponseId)).append("\n"); - sb.append(" model: ").append(toIndentedString(model)).append("\n"); - sb.append(" reasoning: ").append(toIndentedString(reasoning)).append("\n"); - sb.append(" background: ").append(toIndentedString(background)).append("\n"); - sb.append(" maxOutputTokens: ").append(toIndentedString(maxOutputTokens)).append("\n"); - sb.append(" maxToolCalls: ").append(toIndentedString(maxToolCalls)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); - sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); - sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); - sb.append(" truncation: ").append(toIndentedString(truncation)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" incompleteDetails: ").append(toIndentedString(incompleteDetails)).append("\n"); - sb.append(" output: ").append(toIndentedString(output)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" outputText: ").append(toIndentedString(outputText)).append("\n"); - sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); - sb.append(" parallelToolCalls: ").append(toIndentedString(parallelToolCalls)).append("\n"); - sb.append(" conversation: ").append(toIndentedString(conversation)).append("\n"); - sb.append(" contentFilters: ").append(toIndentedString(contentFilters)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * CreateResponse200Response} instance with all required arguments. - */ - public static Builder create() { - return (id) -> - (_object) -> - (createdAt) -> - (error) -> - (incompleteDetails) -> - (output) -> - (instructions) -> - (parallelToolCalls) -> - (contentFilters) -> - new CreateResponse200Response() - .id(id) - ._object(_object) - .createdAt(createdAt) - .error(error) - .incompleteDetails(incompleteDetails) - .output(output) - .instructions(instructions) - .parallelToolCalls(parallelToolCalls) - .contentFilters(contentFilters); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link CreateResponse200Response} instance. - * - * @param id Unique identifier for this Response. - * @return The CreateResponse200Response builder. - */ - Builder1 id(@Nonnull final String id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the _object of this {@link CreateResponse200Response} instance. - * - * @param _object The object type of this resource - always set to `response`. - * @return The CreateResponse200Response builder. - */ - Builder2 _object(@Nonnull final ObjectEnum _object); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the createdAt of this {@link CreateResponse200Response} instance. - * - * @param createdAt Unix timestamp (in seconds) of when this Response was created. - * @return The CreateResponse200Response builder. - */ - Builder3 createdAt(@Nonnull final Integer createdAt); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the error of this {@link CreateResponse200Response} instance. - * - * @param error The error of this {@link CreateResponse200Response} - * @return The CreateResponse200Response builder. - */ - Builder4 error(@Nullable final OpenAIResponseError error); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the incompleteDetails of this {@link CreateResponse200Response} instance. - * - * @param incompleteDetails The incompleteDetails of this {@link CreateResponse200Response} - * @return The CreateResponse200Response builder. - */ - Builder5 incompleteDetails(@Nullable final OpenAIResponseIncompleteDetails incompleteDetails); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the output of this {@link CreateResponse200Response} instance. - * - * @param output An array of content items generated by the model. - The length and order of - * items in the `output` array is dependent on the model's response. - Rather - * than accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - * @return The CreateResponse200Response builder. - */ - Builder6 output(@Nonnull final List output); - - /** - * Set the output of this {@link CreateResponse200Response} instance. - * - * @param output An array of content items generated by the model. - The length and order of - * items in the `output` array is dependent on the model's response. - Rather - * than accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - * @return The CreateResponse200Response builder. - */ - default Builder6 output(@Nonnull final OpenAIOutputItem... output) { - return output(Arrays.asList(output)); - } - } - - /** Builder helper class. */ - public interface Builder6 { - /** - * Set the instructions of this {@link CreateResponse200Response} instance. - * - * @param instructions The instructions of this {@link CreateResponse200Response} - * @return The CreateResponse200Response builder. - */ - Builder7 instructions(@Nullable final CreateResponse200ResponseInstructions instructions); - } - - /** Builder helper class. */ - public interface Builder7 { - /** - * Set the parallelToolCalls of this {@link CreateResponse200Response} instance. - * - * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. - * @return The CreateResponse200Response builder. - */ - Builder8 parallelToolCalls(@Nonnull final Boolean parallelToolCalls); - } - - /** Builder helper class. */ - public interface Builder8 { - /** - * Set the contentFilters of this {@link CreateResponse200Response} instance. - * - * @param contentFilters The content filter results from RAI. - * @return The CreateResponse200Response instance. - */ - CreateResponse200Response contentFilters( - @Nonnull final List contentFilters); - - /** - * Set the contentFilters of this {@link CreateResponse200Response} instance. - * - * @param contentFilters The content filter results from RAI. - * @return The CreateResponse200Response instance. - */ - default CreateResponse200Response contentFilters( - @Nonnull final AzureContentFilterForResponsesAPI... contentFilters) { - return contentFilters(Arrays.asList(contentFilters)); - } - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java deleted file mode 100644 index bff51feb3..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponse200ResponseInstructions.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import java.util.List; -import javax.annotation.Nonnull; - -/** CreateResponse200ResponseInstructions */ -public interface CreateResponse200ResponseInstructions { - /** - * Helper class to create {@code List } that implements {@link - * CreateResponse200ResponseInstructions}. - */ - record ListOfOpenAIInputItems( - @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) - implements CreateResponse200ResponseInstructions {} - - /** - * Creator to enable deserialization of {@code List }. - * - * @param val the value to use - * @return a new instance of {@link ListOfOpenAIInputItems}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static ListOfOpenAIInputItems createListOfOpenAIInputItems( - @Nonnull final List val) { - return new ListOfOpenAIInputItems(val); - } - - /** - * Helper class to create {@code String } that implements {@link - * CreateResponse200ResponseInstructions}. - */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements CreateResponse200ResponseInstructions {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java deleted file mode 100644 index 44caf57af..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/CreateResponseDefaultResponse.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** CreateResponseDefaultResponse */ -// CHECKSTYLE:OFF -public class CreateResponseDefaultResponse -// CHECKSTYLE:ON -{ - @JsonProperty("code") - private String code; - - @JsonProperty("message") - private String message; - - @JsonProperty("param") - private String param; - - @JsonProperty("type") - private String type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for CreateResponseDefaultResponse. */ - protected CreateResponseDefaultResponse() {} - - /** - * Set the code of this {@link CreateResponseDefaultResponse} instance and return the same - * instance. - * - * @param code The code of this {@link CreateResponseDefaultResponse} - * @return The same instance of this {@link CreateResponseDefaultResponse} class - */ - @Nonnull - public CreateResponseDefaultResponse code(@Nullable final String code) { - this.code = code; - return this; - } - - /** - * Get code - * - * @return code The code of this {@link CreateResponseDefaultResponse} instance. - */ - @Nullable - public String getCode() { - return code; - } - - /** - * Set the code of this {@link CreateResponseDefaultResponse} instance. - * - * @param code The code of this {@link CreateResponseDefaultResponse} - */ - public void setCode(@Nullable final String code) { - this.code = code; - } - - /** - * Set the message of this {@link CreateResponseDefaultResponse} instance and return the same - * instance. - * - * @param message The message of this {@link CreateResponseDefaultResponse} - * @return The same instance of this {@link CreateResponseDefaultResponse} class - */ - @Nonnull - public CreateResponseDefaultResponse message(@Nullable final String message) { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link CreateResponseDefaultResponse} instance. - */ - @Nullable - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link CreateResponseDefaultResponse} instance. - * - * @param message The message of this {@link CreateResponseDefaultResponse} - */ - public void setMessage(@Nullable final String message) { - this.message = message; - } - - /** - * Set the param of this {@link CreateResponseDefaultResponse} instance and return the same - * instance. - * - * @param param The param of this {@link CreateResponseDefaultResponse} - * @return The same instance of this {@link CreateResponseDefaultResponse} class - */ - @Nonnull - public CreateResponseDefaultResponse param(@Nullable final String param) { - this.param = param; - return this; - } - - /** - * Get param - * - * @return param The param of this {@link CreateResponseDefaultResponse} instance. - */ - @Nullable - public String getParam() { - return param; - } - - /** - * Set the param of this {@link CreateResponseDefaultResponse} instance. - * - * @param param The param of this {@link CreateResponseDefaultResponse} - */ - public void setParam(@Nullable final String param) { - this.param = param; - } - - /** - * Set the type of this {@link CreateResponseDefaultResponse} instance and return the same - * instance. - * - * @param type The type of this {@link CreateResponseDefaultResponse} - * @return The same instance of this {@link CreateResponseDefaultResponse} class - */ - @Nonnull - public CreateResponseDefaultResponse type(@Nullable final String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link CreateResponseDefaultResponse} instance. - */ - @Nullable - public String getType() { - return type; - } - - /** - * Set the type of this {@link CreateResponseDefaultResponse} instance. - * - * @param type The type of this {@link CreateResponseDefaultResponse} - */ - public void setType(@Nullable final String type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link CreateResponseDefaultResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link CreateResponseDefaultResponse} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "CreateResponseDefaultResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link CreateResponseDefaultResponse} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (code != null) declaredFields.put("code", code); - if (message != null) declaredFields.put("message", message); - if (param != null) declaredFields.put("param", param); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link CreateResponseDefaultResponse} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final CreateResponseDefaultResponse createResponseDefaultResponse = - (CreateResponseDefaultResponse) o; - return Objects.equals( - this.cloudSdkCustomFields, createResponseDefaultResponse.cloudSdkCustomFields) - && Objects.equals(this.code, createResponseDefaultResponse.code) - && Objects.equals(this.message, createResponseDefaultResponse.message) - && Objects.equals(this.param, createResponseDefaultResponse.param) - && Objects.equals(this.type, createResponseDefaultResponse.type); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, param, type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class CreateResponseDefaultResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" param: ").append(toIndentedString(param)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * CreateResponseDefaultResponse} instance with all required arguments. - */ - public static Builder create() { - return (code) -> - (message) -> - (param) -> - (type) -> - new CreateResponseDefaultResponse() - .code(code) - .message(message) - .param(param) - .type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the code of this {@link CreateResponseDefaultResponse} instance. - * - * @param code The code of this {@link CreateResponseDefaultResponse} - * @return The CreateResponseDefaultResponse builder. - */ - Builder1 code(@Nullable final String code); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link CreateResponseDefaultResponse} instance. - * - * @param message The message of this {@link CreateResponseDefaultResponse} - * @return The CreateResponseDefaultResponse builder. - */ - Builder2 message(@Nullable final String message); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the param of this {@link CreateResponseDefaultResponse} instance. - * - * @param param The param of this {@link CreateResponseDefaultResponse} - * @return The CreateResponseDefaultResponse builder. - */ - Builder3 param(@Nullable final String param); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the type of this {@link CreateResponseDefaultResponse} instance. - * - * @param type The type of this {@link CreateResponseDefaultResponse} - * @return The CreateResponseDefaultResponse instance. - */ - CreateResponseDefaultResponse type(@Nullable final String type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java deleted file mode 100644 index 7998e4661..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/GetResponseDefaultResponse.java +++ /dev/null @@ -1,340 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** GetResponseDefaultResponse */ -// CHECKSTYLE:OFF -public class GetResponseDefaultResponse -// CHECKSTYLE:ON -{ - @JsonProperty("code") - private String code; - - @JsonProperty("message") - private String message; - - @JsonProperty("param") - private String param; - - @JsonProperty("type") - private String type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for GetResponseDefaultResponse. */ - protected GetResponseDefaultResponse() {} - - /** - * Set the code of this {@link GetResponseDefaultResponse} instance and return the same instance. - * - * @param code The code of this {@link GetResponseDefaultResponse} - * @return The same instance of this {@link GetResponseDefaultResponse} class - */ - @Nonnull - public GetResponseDefaultResponse code(@Nullable final String code) { - this.code = code; - return this; - } - - /** - * Get code - * - * @return code The code of this {@link GetResponseDefaultResponse} instance. - */ - @Nullable - public String getCode() { - return code; - } - - /** - * Set the code of this {@link GetResponseDefaultResponse} instance. - * - * @param code The code of this {@link GetResponseDefaultResponse} - */ - public void setCode(@Nullable final String code) { - this.code = code; - } - - /** - * Set the message of this {@link GetResponseDefaultResponse} instance and return the same - * instance. - * - * @param message The message of this {@link GetResponseDefaultResponse} - * @return The same instance of this {@link GetResponseDefaultResponse} class - */ - @Nonnull - public GetResponseDefaultResponse message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * Get message - * - * @return message The message of this {@link GetResponseDefaultResponse} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link GetResponseDefaultResponse} instance. - * - * @param message The message of this {@link GetResponseDefaultResponse} - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Set the param of this {@link GetResponseDefaultResponse} instance and return the same instance. - * - * @param param The param of this {@link GetResponseDefaultResponse} - * @return The same instance of this {@link GetResponseDefaultResponse} class - */ - @Nonnull - public GetResponseDefaultResponse param(@Nullable final String param) { - this.param = param; - return this; - } - - /** - * Get param - * - * @return param The param of this {@link GetResponseDefaultResponse} instance. - */ - @Nullable - public String getParam() { - return param; - } - - /** - * Set the param of this {@link GetResponseDefaultResponse} instance. - * - * @param param The param of this {@link GetResponseDefaultResponse} - */ - public void setParam(@Nullable final String param) { - this.param = param; - } - - /** - * Set the type of this {@link GetResponseDefaultResponse} instance and return the same instance. - * - * @param type The type of this {@link GetResponseDefaultResponse} - * @return The same instance of this {@link GetResponseDefaultResponse} class - */ - @Nonnull - public GetResponseDefaultResponse type(@Nonnull final String type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link GetResponseDefaultResponse} instance. - */ - @Nonnull - public String getType() { - return type; - } - - /** - * Set the type of this {@link GetResponseDefaultResponse} instance. - * - * @param type The type of this {@link GetResponseDefaultResponse} - */ - public void setType(@Nonnull final String type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link GetResponseDefaultResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link GetResponseDefaultResponse} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "GetResponseDefaultResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link GetResponseDefaultResponse} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (code != null) declaredFields.put("code", code); - if (message != null) declaredFields.put("message", message); - if (param != null) declaredFields.put("param", param); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link GetResponseDefaultResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final GetResponseDefaultResponse getResponseDefaultResponse = (GetResponseDefaultResponse) o; - return Objects.equals( - this.cloudSdkCustomFields, getResponseDefaultResponse.cloudSdkCustomFields) - && Objects.equals(this.code, getResponseDefaultResponse.code) - && Objects.equals(this.message, getResponseDefaultResponse.message) - && Objects.equals(this.param, getResponseDefaultResponse.param) - && Objects.equals(this.type, getResponseDefaultResponse.type); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, param, type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class GetResponseDefaultResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" param: ").append(toIndentedString(param)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * GetResponseDefaultResponse} instance with all required arguments. - */ - public static Builder create() { - return (code) -> - (message) -> - (param) -> - (type) -> - new GetResponseDefaultResponse() - .code(code) - .message(message) - .param(param) - .type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the code of this {@link GetResponseDefaultResponse} instance. - * - * @param code The code of this {@link GetResponseDefaultResponse} - * @return The GetResponseDefaultResponse builder. - */ - Builder1 code(@Nullable final String code); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link GetResponseDefaultResponse} instance. - * - * @param message The message of this {@link GetResponseDefaultResponse} - * @return The GetResponseDefaultResponse builder. - */ - Builder2 message(@Nonnull final String message); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the param of this {@link GetResponseDefaultResponse} instance. - * - * @param param The param of this {@link GetResponseDefaultResponse} - * @return The GetResponseDefaultResponse builder. - */ - Builder3 param(@Nullable final String param); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the type of this {@link GetResponseDefaultResponse} instance. - * - * @param type The type of this {@link GetResponseDefaultResponse} - * @return The GetResponseDefaultResponse instance. - */ - GetResponseDefaultResponse type(@Nonnull final String type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java deleted file mode 100644 index 16b39d11a..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotation.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** An annotation that applies to a span of output text. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAIAnnotation -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIAnnotationType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIAnnotation. */ - protected OpenAIAnnotation() {} - - /** - * Set the type of this {@link OpenAIAnnotation} instance and return the same instance. - * - * @param type The type of this {@link OpenAIAnnotation} - * @return The same instance of this {@link OpenAIAnnotation} class - */ - @Nonnull - public OpenAIAnnotation type(@Nonnull final OpenAIAnnotationType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIAnnotation} instance. - */ - @Nonnull - public OpenAIAnnotationType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIAnnotation} instance. - * - * @param type The type of this {@link OpenAIAnnotation} - */ - public void setType(@Nonnull final OpenAIAnnotationType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIAnnotation}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIAnnotation} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIAnnotation has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIAnnotation} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIAnnotation} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIAnnotation openAIAnnotation = (OpenAIAnnotation) o; - return Objects.equals(this.cloudSdkCustomFields, openAIAnnotation.cloudSdkCustomFields) - && Objects.equals(this.type, openAIAnnotation.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIAnnotation {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIAnnotation} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIAnnotation().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIAnnotation} instance. - * - * @param type The type of this {@link OpenAIAnnotation} - * @return The OpenAIAnnotation instance. - */ - OpenAIAnnotation type(@Nonnull final OpenAIAnnotationType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java deleted file mode 100644 index 4b3b6b9cc..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIAnnotationType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIAnnotationType */ -public interface OpenAIAnnotationType { - /** Helper class to create {@code String } that implements {@link OpenAIAnnotationType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIAnnotationType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java deleted file mode 100644 index a87eb8cfc..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** - * The conversation that this response belongs to. Items from this conversation are prepended to - * `input_items` for this response request. Input items and output items from this - * response are automatically added to this conversation after this response completes. - */ -public interface OpenAIConversationParam { - /** - * Helper class to create {@code OpenAIConversationParam2 } that implements {@link - * OpenAIConversationParam}. - */ - record InnerOpenAIConversationParam2( - @com.fasterxml.jackson.annotation.JsonValue @Nonnull OpenAIConversationParam2 value) - implements OpenAIConversationParam {} - - /** - * Creator to enable deserialization of {@code OpenAIConversationParam2 }. - * - * @param val the value to use - * @return a new instance of {@link InnerOpenAIConversationParam2}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerOpenAIConversationParam2 createInnerOpenAIConversationParam2( - @Nonnull final OpenAIConversationParam2 val) { - return new InnerOpenAIConversationParam2(val); - } - - /** Helper class to create {@code String } that implements {@link OpenAIConversationParam}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIConversationParam {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java deleted file mode 100644 index 2e8405959..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationParam2.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** The conversation that this response belongs to. */ -// CHECKSTYLE:OFF -public class OpenAIConversationParam2 -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIConversationParam2. */ - protected OpenAIConversationParam2() {} - - /** - * Set the id of this {@link OpenAIConversationParam2} instance and return the same instance. - * - * @param id The unique ID of the conversation. - * @return The same instance of this {@link OpenAIConversationParam2} class - */ - @Nonnull - public OpenAIConversationParam2 id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * The unique ID of the conversation. - * - * @return id The id of this {@link OpenAIConversationParam2} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link OpenAIConversationParam2} instance. - * - * @param id The unique ID of the conversation. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIConversationParam2}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIConversationParam2} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIConversationParam2 has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIConversationParam2} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (id != null) declaredFields.put("id", id); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIConversationParam2} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIConversationParam2 openAIConversationParam2 = (OpenAIConversationParam2) o; - return Objects.equals(this.cloudSdkCustomFields, openAIConversationParam2.cloudSdkCustomFields) - && Objects.equals(this.id, openAIConversationParam2.id); - } - - @Override - public int hashCode() { - return Objects.hash(id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIConversationParam2 {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIConversationParam2} instance with all required arguments. - */ - public static Builder create() { - return (id) -> new OpenAIConversationParam2().id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link OpenAIConversationParam2} instance. - * - * @param id The unique ID of the conversation. - * @return The OpenAIConversationParam2 instance. - */ - OpenAIConversationParam2 id(@Nonnull final String id); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java deleted file mode 100644 index 8021c0d56..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIConversationReference.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * The conversation that this response belonged to. Input items and output items from this response - * were automatically added to this conversation. - */ -// CHECKSTYLE:OFF -public class OpenAIConversationReference -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIConversationReference. */ - protected OpenAIConversationReference() {} - - /** - * Set the id of this {@link OpenAIConversationReference} instance and return the same instance. - * - * @param id The unique ID of the conversation that this response was associated with. - * @return The same instance of this {@link OpenAIConversationReference} class - */ - @Nonnull - public OpenAIConversationReference id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * The unique ID of the conversation that this response was associated with. - * - * @return id The id of this {@link OpenAIConversationReference} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link OpenAIConversationReference} instance. - * - * @param id The unique ID of the conversation that this response was associated with. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIConversationReference}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIConversationReference} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIConversationReference has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIConversationReference} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (id != null) declaredFields.put("id", id); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIConversationReference} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIConversationReference openAIConversationReference = (OpenAIConversationReference) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIConversationReference.cloudSdkCustomFields) - && Objects.equals(this.id, openAIConversationReference.id); - } - - @Override - public int hashCode() { - return Objects.hash(id, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIConversationReference {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIConversationReference} instance with all required arguments. - */ - public static Builder create() { - return (id) -> new OpenAIConversationReference().id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link OpenAIConversationReference} instance. - * - * @param id The unique ID of the conversation that this response was associated with. - * @return The OpenAIConversationReference instance. - */ - OpenAIConversationReference id(@Nonnull final String id); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java deleted file mode 100644 index f0f0bddd8..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAICreateResponse.java +++ /dev/null @@ -1,1392 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAICreateResponse */ -// CHECKSTYLE:OFF -public class OpenAICreateResponse -// CHECKSTYLE:ON -{ - @JsonProperty("metadata") - private Object metadata; - - @JsonProperty("top_logprobs") - private Integer topLogprobs; - - @JsonProperty("temperature") - private BigDecimal temperature; - - @JsonProperty("top_p") - private BigDecimal topP; - - @JsonProperty("user") - private String user; - - @JsonProperty("safety_identifier") - private String safetyIdentifier; - - @JsonProperty("prompt_cache_key") - private String promptCacheKey; - - /** Gets or Sets promptCacheRetention */ - public enum PromptCacheRetentionEnum { - /** The IN_MEMORY option of this OpenAICreateResponse */ - IN_MEMORY("in-memory"), - - /** The _24H option of this OpenAICreateResponse */ - _24H("24h"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAICreateResponse */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PromptCacheRetentionEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAICreateResponse - */ - @JsonCreator - @Nullable - public static PromptCacheRetentionEnum fromValue(@Nonnull final String value) { - for (PromptCacheRetentionEnum b : PromptCacheRetentionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("prompt_cache_retention") - private PromptCacheRetentionEnum promptCacheRetention; - - @JsonProperty("previous_response_id") - private String previousResponseId; - - @JsonProperty("model") - private String model; - - @JsonProperty("reasoning") - private OpenAIReasoning reasoning; - - @JsonProperty("background") - private Boolean background; - - @JsonProperty("max_output_tokens") - private Integer maxOutputTokens; - - @JsonProperty("max_tool_calls") - private Integer maxToolCalls; - - @JsonProperty("text") - private OpenAIResponseTextParam text; - - @JsonProperty("tools") - private List tools; - - @JsonProperty("tool_choice") - private OpenAIToolChoiceParam toolChoice; - - @JsonProperty("prompt") - private OpenAIPrompt prompt; - - /** Gets or Sets truncation */ - public enum TruncationEnum { - /** The AUTO option of this OpenAICreateResponse */ - AUTO("auto"), - - /** The DISABLED option of this OpenAICreateResponse */ - DISABLED("disabled"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAICreateResponse */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TruncationEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAICreateResponse - */ - @JsonCreator - @Nullable - public static TruncationEnum fromValue(@Nonnull final String value) { - for (TruncationEnum b : TruncationEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("truncation") - private TruncationEnum truncation; - - @JsonProperty("input") - private OpenAIInputParam input; - - @JsonProperty("include") - private List include; - - @JsonProperty("parallel_tool_calls") - private Boolean parallelToolCalls; - - @JsonProperty("store") - private Boolean store; - - @JsonProperty("instructions") - private String instructions; - - @JsonProperty("stream") - private Boolean stream; - - @JsonProperty("stream_options") - private OpenAIResponseStreamOptions streamOptions; - - @JsonProperty("conversation") - private OpenAIConversationParam conversation; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAICreateResponse. */ - protected OpenAICreateResponse() {} - - /** - * Set the metadata of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful - * for storing additional information about the object in a structured format, and querying - * for objects via API or the dashboard. Keys are strings with a maximum length of 64 - * characters. Values are strings with a maximum length of 512 characters. - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse metadata(@Nullable final Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing - * additional information about the object in a structured format, and querying for objects via - * API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are - * strings with a maximum length of 512 characters. - * - * @return metadata The metadata of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Object getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link OpenAICreateResponse} instance. - * - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful - * for storing additional information about the object in a structured format, and querying - * for objects via API or the dashboard. Keys are strings with a maximum length of 64 - * characters. Values are strings with a maximum length of 512 characters. - */ - public void setMetadata(@Nullable final Object metadata) { - this.metadata = metadata; - } - - /** - * Set the topLogprobs of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param topLogprobs The topLogprobs of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse topLogprobs(@Nullable final Integer topLogprobs) { - this.topLogprobs = topLogprobs; - return this; - } - - /** - * Get topLogprobs - * - * @return topLogprobs The topLogprobs of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Integer getTopLogprobs() { - return topLogprobs; - } - - /** - * Set the topLogprobs of this {@link OpenAICreateResponse} instance. - * - * @param topLogprobs The topLogprobs of this {@link OpenAICreateResponse} - */ - public void setTopLogprobs(@Nullable final Integer topLogprobs) { - this.topLogprobs = topLogprobs; - } - - /** - * Set the temperature of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param temperature The temperature of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse temperature(@Nullable final BigDecimal temperature) { - this.temperature = temperature; - return this; - } - - /** - * Get temperature - * - * @return temperature The temperature of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public BigDecimal getTemperature() { - return temperature; - } - - /** - * Set the temperature of this {@link OpenAICreateResponse} instance. - * - * @param temperature The temperature of this {@link OpenAICreateResponse} - */ - public void setTemperature(@Nullable final BigDecimal temperature) { - this.temperature = temperature; - } - - /** - * Set the topP of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param topP The topP of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse topP(@Nullable final BigDecimal topP) { - this.topP = topP; - return this; - } - - /** - * Get topP - * - * @return topP The topP of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public BigDecimal getTopP() { - return topP; - } - - /** - * Set the topP of this {@link OpenAICreateResponse} instance. - * - * @param topP The topP of this {@link OpenAICreateResponse} - */ - public void setTopP(@Nullable final BigDecimal topP) { - this.topP = topP; - } - - /** - * Set the user of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param user This field is being replaced by `safety_identifier` and - * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching - * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by - * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse user(@Nullable final String user) { - this.user = user; - return this; - } - - /** - * This field is being replaced by `safety_identifier` and `prompt_cache_key`. - * Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier - * for your end-users. Used to boost cache hit rates by better bucketing similar requests and to - * help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * @return user The user of this {@link OpenAICreateResponse} instance. - * @deprecated - */ - @Deprecated - @Nonnull - public String getUser() { - return user; - } - - /** - * Set the user of this {@link OpenAICreateResponse} instance. - * - * @param user This field is being replaced by `safety_identifier` and - * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching - * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by - * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - */ - public void setUser(@Nullable final String user) { - this.user = user; - } - - /** - * Set the safetyIdentifier of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param safetyIdentifier A stable identifier used to help detect users of your application that - * may be violating OpenAI's usage policies. The IDs should be a string that uniquely - * identifies each user. We recommend hashing their username or email address, in order to - * avoid sending us any identifying information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse safetyIdentifier(@Nullable final String safetyIdentifier) { - this.safetyIdentifier = safetyIdentifier; - return this; - } - - /** - * A stable identifier used to help detect users of your application that may be violating - * OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We - * recommend hashing their username or email address, in order to avoid sending us any identifying - * information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * @return safetyIdentifier The safetyIdentifier of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public String getSafetyIdentifier() { - return safetyIdentifier; - } - - /** - * Set the safetyIdentifier of this {@link OpenAICreateResponse} instance. - * - * @param safetyIdentifier A stable identifier used to help detect users of your application that - * may be violating OpenAI's usage policies. The IDs should be a string that uniquely - * identifies each user. We recommend hashing their username or email address, in order to - * avoid sending us any identifying information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - */ - public void setSafetyIdentifier(@Nullable final String safetyIdentifier) { - this.safetyIdentifier = safetyIdentifier; - } - - /** - * Set the promptCacheKey of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your - * cache hit rates. Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse promptCacheKey(@Nullable final String promptCacheKey) { - this.promptCacheKey = promptCacheKey; - return this; - } - - /** - * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. - * Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - * - * @return promptCacheKey The promptCacheKey of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public String getPromptCacheKey() { - return promptCacheKey; - } - - /** - * Set the promptCacheKey of this {@link OpenAICreateResponse} instance. - * - * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your - * cache hit rates. Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - */ - public void setPromptCacheKey(@Nullable final String promptCacheKey) { - this.promptCacheKey = promptCacheKey; - } - - /** - * Set the promptCacheRetention of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param promptCacheRetention The promptCacheRetention of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse promptCacheRetention( - @Nullable final PromptCacheRetentionEnum promptCacheRetention) { - this.promptCacheRetention = promptCacheRetention; - return this; - } - - /** - * Get promptCacheRetention - * - * @return promptCacheRetention The promptCacheRetention of this {@link OpenAICreateResponse} - * instance. - */ - @Nullable - public PromptCacheRetentionEnum getPromptCacheRetention() { - return promptCacheRetention; - } - - /** - * Set the promptCacheRetention of this {@link OpenAICreateResponse} instance. - * - * @param promptCacheRetention The promptCacheRetention of this {@link OpenAICreateResponse} - */ - public void setPromptCacheRetention( - @Nullable final PromptCacheRetentionEnum promptCacheRetention) { - this.promptCacheRetention = promptCacheRetention; - } - - /** - * Set the previousResponseId of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param previousResponseId The previousResponseId of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse previousResponseId(@Nullable final String previousResponseId) { - this.previousResponseId = previousResponseId; - return this; - } - - /** - * Get previousResponseId - * - * @return previousResponseId The previousResponseId of this {@link OpenAICreateResponse} - * instance. - */ - @Nullable - public String getPreviousResponseId() { - return previousResponseId; - } - - /** - * Set the previousResponseId of this {@link OpenAICreateResponse} instance. - * - * @param previousResponseId The previousResponseId of this {@link OpenAICreateResponse} - */ - public void setPreviousResponseId(@Nullable final String previousResponseId) { - this.previousResponseId = previousResponseId; - } - - /** - * Set the model of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. - * OpenAI offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model - * guide](https://platform.openai.com/docs/models) to browse and compare available models. - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse model(@Nullable final String model) { - this.model = model; - return this; - } - - /** - * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - * offers a wide range of models with different capabilities, performance characteristics, and - * price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and - * compare available models. - * - * @return model The model of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public String getModel() { - return model; - } - - /** - * Set the model of this {@link OpenAICreateResponse} instance. - * - * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. - * OpenAI offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model - * guide](https://platform.openai.com/docs/models) to browse and compare available models. - */ - public void setModel(@Nullable final String model) { - this.model = model; - } - - /** - * Set the reasoning of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param reasoning The reasoning of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse reasoning(@Nullable final OpenAIReasoning reasoning) { - this.reasoning = reasoning; - return this; - } - - /** - * Get reasoning - * - * @return reasoning The reasoning of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public OpenAIReasoning getReasoning() { - return reasoning; - } - - /** - * Set the reasoning of this {@link OpenAICreateResponse} instance. - * - * @param reasoning The reasoning of this {@link OpenAICreateResponse} - */ - public void setReasoning(@Nullable final OpenAIReasoning reasoning) { - this.reasoning = reasoning; - } - - /** - * Set the background of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param background The background of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse background(@Nullable final Boolean background) { - this.background = background; - return this; - } - - /** - * Get background - * - * @return background The background of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Boolean isBackground() { - return background; - } - - /** - * Set the background of this {@link OpenAICreateResponse} instance. - * - * @param background The background of this {@link OpenAICreateResponse} - */ - public void setBackground(@Nullable final Boolean background) { - this.background = background; - } - - /** - * Set the maxOutputTokens of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param maxOutputTokens The maxOutputTokens of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse maxOutputTokens(@Nullable final Integer maxOutputTokens) { - this.maxOutputTokens = maxOutputTokens; - return this; - } - - /** - * Get maxOutputTokens - * - * @return maxOutputTokens The maxOutputTokens of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Integer getMaxOutputTokens() { - return maxOutputTokens; - } - - /** - * Set the maxOutputTokens of this {@link OpenAICreateResponse} instance. - * - * @param maxOutputTokens The maxOutputTokens of this {@link OpenAICreateResponse} - */ - public void setMaxOutputTokens(@Nullable final Integer maxOutputTokens) { - this.maxOutputTokens = maxOutputTokens; - } - - /** - * Set the maxToolCalls of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param maxToolCalls The maxToolCalls of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse maxToolCalls(@Nullable final Integer maxToolCalls) { - this.maxToolCalls = maxToolCalls; - return this; - } - - /** - * Get maxToolCalls - * - * @return maxToolCalls The maxToolCalls of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Integer getMaxToolCalls() { - return maxToolCalls; - } - - /** - * Set the maxToolCalls of this {@link OpenAICreateResponse} instance. - * - * @param maxToolCalls The maxToolCalls of this {@link OpenAICreateResponse} - */ - public void setMaxToolCalls(@Nullable final Integer maxToolCalls) { - this.maxToolCalls = maxToolCalls; - } - - /** - * Set the text of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param text The text of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse text(@Nullable final OpenAIResponseTextParam text) { - this.text = text; - return this; - } - - /** - * Get text - * - * @return text The text of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public OpenAIResponseTextParam getText() { - return text; - } - - /** - * Set the text of this {@link OpenAICreateResponse} instance. - * - * @param text The text of this {@link OpenAICreateResponse} - */ - public void setText(@Nullable final OpenAIResponseTextParam text) { - this.text = text; - } - - /** - * Set the tools of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param tools An array of tools the model may call while generating a response. You can specify - * which tool to use by setting the `tool_choice` parameter. The two categories of - * tools you can provide the model are: - **Built-in tools**: Tools that are provided by - * OpenAI that extend the model's capabilities, like file search. - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own - * code. - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse tools(@Nullable final List tools) { - this.tools = tools; - return this; - } - - /** - * Add one tools instance to this {@link OpenAICreateResponse}. - * - * @param toolsItem The tools that should be added - * @return The same instance of type {@link OpenAICreateResponse} - */ - @Nonnull - public OpenAICreateResponse addToolsItem(@Nonnull final OpenAITool toolsItem) { - if (this.tools == null) { - this.tools = new ArrayList<>(); - } - this.tools.add(toolsItem); - return this; - } - - /** - * An array of tools the model may call while generating a response. You can specify which tool to - * use by setting the `tool_choice` parameter. The two categories of tools you can - * provide the model are: - **Built-in tools**: Tools that are provided by OpenAI that extend the - * model's capabilities, like file search. - **Function calls (custom tools)**: Functions that - * are defined by you, enabling the model to call your own code. - * - * @return tools The tools of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public List getTools() { - return tools; - } - - /** - * Set the tools of this {@link OpenAICreateResponse} instance. - * - * @param tools An array of tools the model may call while generating a response. You can specify - * which tool to use by setting the `tool_choice` parameter. The two categories of - * tools you can provide the model are: - **Built-in tools**: Tools that are provided by - * OpenAI that extend the model's capabilities, like file search. - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own - * code. - */ - public void setTools(@Nullable final List tools) { - this.tools = tools; - } - - /** - * Set the toolChoice of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param toolChoice The toolChoice of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse toolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { - this.toolChoice = toolChoice; - return this; - } - - /** - * Get toolChoice - * - * @return toolChoice The toolChoice of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public OpenAIToolChoiceParam getToolChoice() { - return toolChoice; - } - - /** - * Set the toolChoice of this {@link OpenAICreateResponse} instance. - * - * @param toolChoice The toolChoice of this {@link OpenAICreateResponse} - */ - public void setToolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { - this.toolChoice = toolChoice; - } - - /** - * Set the prompt of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param prompt The prompt of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse prompt(@Nullable final OpenAIPrompt prompt) { - this.prompt = prompt; - return this; - } - - /** - * Get prompt - * - * @return prompt The prompt of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public OpenAIPrompt getPrompt() { - return prompt; - } - - /** - * Set the prompt of this {@link OpenAICreateResponse} instance. - * - * @param prompt The prompt of this {@link OpenAICreateResponse} - */ - public void setPrompt(@Nullable final OpenAIPrompt prompt) { - this.prompt = prompt; - } - - /** - * Set the truncation of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param truncation The truncation of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse truncation(@Nullable final TruncationEnum truncation) { - this.truncation = truncation; - return this; - } - - /** - * Get truncation - * - * @return truncation The truncation of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public TruncationEnum getTruncation() { - return truncation; - } - - /** - * Set the truncation of this {@link OpenAICreateResponse} instance. - * - * @param truncation The truncation of this {@link OpenAICreateResponse} - */ - public void setTruncation(@Nullable final TruncationEnum truncation) { - this.truncation = truncation; - } - - /** - * Set the input of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param input The input of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse input(@Nullable final OpenAIInputParam input) { - this.input = input; - return this; - } - - /** - * Get input - * - * @return input The input of this {@link OpenAICreateResponse} instance. - */ - @Nonnull - public OpenAIInputParam getInput() { - return input; - } - - /** - * Set the input of this {@link OpenAICreateResponse} instance. - * - * @param input The input of this {@link OpenAICreateResponse} - */ - public void setInput(@Nullable final OpenAIInputParam input) { - this.input = input; - } - - /** - * Set the include of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param include The include of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse include(@Nullable final List include) { - this.include = include; - return this; - } - - /** - * Add one include instance to this {@link OpenAICreateResponse}. - * - * @param includeItem The include that should be added - * @return The same instance of type {@link OpenAICreateResponse} - */ - @Nonnull - public OpenAICreateResponse addIncludeItem(@Nonnull final OpenAIIncludeEnum includeItem) { - if (this.include == null) { - this.include = new ArrayList<>(); - } - this.include.add(includeItem); - return this; - } - - /** - * Get include - * - * @return include The include of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public List getInclude() { - return include; - } - - /** - * Set the include of this {@link OpenAICreateResponse} instance. - * - * @param include The include of this {@link OpenAICreateResponse} - */ - public void setInclude(@Nullable final List include) { - this.include = include; - } - - /** - * Set the parallelToolCalls of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param parallelToolCalls The parallelToolCalls of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse parallelToolCalls(@Nullable final Boolean parallelToolCalls) { - this.parallelToolCalls = parallelToolCalls; - return this; - } - - /** - * Get parallelToolCalls - * - * @return parallelToolCalls The parallelToolCalls of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Boolean isParallelToolCalls() { - return parallelToolCalls; - } - - /** - * Set the parallelToolCalls of this {@link OpenAICreateResponse} instance. - * - * @param parallelToolCalls The parallelToolCalls of this {@link OpenAICreateResponse} - */ - public void setParallelToolCalls(@Nullable final Boolean parallelToolCalls) { - this.parallelToolCalls = parallelToolCalls; - } - - /** - * Set the store of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param store The store of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse store(@Nullable final Boolean store) { - this.store = store; - return this; - } - - /** - * Get store - * - * @return store The store of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Boolean isStore() { - return store; - } - - /** - * Set the store of this {@link OpenAICreateResponse} instance. - * - * @param store The store of this {@link OpenAICreateResponse} - */ - public void setStore(@Nullable final Boolean store) { - this.store = store; - } - - /** - * Set the instructions of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param instructions The instructions of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse instructions(@Nullable final String instructions) { - this.instructions = instructions; - return this; - } - - /** - * Get instructions - * - * @return instructions The instructions of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public String getInstructions() { - return instructions; - } - - /** - * Set the instructions of this {@link OpenAICreateResponse} instance. - * - * @param instructions The instructions of this {@link OpenAICreateResponse} - */ - public void setInstructions(@Nullable final String instructions) { - this.instructions = instructions; - } - - /** - * Set the stream of this {@link OpenAICreateResponse} instance and return the same instance. - * - * @param stream The stream of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse stream(@Nullable final Boolean stream) { - this.stream = stream; - return this; - } - - /** - * Get stream - * - * @return stream The stream of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public Boolean isStream() { - return stream; - } - - /** - * Set the stream of this {@link OpenAICreateResponse} instance. - * - * @param stream The stream of this {@link OpenAICreateResponse} - */ - public void setStream(@Nullable final Boolean stream) { - this.stream = stream; - } - - /** - * Set the streamOptions of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param streamOptions The streamOptions of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse streamOptions( - @Nullable final OpenAIResponseStreamOptions streamOptions) { - this.streamOptions = streamOptions; - return this; - } - - /** - * Get streamOptions - * - * @return streamOptions The streamOptions of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public OpenAIResponseStreamOptions getStreamOptions() { - return streamOptions; - } - - /** - * Set the streamOptions of this {@link OpenAICreateResponse} instance. - * - * @param streamOptions The streamOptions of this {@link OpenAICreateResponse} - */ - public void setStreamOptions(@Nullable final OpenAIResponseStreamOptions streamOptions) { - this.streamOptions = streamOptions; - } - - /** - * Set the conversation of this {@link OpenAICreateResponse} instance and return the same - * instance. - * - * @param conversation The conversation of this {@link OpenAICreateResponse} - * @return The same instance of this {@link OpenAICreateResponse} class - */ - @Nonnull - public OpenAICreateResponse conversation(@Nullable final OpenAIConversationParam conversation) { - this.conversation = conversation; - return this; - } - - /** - * Get conversation - * - * @return conversation The conversation of this {@link OpenAICreateResponse} instance. - */ - @Nullable - public OpenAIConversationParam getConversation() { - return conversation; - } - - /** - * Set the conversation of this {@link OpenAICreateResponse} instance. - * - * @param conversation The conversation of this {@link OpenAICreateResponse} - */ - public void setConversation(@Nullable final OpenAIConversationParam conversation) { - this.conversation = conversation; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAICreateResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAICreateResponse} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAICreateResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAICreateResponse} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (metadata != null) declaredFields.put("metadata", metadata); - if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); - if (temperature != null) declaredFields.put("temperature", temperature); - if (topP != null) declaredFields.put("topP", topP); - if (user != null) declaredFields.put("user", user); - if (safetyIdentifier != null) declaredFields.put("safetyIdentifier", safetyIdentifier); - if (promptCacheKey != null) declaredFields.put("promptCacheKey", promptCacheKey); - if (promptCacheRetention != null) - declaredFields.put("promptCacheRetention", promptCacheRetention); - if (previousResponseId != null) declaredFields.put("previousResponseId", previousResponseId); - if (model != null) declaredFields.put("model", model); - if (reasoning != null) declaredFields.put("reasoning", reasoning); - if (background != null) declaredFields.put("background", background); - if (maxOutputTokens != null) declaredFields.put("maxOutputTokens", maxOutputTokens); - if (maxToolCalls != null) declaredFields.put("maxToolCalls", maxToolCalls); - if (text != null) declaredFields.put("text", text); - if (tools != null) declaredFields.put("tools", tools); - if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); - if (prompt != null) declaredFields.put("prompt", prompt); - if (truncation != null) declaredFields.put("truncation", truncation); - if (input != null) declaredFields.put("input", input); - if (include != null) declaredFields.put("include", include); - if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); - if (store != null) declaredFields.put("store", store); - if (instructions != null) declaredFields.put("instructions", instructions); - if (stream != null) declaredFields.put("stream", stream); - if (streamOptions != null) declaredFields.put("streamOptions", streamOptions); - if (conversation != null) declaredFields.put("conversation", conversation); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAICreateResponse} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAICreateResponse openAICreateResponse = (OpenAICreateResponse) o; - return Objects.equals(this.cloudSdkCustomFields, openAICreateResponse.cloudSdkCustomFields) - && Objects.equals(this.metadata, openAICreateResponse.metadata) - && Objects.equals(this.topLogprobs, openAICreateResponse.topLogprobs) - && Objects.equals(this.temperature, openAICreateResponse.temperature) - && Objects.equals(this.topP, openAICreateResponse.topP) - && Objects.equals(this.user, openAICreateResponse.user) - && Objects.equals(this.safetyIdentifier, openAICreateResponse.safetyIdentifier) - && Objects.equals(this.promptCacheKey, openAICreateResponse.promptCacheKey) - && Objects.equals(this.promptCacheRetention, openAICreateResponse.promptCacheRetention) - && Objects.equals(this.previousResponseId, openAICreateResponse.previousResponseId) - && Objects.equals(this.model, openAICreateResponse.model) - && Objects.equals(this.reasoning, openAICreateResponse.reasoning) - && Objects.equals(this.background, openAICreateResponse.background) - && Objects.equals(this.maxOutputTokens, openAICreateResponse.maxOutputTokens) - && Objects.equals(this.maxToolCalls, openAICreateResponse.maxToolCalls) - && Objects.equals(this.text, openAICreateResponse.text) - && Objects.equals(this.tools, openAICreateResponse.tools) - && Objects.equals(this.toolChoice, openAICreateResponse.toolChoice) - && Objects.equals(this.prompt, openAICreateResponse.prompt) - && Objects.equals(this.truncation, openAICreateResponse.truncation) - && Objects.equals(this.input, openAICreateResponse.input) - && Objects.equals(this.include, openAICreateResponse.include) - && Objects.equals(this.parallelToolCalls, openAICreateResponse.parallelToolCalls) - && Objects.equals(this.store, openAICreateResponse.store) - && Objects.equals(this.instructions, openAICreateResponse.instructions) - && Objects.equals(this.stream, openAICreateResponse.stream) - && Objects.equals(this.streamOptions, openAICreateResponse.streamOptions) - && Objects.equals(this.conversation, openAICreateResponse.conversation); - } - - @Override - public int hashCode() { - return Objects.hash( - metadata, - topLogprobs, - temperature, - topP, - user, - safetyIdentifier, - promptCacheKey, - promptCacheRetention, - previousResponseId, - model, - reasoning, - background, - maxOutputTokens, - maxToolCalls, - text, - tools, - toolChoice, - prompt, - truncation, - input, - include, - parallelToolCalls, - store, - instructions, - stream, - streamOptions, - conversation, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAICreateResponse {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); - sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); - sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).append("\n"); - sb.append(" safetyIdentifier: ").append(toIndentedString(safetyIdentifier)).append("\n"); - sb.append(" promptCacheKey: ").append(toIndentedString(promptCacheKey)).append("\n"); - sb.append(" promptCacheRetention: ") - .append(toIndentedString(promptCacheRetention)) - .append("\n"); - sb.append(" previousResponseId: ").append(toIndentedString(previousResponseId)).append("\n"); - sb.append(" model: ").append(toIndentedString(model)).append("\n"); - sb.append(" reasoning: ").append(toIndentedString(reasoning)).append("\n"); - sb.append(" background: ").append(toIndentedString(background)).append("\n"); - sb.append(" maxOutputTokens: ").append(toIndentedString(maxOutputTokens)).append("\n"); - sb.append(" maxToolCalls: ").append(toIndentedString(maxToolCalls)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); - sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); - sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); - sb.append(" truncation: ").append(toIndentedString(truncation)).append("\n"); - sb.append(" input: ").append(toIndentedString(input)).append("\n"); - sb.append(" include: ").append(toIndentedString(include)).append("\n"); - sb.append(" parallelToolCalls: ").append(toIndentedString(parallelToolCalls)).append("\n"); - sb.append(" store: ").append(toIndentedString(store)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" stream: ").append(toIndentedString(stream)).append("\n"); - sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).append("\n"); - sb.append(" conversation: ").append(toIndentedString(conversation)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link OpenAICreateResponse} instance. No arguments are required. */ - public static OpenAICreateResponse create() { - return new OpenAICreateResponse(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java deleted file mode 100644 index 4432e8024..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIImageDetail.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** Gets or Sets OpenAI.ImageDetail */ -public enum OpenAIImageDetail { - LOW("low"), - - HIGH("high"), - - AUTO("auto"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - OpenAIImageDetail(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static OpenAIImageDetail fromValue(@Nonnull final String value) { - for (final OpenAIImageDetail b : OpenAIImageDetail.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java deleted file mode 100644 index 8c9f26225..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIIncludeEnum.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** - * Specify additional output data to include in the model response. Currently supported values are: - * - `web_search_call.action.sources`: Include the sources of the web search tool call. - - * `code_interpreter_call.outputs`: Includes the outputs of python code execution in code - * interpreter tool call items. - `computer_call_output.output.image_url`: Include image - * urls from the computer call output. - `file_search_call.results`: Include the search - * results of the file search tool call. - `message.input_image.image_url`: Include image - * urls from the input message. - `message.output_text.logprobs`: Include logprobs with - * assistant messages. - `reasoning.encrypted_content`: Includes an encrypted version of - * reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn - * conversations when using the Responses API statelessly (like when the `store` parameter - * is set to `false`, or when an organization is enrolled in the zero data retention - * program). - */ -public interface OpenAIIncludeEnum { - /** Helper class to create {@code String } that implements {@link OpenAIIncludeEnum}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIIncludeEnum {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java deleted file mode 100644 index 528b535b8..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputFileContent.java +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.net.URI; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A file input to the model. */ -// CHECKSTYLE:OFF -public class OpenAIInputFileContent -// CHECKSTYLE:ON -{ - /** The type of the input item. Always `input_file`. */ - public enum TypeEnum { - /** The INPUT_FILE option of this OpenAIInputFileContent */ - INPUT_FILE("input_file"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIInputFileContent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIInputFileContent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type = TypeEnum.INPUT_FILE; - - @JsonProperty("file_id") - private String fileId; - - @JsonProperty("filename") - private String filename; - - @JsonProperty("file_url") - private URI fileUrl; - - @JsonProperty("file_data") - private String fileData; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIInputFileContent. */ - protected OpenAIInputFileContent() {} - - /** - * Set the type of this {@link OpenAIInputFileContent} instance and return the same instance. - * - * @param type The type of the input item. Always `input_file`. - * @return The same instance of this {@link OpenAIInputFileContent} class - */ - @Nonnull - public OpenAIInputFileContent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the input item. Always `input_file`. - * - * @return type The type of this {@link OpenAIInputFileContent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIInputFileContent} instance. - * - * @param type The type of the input item. Always `input_file`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the fileId of this {@link OpenAIInputFileContent} instance and return the same instance. - * - * @param fileId The fileId of this {@link OpenAIInputFileContent} - * @return The same instance of this {@link OpenAIInputFileContent} class - */ - @Nonnull - public OpenAIInputFileContent fileId(@Nullable final String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get fileId - * - * @return fileId The fileId of this {@link OpenAIInputFileContent} instance. - */ - @Nullable - public String getFileId() { - return fileId; - } - - /** - * Set the fileId of this {@link OpenAIInputFileContent} instance. - * - * @param fileId The fileId of this {@link OpenAIInputFileContent} - */ - public void setFileId(@Nullable final String fileId) { - this.fileId = fileId; - } - - /** - * Set the filename of this {@link OpenAIInputFileContent} instance and return the same instance. - * - * @param filename The name of the file to be sent to the model. - * @return The same instance of this {@link OpenAIInputFileContent} class - */ - @Nonnull - public OpenAIInputFileContent filename(@Nullable final String filename) { - this.filename = filename; - return this; - } - - /** - * The name of the file to be sent to the model. - * - * @return filename The filename of this {@link OpenAIInputFileContent} instance. - */ - @Nonnull - public String getFilename() { - return filename; - } - - /** - * Set the filename of this {@link OpenAIInputFileContent} instance. - * - * @param filename The name of the file to be sent to the model. - */ - public void setFilename(@Nullable final String filename) { - this.filename = filename; - } - - /** - * Set the fileUrl of this {@link OpenAIInputFileContent} instance and return the same instance. - * - * @param fileUrl The URL of the file to be sent to the model. - * @return The same instance of this {@link OpenAIInputFileContent} class - */ - @Nonnull - public OpenAIInputFileContent fileUrl(@Nullable final URI fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * The URL of the file to be sent to the model. - * - * @return fileUrl The fileUrl of this {@link OpenAIInputFileContent} instance. - */ - @Nonnull - public URI getFileUrl() { - return fileUrl; - } - - /** - * Set the fileUrl of this {@link OpenAIInputFileContent} instance. - * - * @param fileUrl The URL of the file to be sent to the model. - */ - public void setFileUrl(@Nullable final URI fileUrl) { - this.fileUrl = fileUrl; - } - - /** - * Set the fileData of this {@link OpenAIInputFileContent} instance and return the same instance. - * - * @param fileData The content of the file to be sent to the model. - * @return The same instance of this {@link OpenAIInputFileContent} class - */ - @Nonnull - public OpenAIInputFileContent fileData(@Nullable final String fileData) { - this.fileData = fileData; - return this; - } - - /** - * The content of the file to be sent to the model. - * - * @return fileData The fileData of this {@link OpenAIInputFileContent} instance. - */ - @Nonnull - public String getFileData() { - return fileData; - } - - /** - * Set the fileData of this {@link OpenAIInputFileContent} instance. - * - * @param fileData The content of the file to be sent to the model. - */ - public void setFileData(@Nullable final String fileData) { - this.fileData = fileData; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIInputFileContent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIInputFileContent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIInputFileContent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIInputFileContent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (fileId != null) declaredFields.put("fileId", fileId); - if (filename != null) declaredFields.put("filename", filename); - if (fileUrl != null) declaredFields.put("fileUrl", fileUrl); - if (fileData != null) declaredFields.put("fileData", fileData); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIInputFileContent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIInputFileContent openAIInputFileContent = (OpenAIInputFileContent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIInputFileContent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIInputFileContent.type) - && Objects.equals(this.fileId, openAIInputFileContent.fileId) - && Objects.equals(this.filename, openAIInputFileContent.filename) - && Objects.equals(this.fileUrl, openAIInputFileContent.fileUrl) - && Objects.equals(this.fileData, openAIInputFileContent.fileData); - } - - @Override - public int hashCode() { - return Objects.hash(type, fileId, filename, fileUrl, fileData, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIInputFileContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); - sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); - sb.append(" fileUrl: ").append(toIndentedString(fileUrl)).append("\n"); - sb.append(" fileData: ").append(toIndentedString(fileData)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIInputFileContent} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIInputFileContent().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIInputFileContent} instance. - * - * @param type The type of the input item. Always `input_file`. - * @return The OpenAIInputFileContent instance. - */ - OpenAIInputFileContent type(@Nonnull final TypeEnum type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java deleted file mode 100644 index 8a6c94a82..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputImageContent.java +++ /dev/null @@ -1,371 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.net.URI; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * An image input to the model. Learn about [image - * inputs](https://platform.openai.com/docs/guides/vision). - */ -// CHECKSTYLE:OFF -public class OpenAIInputImageContent -// CHECKSTYLE:ON -{ - /** The type of the input item. Always `input_image`. */ - public enum TypeEnum { - /** The INPUT_IMAGE option of this OpenAIInputImageContent */ - INPUT_IMAGE("input_image"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIInputImageContent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIInputImageContent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type = TypeEnum.INPUT_IMAGE; - - @JsonProperty("image_url") - private URI imageUrl; - - @JsonProperty("file_id") - private String fileId; - - @JsonProperty("detail") - private OpenAIImageDetail detail; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIInputImageContent. */ - protected OpenAIInputImageContent() {} - - /** - * Set the type of this {@link OpenAIInputImageContent} instance and return the same instance. - * - * @param type The type of the input item. Always `input_image`. - * @return The same instance of this {@link OpenAIInputImageContent} class - */ - @Nonnull - public OpenAIInputImageContent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the input item. Always `input_image`. - * - * @return type The type of this {@link OpenAIInputImageContent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIInputImageContent} instance. - * - * @param type The type of the input item. Always `input_image`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the imageUrl of this {@link OpenAIInputImageContent} instance and return the same instance. - * - * @param imageUrl The imageUrl of this {@link OpenAIInputImageContent} - * @return The same instance of this {@link OpenAIInputImageContent} class - */ - @Nonnull - public OpenAIInputImageContent imageUrl(@Nullable final URI imageUrl) { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get imageUrl - * - * @return imageUrl The imageUrl of this {@link OpenAIInputImageContent} instance. - */ - @Nullable - public URI getImageUrl() { - return imageUrl; - } - - /** - * Set the imageUrl of this {@link OpenAIInputImageContent} instance. - * - * @param imageUrl The imageUrl of this {@link OpenAIInputImageContent} - */ - public void setImageUrl(@Nullable final URI imageUrl) { - this.imageUrl = imageUrl; - } - - /** - * Set the fileId of this {@link OpenAIInputImageContent} instance and return the same instance. - * - * @param fileId The fileId of this {@link OpenAIInputImageContent} - * @return The same instance of this {@link OpenAIInputImageContent} class - */ - @Nonnull - public OpenAIInputImageContent fileId(@Nullable final String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get fileId - * - * @return fileId The fileId of this {@link OpenAIInputImageContent} instance. - */ - @Nullable - public String getFileId() { - return fileId; - } - - /** - * Set the fileId of this {@link OpenAIInputImageContent} instance. - * - * @param fileId The fileId of this {@link OpenAIInputImageContent} - */ - public void setFileId(@Nullable final String fileId) { - this.fileId = fileId; - } - - /** - * Set the detail of this {@link OpenAIInputImageContent} instance and return the same instance. - * - * @param detail The detail level of the image to be sent to the model. One of `high`, - * `low`, or `auto`. Defaults to `auto`. - * @return The same instance of this {@link OpenAIInputImageContent} class - */ - @Nonnull - public OpenAIInputImageContent detail(@Nonnull final OpenAIImageDetail detail) { - this.detail = detail; - return this; - } - - /** - * The detail level of the image to be sent to the model. One of `high`, - * `low`, or `auto`. Defaults to `auto`. - * - * @return detail The detail of this {@link OpenAIInputImageContent} instance. - */ - @Nonnull - public OpenAIImageDetail getDetail() { - return detail; - } - - /** - * Set the detail of this {@link OpenAIInputImageContent} instance. - * - * @param detail The detail level of the image to be sent to the model. One of `high`, - * `low`, or `auto`. Defaults to `auto`. - */ - public void setDetail(@Nonnull final OpenAIImageDetail detail) { - this.detail = detail; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIInputImageContent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIInputImageContent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIInputImageContent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIInputImageContent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (imageUrl != null) declaredFields.put("imageUrl", imageUrl); - if (fileId != null) declaredFields.put("fileId", fileId); - if (detail != null) declaredFields.put("detail", detail); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIInputImageContent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIInputImageContent openAIInputImageContent = (OpenAIInputImageContent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIInputImageContent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIInputImageContent.type) - && Objects.equals(this.imageUrl, openAIInputImageContent.imageUrl) - && Objects.equals(this.fileId, openAIInputImageContent.fileId) - && Objects.equals(this.detail, openAIInputImageContent.detail); - } - - @Override - public int hashCode() { - return Objects.hash(type, imageUrl, fileId, detail, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIInputImageContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); - sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); - sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIInputImageContent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> (detail) -> new OpenAIInputImageContent().type(type).detail(detail); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIInputImageContent} instance. - * - * @param type The type of the input item. Always `input_image`. - * @return The OpenAIInputImageContent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the detail of this {@link OpenAIInputImageContent} instance. - * - * @param detail The detail level of the image to be sent to the model. One of `high`, - * `low`, or `auto`. Defaults to `auto`. - * @return The OpenAIInputImageContent instance. - */ - OpenAIInputImageContent detail(@Nonnull final OpenAIImageDetail detail); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java deleted file mode 100644 index cc1f5d457..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItem.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIInputItem */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAIInputItem -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIInputItemType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIInputItem. */ - protected OpenAIInputItem() {} - - /** - * Set the type of this {@link OpenAIInputItem} instance and return the same instance. - * - * @param type The type of this {@link OpenAIInputItem} - * @return The same instance of this {@link OpenAIInputItem} class - */ - @Nonnull - public OpenAIInputItem type(@Nonnull final OpenAIInputItemType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIInputItem} instance. - */ - @Nonnull - public OpenAIInputItemType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIInputItem} instance. - * - * @param type The type of this {@link OpenAIInputItem} - */ - public void setType(@Nonnull final OpenAIInputItemType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIInputItem}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIInputItem} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIInputItem has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIInputItem} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIInputItem} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIInputItem openAIInputItem = (OpenAIInputItem) o; - return Objects.equals(this.cloudSdkCustomFields, openAIInputItem.cloudSdkCustomFields) - && Objects.equals(this.type, openAIInputItem.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIInputItem {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIInputItem} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIInputItem().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIInputItem} instance. - * - * @param type The type of this {@link OpenAIInputItem} - * @return The OpenAIInputItem instance. - */ - OpenAIInputItem type(@Nonnull final OpenAIInputItemType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java deleted file mode 100644 index 5cb83e869..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputItemType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIInputItemType */ -public interface OpenAIInputItemType { - /** Helper class to create {@code String } that implements {@link OpenAIInputItemType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIInputItemType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java deleted file mode 100644 index d7992457d..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputParam.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import java.util.List; -import javax.annotation.Nonnull; - -/** - * Text, image, or file inputs to the model, used to generate a response. Learn more: - [Text inputs - * and outputs](https://platform.openai.com/docs/guides/text) - [Image - * inputs](https://platform.openai.com/docs/guides/images) - [File - * inputs](https://platform.openai.com/docs/guides/pdf-files) - [Conversation - * state](https://platform.openai.com/docs/guides/conversation-state) - [Function - * calling](https://platform.openai.com/docs/guides/function-calling) - */ -public interface OpenAIInputParam { - /** - * Helper class to create {@code List } that implements {@link OpenAIInputParam}. - */ - record ListOfOpenAIInputItems( - @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) - implements OpenAIInputParam {} - - /** - * Creator to enable deserialization of {@code List }. - * - * @param val the value to use - * @return a new instance of {@link ListOfOpenAIInputItems}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static ListOfOpenAIInputItems createListOfOpenAIInputItems( - @Nonnull final List val) { - return new ListOfOpenAIInputItems(val); - } - - /** Helper class to create {@code String } that implements {@link OpenAIInputParam}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIInputParam {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java deleted file mode 100644 index dfce02e5f..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIInputTextContent.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A text input to the model. */ -// CHECKSTYLE:OFF -public class OpenAIInputTextContent -// CHECKSTYLE:ON -{ - /** The type of the input item. Always `input_text`. */ - public enum TypeEnum { - /** The INPUT_TEXT option of this OpenAIInputTextContent */ - INPUT_TEXT("input_text"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIInputTextContent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIInputTextContent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type = TypeEnum.INPUT_TEXT; - - @JsonProperty("text") - private String text; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIInputTextContent. */ - protected OpenAIInputTextContent() {} - - /** - * Set the type of this {@link OpenAIInputTextContent} instance and return the same instance. - * - * @param type The type of the input item. Always `input_text`. - * @return The same instance of this {@link OpenAIInputTextContent} class - */ - @Nonnull - public OpenAIInputTextContent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the input item. Always `input_text`. - * - * @return type The type of this {@link OpenAIInputTextContent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIInputTextContent} instance. - * - * @param type The type of the input item. Always `input_text`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the text of this {@link OpenAIInputTextContent} instance and return the same instance. - * - * @param text The text input to the model. - * @return The same instance of this {@link OpenAIInputTextContent} class - */ - @Nonnull - public OpenAIInputTextContent text(@Nonnull final String text) { - this.text = text; - return this; - } - - /** - * The text input to the model. - * - * @return text The text of this {@link OpenAIInputTextContent} instance. - */ - @Nonnull - public String getText() { - return text; - } - - /** - * Set the text of this {@link OpenAIInputTextContent} instance. - * - * @param text The text input to the model. - */ - public void setText(@Nonnull final String text) { - this.text = text; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIInputTextContent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIInputTextContent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIInputTextContent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIInputTextContent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (text != null) declaredFields.put("text", text); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIInputTextContent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIInputTextContent openAIInputTextContent = (OpenAIInputTextContent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIInputTextContent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIInputTextContent.type) - && Objects.equals(this.text, openAIInputTextContent.text); - } - - @Override - public int hashCode() { - return Objects.hash(type, text, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIInputTextContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIInputTextContent} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> (text) -> new OpenAIInputTextContent().type(type).text(text); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIInputTextContent} instance. - * - * @param type The type of the input item. Always `input_text`. - * @return The OpenAIInputTextContent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the text of this {@link OpenAIInputTextContent} instance. - * - * @param text The text input to the model. - * @return The OpenAIInputTextContent instance. - */ - OpenAIInputTextContent text(@Nonnull final String text); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java deleted file mode 100644 index 4ac76ec08..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResource.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Content item used to generate a response. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAIItemResource -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIItemResourceType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIItemResource. */ - protected OpenAIItemResource() {} - - /** - * Set the type of this {@link OpenAIItemResource} instance and return the same instance. - * - * @param type The type of this {@link OpenAIItemResource} - * @return The same instance of this {@link OpenAIItemResource} class - */ - @Nonnull - public OpenAIItemResource type(@Nonnull final OpenAIItemResourceType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIItemResource} instance. - */ - @Nonnull - public OpenAIItemResourceType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIItemResource} instance. - * - * @param type The type of this {@link OpenAIItemResource} - */ - public void setType(@Nonnull final OpenAIItemResourceType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIItemResource}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIItemResource} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIItemResource has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIItemResource} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIItemResource} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIItemResource openAIItemResource = (OpenAIItemResource) o; - return Objects.equals(this.cloudSdkCustomFields, openAIItemResource.cloudSdkCustomFields) - && Objects.equals(this.type, openAIItemResource.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIItemResource {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIItemResource} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIItemResource().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIItemResource} instance. - * - * @param type The type of this {@link OpenAIItemResource} - * @return The OpenAIItemResource instance. - */ - OpenAIItemResource type(@Nonnull final OpenAIItemResourceType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java deleted file mode 100644 index 82a36ce4c..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIItemResourceType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIItemResourceType */ -public interface OpenAIItemResourceType { - /** Helper class to create {@code String } that implements {@link OpenAIItemResourceType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIItemResourceType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java deleted file mode 100644 index 2ce36299e..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContent.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIOutputContent */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAIOutputContent -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIOutputContentType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIOutputContent. */ - protected OpenAIOutputContent() {} - - /** - * Set the type of this {@link OpenAIOutputContent} instance and return the same instance. - * - * @param type The type of this {@link OpenAIOutputContent} - * @return The same instance of this {@link OpenAIOutputContent} class - */ - @Nonnull - public OpenAIOutputContent type(@Nonnull final OpenAIOutputContentType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIOutputContent} instance. - */ - @Nonnull - public OpenAIOutputContentType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIOutputContent} instance. - * - * @param type The type of this {@link OpenAIOutputContent} - */ - public void setType(@Nonnull final OpenAIOutputContentType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIOutputContent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIOutputContent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIOutputContent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIOutputContent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIOutputContent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIOutputContent openAIOutputContent = (OpenAIOutputContent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIOutputContent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIOutputContent.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIOutputContent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIOutputContent} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIOutputContent().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIOutputContent} instance. - * - * @param type The type of this {@link OpenAIOutputContent} - * @return The OpenAIOutputContent instance. - */ - OpenAIOutputContent type(@Nonnull final OpenAIOutputContentType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java deleted file mode 100644 index 4e13287e2..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputContentType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIOutputContentType */ -public interface OpenAIOutputContentType { - /** Helper class to create {@code String } that implements {@link OpenAIOutputContentType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIOutputContentType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java deleted file mode 100644 index cdaf82f92..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItem.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIOutputItem */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAIOutputItem -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIOutputItemType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIOutputItem. */ - protected OpenAIOutputItem() {} - - /** - * Set the type of this {@link OpenAIOutputItem} instance and return the same instance. - * - * @param type The type of this {@link OpenAIOutputItem} - * @return The same instance of this {@link OpenAIOutputItem} class - */ - @Nonnull - public OpenAIOutputItem type(@Nonnull final OpenAIOutputItemType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIOutputItem} instance. - */ - @Nonnull - public OpenAIOutputItemType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIOutputItem} instance. - * - * @param type The type of this {@link OpenAIOutputItem} - */ - public void setType(@Nonnull final OpenAIOutputItemType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIOutputItem}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIOutputItem} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIOutputItem has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIOutputItem} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIOutputItem} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIOutputItem openAIOutputItem = (OpenAIOutputItem) o; - return Objects.equals(this.cloudSdkCustomFields, openAIOutputItem.cloudSdkCustomFields) - && Objects.equals(this.type, openAIOutputItem.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIOutputItem {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIOutputItem} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIOutputItem().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIOutputItem} instance. - * - * @param type The type of this {@link OpenAIOutputItem} - * @return The OpenAIOutputItem instance. - */ - OpenAIOutputItem type(@Nonnull final OpenAIOutputItemType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java deleted file mode 100644 index 347d0aca6..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIOutputItemType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIOutputItemType */ -public interface OpenAIOutputItemType { - /** Helper class to create {@code String } that implements {@link OpenAIOutputItemType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIOutputItemType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java deleted file mode 100644 index 304cb14bd..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIPrompt.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * Reference to a prompt template and its variables. [Learn - * more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - */ -// CHECKSTYLE:OFF -public class OpenAIPrompt -// CHECKSTYLE:ON -{ - @JsonProperty("id") - private String id; - - @JsonProperty("version") - private String version; - - @JsonProperty("variables") - private Object variables; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIPrompt. */ - protected OpenAIPrompt() {} - - /** - * Set the id of this {@link OpenAIPrompt} instance and return the same instance. - * - * @param id The unique identifier of the prompt template to use. - * @return The same instance of this {@link OpenAIPrompt} class - */ - @Nonnull - public OpenAIPrompt id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * The unique identifier of the prompt template to use. - * - * @return id The id of this {@link OpenAIPrompt} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link OpenAIPrompt} instance. - * - * @param id The unique identifier of the prompt template to use. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the version of this {@link OpenAIPrompt} instance and return the same instance. - * - * @param version The version of this {@link OpenAIPrompt} - * @return The same instance of this {@link OpenAIPrompt} class - */ - @Nonnull - public OpenAIPrompt version(@Nullable final String version) { - this.version = version; - return this; - } - - /** - * Get version - * - * @return version The version of this {@link OpenAIPrompt} instance. - */ - @Nullable - public String getVersion() { - return version; - } - - /** - * Set the version of this {@link OpenAIPrompt} instance. - * - * @param version The version of this {@link OpenAIPrompt} - */ - public void setVersion(@Nullable final String version) { - this.version = version; - } - - /** - * Set the variables of this {@link OpenAIPrompt} instance and return the same instance. - * - * @param variables Optional map of values to substitute in for variables in your prompt. The - * substitution values can either be strings, or other Response input types like images or - * files. - * @return The same instance of this {@link OpenAIPrompt} class - */ - @Nonnull - public OpenAIPrompt variables(@Nullable final Object variables) { - this.variables = variables; - return this; - } - - /** - * Optional map of values to substitute in for variables in your prompt. The substitution values - * can either be strings, or other Response input types like images or files. - * - * @return variables The variables of this {@link OpenAIPrompt} instance. - */ - @Nullable - public Object getVariables() { - return variables; - } - - /** - * Set the variables of this {@link OpenAIPrompt} instance. - * - * @param variables Optional map of values to substitute in for variables in your prompt. The - * substitution values can either be strings, or other Response input types like images or - * files. - */ - public void setVariables(@Nullable final Object variables) { - this.variables = variables; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIPrompt}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIPrompt} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIPrompt has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIPrompt} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (id != null) declaredFields.put("id", id); - if (version != null) declaredFields.put("version", version); - if (variables != null) declaredFields.put("variables", variables); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIPrompt} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIPrompt openAIPrompt = (OpenAIPrompt) o; - return Objects.equals(this.cloudSdkCustomFields, openAIPrompt.cloudSdkCustomFields) - && Objects.equals(this.id, openAIPrompt.id) - && Objects.equals(this.version, openAIPrompt.version) - && Objects.equals(this.variables, openAIPrompt.variables); - } - - @Override - public int hashCode() { - return Objects.hash(id, version, variables, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIPrompt {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" version: ").append(toIndentedString(version)).append("\n"); - sb.append(" variables: ").append(toIndentedString(variables)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIPrompt} instance - * with all required arguments. - */ - public static Builder create() { - return (id) -> new OpenAIPrompt().id(id); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link OpenAIPrompt} instance. - * - * @param id The unique identifier of the prompt template to use. - * @return The OpenAIPrompt instance. - */ - OpenAIPrompt id(@Nonnull final String id); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java deleted file mode 100644 index 18ba98898..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoning.java +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * **gpt-5 and o-series models only** Configuration options for [reasoning - * models](https://platform.openai.com/docs/guides/reasoning). - */ -// CHECKSTYLE:OFF -public class OpenAIReasoning -// CHECKSTYLE:ON -{ - @JsonProperty("effort") - private OpenAIReasoningEffort effort; - - /** Gets or Sets summary */ - public enum SummaryEnum { - /** The AUTO option of this OpenAIReasoning */ - AUTO("auto"), - - /** The CONCISE option of this OpenAIReasoning */ - CONCISE("concise"), - - /** The DETAILED option of this OpenAIReasoning */ - DETAILED("detailed"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIReasoning */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - SummaryEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIReasoning - */ - @JsonCreator - @Nullable - public static SummaryEnum fromValue(@Nonnull final String value) { - for (SummaryEnum b : SummaryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("summary") - private SummaryEnum summary; - - /** Gets or Sets generateSummary */ - public enum GenerateSummaryEnum { - /** The AUTO option of this OpenAIReasoning */ - AUTO("auto"), - - /** The CONCISE option of this OpenAIReasoning */ - CONCISE("concise"), - - /** The DETAILED option of this OpenAIReasoning */ - DETAILED("detailed"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIReasoning */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - GenerateSummaryEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIReasoning - */ - @JsonCreator - @Nullable - public static GenerateSummaryEnum fromValue(@Nonnull final String value) { - for (GenerateSummaryEnum b : GenerateSummaryEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("generate_summary") - private GenerateSummaryEnum generateSummary; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIReasoning. */ - protected OpenAIReasoning() {} - - /** - * Set the effort of this {@link OpenAIReasoning} instance and return the same instance. - * - * @param effort The effort of this {@link OpenAIReasoning} - * @return The same instance of this {@link OpenAIReasoning} class - */ - @Nonnull - public OpenAIReasoning effort(@Nullable final OpenAIReasoningEffort effort) { - this.effort = effort; - return this; - } - - /** - * Get effort - * - * @return effort The effort of this {@link OpenAIReasoning} instance. - */ - @Nullable - public OpenAIReasoningEffort getEffort() { - return effort; - } - - /** - * Set the effort of this {@link OpenAIReasoning} instance. - * - * @param effort The effort of this {@link OpenAIReasoning} - */ - public void setEffort(@Nullable final OpenAIReasoningEffort effort) { - this.effort = effort; - } - - /** - * Set the summary of this {@link OpenAIReasoning} instance and return the same instance. - * - * @param summary The summary of this {@link OpenAIReasoning} - * @return The same instance of this {@link OpenAIReasoning} class - */ - @Nonnull - public OpenAIReasoning summary(@Nullable final SummaryEnum summary) { - this.summary = summary; - return this; - } - - /** - * Get summary - * - * @return summary The summary of this {@link OpenAIReasoning} instance. - */ - @Nullable - public SummaryEnum getSummary() { - return summary; - } - - /** - * Set the summary of this {@link OpenAIReasoning} instance. - * - * @param summary The summary of this {@link OpenAIReasoning} - */ - public void setSummary(@Nullable final SummaryEnum summary) { - this.summary = summary; - } - - /** - * Set the generateSummary of this {@link OpenAIReasoning} instance and return the same instance. - * - * @param generateSummary The generateSummary of this {@link OpenAIReasoning} - * @return The same instance of this {@link OpenAIReasoning} class - */ - @Nonnull - public OpenAIReasoning generateSummary(@Nullable final GenerateSummaryEnum generateSummary) { - this.generateSummary = generateSummary; - return this; - } - - /** - * Get generateSummary - * - * @return generateSummary The generateSummary of this {@link OpenAIReasoning} instance. - */ - @Nullable - public GenerateSummaryEnum getGenerateSummary() { - return generateSummary; - } - - /** - * Set the generateSummary of this {@link OpenAIReasoning} instance. - * - * @param generateSummary The generateSummary of this {@link OpenAIReasoning} - */ - public void setGenerateSummary(@Nullable final GenerateSummaryEnum generateSummary) { - this.generateSummary = generateSummary; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIReasoning}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIReasoning} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIReasoning has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIReasoning} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (effort != null) declaredFields.put("effort", effort); - if (summary != null) declaredFields.put("summary", summary); - if (generateSummary != null) declaredFields.put("generateSummary", generateSummary); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIReasoning} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIReasoning openAIReasoning = (OpenAIReasoning) o; - return Objects.equals(this.cloudSdkCustomFields, openAIReasoning.cloudSdkCustomFields) - && Objects.equals(this.effort, openAIReasoning.effort) - && Objects.equals(this.summary, openAIReasoning.summary) - && Objects.equals(this.generateSummary, openAIReasoning.generateSummary); - } - - @Override - public int hashCode() { - return Objects.hash(effort, summary, generateSummary, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIReasoning {\n"); - sb.append(" effort: ").append(toIndentedString(effort)).append("\n"); - sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); - sb.append(" generateSummary: ").append(toIndentedString(generateSummary)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link OpenAIReasoning} instance. No arguments are required. */ - public static OpenAIReasoning create() { - return new OpenAIReasoning(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java deleted file mode 100644 index 8d617103b..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIReasoningEffort.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** Gets or Sets OpenAI.ReasoningEffort */ -public enum OpenAIReasoningEffort { - NONE("none"), - - MINIMAL("minimal"), - - LOW("low"), - - MEDIUM("medium"), - - HIGH("high"), - - XHIGH("xhigh"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - OpenAIReasoningEffort(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static OpenAIReasoningEffort fromValue(@Nonnull final String value) { - for (final OpenAIReasoningEffort b : OpenAIReasoningEffort.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java deleted file mode 100644 index 984f00003..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponse.java +++ /dev/null @@ -1,1947 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIResponse */ -// CHECKSTYLE:OFF -public class OpenAIResponse -// CHECKSTYLE:ON -{ - @JsonProperty("metadata") - private Object metadata; - - @JsonProperty("top_logprobs") - private Integer topLogprobs; - - @JsonProperty("temperature") - private BigDecimal temperature; - - @JsonProperty("top_p") - private BigDecimal topP; - - @JsonProperty("user") - private String user; - - @JsonProperty("safety_identifier") - private String safetyIdentifier; - - @JsonProperty("prompt_cache_key") - private String promptCacheKey; - - /** Gets or Sets promptCacheRetention */ - public enum PromptCacheRetentionEnum { - /** The IN_MEMORY option of this OpenAIResponse */ - IN_MEMORY("in-memory"), - - /** The _24H option of this OpenAIResponse */ - _24H("24h"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - PromptCacheRetentionEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponse - */ - @JsonCreator - @Nullable - public static PromptCacheRetentionEnum fromValue(@Nonnull final String value) { - for (PromptCacheRetentionEnum b : PromptCacheRetentionEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("prompt_cache_retention") - private PromptCacheRetentionEnum promptCacheRetention; - - @JsonProperty("previous_response_id") - private String previousResponseId; - - @JsonProperty("model") - private String model; - - @JsonProperty("reasoning") - private OpenAIReasoning reasoning; - - @JsonProperty("background") - private Boolean background; - - @JsonProperty("max_output_tokens") - private Integer maxOutputTokens; - - @JsonProperty("max_tool_calls") - private Integer maxToolCalls; - - @JsonProperty("text") - private OpenAIResponseTextParam text; - - @JsonProperty("tools") - private List tools = new ArrayList<>(); - - @JsonProperty("tool_choice") - private OpenAIToolChoiceParam toolChoice; - - @JsonProperty("prompt") - private OpenAIPrompt prompt; - - /** Gets or Sets truncation */ - public enum TruncationEnum { - /** The AUTO option of this OpenAIResponse */ - AUTO("auto"), - - /** The DISABLED option of this OpenAIResponse */ - DISABLED("disabled"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TruncationEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponse - */ - @JsonCreator - @Nullable - public static TruncationEnum fromValue(@Nonnull final String value) { - for (TruncationEnum b : TruncationEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - } - - @JsonProperty("truncation") - private TruncationEnum truncation; - - @JsonProperty("id") - private String id; - - /** The object type of this resource - always set to `response`. */ - public enum ObjectEnum { - /** The RESPONSE option of this OpenAIResponse */ - RESPONSE("response"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ObjectEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponse - */ - @JsonCreator - @Nonnull - public static ObjectEnum fromValue(@Nonnull final String value) { - for (ObjectEnum b : ObjectEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("object") - private ObjectEnum _object; - - /** - * The status of the response generation. One of `completed`, `failed`, - * `in_progress`, `cancelled`, `queued`, or `incomplete`. - */ - public enum StatusEnum { - /** The COMPLETED option of this OpenAIResponse */ - COMPLETED("completed"), - - /** The FAILED option of this OpenAIResponse */ - FAILED("failed"), - - /** The IN_PROGRESS option of this OpenAIResponse */ - IN_PROGRESS("in_progress"), - - /** The CANCELLED option of this OpenAIResponse */ - CANCELLED("cancelled"), - - /** The QUEUED option of this OpenAIResponse */ - QUEUED("queued"), - - /** The INCOMPLETE option of this OpenAIResponse */ - INCOMPLETE("incomplete"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponse */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponse - */ - @JsonCreator - @Nonnull - public static StatusEnum fromValue(@Nonnull final String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("created_at") - private Integer createdAt; - - @JsonProperty("completed_at") - private OffsetDateTime completedAt; - - @JsonProperty("error") - private OpenAIResponseError error; - - @JsonProperty("incomplete_details") - private OpenAIResponseIncompleteDetails incompleteDetails; - - @JsonProperty("output") - private List output = new ArrayList<>(); - - @JsonProperty("instructions") - private OpenAIResponseInstructions instructions; - - @JsonProperty("output_text") - private String outputText; - - @JsonProperty("usage") - private OpenAIResponseUsage usage; - - @JsonProperty("parallel_tool_calls") - private Boolean parallelToolCalls = true; - - @JsonProperty("conversation") - private OpenAIConversationReference conversation; - - @JsonProperty("content_filters") - private List contentFilters = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponse. */ - protected OpenAIResponse() {} - - /** - * Set the metadata of this {@link OpenAIResponse} instance and return the same instance. - * - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful - * for storing additional information about the object in a structured format, and querying - * for objects via API or the dashboard. Keys are strings with a maximum length of 64 - * characters. Values are strings with a maximum length of 512 characters. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse metadata(@Nullable final Object metadata) { - this.metadata = metadata; - return this; - } - - /** - * Set of 16 key-value pairs that can be attached to an object. This can be useful for storing - * additional information about the object in a structured format, and querying for objects via - * API or the dashboard. Keys are strings with a maximum length of 64 characters. Values are - * strings with a maximum length of 512 characters. - * - * @return metadata The metadata of this {@link OpenAIResponse} instance. - */ - @Nullable - public Object getMetadata() { - return metadata; - } - - /** - * Set the metadata of this {@link OpenAIResponse} instance. - * - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be useful - * for storing additional information about the object in a structured format, and querying - * for objects via API or the dashboard. Keys are strings with a maximum length of 64 - * characters. Values are strings with a maximum length of 512 characters. - */ - public void setMetadata(@Nullable final Object metadata) { - this.metadata = metadata; - } - - /** - * Set the topLogprobs of this {@link OpenAIResponse} instance and return the same instance. - * - * @param topLogprobs The topLogprobs of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse topLogprobs(@Nullable final Integer topLogprobs) { - this.topLogprobs = topLogprobs; - return this; - } - - /** - * Get topLogprobs - * - * @return topLogprobs The topLogprobs of this {@link OpenAIResponse} instance. - */ - @Nullable - public Integer getTopLogprobs() { - return topLogprobs; - } - - /** - * Set the topLogprobs of this {@link OpenAIResponse} instance. - * - * @param topLogprobs The topLogprobs of this {@link OpenAIResponse} - */ - public void setTopLogprobs(@Nullable final Integer topLogprobs) { - this.topLogprobs = topLogprobs; - } - - /** - * Set the temperature of this {@link OpenAIResponse} instance and return the same instance. - * - * @param temperature The temperature of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse temperature(@Nullable final BigDecimal temperature) { - this.temperature = temperature; - return this; - } - - /** - * Get temperature - * - * @return temperature The temperature of this {@link OpenAIResponse} instance. - */ - @Nullable - public BigDecimal getTemperature() { - return temperature; - } - - /** - * Set the temperature of this {@link OpenAIResponse} instance. - * - * @param temperature The temperature of this {@link OpenAIResponse} - */ - public void setTemperature(@Nullable final BigDecimal temperature) { - this.temperature = temperature; - } - - /** - * Set the topP of this {@link OpenAIResponse} instance and return the same instance. - * - * @param topP The topP of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse topP(@Nullable final BigDecimal topP) { - this.topP = topP; - return this; - } - - /** - * Get topP - * - * @return topP The topP of this {@link OpenAIResponse} instance. - */ - @Nullable - public BigDecimal getTopP() { - return topP; - } - - /** - * Set the topP of this {@link OpenAIResponse} instance. - * - * @param topP The topP of this {@link OpenAIResponse} - */ - public void setTopP(@Nullable final BigDecimal topP) { - this.topP = topP; - } - - /** - * Set the user of this {@link OpenAIResponse} instance and return the same instance. - * - * @param user This field is being replaced by `safety_identifier` and - * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching - * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by - * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse user(@Nullable final String user) { - this.user = user; - return this; - } - - /** - * This field is being replaced by `safety_identifier` and `prompt_cache_key`. - * Use `prompt_cache_key` instead to maintain caching optimizations. A stable identifier - * for your end-users. Used to boost cache hit rates by better bucketing similar requests and to - * help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * @return user The user of this {@link OpenAIResponse} instance. - * @deprecated - */ - @Deprecated - @Nonnull - public String getUser() { - return user; - } - - /** - * Set the user of this {@link OpenAIResponse} instance. - * - * @param user This field is being replaced by `safety_identifier` and - * `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching - * optimizations. A stable identifier for your end-users. Used to boost cache hit rates by - * better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - */ - public void setUser(@Nullable final String user) { - this.user = user; - } - - /** - * Set the safetyIdentifier of this {@link OpenAIResponse} instance and return the same instance. - * - * @param safetyIdentifier A stable identifier used to help detect users of your application that - * may be violating OpenAI's usage policies. The IDs should be a string that uniquely - * identifies each user. We recommend hashing their username or email address, in order to - * avoid sending us any identifying information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse safetyIdentifier(@Nullable final String safetyIdentifier) { - this.safetyIdentifier = safetyIdentifier; - return this; - } - - /** - * A stable identifier used to help detect users of your application that may be violating - * OpenAI's usage policies. The IDs should be a string that uniquely identifies each user. We - * recommend hashing their username or email address, in order to avoid sending us any identifying - * information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * @return safetyIdentifier The safetyIdentifier of this {@link OpenAIResponse} instance. - */ - @Nonnull - public String getSafetyIdentifier() { - return safetyIdentifier; - } - - /** - * Set the safetyIdentifier of this {@link OpenAIResponse} instance. - * - * @param safetyIdentifier A stable identifier used to help detect users of your application that - * may be violating OpenAI's usage policies. The IDs should be a string that uniquely - * identifies each user. We recommend hashing their username or email address, in order to - * avoid sending us any identifying information. [Learn - * more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - */ - public void setSafetyIdentifier(@Nullable final String safetyIdentifier) { - this.safetyIdentifier = safetyIdentifier; - } - - /** - * Set the promptCacheKey of this {@link OpenAIResponse} instance and return the same instance. - * - * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your - * cache hit rates. Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse promptCacheKey(@Nullable final String promptCacheKey) { - this.promptCacheKey = promptCacheKey; - return this; - } - - /** - * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. - * Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - * - * @return promptCacheKey The promptCacheKey of this {@link OpenAIResponse} instance. - */ - @Nonnull - public String getPromptCacheKey() { - return promptCacheKey; - } - - /** - * Set the promptCacheKey of this {@link OpenAIResponse} instance. - * - * @param promptCacheKey Used by OpenAI to cache responses for similar requests to optimize your - * cache hit rates. Replaces the `user` field. [Learn - * more](https://platform.openai.com/docs/guides/prompt-caching). - */ - public void setPromptCacheKey(@Nullable final String promptCacheKey) { - this.promptCacheKey = promptCacheKey; - } - - /** - * Set the promptCacheRetention of this {@link OpenAIResponse} instance and return the same - * instance. - * - * @param promptCacheRetention The promptCacheRetention of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse promptCacheRetention( - @Nullable final PromptCacheRetentionEnum promptCacheRetention) { - this.promptCacheRetention = promptCacheRetention; - return this; - } - - /** - * Get promptCacheRetention - * - * @return promptCacheRetention The promptCacheRetention of this {@link OpenAIResponse} instance. - */ - @Nullable - public PromptCacheRetentionEnum getPromptCacheRetention() { - return promptCacheRetention; - } - - /** - * Set the promptCacheRetention of this {@link OpenAIResponse} instance. - * - * @param promptCacheRetention The promptCacheRetention of this {@link OpenAIResponse} - */ - public void setPromptCacheRetention( - @Nullable final PromptCacheRetentionEnum promptCacheRetention) { - this.promptCacheRetention = promptCacheRetention; - } - - /** - * Set the previousResponseId of this {@link OpenAIResponse} instance and return the same - * instance. - * - * @param previousResponseId The previousResponseId of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse previousResponseId(@Nullable final String previousResponseId) { - this.previousResponseId = previousResponseId; - return this; - } - - /** - * Get previousResponseId - * - * @return previousResponseId The previousResponseId of this {@link OpenAIResponse} instance. - */ - @Nullable - public String getPreviousResponseId() { - return previousResponseId; - } - - /** - * Set the previousResponseId of this {@link OpenAIResponse} instance. - * - * @param previousResponseId The previousResponseId of this {@link OpenAIResponse} - */ - public void setPreviousResponseId(@Nullable final String previousResponseId) { - this.previousResponseId = previousResponseId; - } - - /** - * Set the model of this {@link OpenAIResponse} instance and return the same instance. - * - * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. - * OpenAI offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model - * guide](https://platform.openai.com/docs/models) to browse and compare available models. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse model(@Nullable final String model) { - this.model = model; - return this; - } - - /** - * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - * offers a wide range of models with different capabilities, performance characteristics, and - * price points. Refer to the [model guide](https://platform.openai.com/docs/models) to browse and - * compare available models. - * - * @return model The model of this {@link OpenAIResponse} instance. - */ - @Nonnull - public String getModel() { - return model; - } - - /** - * Set the model of this {@link OpenAIResponse} instance. - * - * @param model Model ID used to generate the response, like `gpt-4o` or `o3`. - * OpenAI offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model - * guide](https://platform.openai.com/docs/models) to browse and compare available models. - */ - public void setModel(@Nullable final String model) { - this.model = model; - } - - /** - * Set the reasoning of this {@link OpenAIResponse} instance and return the same instance. - * - * @param reasoning The reasoning of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse reasoning(@Nullable final OpenAIReasoning reasoning) { - this.reasoning = reasoning; - return this; - } - - /** - * Get reasoning - * - * @return reasoning The reasoning of this {@link OpenAIResponse} instance. - */ - @Nullable - public OpenAIReasoning getReasoning() { - return reasoning; - } - - /** - * Set the reasoning of this {@link OpenAIResponse} instance. - * - * @param reasoning The reasoning of this {@link OpenAIResponse} - */ - public void setReasoning(@Nullable final OpenAIReasoning reasoning) { - this.reasoning = reasoning; - } - - /** - * Set the background of this {@link OpenAIResponse} instance and return the same instance. - * - * @param background The background of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse background(@Nullable final Boolean background) { - this.background = background; - return this; - } - - /** - * Get background - * - * @return background The background of this {@link OpenAIResponse} instance. - */ - @Nullable - public Boolean isBackground() { - return background; - } - - /** - * Set the background of this {@link OpenAIResponse} instance. - * - * @param background The background of this {@link OpenAIResponse} - */ - public void setBackground(@Nullable final Boolean background) { - this.background = background; - } - - /** - * Set the maxOutputTokens of this {@link OpenAIResponse} instance and return the same instance. - * - * @param maxOutputTokens The maxOutputTokens of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse maxOutputTokens(@Nullable final Integer maxOutputTokens) { - this.maxOutputTokens = maxOutputTokens; - return this; - } - - /** - * Get maxOutputTokens - * - * @return maxOutputTokens The maxOutputTokens of this {@link OpenAIResponse} instance. - */ - @Nullable - public Integer getMaxOutputTokens() { - return maxOutputTokens; - } - - /** - * Set the maxOutputTokens of this {@link OpenAIResponse} instance. - * - * @param maxOutputTokens The maxOutputTokens of this {@link OpenAIResponse} - */ - public void setMaxOutputTokens(@Nullable final Integer maxOutputTokens) { - this.maxOutputTokens = maxOutputTokens; - } - - /** - * Set the maxToolCalls of this {@link OpenAIResponse} instance and return the same instance. - * - * @param maxToolCalls The maxToolCalls of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse maxToolCalls(@Nullable final Integer maxToolCalls) { - this.maxToolCalls = maxToolCalls; - return this; - } - - /** - * Get maxToolCalls - * - * @return maxToolCalls The maxToolCalls of this {@link OpenAIResponse} instance. - */ - @Nullable - public Integer getMaxToolCalls() { - return maxToolCalls; - } - - /** - * Set the maxToolCalls of this {@link OpenAIResponse} instance. - * - * @param maxToolCalls The maxToolCalls of this {@link OpenAIResponse} - */ - public void setMaxToolCalls(@Nullable final Integer maxToolCalls) { - this.maxToolCalls = maxToolCalls; - } - - /** - * Set the text of this {@link OpenAIResponse} instance and return the same instance. - * - * @param text The text of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse text(@Nullable final OpenAIResponseTextParam text) { - this.text = text; - return this; - } - - /** - * Get text - * - * @return text The text of this {@link OpenAIResponse} instance. - */ - @Nonnull - public OpenAIResponseTextParam getText() { - return text; - } - - /** - * Set the text of this {@link OpenAIResponse} instance. - * - * @param text The text of this {@link OpenAIResponse} - */ - public void setText(@Nullable final OpenAIResponseTextParam text) { - this.text = text; - } - - /** - * Set the tools of this {@link OpenAIResponse} instance and return the same instance. - * - * @param tools An array of tools the model may call while generating a response. You can specify - * which tool to use by setting the `tool_choice` parameter. We support the - * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that - * extend the model's capabilities, like [web - * search](https://platform.openai.com/docs/guides/tools-web-search) or [file - * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: - * Integrations with third-party systems via custom MCP servers or predefined connectors such - * as Google Drive and SharePoint. Learn more about [MCP - * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own - * code with strongly typed arguments and outputs. Learn more about [function - * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom - * tools to call your own code. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse tools(@Nullable final List tools) { - this.tools = tools; - return this; - } - - /** - * Add one tools instance to this {@link OpenAIResponse}. - * - * @param toolsItem The tools that should be added - * @return The same instance of type {@link OpenAIResponse} - */ - @Nonnull - public OpenAIResponse addToolsItem(@Nonnull final OpenAITool toolsItem) { - if (this.tools == null) { - this.tools = new ArrayList<>(); - } - this.tools.add(toolsItem); - return this; - } - - /** - * An array of tools the model may call while generating a response. You can specify which tool to - * use by setting the `tool_choice` parameter. We support the following categories of - * tools: - **Built-in tools**: Tools that are provided by OpenAI that extend the model's - * capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) or - * [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: Integrations - * with third-party systems via custom MCP servers or predefined connectors such as Google Drive - * and SharePoint. Learn more about [MCP - * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own code - * with strongly typed arguments and outputs. Learn more about [function - * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom - * tools to call your own code. - * - * @return tools The tools of this {@link OpenAIResponse} instance. - */ - @Nonnull - public List getTools() { - return tools; - } - - /** - * Set the tools of this {@link OpenAIResponse} instance. - * - * @param tools An array of tools the model may call while generating a response. You can specify - * which tool to use by setting the `tool_choice` parameter. We support the - * following categories of tools: - **Built-in tools**: Tools that are provided by OpenAI that - * extend the model's capabilities, like [web - * search](https://platform.openai.com/docs/guides/tools-web-search) or [file - * search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - **MCP Tools**: - * Integrations with third-party systems via custom MCP servers or predefined connectors such - * as Google Drive and SharePoint. Learn more about [MCP - * Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - **Function calls - * (custom tools)**: Functions that are defined by you, enabling the model to call your own - * code with strongly typed arguments and outputs. Learn more about [function - * calling](https://platform.openai.com/docs/guides/function-calling). You can also use custom - * tools to call your own code. - */ - public void setTools(@Nullable final List tools) { - this.tools = tools; - } - - /** - * Set the toolChoice of this {@link OpenAIResponse} instance and return the same instance. - * - * @param toolChoice The toolChoice of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse toolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { - this.toolChoice = toolChoice; - return this; - } - - /** - * Get toolChoice - * - * @return toolChoice The toolChoice of this {@link OpenAIResponse} instance. - */ - @Nonnull - public OpenAIToolChoiceParam getToolChoice() { - return toolChoice; - } - - /** - * Set the toolChoice of this {@link OpenAIResponse} instance. - * - * @param toolChoice The toolChoice of this {@link OpenAIResponse} - */ - public void setToolChoice(@Nullable final OpenAIToolChoiceParam toolChoice) { - this.toolChoice = toolChoice; - } - - /** - * Set the prompt of this {@link OpenAIResponse} instance and return the same instance. - * - * @param prompt The prompt of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse prompt(@Nullable final OpenAIPrompt prompt) { - this.prompt = prompt; - return this; - } - - /** - * Get prompt - * - * @return prompt The prompt of this {@link OpenAIResponse} instance. - */ - @Nonnull - public OpenAIPrompt getPrompt() { - return prompt; - } - - /** - * Set the prompt of this {@link OpenAIResponse} instance. - * - * @param prompt The prompt of this {@link OpenAIResponse} - */ - public void setPrompt(@Nullable final OpenAIPrompt prompt) { - this.prompt = prompt; - } - - /** - * Set the truncation of this {@link OpenAIResponse} instance and return the same instance. - * - * @param truncation The truncation of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse truncation(@Nullable final TruncationEnum truncation) { - this.truncation = truncation; - return this; - } - - /** - * Get truncation - * - * @return truncation The truncation of this {@link OpenAIResponse} instance. - */ - @Nullable - public TruncationEnum getTruncation() { - return truncation; - } - - /** - * Set the truncation of this {@link OpenAIResponse} instance. - * - * @param truncation The truncation of this {@link OpenAIResponse} - */ - public void setTruncation(@Nullable final TruncationEnum truncation) { - this.truncation = truncation; - } - - /** - * Set the id of this {@link OpenAIResponse} instance and return the same instance. - * - * @param id Unique identifier for this Response. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse id(@Nonnull final String id) { - this.id = id; - return this; - } - - /** - * Unique identifier for this Response. - * - * @return id The id of this {@link OpenAIResponse} instance. - */ - @Nonnull - public String getId() { - return id; - } - - /** - * Set the id of this {@link OpenAIResponse} instance. - * - * @param id Unique identifier for this Response. - */ - public void setId(@Nonnull final String id) { - this.id = id; - } - - /** - * Set the _object of this {@link OpenAIResponse} instance and return the same instance. - * - * @param _object The object type of this resource - always set to `response`. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse _object(@Nonnull final ObjectEnum _object) { - this._object = _object; - return this; - } - - /** - * The object type of this resource - always set to `response`. - * - * @return _object The _object of this {@link OpenAIResponse} instance. - */ - @Nonnull - public ObjectEnum getObject() { - return _object; - } - - /** - * Set the _object of this {@link OpenAIResponse} instance. - * - * @param _object The object type of this resource - always set to `response`. - */ - public void setObject(@Nonnull final ObjectEnum _object) { - this._object = _object; - } - - /** - * Set the status of this {@link OpenAIResponse} instance and return the same instance. - * - * @param status The status of the response generation. One of `completed`, - * `failed`, `in_progress`, `cancelled`, `queued`, or - * `incomplete`. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse status(@Nullable final StatusEnum status) { - this.status = status; - return this; - } - - /** - * The status of the response generation. One of `completed`, `failed`, - * `in_progress`, `cancelled`, `queued`, or `incomplete`. - * - * @return status The status of this {@link OpenAIResponse} instance. - */ - @Nonnull - public StatusEnum getStatus() { - return status; - } - - /** - * Set the status of this {@link OpenAIResponse} instance. - * - * @param status The status of the response generation. One of `completed`, - * `failed`, `in_progress`, `cancelled`, `queued`, or - * `incomplete`. - */ - public void setStatus(@Nullable final StatusEnum status) { - this.status = status; - } - - /** - * Set the createdAt of this {@link OpenAIResponse} instance and return the same instance. - * - * @param createdAt Unix timestamp (in seconds) of when this Response was created. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse createdAt(@Nonnull final Integer createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Unix timestamp (in seconds) of when this Response was created. - * - * @return createdAt The createdAt of this {@link OpenAIResponse} instance. - */ - @Nonnull - public Integer getCreatedAt() { - return createdAt; - } - - /** - * Set the createdAt of this {@link OpenAIResponse} instance. - * - * @param createdAt Unix timestamp (in seconds) of when this Response was created. - */ - public void setCreatedAt(@Nonnull final Integer createdAt) { - this.createdAt = createdAt; - } - - /** - * Set the completedAt of this {@link OpenAIResponse} instance and return the same instance. - * - * @param completedAt The completedAt of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse completedAt(@Nullable final OffsetDateTime completedAt) { - this.completedAt = completedAt; - return this; - } - - /** - * Get completedAt - * - * @return completedAt The completedAt of this {@link OpenAIResponse} instance. - */ - @Nullable - public OffsetDateTime getCompletedAt() { - return completedAt; - } - - /** - * Set the completedAt of this {@link OpenAIResponse} instance. - * - * @param completedAt The completedAt of this {@link OpenAIResponse} - */ - public void setCompletedAt(@Nullable final OffsetDateTime completedAt) { - this.completedAt = completedAt; - } - - /** - * Set the error of this {@link OpenAIResponse} instance and return the same instance. - * - * @param error The error of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse error(@Nullable final OpenAIResponseError error) { - this.error = error; - return this; - } - - /** - * Get error - * - * @return error The error of this {@link OpenAIResponse} instance. - */ - @Nullable - public OpenAIResponseError getError() { - return error; - } - - /** - * Set the error of this {@link OpenAIResponse} instance. - * - * @param error The error of this {@link OpenAIResponse} - */ - public void setError(@Nullable final OpenAIResponseError error) { - this.error = error; - } - - /** - * Set the incompleteDetails of this {@link OpenAIResponse} instance and return the same instance. - * - * @param incompleteDetails The incompleteDetails of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse incompleteDetails( - @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { - this.incompleteDetails = incompleteDetails; - return this; - } - - /** - * Get incompleteDetails - * - * @return incompleteDetails The incompleteDetails of this {@link OpenAIResponse} instance. - */ - @Nullable - public OpenAIResponseIncompleteDetails getIncompleteDetails() { - return incompleteDetails; - } - - /** - * Set the incompleteDetails of this {@link OpenAIResponse} instance. - * - * @param incompleteDetails The incompleteDetails of this {@link OpenAIResponse} - */ - public void setIncompleteDetails( - @Nullable final OpenAIResponseIncompleteDetails incompleteDetails) { - this.incompleteDetails = incompleteDetails; - } - - /** - * Set the output of this {@link OpenAIResponse} instance and return the same instance. - * - * @param output An array of content items generated by the model. - The length and order of items - * in the `output` array is dependent on the model's response. - Rather than - * accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse output(@Nonnull final List output) { - this.output = output; - return this; - } - - /** - * Add one output instance to this {@link OpenAIResponse}. - * - * @param outputItem The output that should be added - * @return The same instance of type {@link OpenAIResponse} - */ - @Nonnull - public OpenAIResponse addOutputItem(@Nonnull final OpenAIOutputItem outputItem) { - if (this.output == null) { - this.output = new ArrayList<>(); - } - this.output.add(outputItem); - return this; - } - - /** - * An array of content items generated by the model. - The length and order of items in the - * `output` array is dependent on the model's response. - Rather than accessing the - * first item in the `output` array and assuming it's an `assistant` - * message with the content generated by the model, you might consider using the - * `output_text` property where supported in SDKs. - * - * @return output The output of this {@link OpenAIResponse} instance. - */ - @Nonnull - public List getOutput() { - return output; - } - - /** - * Set the output of this {@link OpenAIResponse} instance. - * - * @param output An array of content items generated by the model. - The length and order of items - * in the `output` array is dependent on the model's response. - Rather than - * accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - */ - public void setOutput(@Nonnull final List output) { - this.output = output; - } - - /** - * Set the instructions of this {@link OpenAIResponse} instance and return the same instance. - * - * @param instructions The instructions of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse instructions(@Nullable final OpenAIResponseInstructions instructions) { - this.instructions = instructions; - return this; - } - - /** - * Get instructions - * - * @return instructions The instructions of this {@link OpenAIResponse} instance. - */ - @Nullable - public OpenAIResponseInstructions getInstructions() { - return instructions; - } - - /** - * Set the instructions of this {@link OpenAIResponse} instance. - * - * @param instructions The instructions of this {@link OpenAIResponse} - */ - public void setInstructions(@Nullable final OpenAIResponseInstructions instructions) { - this.instructions = instructions; - } - - /** - * Set the outputText of this {@link OpenAIResponse} instance and return the same instance. - * - * @param outputText The outputText of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse outputText(@Nullable final String outputText) { - this.outputText = outputText; - return this; - } - - /** - * Get outputText - * - * @return outputText The outputText of this {@link OpenAIResponse} instance. - */ - @Nullable - public String getOutputText() { - return outputText; - } - - /** - * Set the outputText of this {@link OpenAIResponse} instance. - * - * @param outputText The outputText of this {@link OpenAIResponse} - */ - public void setOutputText(@Nullable final String outputText) { - this.outputText = outputText; - } - - /** - * Set the usage of this {@link OpenAIResponse} instance and return the same instance. - * - * @param usage The usage of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse usage(@Nullable final OpenAIResponseUsage usage) { - this.usage = usage; - return this; - } - - /** - * Get usage - * - * @return usage The usage of this {@link OpenAIResponse} instance. - */ - @Nonnull - public OpenAIResponseUsage getUsage() { - return usage; - } - - /** - * Set the usage of this {@link OpenAIResponse} instance. - * - * @param usage The usage of this {@link OpenAIResponse} - */ - public void setUsage(@Nullable final OpenAIResponseUsage usage) { - this.usage = usage; - } - - /** - * Set the parallelToolCalls of this {@link OpenAIResponse} instance and return the same instance. - * - * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse parallelToolCalls(@Nonnull final Boolean parallelToolCalls) { - this.parallelToolCalls = parallelToolCalls; - return this; - } - - /** - * Whether to allow the model to run tool calls in parallel. - * - * @return parallelToolCalls The parallelToolCalls of this {@link OpenAIResponse} instance. - */ - @Nonnull - public Boolean isParallelToolCalls() { - return parallelToolCalls; - } - - /** - * Set the parallelToolCalls of this {@link OpenAIResponse} instance. - * - * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. - */ - public void setParallelToolCalls(@Nonnull final Boolean parallelToolCalls) { - this.parallelToolCalls = parallelToolCalls; - } - - /** - * Set the conversation of this {@link OpenAIResponse} instance and return the same instance. - * - * @param conversation The conversation of this {@link OpenAIResponse} - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse conversation(@Nullable final OpenAIConversationReference conversation) { - this.conversation = conversation; - return this; - } - - /** - * Get conversation - * - * @return conversation The conversation of this {@link OpenAIResponse} instance. - */ - @Nullable - public OpenAIConversationReference getConversation() { - return conversation; - } - - /** - * Set the conversation of this {@link OpenAIResponse} instance. - * - * @param conversation The conversation of this {@link OpenAIResponse} - */ - public void setConversation(@Nullable final OpenAIConversationReference conversation) { - this.conversation = conversation; - } - - /** - * Set the contentFilters of this {@link OpenAIResponse} instance and return the same instance. - * - * @param contentFilters The content filter results from RAI. - * @return The same instance of this {@link OpenAIResponse} class - */ - @Nonnull - public OpenAIResponse contentFilters( - @Nonnull final List contentFilters) { - this.contentFilters = contentFilters; - return this; - } - - /** - * Add one contentFilters instance to this {@link OpenAIResponse}. - * - * @param contentFiltersItem The contentFilters that should be added - * @return The same instance of type {@link OpenAIResponse} - */ - @Nonnull - public OpenAIResponse addContentFiltersItem( - @Nonnull final AzureContentFilterForResponsesAPI contentFiltersItem) { - if (this.contentFilters == null) { - this.contentFilters = new ArrayList<>(); - } - this.contentFilters.add(contentFiltersItem); - return this; - } - - /** - * The content filter results from RAI. - * - * @return contentFilters The contentFilters of this {@link OpenAIResponse} instance. - */ - @Nonnull - public List getContentFilters() { - return contentFilters; - } - - /** - * Set the contentFilters of this {@link OpenAIResponse} instance. - * - * @param contentFilters The content filter results from RAI. - */ - public void setContentFilters( - @Nonnull final List contentFilters) { - this.contentFilters = contentFilters; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponse}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponse} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAIResponse has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponse} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (metadata != null) declaredFields.put("metadata", metadata); - if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); - if (temperature != null) declaredFields.put("temperature", temperature); - if (topP != null) declaredFields.put("topP", topP); - if (user != null) declaredFields.put("user", user); - if (safetyIdentifier != null) declaredFields.put("safetyIdentifier", safetyIdentifier); - if (promptCacheKey != null) declaredFields.put("promptCacheKey", promptCacheKey); - if (promptCacheRetention != null) - declaredFields.put("promptCacheRetention", promptCacheRetention); - if (previousResponseId != null) declaredFields.put("previousResponseId", previousResponseId); - if (model != null) declaredFields.put("model", model); - if (reasoning != null) declaredFields.put("reasoning", reasoning); - if (background != null) declaredFields.put("background", background); - if (maxOutputTokens != null) declaredFields.put("maxOutputTokens", maxOutputTokens); - if (maxToolCalls != null) declaredFields.put("maxToolCalls", maxToolCalls); - if (text != null) declaredFields.put("text", text); - if (tools != null) declaredFields.put("tools", tools); - if (toolChoice != null) declaredFields.put("toolChoice", toolChoice); - if (prompt != null) declaredFields.put("prompt", prompt); - if (truncation != null) declaredFields.put("truncation", truncation); - if (id != null) declaredFields.put("id", id); - if (_object != null) declaredFields.put("_object", _object); - if (status != null) declaredFields.put("status", status); - if (createdAt != null) declaredFields.put("createdAt", createdAt); - if (completedAt != null) declaredFields.put("completedAt", completedAt); - if (error != null) declaredFields.put("error", error); - if (incompleteDetails != null) declaredFields.put("incompleteDetails", incompleteDetails); - if (output != null) declaredFields.put("output", output); - if (instructions != null) declaredFields.put("instructions", instructions); - if (outputText != null) declaredFields.put("outputText", outputText); - if (usage != null) declaredFields.put("usage", usage); - if (parallelToolCalls != null) declaredFields.put("parallelToolCalls", parallelToolCalls); - if (conversation != null) declaredFields.put("conversation", conversation); - if (contentFilters != null) declaredFields.put("contentFilters", contentFilters); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponse} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponse openAIResponse = (OpenAIResponse) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponse.cloudSdkCustomFields) - && Objects.equals(this.metadata, openAIResponse.metadata) - && Objects.equals(this.topLogprobs, openAIResponse.topLogprobs) - && Objects.equals(this.temperature, openAIResponse.temperature) - && Objects.equals(this.topP, openAIResponse.topP) - && Objects.equals(this.user, openAIResponse.user) - && Objects.equals(this.safetyIdentifier, openAIResponse.safetyIdentifier) - && Objects.equals(this.promptCacheKey, openAIResponse.promptCacheKey) - && Objects.equals(this.promptCacheRetention, openAIResponse.promptCacheRetention) - && Objects.equals(this.previousResponseId, openAIResponse.previousResponseId) - && Objects.equals(this.model, openAIResponse.model) - && Objects.equals(this.reasoning, openAIResponse.reasoning) - && Objects.equals(this.background, openAIResponse.background) - && Objects.equals(this.maxOutputTokens, openAIResponse.maxOutputTokens) - && Objects.equals(this.maxToolCalls, openAIResponse.maxToolCalls) - && Objects.equals(this.text, openAIResponse.text) - && Objects.equals(this.tools, openAIResponse.tools) - && Objects.equals(this.toolChoice, openAIResponse.toolChoice) - && Objects.equals(this.prompt, openAIResponse.prompt) - && Objects.equals(this.truncation, openAIResponse.truncation) - && Objects.equals(this.id, openAIResponse.id) - && Objects.equals(this._object, openAIResponse._object) - && Objects.equals(this.status, openAIResponse.status) - && Objects.equals(this.createdAt, openAIResponse.createdAt) - && Objects.equals(this.completedAt, openAIResponse.completedAt) - && Objects.equals(this.error, openAIResponse.error) - && Objects.equals(this.incompleteDetails, openAIResponse.incompleteDetails) - && Objects.equals(this.output, openAIResponse.output) - && Objects.equals(this.instructions, openAIResponse.instructions) - && Objects.equals(this.outputText, openAIResponse.outputText) - && Objects.equals(this.usage, openAIResponse.usage) - && Objects.equals(this.parallelToolCalls, openAIResponse.parallelToolCalls) - && Objects.equals(this.conversation, openAIResponse.conversation) - && Objects.equals(this.contentFilters, openAIResponse.contentFilters); - } - - @Override - public int hashCode() { - return Objects.hash( - metadata, - topLogprobs, - temperature, - topP, - user, - safetyIdentifier, - promptCacheKey, - promptCacheRetention, - previousResponseId, - model, - reasoning, - background, - maxOutputTokens, - maxToolCalls, - text, - tools, - toolChoice, - prompt, - truncation, - id, - _object, - status, - createdAt, - completedAt, - error, - incompleteDetails, - output, - instructions, - outputText, - usage, - parallelToolCalls, - conversation, - contentFilters, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponse {\n"); - sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); - sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); - sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); - sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); - sb.append(" user: ").append(toIndentedString(user)).append("\n"); - sb.append(" safetyIdentifier: ").append(toIndentedString(safetyIdentifier)).append("\n"); - sb.append(" promptCacheKey: ").append(toIndentedString(promptCacheKey)).append("\n"); - sb.append(" promptCacheRetention: ") - .append(toIndentedString(promptCacheRetention)) - .append("\n"); - sb.append(" previousResponseId: ").append(toIndentedString(previousResponseId)).append("\n"); - sb.append(" model: ").append(toIndentedString(model)).append("\n"); - sb.append(" reasoning: ").append(toIndentedString(reasoning)).append("\n"); - sb.append(" background: ").append(toIndentedString(background)).append("\n"); - sb.append(" maxOutputTokens: ").append(toIndentedString(maxOutputTokens)).append("\n"); - sb.append(" maxToolCalls: ").append(toIndentedString(maxToolCalls)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); - sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); - sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); - sb.append(" truncation: ").append(toIndentedString(truncation)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); - sb.append(" completedAt: ").append(toIndentedString(completedAt)).append("\n"); - sb.append(" error: ").append(toIndentedString(error)).append("\n"); - sb.append(" incompleteDetails: ").append(toIndentedString(incompleteDetails)).append("\n"); - sb.append(" output: ").append(toIndentedString(output)).append("\n"); - sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); - sb.append(" outputText: ").append(toIndentedString(outputText)).append("\n"); - sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); - sb.append(" parallelToolCalls: ").append(toIndentedString(parallelToolCalls)).append("\n"); - sb.append(" conversation: ").append(toIndentedString(conversation)).append("\n"); - sb.append(" contentFilters: ").append(toIndentedString(contentFilters)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponse} - * instance with all required arguments. - */ - public static Builder create() { - return (id) -> - (_object) -> - (createdAt) -> - (error) -> - (incompleteDetails) -> - (output) -> - (instructions) -> - (parallelToolCalls) -> - (contentFilters) -> - new OpenAIResponse() - .id(id) - ._object(_object) - .createdAt(createdAt) - .error(error) - .incompleteDetails(incompleteDetails) - .output(output) - .instructions(instructions) - .parallelToolCalls(parallelToolCalls) - .contentFilters(contentFilters); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the id of this {@link OpenAIResponse} instance. - * - * @param id Unique identifier for this Response. - * @return The OpenAIResponse builder. - */ - Builder1 id(@Nonnull final String id); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the _object of this {@link OpenAIResponse} instance. - * - * @param _object The object type of this resource - always set to `response`. - * @return The OpenAIResponse builder. - */ - Builder2 _object(@Nonnull final ObjectEnum _object); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the createdAt of this {@link OpenAIResponse} instance. - * - * @param createdAt Unix timestamp (in seconds) of when this Response was created. - * @return The OpenAIResponse builder. - */ - Builder3 createdAt(@Nonnull final Integer createdAt); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the error of this {@link OpenAIResponse} instance. - * - * @param error The error of this {@link OpenAIResponse} - * @return The OpenAIResponse builder. - */ - Builder4 error(@Nullable final OpenAIResponseError error); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the incompleteDetails of this {@link OpenAIResponse} instance. - * - * @param incompleteDetails The incompleteDetails of this {@link OpenAIResponse} - * @return The OpenAIResponse builder. - */ - Builder5 incompleteDetails(@Nullable final OpenAIResponseIncompleteDetails incompleteDetails); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the output of this {@link OpenAIResponse} instance. - * - * @param output An array of content items generated by the model. - The length and order of - * items in the `output` array is dependent on the model's response. - Rather - * than accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - * @return The OpenAIResponse builder. - */ - Builder6 output(@Nonnull final List output); - - /** - * Set the output of this {@link OpenAIResponse} instance. - * - * @param output An array of content items generated by the model. - The length and order of - * items in the `output` array is dependent on the model's response. - Rather - * than accessing the first item in the `output` array and assuming it's an - * `assistant` message with the content generated by the model, you might consider - * using the `output_text` property where supported in SDKs. - * @return The OpenAIResponse builder. - */ - default Builder6 output(@Nonnull final OpenAIOutputItem... output) { - return output(Arrays.asList(output)); - } - } - - /** Builder helper class. */ - public interface Builder6 { - /** - * Set the instructions of this {@link OpenAIResponse} instance. - * - * @param instructions The instructions of this {@link OpenAIResponse} - * @return The OpenAIResponse builder. - */ - Builder7 instructions(@Nullable final OpenAIResponseInstructions instructions); - } - - /** Builder helper class. */ - public interface Builder7 { - /** - * Set the parallelToolCalls of this {@link OpenAIResponse} instance. - * - * @param parallelToolCalls Whether to allow the model to run tool calls in parallel. - * @return The OpenAIResponse builder. - */ - Builder8 parallelToolCalls(@Nonnull final Boolean parallelToolCalls); - } - - /** Builder helper class. */ - public interface Builder8 { - /** - * Set the contentFilters of this {@link OpenAIResponse} instance. - * - * @param contentFilters The content filter results from RAI. - * @return The OpenAIResponse instance. - */ - OpenAIResponse contentFilters( - @Nonnull final List contentFilters); - - /** - * Set the contentFilters of this {@link OpenAIResponse} instance. - * - * @param contentFilters The content filter results from RAI. - * @return The OpenAIResponse instance. - */ - default OpenAIResponse contentFilters( - @Nonnull final AzureContentFilterForResponsesAPI... contentFilters) { - return contentFilters(Arrays.asList(contentFilters)); - } - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java deleted file mode 100644 index b0c95d869..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioDeltaEvent.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when there is a partial audio response. */ -// CHECKSTYLE:OFF -public class OpenAIResponseAudioDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.audio.delta`. */ - public enum TypeEnum { - /** The RESPONSE_AUDIO_DELTA option of this OpenAIResponseAudioDeltaEvent */ - RESPONSE_AUDIO_DELTA("response.audio.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseAudioDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseAudioDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("delta") - private String delta; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseAudioDeltaEvent. */ - protected OpenAIResponseAudioDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseAudioDeltaEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.audio.delta`. - * @return The same instance of this {@link OpenAIResponseAudioDeltaEvent} class - */ - @Nonnull - public OpenAIResponseAudioDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.audio.delta`. - * - * @return type The type of this {@link OpenAIResponseAudioDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseAudioDeltaEvent} instance. - * - * @param type The type of the event. Always `response.audio.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} instance and return the - * same instance. - * - * @param sequenceNumber A sequence number for this chunk of the stream response. - * @return The same instance of this {@link OpenAIResponseAudioDeltaEvent} class - */ - @Nonnull - public OpenAIResponseAudioDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * A sequence number for this chunk of the stream response. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} instance. - * - * @param sequenceNumber A sequence number for this chunk of the stream response. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the delta of this {@link OpenAIResponseAudioDeltaEvent} instance and return the same - * instance. - * - * @param delta A chunk of Base64 encoded response audio bytes. - * @return The same instance of this {@link OpenAIResponseAudioDeltaEvent} class - */ - @Nonnull - public OpenAIResponseAudioDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * A chunk of Base64 encoded response audio bytes. - * - * @return delta The delta of this {@link OpenAIResponseAudioDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseAudioDeltaEvent} instance. - * - * @param delta A chunk of Base64 encoded response audio bytes. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseAudioDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseAudioDeltaEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseAudioDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseAudioDeltaEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (delta != null) declaredFields.put("delta", delta); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseAudioDeltaEvent} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseAudioDeltaEvent openAIResponseAudioDeltaEvent = - (OpenAIResponseAudioDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseAudioDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseAudioDeltaEvent.type) - && Objects.equals(this.sequenceNumber, openAIResponseAudioDeltaEvent.sequenceNumber) - && Objects.equals(this.delta, openAIResponseAudioDeltaEvent.delta); - } - - @Override - public int hashCode() { - return Objects.hash(type, sequenceNumber, delta, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseAudioDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseAudioDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (sequenceNumber) -> - (delta) -> - new OpenAIResponseAudioDeltaEvent() - .type(type) - .sequenceNumber(sequenceNumber) - .delta(delta); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseAudioDeltaEvent} instance. - * - * @param type The type of the event. Always `response.audio.delta`. - * @return The OpenAIResponseAudioDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseAudioDeltaEvent} instance. - * - * @param sequenceNumber A sequence number for this chunk of the stream response. - * @return The OpenAIResponseAudioDeltaEvent builder. - */ - Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the delta of this {@link OpenAIResponseAudioDeltaEvent} instance. - * - * @param delta A chunk of Base64 encoded response audio bytes. - * @return The OpenAIResponseAudioDeltaEvent instance. - */ - OpenAIResponseAudioDeltaEvent delta(@Nonnull final String delta); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java deleted file mode 100644 index 724d6ee42..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseAudioTranscriptDeltaEvent.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when there is a partial transcript of audio. */ -// CHECKSTYLE:OFF -public class OpenAIResponseAudioTranscriptDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.audio.transcript.delta`. */ - public enum TypeEnum { - /** - * The RESPONSE_AUDIO_TRANSCRIPT_DELTA option of this OpenAIResponseAudioTranscriptDeltaEvent - */ - RESPONSE_AUDIO_TRANSCRIPT_DELTA("response.audio.transcript.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseAudioTranscriptDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseAudioTranscriptDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseAudioTranscriptDeltaEvent. */ - protected OpenAIResponseAudioTranscriptDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always `response.audio.transcript.delta`. - * @return The same instance of this {@link OpenAIResponseAudioTranscriptDeltaEvent} class - */ - @Nonnull - public OpenAIResponseAudioTranscriptDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.audio.transcript.delta`. - * - * @return type The type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @param type The type of the event. Always `response.audio.transcript.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance and return the - * same instance. - * - * @param delta The partial transcript of the audio response. - * @return The same instance of this {@link OpenAIResponseAudioTranscriptDeltaEvent} class - */ - @Nonnull - public OpenAIResponseAudioTranscriptDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The partial transcript of the audio response. - * - * @return delta The delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @param delta The partial transcript of the audio response. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseAudioTranscriptDeltaEvent} class - */ - @Nonnull - public OpenAIResponseAudioTranscriptDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseAudioTranscriptDeltaEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseAudioTranscriptDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseAudioTranscriptDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseAudioTranscriptDeltaEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseAudioTranscriptDeltaEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseAudioTranscriptDeltaEvent openAIResponseAudioTranscriptDeltaEvent = - (OpenAIResponseAudioTranscriptDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseAudioTranscriptDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseAudioTranscriptDeltaEvent.type) - && Objects.equals(this.delta, openAIResponseAudioTranscriptDeltaEvent.delta) - && Objects.equals( - this.sequenceNumber, openAIResponseAudioTranscriptDeltaEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, delta, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseAudioTranscriptDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseAudioTranscriptDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (delta) -> - (sequenceNumber) -> - new OpenAIResponseAudioTranscriptDeltaEvent() - .type(type) - .delta(delta) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @param type The type of the event. Always `response.audio.transcript.delta`. - * @return The OpenAIResponseAudioTranscriptDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the delta of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @param delta The partial transcript of the audio response. - * @return The OpenAIResponseAudioTranscriptDeltaEvent builder. - */ - Builder2 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseAudioTranscriptDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseAudioTranscriptDeltaEvent instance. - */ - OpenAIResponseAudioTranscriptDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java deleted file mode 100644 index 60c80f61a..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallCodeDeltaEvent.java +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a partial code snippet is streamed by the code interpreter. */ -// CHECKSTYLE:OFF -public class OpenAIResponseCodeInterpreterCallCodeDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.code_interpreter_call_code.delta`. */ - public enum TypeEnum { - /** - * The RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA option of this - * OpenAIResponseCodeInterpreterCallCodeDeltaEvent - */ - RESPONSE_CODE_INTERPRETER_CALL_CODE_DELTA("response.code_interpreter_call_code.delta"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCodeInterpreterCallCodeDeltaEvent - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseCodeInterpreterCallCodeDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseCodeInterpreterCallCodeDeltaEvent. */ - protected OpenAIResponseCodeInterpreterCallCodeDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance and - * return the same instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call_code.delta`. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallCodeDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.code_interpreter_call_code.delta`. - * - * @return type The type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call_code.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance - * and return the same instance. - * - * @param outputIndex The index of the output item in the response for which the code is being - * streamed. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallCodeDeltaEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response for which the code is being streamed. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param outputIndex The index of the output item in the response for which the code is being - * streamed. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance and - * return the same instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallCodeDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the code interpreter tool call item. - * - * @return itemId The itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance and - * return the same instance. - * - * @param delta The partial code snippet being streamed by the code interpreter. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallCodeDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The partial code snippet being streamed by the code interpreter. - * - * @return delta The delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} - * instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param delta The partial code snippet being streamed by the code interpreter. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance - * and return the same instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallCodeDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event, used to order streaming events. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseCodeInterpreterCallCodeDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseCodeInterpreterCallCodeDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseCodeInterpreterCallCodeDeltaEvent - openAIResponseCodeInterpreterCallCodeDeltaEvent = - (OpenAIResponseCodeInterpreterCallCodeDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseCodeInterpreterCallCodeDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseCodeInterpreterCallCodeDeltaEvent.type) - && Objects.equals( - this.outputIndex, openAIResponseCodeInterpreterCallCodeDeltaEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseCodeInterpreterCallCodeDeltaEvent.itemId) - && Objects.equals(this.delta, openAIResponseCodeInterpreterCallCodeDeltaEvent.delta) - && Objects.equals( - this.sequenceNumber, openAIResponseCodeInterpreterCallCodeDeltaEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, delta, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseCodeInterpreterCallCodeDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (delta) -> - (sequenceNumber) -> - new OpenAIResponseCodeInterpreterCallCodeDeltaEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .delta(delta) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call_code.delta`. - * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param outputIndex The index of the output item in the response for which the code is being - * streamed. - * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the delta of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} instance. - * - * @param delta The partial code snippet being streamed by the code interpreter. - * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent builder. - */ - Builder4 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallCodeDeltaEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - * @return The OpenAIResponseCodeInterpreterCallCodeDeltaEvent instance. - */ - OpenAIResponseCodeInterpreterCallCodeDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java deleted file mode 100644 index 92eef17b2..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInProgressEvent.java +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a code interpreter call is in progress. */ -// CHECKSTYLE:OFF -public class OpenAIResponseCodeInterpreterCallInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.code_interpreter_call.in_progress`. */ - public enum TypeEnum { - /** - * The RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS option of this - * OpenAIResponseCodeInterpreterCallInProgressEvent - */ - RESPONSE_CODE_INTERPRETER_CALL_IN_PROGRESS("response.code_interpreter_call.in_progress"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCodeInterpreterCallInProgressEvent - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseCodeInterpreterCallInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseCodeInterpreterCallInProgressEvent. */ - protected OpenAIResponseCodeInterpreterCallInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance and - * return the same instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call.in_progress`. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.code_interpreter_call.in_progress`. - * - * @return type The type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call.in_progress`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance - * and return the same instance. - * - * @param outputIndex The index of the output item in the response for which the code interpreter - * call is in progress. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInProgressEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response for which the code interpreter call is in - * progress. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item in the response for which the code interpreter - * call is in progress. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance and - * return the same instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInProgressEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the code interpreter tool call item. - * - * @return itemId The itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance and return the same instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event, used to order streaming events. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseCodeInterpreterCallInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseCodeInterpreterCallInProgressEvent has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * OpenAIResponseCodeInterpreterCallInProgressEvent} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseCodeInterpreterCallInProgressEvent - openAIResponseCodeInterpreterCallInProgressEvent = - (OpenAIResponseCodeInterpreterCallInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseCodeInterpreterCallInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseCodeInterpreterCallInProgressEvent.type) - && Objects.equals( - this.outputIndex, openAIResponseCodeInterpreterCallInProgressEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseCodeInterpreterCallInProgressEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseCodeInterpreterCallInProgressEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseCodeInterpreterCallInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseCodeInterpreterCallInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseCodeInterpreterCallInProgressEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call.in_progress`. - * @return The OpenAIResponseCodeInterpreterCallInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance. - * - * @param outputIndex The index of the output item in the response for which the code - * interpreter call is in progress. - * @return The OpenAIResponseCodeInterpreterCallInProgressEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - * @return The OpenAIResponseCodeInterpreterCallInProgressEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInProgressEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - * @return The OpenAIResponseCodeInterpreterCallInProgressEvent instance. - */ - OpenAIResponseCodeInterpreterCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java deleted file mode 100644 index 0a7ae3698..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCodeInterpreterCallInterpretingEvent.java +++ /dev/null @@ -1,436 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when the code interpreter is actively interpreting the code snippet. */ -// CHECKSTYLE:OFF -public class OpenAIResponseCodeInterpreterCallInterpretingEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.code_interpreter_call.interpreting`. */ - public enum TypeEnum { - /** - * The RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING option of this - * OpenAIResponseCodeInterpreterCallInterpretingEvent - */ - RESPONSE_CODE_INTERPRETER_CALL_INTERPRETING("response.code_interpreter_call.interpreting"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this - * OpenAIResponseCodeInterpreterCallInterpretingEvent - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseCodeInterpreterCallInterpretingEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseCodeInterpreterCallInterpretingEvent. */ - protected OpenAIResponseCodeInterpreterCallInterpretingEvent() {} - - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance and - * return the same instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call.interpreting`. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInterpretingEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.code_interpreter_call.interpreting`. - * - * @return type The type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call.interpreting`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance - * and return the same instance. - * - * @param outputIndex The index of the output item in the response for which the code interpreter - * is interpreting code. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInterpretingEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response for which the code interpreter is interpreting - * code. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance. - * - * @param outputIndex The index of the output item in the response for which the code interpreter - * is interpreting code. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance and - * return the same instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInterpretingEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the code interpreter tool call item. - * - * @return itemId The itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance and return the same instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - * @return The same instance of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * class - */ - @Nonnull - public OpenAIResponseCodeInterpreterCallInterpretingEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event, used to order streaming events. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseCodeInterpreterCallInterpretingEvent has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. If the map previously contained a - * mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseCodeInterpreterCallInterpretingEvent - openAIResponseCodeInterpreterCallInterpretingEvent = - (OpenAIResponseCodeInterpreterCallInterpretingEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseCodeInterpreterCallInterpretingEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseCodeInterpreterCallInterpretingEvent.type) - && Objects.equals( - this.outputIndex, openAIResponseCodeInterpreterCallInterpretingEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseCodeInterpreterCallInterpretingEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseCodeInterpreterCallInterpretingEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseCodeInterpreterCallInterpretingEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseCodeInterpreterCallInterpretingEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseCodeInterpreterCallInterpretingEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - * - * @param type The type of the event. Always - * `response.code_interpreter_call.interpreting`. - * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance. - * - * @param outputIndex The index of the output item in the response for which the code - * interpreter is interpreting code. - * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} instance. - * - * @param itemId The unique identifier of the code interpreter tool call item. - * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseCodeInterpreterCallInterpretingEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event, used to order streaming events. - * @return The OpenAIResponseCodeInterpreterCallInterpretingEvent instance. - */ - OpenAIResponseCodeInterpreterCallInterpretingEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java deleted file mode 100644 index 69508d822..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseContentPartAddedEvent.java +++ /dev/null @@ -1,508 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a new content part is added. */ -// CHECKSTYLE:OFF -public class OpenAIResponseContentPartAddedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.content_part.added`. */ - public enum TypeEnum { - /** The RESPONSE_CONTENT_PART_ADDED option of this OpenAIResponseContentPartAddedEvent */ - RESPONSE_CONTENT_PART_ADDED("response.content_part.added"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseContentPartAddedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseContentPartAddedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("content_index") - private Integer contentIndex; - - @JsonProperty("part") - private OpenAIOutputContent part; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseContentPartAddedEvent. */ - protected OpenAIResponseContentPartAddedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseContentPartAddedEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.content_part.added`. - * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseContentPartAddedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.content_part.added`. - * - * @return type The type of this {@link OpenAIResponseContentPartAddedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param type The type of the event. Always `response.content_part.added`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseContentPartAddedEvent} instance and return the same - * instance. - * - * @param itemId The ID of the output item that the content part was added to. - * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseContentPartAddedEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the output item that the content part was added to. - * - * @return itemId The itemId of this {@link OpenAIResponseContentPartAddedEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param itemId The ID of the output item that the content part was added to. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseContentPartAddedEvent} instance and return the - * same instance. - * - * @param outputIndex The index of the output item that the content part was added to. - * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseContentPartAddedEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the content part was added to. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseContentPartAddedEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param outputIndex The index of the output item that the content part was added to. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseContentPartAddedEvent} instance and return - * the same instance. - * - * @param contentIndex The index of the content part that was added. - * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseContentPartAddedEvent contentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - return this; - } - - /** - * The index of the content part that was added. - * - * @return contentIndex The contentIndex of this {@link OpenAIResponseContentPartAddedEvent} - * instance. - */ - @Nonnull - public Integer getContentIndex() { - return contentIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param contentIndex The index of the content part that was added. - */ - public void setContentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - } - - /** - * Set the part of this {@link OpenAIResponseContentPartAddedEvent} instance and return the same - * instance. - * - * @param part The content part that was added. - * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseContentPartAddedEvent part(@Nonnull final OpenAIOutputContent part) { - this.part = part; - return this; - } - - /** - * The content part that was added. - * - * @return part The part of this {@link OpenAIResponseContentPartAddedEvent} instance. - */ - @Nonnull - public OpenAIOutputContent getPart() { - return part; - } - - /** - * Set the part of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param part The content part that was added. - */ - public void setPart(@Nonnull final OpenAIOutputContent part) { - this.part = part; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} instance and return - * the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseContentPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseContentPartAddedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseContentPartAddedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseContentPartAddedEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseContentPartAddedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseContentPartAddedEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); - if (part != null) declaredFields.put("part", part); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseContentPartAddedEvent} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseContentPartAddedEvent openAIResponseContentPartAddedEvent = - (OpenAIResponseContentPartAddedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseContentPartAddedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseContentPartAddedEvent.type) - && Objects.equals(this.itemId, openAIResponseContentPartAddedEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseContentPartAddedEvent.outputIndex) - && Objects.equals(this.contentIndex, openAIResponseContentPartAddedEvent.contentIndex) - && Objects.equals(this.part, openAIResponseContentPartAddedEvent.part) - && Objects.equals(this.sequenceNumber, openAIResponseContentPartAddedEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash( - type, itemId, outputIndex, contentIndex, part, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseContentPartAddedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); - sb.append(" part: ").append(toIndentedString(part)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseContentPartAddedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (contentIndex) -> - (part) -> - (sequenceNumber) -> - new OpenAIResponseContentPartAddedEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .contentIndex(contentIndex) - .part(part) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param type The type of the event. Always `response.content_part.added`. - * @return The OpenAIResponseContentPartAddedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param itemId The ID of the output item that the content part was added to. - * @return The OpenAIResponseContentPartAddedEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param outputIndex The index of the output item that the content part was added to. - * @return The OpenAIResponseContentPartAddedEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the contentIndex of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param contentIndex The index of the content part that was added. - * @return The OpenAIResponseContentPartAddedEvent builder. - */ - Builder4 contentIndex(@Nonnull final Integer contentIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the part of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param part The content part that was added. - * @return The OpenAIResponseContentPartAddedEvent builder. - */ - Builder5 part(@Nonnull final OpenAIOutputContent part); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseContentPartAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseContentPartAddedEvent instance. - */ - OpenAIResponseContentPartAddedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java deleted file mode 100644 index a53053733..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCreatedEvent.java +++ /dev/null @@ -1,347 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** An event that is emitted when a response is created. */ -// CHECKSTYLE:OFF -public class OpenAIResponseCreatedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.created`. */ - public enum TypeEnum { - /** The RESPONSE_CREATED option of this OpenAIResponseCreatedEvent */ - RESPONSE_CREATED("response.created"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCreatedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseCreatedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("response") - private OpenAIResponse response; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseCreatedEvent. */ - protected OpenAIResponseCreatedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseCreatedEvent} instance and return the same instance. - * - * @param type The type of the event. Always `response.created`. - * @return The same instance of this {@link OpenAIResponseCreatedEvent} class - */ - @Nonnull - public OpenAIResponseCreatedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.created`. - * - * @return type The type of this {@link OpenAIResponseCreatedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseCreatedEvent} instance. - * - * @param type The type of the event. Always `response.created`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the response of this {@link OpenAIResponseCreatedEvent} instance and return the same - * instance. - * - * @param response The response that was created. - * @return The same instance of this {@link OpenAIResponseCreatedEvent} class - */ - @Nonnull - public OpenAIResponseCreatedEvent response(@Nonnull final OpenAIResponse response) { - this.response = response; - return this; - } - - /** - * The response that was created. - * - * @return response The response of this {@link OpenAIResponseCreatedEvent} instance. - */ - @Nonnull - public OpenAIResponse getResponse() { - return response; - } - - /** - * Set the response of this {@link OpenAIResponseCreatedEvent} instance. - * - * @param response The response that was created. - */ - public void setResponse(@Nonnull final OpenAIResponse response) { - this.response = response; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance and return the same - * instance. - * - * @param sequenceNumber The sequence number for this event. - * @return The same instance of this {@link OpenAIResponseCreatedEvent} class - */ - @Nonnull - public OpenAIResponseCreatedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number for this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance. - * - * @param sequenceNumber The sequence number for this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseCreatedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseCreatedEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseCreatedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseCreatedEvent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (response != null) declaredFields.put("response", response); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseCreatedEvent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseCreatedEvent openAIResponseCreatedEvent = (OpenAIResponseCreatedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseCreatedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseCreatedEvent.type) - && Objects.equals(this.response, openAIResponseCreatedEvent.response) - && Objects.equals(this.sequenceNumber, openAIResponseCreatedEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseCreatedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseCreatedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (response) -> - (sequenceNumber) -> - new OpenAIResponseCreatedEvent() - .type(type) - .response(response) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseCreatedEvent} instance. - * - * @param type The type of the event. Always `response.created`. - * @return The OpenAIResponseCreatedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the response of this {@link OpenAIResponseCreatedEvent} instance. - * - * @param response The response that was created. - * @return The OpenAIResponseCreatedEvent builder. - */ - Builder2 response(@Nonnull final OpenAIResponse response); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseCreatedEvent} instance. - * - * @param sequenceNumber The sequence number for this event. - * @return The OpenAIResponseCreatedEvent instance. - */ - OpenAIResponseCreatedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java deleted file mode 100644 index b76d1fa43..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseCustomToolCallInputDeltaEvent.java +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Event representing a delta (partial update) to the input of a custom tool call. */ -// CHECKSTYLE:OFF -public class OpenAIResponseCustomToolCallInputDeltaEvent -// CHECKSTYLE:ON -{ - /** The event type identifier. */ - public enum TypeEnum { - /** - * The RESPONSE_CUSTOM_TOOL_CALL_INPUT_DELTA option of this - * OpenAIResponseCustomToolCallInputDeltaEvent - */ - RESPONSE_CUSTOM_TOOL_CALL_INPUT_DELTA("response.custom_tool_call_input.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseCustomToolCallInputDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseCustomToolCallInputDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("delta") - private String delta; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseCustomToolCallInputDeltaEvent. */ - protected OpenAIResponseCustomToolCallInputDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and return - * the same instance. - * - * @param type The event type identifier. - * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCustomToolCallInputDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The event type identifier. - * - * @return type The type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param type The event type identifier. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCustomToolCallInputDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseCustomToolCallInputDeltaEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output this delta applies to. - * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCustomToolCallInputDeltaEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output this delta applies to. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param outputIndex The index of the output this delta applies to. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and return - * the same instance. - * - * @param itemId Unique identifier for the API item associated with this event. - * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCustomToolCallInputDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * Unique identifier for the API item associated with this event. - * - * @return itemId The itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param itemId Unique identifier for the API item associated with this event. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance and return - * the same instance. - * - * @param delta The incremental input data (delta) for the custom tool call. - * @return The same instance of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} class - */ - @Nonnull - public OpenAIResponseCustomToolCallInputDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The incremental input data (delta) for the custom tool call. - * - * @return delta The delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param delta The incremental input data (delta) for the custom tool call. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseCustomToolCallInputDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseCustomToolCallInputDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (delta != null) declaredFields.put("delta", delta); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseCustomToolCallInputDeltaEvent openAIResponseCustomToolCallInputDeltaEvent = - (OpenAIResponseCustomToolCallInputDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseCustomToolCallInputDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseCustomToolCallInputDeltaEvent.type) - && Objects.equals( - this.sequenceNumber, openAIResponseCustomToolCallInputDeltaEvent.sequenceNumber) - && Objects.equals(this.outputIndex, openAIResponseCustomToolCallInputDeltaEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseCustomToolCallInputDeltaEvent.itemId) - && Objects.equals(this.delta, openAIResponseCustomToolCallInputDeltaEvent.delta); - } - - @Override - public int hashCode() { - return Objects.hash(type, sequenceNumber, outputIndex, itemId, delta, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseCustomToolCallInputDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseCustomToolCallInputDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (sequenceNumber) -> - (outputIndex) -> - (itemId) -> - (delta) -> - new OpenAIResponseCustomToolCallInputDeltaEvent() - .type(type) - .sequenceNumber(sequenceNumber) - .outputIndex(outputIndex) - .itemId(itemId) - .delta(delta); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param type The event type identifier. - * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. - */ - Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param outputIndex The index of the output this delta applies to. - * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the itemId of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param itemId Unique identifier for the API item associated with this event. - * @return The OpenAIResponseCustomToolCallInputDeltaEvent builder. - */ - Builder4 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the delta of this {@link OpenAIResponseCustomToolCallInputDeltaEvent} instance. - * - * @param delta The incremental input data (delta) for the custom tool call. - * @return The OpenAIResponseCustomToolCallInputDeltaEvent instance. - */ - OpenAIResponseCustomToolCallInputDeltaEvent delta(@Nonnull final String delta); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java deleted file mode 100644 index d0fc412e1..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseError.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** An error object returned when the model fails to generate a Response. */ -// CHECKSTYLE:OFF -public class OpenAIResponseError -// CHECKSTYLE:ON -{ - @JsonProperty("code") - private OpenAIResponseErrorCode code; - - @JsonProperty("message") - private String message; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseError. */ - protected OpenAIResponseError() {} - - /** - * Set the code of this {@link OpenAIResponseError} instance and return the same instance. - * - * @param code The code of this {@link OpenAIResponseError} - * @return The same instance of this {@link OpenAIResponseError} class - */ - @Nonnull - public OpenAIResponseError code(@Nonnull final OpenAIResponseErrorCode code) { - this.code = code; - return this; - } - - /** - * Get code - * - * @return code The code of this {@link OpenAIResponseError} instance. - */ - @Nonnull - public OpenAIResponseErrorCode getCode() { - return code; - } - - /** - * Set the code of this {@link OpenAIResponseError} instance. - * - * @param code The code of this {@link OpenAIResponseError} - */ - public void setCode(@Nonnull final OpenAIResponseErrorCode code) { - this.code = code; - } - - /** - * Set the message of this {@link OpenAIResponseError} instance and return the same instance. - * - * @param message A human-readable description of the error. - * @return The same instance of this {@link OpenAIResponseError} class - */ - @Nonnull - public OpenAIResponseError message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * A human-readable description of the error. - * - * @return message The message of this {@link OpenAIResponseError} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link OpenAIResponseError} instance. - * - * @param message A human-readable description of the error. - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseError}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseError} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseError has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseError} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (code != null) declaredFields.put("code", code); - if (message != null) declaredFields.put("message", message); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseError} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseError openAIResponseError = (OpenAIResponseError) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseError.cloudSdkCustomFields) - && Objects.equals(this.code, openAIResponseError.code) - && Objects.equals(this.message, openAIResponseError.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, message, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseError {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseError} - * instance with all required arguments. - */ - public static Builder create() { - return (code) -> (message) -> new OpenAIResponseError().code(code).message(message); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the code of this {@link OpenAIResponseError} instance. - * - * @param code The code of this {@link OpenAIResponseError} - * @return The OpenAIResponseError builder. - */ - Builder1 code(@Nonnull final OpenAIResponseErrorCode code); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the message of this {@link OpenAIResponseError} instance. - * - * @param message A human-readable description of the error. - * @return The OpenAIResponseError instance. - */ - OpenAIResponseError message(@Nonnull final String message); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java deleted file mode 100644 index fc51482c4..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorCode.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** The error code for the response. */ -public enum OpenAIResponseErrorCode { - SERVER_ERROR("server_error"), - - RATE_LIMIT_EXCEEDED("rate_limit_exceeded"), - - INVALID_PROMPT("invalid_prompt"), - - VECTOR_STORE_TIMEOUT("vector_store_timeout"), - - INVALID_IMAGE("invalid_image"), - - INVALID_IMAGE_FORMAT("invalid_image_format"), - - INVALID_BASE64_IMAGE("invalid_base64_image"), - - INVALID_IMAGE_URL("invalid_image_url"), - - IMAGE_TOO_LARGE("image_too_large"), - - IMAGE_TOO_SMALL("image_too_small"), - - IMAGE_PARSE_ERROR("image_parse_error"), - - IMAGE_CONTENT_POLICY_VIOLATION("image_content_policy_violation"), - - INVALID_IMAGE_MODE("invalid_image_mode"), - - IMAGE_FILE_TOO_LARGE("image_file_too_large"), - - UNSUPPORTED_IMAGE_MEDIA_TYPE("unsupported_image_media_type"), - - EMPTY_IMAGE_FILE("empty_image_file"), - - FAILED_TO_DOWNLOAD_IMAGE("failed_to_download_image"), - - IMAGE_FILE_NOT_FOUND("image_file_not_found"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - OpenAIResponseErrorCode(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static OpenAIResponseErrorCode fromValue(@Nonnull final String value) { - for (final OpenAIResponseErrorCode b : OpenAIResponseErrorCode.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java deleted file mode 100644 index d61535afb..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseErrorEvent.java +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when an error occurs. */ -// CHECKSTYLE:OFF -public class OpenAIResponseErrorEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `error`. */ - public enum TypeEnum { - /** The ERROR option of this OpenAIResponseErrorEvent */ - ERROR("error"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseErrorEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseErrorEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("code") - private String code; - - @JsonProperty("message") - private String message; - - @JsonProperty("param") - private String param; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseErrorEvent. */ - protected OpenAIResponseErrorEvent() {} - - /** - * Set the type of this {@link OpenAIResponseErrorEvent} instance and return the same instance. - * - * @param type The type of the event. Always `error`. - * @return The same instance of this {@link OpenAIResponseErrorEvent} class - */ - @Nonnull - public OpenAIResponseErrorEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `error`. - * - * @return type The type of this {@link OpenAIResponseErrorEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseErrorEvent} instance. - * - * @param type The type of the event. Always `error`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the code of this {@link OpenAIResponseErrorEvent} instance and return the same instance. - * - * @param code The code of this {@link OpenAIResponseErrorEvent} - * @return The same instance of this {@link OpenAIResponseErrorEvent} class - */ - @Nonnull - public OpenAIResponseErrorEvent code(@Nullable final String code) { - this.code = code; - return this; - } - - /** - * Get code - * - * @return code The code of this {@link OpenAIResponseErrorEvent} instance. - */ - @Nullable - public String getCode() { - return code; - } - - /** - * Set the code of this {@link OpenAIResponseErrorEvent} instance. - * - * @param code The code of this {@link OpenAIResponseErrorEvent} - */ - public void setCode(@Nullable final String code) { - this.code = code; - } - - /** - * Set the message of this {@link OpenAIResponseErrorEvent} instance and return the same instance. - * - * @param message The error message. - * @return The same instance of this {@link OpenAIResponseErrorEvent} class - */ - @Nonnull - public OpenAIResponseErrorEvent message(@Nonnull final String message) { - this.message = message; - return this; - } - - /** - * The error message. - * - * @return message The message of this {@link OpenAIResponseErrorEvent} instance. - */ - @Nonnull - public String getMessage() { - return message; - } - - /** - * Set the message of this {@link OpenAIResponseErrorEvent} instance. - * - * @param message The error message. - */ - public void setMessage(@Nonnull final String message) { - this.message = message; - } - - /** - * Set the param of this {@link OpenAIResponseErrorEvent} instance and return the same instance. - * - * @param param The param of this {@link OpenAIResponseErrorEvent} - * @return The same instance of this {@link OpenAIResponseErrorEvent} class - */ - @Nonnull - public OpenAIResponseErrorEvent param(@Nullable final String param) { - this.param = param; - return this; - } - - /** - * Get param - * - * @return param The param of this {@link OpenAIResponseErrorEvent} instance. - */ - @Nullable - public String getParam() { - return param; - } - - /** - * Set the param of this {@link OpenAIResponseErrorEvent} instance. - * - * @param param The param of this {@link OpenAIResponseErrorEvent} - */ - public void setParam(@Nullable final String param) { - this.param = param; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseErrorEvent} instance and return the same - * instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseErrorEvent} class - */ - @Nonnull - public OpenAIResponseErrorEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseErrorEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseErrorEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseErrorEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseErrorEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseErrorEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseErrorEvent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (code != null) declaredFields.put("code", code); - if (message != null) declaredFields.put("message", message); - if (param != null) declaredFields.put("param", param); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseErrorEvent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseErrorEvent openAIResponseErrorEvent = (OpenAIResponseErrorEvent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseErrorEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseErrorEvent.type) - && Objects.equals(this.code, openAIResponseErrorEvent.code) - && Objects.equals(this.message, openAIResponseErrorEvent.message) - && Objects.equals(this.param, openAIResponseErrorEvent.param) - && Objects.equals(this.sequenceNumber, openAIResponseErrorEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, code, message, param, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseErrorEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append(" param: ").append(toIndentedString(param)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseErrorEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (code) -> - (message) -> - (param) -> - (sequenceNumber) -> - new OpenAIResponseErrorEvent() - .type(type) - .code(code) - .message(message) - .param(param) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseErrorEvent} instance. - * - * @param type The type of the event. Always `error`. - * @return The OpenAIResponseErrorEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the code of this {@link OpenAIResponseErrorEvent} instance. - * - * @param code The code of this {@link OpenAIResponseErrorEvent} - * @return The OpenAIResponseErrorEvent builder. - */ - Builder2 code(@Nullable final String code); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the message of this {@link OpenAIResponseErrorEvent} instance. - * - * @param message The error message. - * @return The OpenAIResponseErrorEvent builder. - */ - Builder3 message(@Nonnull final String message); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the param of this {@link OpenAIResponseErrorEvent} instance. - * - * @param param The param of this {@link OpenAIResponseErrorEvent} - * @return The OpenAIResponseErrorEvent builder. - */ - Builder4 param(@Nullable final String param); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseErrorEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseErrorEvent instance. - */ - OpenAIResponseErrorEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java deleted file mode 100644 index 1b09e8689..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFailedEvent.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** An event that is emitted when a response fails. */ -// CHECKSTYLE:OFF -public class OpenAIResponseFailedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.failed`. */ - public enum TypeEnum { - /** The RESPONSE_FAILED option of this OpenAIResponseFailedEvent */ - RESPONSE_FAILED("response.failed"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFailedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseFailedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("response") - private OpenAIResponse response; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseFailedEvent. */ - protected OpenAIResponseFailedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseFailedEvent} instance and return the same instance. - * - * @param type The type of the event. Always `response.failed`. - * @return The same instance of this {@link OpenAIResponseFailedEvent} class - */ - @Nonnull - public OpenAIResponseFailedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.failed`. - * - * @return type The type of this {@link OpenAIResponseFailedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseFailedEvent} instance. - * - * @param type The type of the event. Always `response.failed`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFailedEvent} instance and return the same - * instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseFailedEvent} class - */ - @Nonnull - public OpenAIResponseFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseFailedEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFailedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the response of this {@link OpenAIResponseFailedEvent} instance and return the same - * instance. - * - * @param response The response that failed. - * @return The same instance of this {@link OpenAIResponseFailedEvent} class - */ - @Nonnull - public OpenAIResponseFailedEvent response(@Nonnull final OpenAIResponse response) { - this.response = response; - return this; - } - - /** - * The response that failed. - * - * @return response The response of this {@link OpenAIResponseFailedEvent} instance. - */ - @Nonnull - public OpenAIResponse getResponse() { - return response; - } - - /** - * Set the response of this {@link OpenAIResponseFailedEvent} instance. - * - * @param response The response that failed. - */ - public void setResponse(@Nonnull final OpenAIResponse response) { - this.response = response; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseFailedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseFailedEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseFailedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseFailedEvent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (response != null) declaredFields.put("response", response); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseFailedEvent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseFailedEvent openAIResponseFailedEvent = (OpenAIResponseFailedEvent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseFailedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseFailedEvent.type) - && Objects.equals(this.sequenceNumber, openAIResponseFailedEvent.sequenceNumber) - && Objects.equals(this.response, openAIResponseFailedEvent.response); - } - - @Override - public int hashCode() { - return Objects.hash(type, sequenceNumber, response, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseFailedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseFailedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (sequenceNumber) -> - (response) -> - new OpenAIResponseFailedEvent() - .type(type) - .sequenceNumber(sequenceNumber) - .response(response); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseFailedEvent} instance. - * - * @param type The type of the event. Always `response.failed`. - * @return The OpenAIResponseFailedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseFailedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseFailedEvent builder. - */ - Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the response of this {@link OpenAIResponseFailedEvent} instance. - * - * @param response The response that failed. - * @return The OpenAIResponseFailedEvent instance. - */ - OpenAIResponseFailedEvent response(@Nonnull final OpenAIResponse response); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java deleted file mode 100644 index 257ee0190..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallInProgressEvent.java +++ /dev/null @@ -1,412 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a file search call is initiated. */ -// CHECKSTYLE:OFF -public class OpenAIResponseFileSearchCallInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.file_search_call.in_progress`. */ - public enum TypeEnum { - /** - * The RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS option of this - * OpenAIResponseFileSearchCallInProgressEvent - */ - RESPONSE_FILE_SEARCH_CALL_IN_PROGRESS("response.file_search_call.in_progress"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFileSearchCallInProgressEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseFileSearchCallInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseFileSearchCallInProgressEvent. */ - protected OpenAIResponseFileSearchCallInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and return - * the same instance. - * - * @param type The type of the event. Always `response.file_search_call.in_progress`. - * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.file_search_call.in_progress`. - * - * @return type The type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param type The type of the event. Always `response.file_search_call.in_progress`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item that the file search call is initiated. - * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallInProgressEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the file search call is initiated. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item that the file search call is initiated. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and return - * the same instance. - * - * @param itemId The ID of the output item that the file search call is initiated. - * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallInProgressEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the output item that the file search call is initiated. - * - * @return itemId The itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param itemId The ID of the output item that the file search call is initiated. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseFileSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseFileSearchCallInProgressEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseFileSearchCallInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseFileSearchCallInProgressEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseFileSearchCallInProgressEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseFileSearchCallInProgressEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseFileSearchCallInProgressEvent openAIResponseFileSearchCallInProgressEvent = - (OpenAIResponseFileSearchCallInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseFileSearchCallInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseFileSearchCallInProgressEvent.type) - && Objects.equals(this.outputIndex, openAIResponseFileSearchCallInProgressEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseFileSearchCallInProgressEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseFileSearchCallInProgressEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseFileSearchCallInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseFileSearchCallInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseFileSearchCallInProgressEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param type The type of the event. Always `response.file_search_call.in_progress`. - * @return The OpenAIResponseFileSearchCallInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item that the file search call is initiated. - * @return The OpenAIResponseFileSearchCallInProgressEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param itemId The ID of the output item that the file search call is initiated. - * @return The OpenAIResponseFileSearchCallInProgressEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseFileSearchCallInProgressEvent instance. - */ - OpenAIResponseFileSearchCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java deleted file mode 100644 index 4df81087b..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFileSearchCallSearchingEvent.java +++ /dev/null @@ -1,412 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a file search is currently searching. */ -// CHECKSTYLE:OFF -public class OpenAIResponseFileSearchCallSearchingEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.file_search_call.searching`. */ - public enum TypeEnum { - /** - * The RESPONSE_FILE_SEARCH_CALL_SEARCHING option of this - * OpenAIResponseFileSearchCallSearchingEvent - */ - RESPONSE_FILE_SEARCH_CALL_SEARCHING("response.file_search_call.searching"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFileSearchCallSearchingEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseFileSearchCallSearchingEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseFileSearchCallSearchingEvent. */ - protected OpenAIResponseFileSearchCallSearchingEvent() {} - - /** - * Set the type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always `response.file_search_call.searching`. - * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallSearchingEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.file_search_call.searching`. - * - * @return type The type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param type The type of the event. Always `response.file_search_call.searching`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item that the file search call is searching. - * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallSearchingEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the file search call is searching. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param outputIndex The index of the output item that the file search call is searching. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and return - * the same instance. - * - * @param itemId The ID of the output item that the file search call is initiated. - * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallSearchingEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the output item that the file search call is initiated. - * - * @return itemId The itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param itemId The ID of the output item that the file search call is initiated. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseFileSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseFileSearchCallSearchingEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseFileSearchCallSearchingEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseFileSearchCallSearchingEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseFileSearchCallSearchingEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseFileSearchCallSearchingEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseFileSearchCallSearchingEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseFileSearchCallSearchingEvent openAIResponseFileSearchCallSearchingEvent = - (OpenAIResponseFileSearchCallSearchingEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseFileSearchCallSearchingEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseFileSearchCallSearchingEvent.type) - && Objects.equals(this.outputIndex, openAIResponseFileSearchCallSearchingEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseFileSearchCallSearchingEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseFileSearchCallSearchingEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseFileSearchCallSearchingEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseFileSearchCallSearchingEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseFileSearchCallSearchingEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param type The type of the event. Always `response.file_search_call.searching`. - * @return The OpenAIResponseFileSearchCallSearchingEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param outputIndex The index of the output item that the file search call is searching. - * @return The OpenAIResponseFileSearchCallSearchingEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param itemId The ID of the output item that the file search call is initiated. - * @return The OpenAIResponseFileSearchCallSearchingEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseFileSearchCallSearchingEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseFileSearchCallSearchingEvent instance. - */ - OpenAIResponseFileSearchCallSearchingEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java deleted file mode 100644 index 64757f503..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseFunctionCallArgumentsDeltaEvent.java +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when there is a partial function-call arguments delta. */ -// CHECKSTYLE:OFF -public class OpenAIResponseFunctionCallArgumentsDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.function_call_arguments.delta`. */ - public enum TypeEnum { - /** - * The RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA option of this - * OpenAIResponseFunctionCallArgumentsDeltaEvent - */ - RESPONSE_FUNCTION_CALL_ARGUMENTS_DELTA("response.function_call_arguments.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseFunctionCallArgumentsDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseFunctionCallArgumentsDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("delta") - private String delta; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseFunctionCallArgumentsDeltaEvent. */ - protected OpenAIResponseFunctionCallArgumentsDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and return - * the same instance. - * - * @param type The type of the event. Always `response.function_call_arguments.delta`. - * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseFunctionCallArgumentsDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.function_call_arguments.delta`. - * - * @return type The type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param type The type of the event. Always `response.function_call_arguments.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and - * return the same instance. - * - * @param itemId The ID of the output item that the function-call arguments delta is added to. - * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseFunctionCallArgumentsDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the output item that the function-call arguments delta is added to. - * - * @return itemId The itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param itemId The ID of the output item that the function-call arguments delta is added to. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item that the function-call arguments delta is added - * to. - * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseFunctionCallArgumentsDeltaEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the function-call arguments delta is added to. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param outputIndex The index of the output item that the function-call arguments delta is added - * to. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance - * and return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseFunctionCallArgumentsDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance and return - * the same instance. - * - * @param delta The function-call arguments delta that is added. - * @return The same instance of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseFunctionCallArgumentsDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The function-call arguments delta that is added. - * - * @return delta The delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param delta The function-call arguments delta that is added. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseFunctionCallArgumentsDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseFunctionCallArgumentsDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (delta != null) declaredFields.put("delta", delta); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseFunctionCallArgumentsDeltaEvent - openAIResponseFunctionCallArgumentsDeltaEvent = - (OpenAIResponseFunctionCallArgumentsDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseFunctionCallArgumentsDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseFunctionCallArgumentsDeltaEvent.type) - && Objects.equals(this.itemId, openAIResponseFunctionCallArgumentsDeltaEvent.itemId) - && Objects.equals( - this.outputIndex, openAIResponseFunctionCallArgumentsDeltaEvent.outputIndex) - && Objects.equals( - this.sequenceNumber, openAIResponseFunctionCallArgumentsDeltaEvent.sequenceNumber) - && Objects.equals(this.delta, openAIResponseFunctionCallArgumentsDeltaEvent.delta); - } - - @Override - public int hashCode() { - return Objects.hash(type, itemId, outputIndex, sequenceNumber, delta, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseFunctionCallArgumentsDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseFunctionCallArgumentsDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (sequenceNumber) -> - (delta) -> - new OpenAIResponseFunctionCallArgumentsDeltaEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .sequenceNumber(sequenceNumber) - .delta(delta); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param type The type of the event. Always `response.function_call_arguments.delta`. - * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param itemId The ID of the output item that the function-call arguments delta is added to. - * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param outputIndex The index of the output item that the function-call arguments delta is - * added to. - * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} - * instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent builder. - */ - Builder4 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the delta of this {@link OpenAIResponseFunctionCallArgumentsDeltaEvent} instance. - * - * @param delta The function-call arguments delta that is added. - * @return The OpenAIResponseFunctionCallArgumentsDeltaEvent instance. - */ - OpenAIResponseFunctionCallArgumentsDeltaEvent delta(@Nonnull final String delta); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java deleted file mode 100644 index 71b831c5f..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallGeneratingEvent.java +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * Emitted when an image generation tool call is actively generating an image (intermediate state). - */ -// CHECKSTYLE:OFF -public class OpenAIResponseImageGenCallGeneratingEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.image_generation_call.generating'. */ - public enum TypeEnum { - /** - * The RESPONSE_IMAGE_GENERATION_CALL_GENERATING option of this - * OpenAIResponseImageGenCallGeneratingEvent - */ - RESPONSE_IMAGE_GENERATION_CALL_GENERATING("response.image_generation_call.generating"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseImageGenCallGeneratingEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseImageGenCallGeneratingEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseImageGenCallGeneratingEvent. */ - protected OpenAIResponseImageGenCallGeneratingEvent() {} - - /** - * Set the type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always 'response.image_generation_call.generating'. - * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallGeneratingEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.image_generation_call.generating'. - * - * @return type The type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param type The type of the event. Always 'response.image_generation_call.generating'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallGeneratingEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response's output array. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and return - * the same instance. - * - * @param itemId The unique identifier of the image generation item being processed. - * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallGeneratingEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the image generation item being processed. - * - * @return itemId The itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param itemId The unique identifier of the image generation item being processed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - * @return The same instance of this {@link OpenAIResponseImageGenCallGeneratingEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallGeneratingEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of the image generation item being processed. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseImageGenCallGeneratingEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseImageGenCallGeneratingEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseImageGenCallGeneratingEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseImageGenCallGeneratingEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseImageGenCallGeneratingEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseImageGenCallGeneratingEvent openAIResponseImageGenCallGeneratingEvent = - (OpenAIResponseImageGenCallGeneratingEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseImageGenCallGeneratingEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseImageGenCallGeneratingEvent.type) - && Objects.equals(this.outputIndex, openAIResponseImageGenCallGeneratingEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseImageGenCallGeneratingEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseImageGenCallGeneratingEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseImageGenCallGeneratingEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseImageGenCallGeneratingEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseImageGenCallGeneratingEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param type The type of the event. Always - * 'response.image_generation_call.generating'. - * @return The OpenAIResponseImageGenCallGeneratingEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The OpenAIResponseImageGenCallGeneratingEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param itemId The unique identifier of the image generation item being processed. - * @return The OpenAIResponseImageGenCallGeneratingEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallGeneratingEvent} instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - * @return The OpenAIResponseImageGenCallGeneratingEvent instance. - */ - OpenAIResponseImageGenCallGeneratingEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java deleted file mode 100644 index d7330b646..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallInProgressEvent.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when an image generation tool call is in progress. */ -// CHECKSTYLE:OFF -public class OpenAIResponseImageGenCallInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.image_generation_call.in_progress'. */ - public enum TypeEnum { - /** - * The RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS option of this - * OpenAIResponseImageGenCallInProgressEvent - */ - RESPONSE_IMAGE_GENERATION_CALL_IN_PROGRESS("response.image_generation_call.in_progress"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseImageGenCallInProgressEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseImageGenCallInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseImageGenCallInProgressEvent. */ - protected OpenAIResponseImageGenCallInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always 'response.image_generation_call.in_progress'. - * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.image_generation_call.in_progress'. - * - * @return type The type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param type The type of the event. Always 'response.image_generation_call.in_progress'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallInProgressEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response's output array. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and return - * the same instance. - * - * @param itemId The unique identifier of the image generation item being processed. - * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallInProgressEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the image generation item being processed. - * - * @return itemId The itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param itemId The unique identifier of the image generation item being processed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallInProgressEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - * @return The same instance of this {@link OpenAIResponseImageGenCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of the image generation item being processed. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseImageGenCallInProgressEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseImageGenCallInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseImageGenCallInProgressEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseImageGenCallInProgressEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseImageGenCallInProgressEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseImageGenCallInProgressEvent openAIResponseImageGenCallInProgressEvent = - (OpenAIResponseImageGenCallInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseImageGenCallInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseImageGenCallInProgressEvent.type) - && Objects.equals(this.outputIndex, openAIResponseImageGenCallInProgressEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseImageGenCallInProgressEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseImageGenCallInProgressEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseImageGenCallInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseImageGenCallInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseImageGenCallInProgressEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param type The type of the event. Always - * 'response.image_generation_call.in_progress'. - * @return The OpenAIResponseImageGenCallInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The OpenAIResponseImageGenCallInProgressEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param itemId The unique identifier of the image generation item being processed. - * @return The OpenAIResponseImageGenCallInProgressEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - * @return The OpenAIResponseImageGenCallInProgressEvent instance. - */ - OpenAIResponseImageGenCallInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java deleted file mode 100644 index 3dcc2e6a4..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseImageGenCallPartialImageEvent.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a partial image is available during image generation streaming. */ -// CHECKSTYLE:OFF -public class OpenAIResponseImageGenCallPartialImageEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.image_generation_call.partial_image'. */ - public enum TypeEnum { - /** - * The RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE option of this - * OpenAIResponseImageGenCallPartialImageEvent - */ - RESPONSE_IMAGE_GENERATION_CALL_PARTIAL_IMAGE("response.image_generation_call.partial_image"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseImageGenCallPartialImageEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseImageGenCallPartialImageEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("partial_image_index") - private Integer partialImageIndex; - - @JsonProperty("partial_image_b64") - private String partialImageB64; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseImageGenCallPartialImageEvent. */ - protected OpenAIResponseImageGenCallPartialImageEvent() {} - - /** - * Set the type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and return - * the same instance. - * - * @param type The type of the event. Always - * 'response.image_generation_call.partial_image'. - * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallPartialImageEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.image_generation_call.partial_image'. - * - * @return type The type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param type The type of the event. Always - * 'response.image_generation_call.partial_image'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallPartialImageEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response's output array. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and return - * the same instance. - * - * @param itemId The unique identifier of the image generation item being processed. - * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallPartialImageEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the image generation item being processed. - * - * @return itemId The itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param itemId The unique identifier of the image generation item being processed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallPartialImageEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of the image generation item being processed. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseImageGenCallPartialImageEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the partialImageIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance - * and return the same instance. - * - * @param partialImageIndex 0-based index for the partial image (backend is 1-based, but this is - * 0-based for the user). - * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallPartialImageEvent partialImageIndex( - @Nonnull final Integer partialImageIndex) { - this.partialImageIndex = partialImageIndex; - return this; - } - - /** - * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). - * - * @return partialImageIndex The partialImageIndex of this {@link - * OpenAIResponseImageGenCallPartialImageEvent} instance. - */ - @Nonnull - public Integer getPartialImageIndex() { - return partialImageIndex; - } - - /** - * Set the partialImageIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param partialImageIndex 0-based index for the partial image (backend is 1-based, but this is - * 0-based for the user). - */ - public void setPartialImageIndex(@Nonnull final Integer partialImageIndex) { - this.partialImageIndex = partialImageIndex; - } - - /** - * Set the partialImageB64 of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance - * and return the same instance. - * - * @param partialImageB64 Base64-encoded partial image data, suitable for rendering as an image. - * @return The same instance of this {@link OpenAIResponseImageGenCallPartialImageEvent} class - */ - @Nonnull - public OpenAIResponseImageGenCallPartialImageEvent partialImageB64( - @Nonnull final String partialImageB64) { - this.partialImageB64 = partialImageB64; - return this; - } - - /** - * Base64-encoded partial image data, suitable for rendering as an image. - * - * @return partialImageB64 The partialImageB64 of this {@link - * OpenAIResponseImageGenCallPartialImageEvent} instance. - */ - @Nonnull - public String getPartialImageB64() { - return partialImageB64; - } - - /** - * Set the partialImageB64 of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param partialImageB64 Base64-encoded partial image data, suitable for rendering as an image. - */ - public void setPartialImageB64(@Nonnull final String partialImageB64) { - this.partialImageB64 = partialImageB64; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseImageGenCallPartialImageEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseImageGenCallPartialImageEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseImageGenCallPartialImageEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (partialImageIndex != null) declaredFields.put("partialImageIndex", partialImageIndex); - if (partialImageB64 != null) declaredFields.put("partialImageB64", partialImageB64); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseImageGenCallPartialImageEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseImageGenCallPartialImageEvent openAIResponseImageGenCallPartialImageEvent = - (OpenAIResponseImageGenCallPartialImageEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseImageGenCallPartialImageEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseImageGenCallPartialImageEvent.type) - && Objects.equals(this.outputIndex, openAIResponseImageGenCallPartialImageEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseImageGenCallPartialImageEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseImageGenCallPartialImageEvent.sequenceNumber) - && Objects.equals( - this.partialImageIndex, openAIResponseImageGenCallPartialImageEvent.partialImageIndex) - && Objects.equals( - this.partialImageB64, openAIResponseImageGenCallPartialImageEvent.partialImageB64); - } - - @Override - public int hashCode() { - return Objects.hash( - type, - outputIndex, - itemId, - sequenceNumber, - partialImageIndex, - partialImageB64, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseImageGenCallPartialImageEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" partialImageIndex: ").append(toIndentedString(partialImageIndex)).append("\n"); - sb.append(" partialImageB64: ").append(toIndentedString(partialImageB64)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseImageGenCallPartialImageEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - (partialImageIndex) -> - (partialImageB64) -> - new OpenAIResponseImageGenCallPartialImageEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber) - .partialImageIndex(partialImageIndex) - .partialImageB64(partialImageB64); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param type The type of the event. Always - * 'response.image_generation_call.partial_image'. - * @return The OpenAIResponseImageGenCallPartialImageEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The OpenAIResponseImageGenCallPartialImageEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param itemId The unique identifier of the image generation item being processed. - * @return The OpenAIResponseImageGenCallPartialImageEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param sequenceNumber The sequence number of the image generation item being processed. - * @return The OpenAIResponseImageGenCallPartialImageEvent builder. - */ - Builder4 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the partialImageIndex of this {@link OpenAIResponseImageGenCallPartialImageEvent} - * instance. - * - * @param partialImageIndex 0-based index for the partial image (backend is 1-based, but this is - * 0-based for the user). - * @return The OpenAIResponseImageGenCallPartialImageEvent builder. - */ - Builder5 partialImageIndex(@Nonnull final Integer partialImageIndex); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the partialImageB64 of this {@link OpenAIResponseImageGenCallPartialImageEvent} instance. - * - * @param partialImageB64 Base64-encoded partial image data, suitable for rendering as an image. - * @return The OpenAIResponseImageGenCallPartialImageEvent instance. - */ - OpenAIResponseImageGenCallPartialImageEvent partialImageB64( - @Nonnull final String partialImageB64); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java deleted file mode 100644 index 4ce18a6a3..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInProgressEvent.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when the response is in progress. */ -// CHECKSTYLE:OFF -public class OpenAIResponseInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.in_progress`. */ - public enum TypeEnum { - /** The RESPONSE_IN_PROGRESS option of this OpenAIResponseInProgressEvent */ - RESPONSE_IN_PROGRESS("response.in_progress"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseInProgressEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("response") - private OpenAIResponse response; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseInProgressEvent. */ - protected OpenAIResponseInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseInProgressEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.in_progress`. - * @return The same instance of this {@link OpenAIResponseInProgressEvent} class - */ - @Nonnull - public OpenAIResponseInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.in_progress`. - * - * @return type The type of this {@link OpenAIResponseInProgressEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseInProgressEvent} instance. - * - * @param type The type of the event. Always `response.in_progress`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the response of this {@link OpenAIResponseInProgressEvent} instance and return the same - * instance. - * - * @param response The response that is in progress. - * @return The same instance of this {@link OpenAIResponseInProgressEvent} class - */ - @Nonnull - public OpenAIResponseInProgressEvent response(@Nonnull final OpenAIResponse response) { - this.response = response; - return this; - } - - /** - * The response that is in progress. - * - * @return response The response of this {@link OpenAIResponseInProgressEvent} instance. - */ - @Nonnull - public OpenAIResponse getResponse() { - return response; - } - - /** - * Set the response of this {@link OpenAIResponseInProgressEvent} instance. - * - * @param response The response that is in progress. - */ - public void setResponse(@Nonnull final OpenAIResponse response) { - this.response = response; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseInProgressEvent} instance and return the - * same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseInProgressEvent} class - */ - @Nonnull - public OpenAIResponseInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseInProgressEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseInProgressEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseInProgressEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseInProgressEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (response != null) declaredFields.put("response", response); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseInProgressEvent} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseInProgressEvent openAIResponseInProgressEvent = - (OpenAIResponseInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseInProgressEvent.type) - && Objects.equals(this.response, openAIResponseInProgressEvent.response) - && Objects.equals(this.sequenceNumber, openAIResponseInProgressEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (response) -> - (sequenceNumber) -> - new OpenAIResponseInProgressEvent() - .type(type) - .response(response) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseInProgressEvent} instance. - * - * @param type The type of the event. Always `response.in_progress`. - * @return The OpenAIResponseInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the response of this {@link OpenAIResponseInProgressEvent} instance. - * - * @param response The response that is in progress. - * @return The OpenAIResponseInProgressEvent builder. - */ - Builder2 response(@Nonnull final OpenAIResponse response); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseInProgressEvent instance. - */ - OpenAIResponseInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java deleted file mode 100644 index 0cd076e36..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteDetails.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIResponseIncompleteDetails */ -// CHECKSTYLE:OFF -public class OpenAIResponseIncompleteDetails -// CHECKSTYLE:ON -{ - /** Gets or Sets reason */ - public enum ReasonEnum { - /** The MAX_OUTPUT_TOKENS option of this OpenAIResponseIncompleteDetails */ - MAX_OUTPUT_TOKENS("max_output_tokens"), - - /** The CONTENT_FILTER option of this OpenAIResponseIncompleteDetails */ - CONTENT_FILTER("content_filter"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseIncompleteDetails */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ReasonEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseIncompleteDetails - */ - @JsonCreator - @Nonnull - public static ReasonEnum fromValue(@Nonnull final String value) { - for (ReasonEnum b : ReasonEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("reason") - private ReasonEnum reason; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseIncompleteDetails. */ - protected OpenAIResponseIncompleteDetails() {} - - /** - * Set the reason of this {@link OpenAIResponseIncompleteDetails} instance and return the same - * instance. - * - * @param reason The reason of this {@link OpenAIResponseIncompleteDetails} - * @return The same instance of this {@link OpenAIResponseIncompleteDetails} class - */ - @Nonnull - public OpenAIResponseIncompleteDetails reason(@Nullable final ReasonEnum reason) { - this.reason = reason; - return this; - } - - /** - * Get reason - * - * @return reason The reason of this {@link OpenAIResponseIncompleteDetails} instance. - */ - @Nonnull - public ReasonEnum getReason() { - return reason; - } - - /** - * Set the reason of this {@link OpenAIResponseIncompleteDetails} instance. - * - * @param reason The reason of this {@link OpenAIResponseIncompleteDetails} - */ - public void setReason(@Nullable final ReasonEnum reason) { - this.reason = reason; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseIncompleteDetails}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseIncompleteDetails} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseIncompleteDetails has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseIncompleteDetails} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (reason != null) declaredFields.put("reason", reason); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseIncompleteDetails} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseIncompleteDetails openAIResponseIncompleteDetails = - (OpenAIResponseIncompleteDetails) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseIncompleteDetails.cloudSdkCustomFields) - && Objects.equals(this.reason, openAIResponseIncompleteDetails.reason); - } - - @Override - public int hashCode() { - return Objects.hash(reason, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseIncompleteDetails {\n"); - sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link OpenAIResponseIncompleteDetails} instance. No arguments are required. */ - public static OpenAIResponseIncompleteDetails create() { - return new OpenAIResponseIncompleteDetails(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java deleted file mode 100644 index 967e45f1a..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseIncompleteEvent.java +++ /dev/null @@ -1,351 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** An event that is emitted when a response finishes as incomplete. */ -// CHECKSTYLE:OFF -public class OpenAIResponseIncompleteEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.incomplete`. */ - public enum TypeEnum { - /** The RESPONSE_INCOMPLETE option of this OpenAIResponseIncompleteEvent */ - RESPONSE_INCOMPLETE("response.incomplete"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseIncompleteEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseIncompleteEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("response") - private OpenAIResponse response; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseIncompleteEvent. */ - protected OpenAIResponseIncompleteEvent() {} - - /** - * Set the type of this {@link OpenAIResponseIncompleteEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.incomplete`. - * @return The same instance of this {@link OpenAIResponseIncompleteEvent} class - */ - @Nonnull - public OpenAIResponseIncompleteEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.incomplete`. - * - * @return type The type of this {@link OpenAIResponseIncompleteEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseIncompleteEvent} instance. - * - * @param type The type of the event. Always `response.incomplete`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the response of this {@link OpenAIResponseIncompleteEvent} instance and return the same - * instance. - * - * @param response The response that was incomplete. - * @return The same instance of this {@link OpenAIResponseIncompleteEvent} class - */ - @Nonnull - public OpenAIResponseIncompleteEvent response(@Nonnull final OpenAIResponse response) { - this.response = response; - return this; - } - - /** - * The response that was incomplete. - * - * @return response The response of this {@link OpenAIResponseIncompleteEvent} instance. - */ - @Nonnull - public OpenAIResponse getResponse() { - return response; - } - - /** - * Set the response of this {@link OpenAIResponseIncompleteEvent} instance. - * - * @param response The response that was incomplete. - */ - public void setResponse(@Nonnull final OpenAIResponse response) { - this.response = response; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseIncompleteEvent} instance and return the - * same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseIncompleteEvent} class - */ - @Nonnull - public OpenAIResponseIncompleteEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseIncompleteEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseIncompleteEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseIncompleteEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseIncompleteEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseIncompleteEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseIncompleteEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (response != null) declaredFields.put("response", response); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseIncompleteEvent} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseIncompleteEvent openAIResponseIncompleteEvent = - (OpenAIResponseIncompleteEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseIncompleteEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseIncompleteEvent.type) - && Objects.equals(this.response, openAIResponseIncompleteEvent.response) - && Objects.equals(this.sequenceNumber, openAIResponseIncompleteEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseIncompleteEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseIncompleteEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (response) -> - (sequenceNumber) -> - new OpenAIResponseIncompleteEvent() - .type(type) - .response(response) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseIncompleteEvent} instance. - * - * @param type The type of the event. Always `response.incomplete`. - * @return The OpenAIResponseIncompleteEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the response of this {@link OpenAIResponseIncompleteEvent} instance. - * - * @param response The response that was incomplete. - * @return The OpenAIResponseIncompleteEvent builder. - */ - Builder2 response(@Nonnull final OpenAIResponse response); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseIncompleteEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseIncompleteEvent instance. - */ - OpenAIResponseIncompleteEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java deleted file mode 100644 index 651738624..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseInstructions.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import java.util.List; -import javax.annotation.Nonnull; - -/** OpenAIResponseInstructions */ -public interface OpenAIResponseInstructions { - /** - * Helper class to create {@code List } that implements {@link - * OpenAIResponseInstructions}. - */ - record ListOfOpenAIInputItems( - @com.fasterxml.jackson.annotation.JsonValue @Nonnull List values) - implements OpenAIResponseInstructions {} - - /** - * Creator to enable deserialization of {@code List }. - * - * @param val the value to use - * @return a new instance of {@link ListOfOpenAIInputItems}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static ListOfOpenAIInputItems createListOfOpenAIInputItems( - @Nonnull final List val) { - return new ListOfOpenAIInputItems(val); - } - - /** Helper class to create {@code String } that implements {@link OpenAIResponseInstructions}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIResponseInstructions {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java deleted file mode 100644 index 7ecd9047c..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseItemList.java +++ /dev/null @@ -1,471 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A list of Response items. */ -// CHECKSTYLE:OFF -public class OpenAIResponseItemList -// CHECKSTYLE:ON -{ - /** The type of object returned, must be `list`. */ - public enum ObjectEnum { - /** The LIST option of this OpenAIResponseItemList */ - LIST("list"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseItemList */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - ObjectEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseItemList - */ - @JsonCreator - @Nonnull - public static ObjectEnum fromValue(@Nonnull final String value) { - for (ObjectEnum b : ObjectEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("object") - private ObjectEnum _object; - - @JsonProperty("data") - private List data = new ArrayList<>(); - - @JsonProperty("has_more") - private Boolean hasMore; - - @JsonProperty("first_id") - private String firstId; - - @JsonProperty("last_id") - private String lastId; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseItemList. */ - protected OpenAIResponseItemList() {} - - /** - * Set the _object of this {@link OpenAIResponseItemList} instance and return the same instance. - * - * @param _object The type of object returned, must be `list`. - * @return The same instance of this {@link OpenAIResponseItemList} class - */ - @Nonnull - public OpenAIResponseItemList _object(@Nonnull final ObjectEnum _object) { - this._object = _object; - return this; - } - - /** - * The type of object returned, must be `list`. - * - * @return _object The _object of this {@link OpenAIResponseItemList} instance. - */ - @Nonnull - public ObjectEnum getObject() { - return _object; - } - - /** - * Set the _object of this {@link OpenAIResponseItemList} instance. - * - * @param _object The type of object returned, must be `list`. - */ - public void setObject(@Nonnull final ObjectEnum _object) { - this._object = _object; - } - - /** - * Set the data of this {@link OpenAIResponseItemList} instance and return the same instance. - * - * @param data A list of items used to generate this response. - * @return The same instance of this {@link OpenAIResponseItemList} class - */ - @Nonnull - public OpenAIResponseItemList data(@Nonnull final List data) { - this.data = data; - return this; - } - - /** - * Add one data instance to this {@link OpenAIResponseItemList}. - * - * @param dataItem The data that should be added - * @return The same instance of type {@link OpenAIResponseItemList} - */ - @Nonnull - public OpenAIResponseItemList addDataItem(@Nonnull final OpenAIItemResource dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - return this; - } - - /** - * A list of items used to generate this response. - * - * @return data The data of this {@link OpenAIResponseItemList} instance. - */ - @Nonnull - public List getData() { - return data; - } - - /** - * Set the data of this {@link OpenAIResponseItemList} instance. - * - * @param data A list of items used to generate this response. - */ - public void setData(@Nonnull final List data) { - this.data = data; - } - - /** - * Set the hasMore of this {@link OpenAIResponseItemList} instance and return the same instance. - * - * @param hasMore Whether there are more items available. - * @return The same instance of this {@link OpenAIResponseItemList} class - */ - @Nonnull - public OpenAIResponseItemList hasMore(@Nonnull final Boolean hasMore) { - this.hasMore = hasMore; - return this; - } - - /** - * Whether there are more items available. - * - * @return hasMore The hasMore of this {@link OpenAIResponseItemList} instance. - */ - @Nonnull - public Boolean isHasMore() { - return hasMore; - } - - /** - * Set the hasMore of this {@link OpenAIResponseItemList} instance. - * - * @param hasMore Whether there are more items available. - */ - public void setHasMore(@Nonnull final Boolean hasMore) { - this.hasMore = hasMore; - } - - /** - * Set the firstId of this {@link OpenAIResponseItemList} instance and return the same instance. - * - * @param firstId The ID of the first item in the list. - * @return The same instance of this {@link OpenAIResponseItemList} class - */ - @Nonnull - public OpenAIResponseItemList firstId(@Nonnull final String firstId) { - this.firstId = firstId; - return this; - } - - /** - * The ID of the first item in the list. - * - * @return firstId The firstId of this {@link OpenAIResponseItemList} instance. - */ - @Nonnull - public String getFirstId() { - return firstId; - } - - /** - * Set the firstId of this {@link OpenAIResponseItemList} instance. - * - * @param firstId The ID of the first item in the list. - */ - public void setFirstId(@Nonnull final String firstId) { - this.firstId = firstId; - } - - /** - * Set the lastId of this {@link OpenAIResponseItemList} instance and return the same instance. - * - * @param lastId The ID of the last item in the list. - * @return The same instance of this {@link OpenAIResponseItemList} class - */ - @Nonnull - public OpenAIResponseItemList lastId(@Nonnull final String lastId) { - this.lastId = lastId; - return this; - } - - /** - * The ID of the last item in the list. - * - * @return lastId The lastId of this {@link OpenAIResponseItemList} instance. - */ - @Nonnull - public String getLastId() { - return lastId; - } - - /** - * Set the lastId of this {@link OpenAIResponseItemList} instance. - * - * @param lastId The ID of the last item in the list. - */ - public void setLastId(@Nonnull final String lastId) { - this.lastId = lastId; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseItemList}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseItemList} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseItemList has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseItemList} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (_object != null) declaredFields.put("_object", _object); - if (data != null) declaredFields.put("data", data); - if (hasMore != null) declaredFields.put("hasMore", hasMore); - if (firstId != null) declaredFields.put("firstId", firstId); - if (lastId != null) declaredFields.put("lastId", lastId); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseItemList} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseItemList openAIResponseItemList = (OpenAIResponseItemList) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseItemList.cloudSdkCustomFields) - && Objects.equals(this._object, openAIResponseItemList._object) - && Objects.equals(this.data, openAIResponseItemList.data) - && Objects.equals(this.hasMore, openAIResponseItemList.hasMore) - && Objects.equals(this.firstId, openAIResponseItemList.firstId) - && Objects.equals(this.lastId, openAIResponseItemList.lastId); - } - - @Override - public int hashCode() { - return Objects.hash(_object, data, hasMore, firstId, lastId, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseItemList {\n"); - sb.append(" _object: ").append(toIndentedString(_object)).append("\n"); - sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" hasMore: ").append(toIndentedString(hasMore)).append("\n"); - sb.append(" firstId: ").append(toIndentedString(firstId)).append("\n"); - sb.append(" lastId: ").append(toIndentedString(lastId)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseItemList} - * instance with all required arguments. - */ - public static Builder create() { - return (_object) -> - (data) -> - (hasMore) -> - (firstId) -> - (lastId) -> - new OpenAIResponseItemList() - ._object(_object) - .data(data) - .hasMore(hasMore) - .firstId(firstId) - .lastId(lastId); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the _object of this {@link OpenAIResponseItemList} instance. - * - * @param _object The type of object returned, must be `list`. - * @return The OpenAIResponseItemList builder. - */ - Builder1 _object(@Nonnull final ObjectEnum _object); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the data of this {@link OpenAIResponseItemList} instance. - * - * @param data A list of items used to generate this response. - * @return The OpenAIResponseItemList builder. - */ - Builder2 data(@Nonnull final List data); - - /** - * Set the data of this {@link OpenAIResponseItemList} instance. - * - * @param data A list of items used to generate this response. - * @return The OpenAIResponseItemList builder. - */ - default Builder2 data(@Nonnull final OpenAIItemResource... data) { - return data(Arrays.asList(data)); - } - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the hasMore of this {@link OpenAIResponseItemList} instance. - * - * @param hasMore Whether there are more items available. - * @return The OpenAIResponseItemList builder. - */ - Builder3 hasMore(@Nonnull final Boolean hasMore); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the firstId of this {@link OpenAIResponseItemList} instance. - * - * @param firstId The ID of the first item in the list. - * @return The OpenAIResponseItemList builder. - */ - Builder4 firstId(@Nonnull final String firstId); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the lastId of this {@link OpenAIResponseItemList} instance. - * - * @param lastId The ID of the last item in the list. - * @return The OpenAIResponseItemList instance. - */ - OpenAIResponseItemList lastId(@Nonnull final String lastId); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java deleted file mode 100644 index 31b0c7c52..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProb.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * A logprob is the logarithmic probability that the model assigns to producing a particular token - * at a given position in the sequence. Less-negative (higher) logprob values indicate greater model - * confidence in that token choice. - */ -// CHECKSTYLE:OFF -public class OpenAIResponseLogProb -// CHECKSTYLE:ON -{ - @JsonProperty("token") - private String token; - - @JsonProperty("logprob") - private BigDecimal logprob; - - @JsonProperty("top_logprobs") - private List topLogprobs = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseLogProb. */ - protected OpenAIResponseLogProb() {} - - /** - * Set the token of this {@link OpenAIResponseLogProb} instance and return the same instance. - * - * @param token A possible text token. - * @return The same instance of this {@link OpenAIResponseLogProb} class - */ - @Nonnull - public OpenAIResponseLogProb token(@Nonnull final String token) { - this.token = token; - return this; - } - - /** - * A possible text token. - * - * @return token The token of this {@link OpenAIResponseLogProb} instance. - */ - @Nonnull - public String getToken() { - return token; - } - - /** - * Set the token of this {@link OpenAIResponseLogProb} instance. - * - * @param token A possible text token. - */ - public void setToken(@Nonnull final String token) { - this.token = token; - } - - /** - * Set the logprob of this {@link OpenAIResponseLogProb} instance and return the same instance. - * - * @param logprob The log probability of this token. - * @return The same instance of this {@link OpenAIResponseLogProb} class - */ - @Nonnull - public OpenAIResponseLogProb logprob(@Nonnull final BigDecimal logprob) { - this.logprob = logprob; - return this; - } - - /** - * The log probability of this token. - * - * @return logprob The logprob of this {@link OpenAIResponseLogProb} instance. - */ - @Nonnull - public BigDecimal getLogprob() { - return logprob; - } - - /** - * Set the logprob of this {@link OpenAIResponseLogProb} instance. - * - * @param logprob The log probability of this token. - */ - public void setLogprob(@Nonnull final BigDecimal logprob) { - this.logprob = logprob; - } - - /** - * Set the topLogprobs of this {@link OpenAIResponseLogProb} instance and return the same - * instance. - * - * @param topLogprobs The log probability of the top 20 most likely tokens. - * @return The same instance of this {@link OpenAIResponseLogProb} class - */ - @Nonnull - public OpenAIResponseLogProb topLogprobs( - @Nullable final List topLogprobs) { - this.topLogprobs = topLogprobs; - return this; - } - - /** - * Add one topLogprobs instance to this {@link OpenAIResponseLogProb}. - * - * @param topLogprobsItem The topLogprobs that should be added - * @return The same instance of type {@link OpenAIResponseLogProb} - */ - @Nonnull - public OpenAIResponseLogProb addTopLogprobsItem( - @Nonnull final OpenAIResponseLogProbTopLogprobs topLogprobsItem) { - if (this.topLogprobs == null) { - this.topLogprobs = new ArrayList<>(); - } - this.topLogprobs.add(topLogprobsItem); - return this; - } - - /** - * The log probability of the top 20 most likely tokens. - * - * @return topLogprobs The topLogprobs of this {@link OpenAIResponseLogProb} instance. - */ - @Nonnull - public List getTopLogprobs() { - return topLogprobs; - } - - /** - * Set the topLogprobs of this {@link OpenAIResponseLogProb} instance. - * - * @param topLogprobs The log probability of the top 20 most likely tokens. - */ - public void setTopLogprobs(@Nullable final List topLogprobs) { - this.topLogprobs = topLogprobs; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseLogProb}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseLogProb} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseLogProb has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseLogProb} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (token != null) declaredFields.put("token", token); - if (logprob != null) declaredFields.put("logprob", logprob); - if (topLogprobs != null) declaredFields.put("topLogprobs", topLogprobs); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseLogProb} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseLogProb openAIResponseLogProb = (OpenAIResponseLogProb) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseLogProb.cloudSdkCustomFields) - && Objects.equals(this.token, openAIResponseLogProb.token) - && Objects.equals(this.logprob, openAIResponseLogProb.logprob) - && Objects.equals(this.topLogprobs, openAIResponseLogProb.topLogprobs); - } - - @Override - public int hashCode() { - return Objects.hash(token, logprob, topLogprobs, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseLogProb {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" logprob: ").append(toIndentedString(logprob)).append("\n"); - sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseLogProb} - * instance with all required arguments. - */ - public static Builder create() { - return (token) -> (logprob) -> new OpenAIResponseLogProb().token(token).logprob(logprob); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the token of this {@link OpenAIResponseLogProb} instance. - * - * @param token A possible text token. - * @return The OpenAIResponseLogProb builder. - */ - Builder1 token(@Nonnull final String token); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the logprob of this {@link OpenAIResponseLogProb} instance. - * - * @param logprob The log probability of this token. - * @return The OpenAIResponseLogProb instance. - */ - OpenAIResponseLogProb logprob(@Nonnull final BigDecimal logprob); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java deleted file mode 100644 index 77e3aa350..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseLogProbTopLogprobs.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIResponseLogProbTopLogprobs */ -// CHECKSTYLE:OFF -public class OpenAIResponseLogProbTopLogprobs -// CHECKSTYLE:ON -{ - @JsonProperty("token") - private String token; - - @JsonProperty("logprob") - private BigDecimal logprob; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseLogProbTopLogprobs. */ - protected OpenAIResponseLogProbTopLogprobs() {} - - /** - * Set the token of this {@link OpenAIResponseLogProbTopLogprobs} instance and return the same - * instance. - * - * @param token The token of this {@link OpenAIResponseLogProbTopLogprobs} - * @return The same instance of this {@link OpenAIResponseLogProbTopLogprobs} class - */ - @Nonnull - public OpenAIResponseLogProbTopLogprobs token(@Nullable final String token) { - this.token = token; - return this; - } - - /** - * Get token - * - * @return token The token of this {@link OpenAIResponseLogProbTopLogprobs} instance. - */ - @Nonnull - public String getToken() { - return token; - } - - /** - * Set the token of this {@link OpenAIResponseLogProbTopLogprobs} instance. - * - * @param token The token of this {@link OpenAIResponseLogProbTopLogprobs} - */ - public void setToken(@Nullable final String token) { - this.token = token; - } - - /** - * Set the logprob of this {@link OpenAIResponseLogProbTopLogprobs} instance and return the same - * instance. - * - * @param logprob The logprob of this {@link OpenAIResponseLogProbTopLogprobs} - * @return The same instance of this {@link OpenAIResponseLogProbTopLogprobs} class - */ - @Nonnull - public OpenAIResponseLogProbTopLogprobs logprob(@Nullable final BigDecimal logprob) { - this.logprob = logprob; - return this; - } - - /** - * Get logprob - * - * @return logprob The logprob of this {@link OpenAIResponseLogProbTopLogprobs} instance. - */ - @Nonnull - public BigDecimal getLogprob() { - return logprob; - } - - /** - * Set the logprob of this {@link OpenAIResponseLogProbTopLogprobs} instance. - * - * @param logprob The logprob of this {@link OpenAIResponseLogProbTopLogprobs} - */ - public void setLogprob(@Nullable final BigDecimal logprob) { - this.logprob = logprob; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseLogProbTopLogprobs}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseLogProbTopLogprobs} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseLogProbTopLogprobs has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseLogProbTopLogprobs} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (token != null) declaredFields.put("token", token); - if (logprob != null) declaredFields.put("logprob", logprob); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseLogProbTopLogprobs} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseLogProbTopLogprobs openAIResponseLogProbTopLogprobs = - (OpenAIResponseLogProbTopLogprobs) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseLogProbTopLogprobs.cloudSdkCustomFields) - && Objects.equals(this.token, openAIResponseLogProbTopLogprobs.token) - && Objects.equals(this.logprob, openAIResponseLogProbTopLogprobs.logprob); - } - - @Override - public int hashCode() { - return Objects.hash(token, logprob, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseLogProbTopLogprobs {\n"); - sb.append(" token: ").append(toIndentedString(token)).append("\n"); - sb.append(" logprob: ").append(toIndentedString(logprob)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link OpenAIResponseLogProbTopLogprobs} instance. No arguments are required. */ - public static OpenAIResponseLogProbTopLogprobs create() { - return new OpenAIResponseLogProbTopLogprobs(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java deleted file mode 100644 index 7bcf170b4..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallArgumentsDeltaEvent.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when there is a delta (partial update) to the arguments of an MCP tool call. */ -// CHECKSTYLE:OFF -public class OpenAIResponseMCPCallArgumentsDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.mcp_call_arguments.delta'. */ - public enum TypeEnum { - /** - * The RESPONSE_MCP_CALL_ARGUMENTS_DELTA option of this OpenAIResponseMCPCallArgumentsDeltaEvent - */ - RESPONSE_MCP_CALL_ARGUMENTS_DELTA("response.mcp_call_arguments.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPCallArgumentsDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseMCPCallArgumentsDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseMCPCallArgumentsDeltaEvent. */ - protected OpenAIResponseMCPCallArgumentsDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always 'response.mcp_call_arguments.delta'. - * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallArgumentsDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.mcp_call_arguments.delta'. - * - * @return type The type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_call_arguments.delta'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallArgumentsDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response's output array. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and return the - * same instance. - * - * @param itemId The unique identifier of the MCP tool call item being processed. - * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallArgumentsDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the MCP tool call item being processed. - * - * @return itemId The itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param itemId The unique identifier of the MCP tool call item being processed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and return the - * same instance. - * - * @param delta A JSON string containing the partial update to the arguments for the MCP tool - * call. - * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallArgumentsDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * A JSON string containing the partial update to the arguments for the MCP tool call. - * - * @return delta The delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param delta A JSON string containing the partial update to the arguments for the MCP tool - * call. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallArgumentsDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseMCPCallArgumentsDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseMCPCallArgumentsDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseMCPCallArgumentsDeltaEvent openAIResponseMCPCallArgumentsDeltaEvent = - (OpenAIResponseMCPCallArgumentsDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseMCPCallArgumentsDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseMCPCallArgumentsDeltaEvent.type) - && Objects.equals(this.outputIndex, openAIResponseMCPCallArgumentsDeltaEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseMCPCallArgumentsDeltaEvent.itemId) - && Objects.equals(this.delta, openAIResponseMCPCallArgumentsDeltaEvent.delta) - && Objects.equals( - this.sequenceNumber, openAIResponseMCPCallArgumentsDeltaEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, delta, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseMCPCallArgumentsDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseMCPCallArgumentsDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (delta) -> - (sequenceNumber) -> - new OpenAIResponseMCPCallArgumentsDeltaEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .delta(delta) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_call_arguments.delta'. - * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param itemId The unique identifier of the MCP tool call item being processed. - * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the delta of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param delta A JSON string containing the partial update to the arguments for the MCP tool - * call. - * @return The OpenAIResponseMCPCallArgumentsDeltaEvent builder. - */ - Builder4 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallArgumentsDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseMCPCallArgumentsDeltaEvent instance. - */ - OpenAIResponseMCPCallArgumentsDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java deleted file mode 100644 index 64f585d4e..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallFailedEvent.java +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when an MCP tool call has failed. */ -// CHECKSTYLE:OFF -public class OpenAIResponseMCPCallFailedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.mcp_call.failed'. */ - public enum TypeEnum { - /** The RESPONSE_MCP_CALL_FAILED option of this OpenAIResponseMCPCallFailedEvent */ - RESPONSE_MCP_CALL_FAILED("response.mcp_call.failed"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPCallFailedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseMCPCallFailedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseMCPCallFailedEvent. */ - protected OpenAIResponseMCPCallFailedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always 'response.mcp_call.failed'. - * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallFailedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.mcp_call.failed'. - * - * @return type The type of this {@link OpenAIResponseMCPCallFailedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_call.failed'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the same - * instance. - * - * @param itemId The ID of the MCP tool call item that failed. - * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallFailedEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the MCP tool call item that failed. - * - * @return itemId The itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param itemId The ID of the MCP tool call item that failed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the - * same instance. - * - * @param outputIndex The index of the output item that failed. - * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallFailedEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that failed. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param outputIndex The index of the output item that failed. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} instance and return the - * same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseMCPCallFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseMCPCallFailedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseMCPCallFailedEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseMCPCallFailedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseMCPCallFailedEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseMCPCallFailedEvent} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseMCPCallFailedEvent openAIResponseMCPCallFailedEvent = - (OpenAIResponseMCPCallFailedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseMCPCallFailedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseMCPCallFailedEvent.type) - && Objects.equals(this.itemId, openAIResponseMCPCallFailedEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseMCPCallFailedEvent.outputIndex) - && Objects.equals(this.sequenceNumber, openAIResponseMCPCallFailedEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, itemId, outputIndex, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseMCPCallFailedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseMCPCallFailedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (sequenceNumber) -> - new OpenAIResponseMCPCallFailedEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_call.failed'. - * @return The OpenAIResponseMCPCallFailedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param itemId The ID of the MCP tool call item that failed. - * @return The OpenAIResponseMCPCallFailedEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param outputIndex The index of the output item that failed. - * @return The OpenAIResponseMCPCallFailedEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallFailedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseMCPCallFailedEvent instance. - */ - OpenAIResponseMCPCallFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java deleted file mode 100644 index ce306f6aa..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPCallInProgressEvent.java +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when an MCP tool call is in progress. */ -// CHECKSTYLE:OFF -public class OpenAIResponseMCPCallInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.mcp_call.in_progress'. */ - public enum TypeEnum { - /** The RESPONSE_MCP_CALL_IN_PROGRESS option of this OpenAIResponseMCPCallInProgressEvent */ - RESPONSE_MCP_CALL_IN_PROGRESS("response.mcp_call.in_progress"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPCallInProgressEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseMCPCallInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseMCPCallInProgressEvent. */ - protected OpenAIResponseMCPCallInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always 'response.mcp_call.in_progress'. - * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.mcp_call.in_progress'. - * - * @return type The type of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_call.in_progress'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return - * the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return - * the same instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallInProgressEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response's output array. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance and return the - * same instance. - * - * @param itemId The unique identifier of the MCP tool call item being processed. - * @return The same instance of this {@link OpenAIResponseMCPCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPCallInProgressEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the MCP tool call item being processed. - * - * @return itemId The itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param itemId The unique identifier of the MCP tool call item being processed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseMCPCallInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseMCPCallInProgressEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseMCPCallInProgressEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseMCPCallInProgressEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseMCPCallInProgressEvent openAIResponseMCPCallInProgressEvent = - (OpenAIResponseMCPCallInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseMCPCallInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseMCPCallInProgressEvent.type) - && Objects.equals(this.sequenceNumber, openAIResponseMCPCallInProgressEvent.sequenceNumber) - && Objects.equals(this.outputIndex, openAIResponseMCPCallInProgressEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseMCPCallInProgressEvent.itemId); - } - - @Override - public int hashCode() { - return Objects.hash(type, sequenceNumber, outputIndex, itemId, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseMCPCallInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseMCPCallInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (sequenceNumber) -> - (outputIndex) -> - (itemId) -> - new OpenAIResponseMCPCallInProgressEvent() - .type(type) - .sequenceNumber(sequenceNumber) - .outputIndex(outputIndex) - .itemId(itemId); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_call.in_progress'. - * @return The OpenAIResponseMCPCallInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseMCPCallInProgressEvent builder. - */ - Builder2 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The OpenAIResponseMCPCallInProgressEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the itemId of this {@link OpenAIResponseMCPCallInProgressEvent} instance. - * - * @param itemId The unique identifier of the MCP tool call item being processed. - * @return The OpenAIResponseMCPCallInProgressEvent instance. - */ - OpenAIResponseMCPCallInProgressEvent itemId(@Nonnull final String itemId); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java deleted file mode 100644 index 210b1d701..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsFailedEvent.java +++ /dev/null @@ -1,406 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when the attempt to list available MCP tools has failed. */ -// CHECKSTYLE:OFF -public class OpenAIResponseMCPListToolsFailedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.mcp_list_tools.failed'. */ - public enum TypeEnum { - /** The RESPONSE_MCP_LIST_TOOLS_FAILED option of this OpenAIResponseMCPListToolsFailedEvent */ - RESPONSE_MCP_LIST_TOOLS_FAILED("response.mcp_list_tools.failed"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPListToolsFailedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseMCPListToolsFailedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseMCPListToolsFailedEvent. */ - protected OpenAIResponseMCPListToolsFailedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always 'response.mcp_list_tools.failed'. - * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsFailedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.mcp_list_tools.failed'. - * - * @return type The type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_list_tools.failed'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and return the - * same instance. - * - * @param itemId The ID of the MCP tool call item that failed. - * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsFailedEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the MCP tool call item that failed. - * - * @return itemId The itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param itemId The ID of the MCP tool call item that failed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and return - * the same instance. - * - * @param outputIndex The index of the output item that failed. - * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsFailedEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that failed. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param outputIndex The index of the output item that failed. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseMCPListToolsFailedEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsFailedEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseMCPListToolsFailedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseMCPListToolsFailedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseMCPListToolsFailedEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseMCPListToolsFailedEvent openAIResponseMCPListToolsFailedEvent = - (OpenAIResponseMCPListToolsFailedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseMCPListToolsFailedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseMCPListToolsFailedEvent.type) - && Objects.equals(this.itemId, openAIResponseMCPListToolsFailedEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseMCPListToolsFailedEvent.outputIndex) - && Objects.equals( - this.sequenceNumber, openAIResponseMCPListToolsFailedEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, itemId, outputIndex, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseMCPListToolsFailedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseMCPListToolsFailedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (sequenceNumber) -> - new OpenAIResponseMCPListToolsFailedEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_list_tools.failed'. - * @return The OpenAIResponseMCPListToolsFailedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param itemId The ID of the MCP tool call item that failed. - * @return The OpenAIResponseMCPListToolsFailedEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param outputIndex The index of the output item that failed. - * @return The OpenAIResponseMCPListToolsFailedEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsFailedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseMCPListToolsFailedEvent instance. - */ - OpenAIResponseMCPListToolsFailedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java deleted file mode 100644 index 1020b0952..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseMCPListToolsInProgressEvent.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when the system is in the process of retrieving the list of available MCP tools. */ -// CHECKSTYLE:OFF -public class OpenAIResponseMCPListToolsInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.mcp_list_tools.in_progress'. */ - public enum TypeEnum { - /** - * The RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS option of this - * OpenAIResponseMCPListToolsInProgressEvent - */ - RESPONSE_MCP_LIST_TOOLS_IN_PROGRESS("response.mcp_list_tools.in_progress"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseMCPListToolsInProgressEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseMCPListToolsInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseMCPListToolsInProgressEvent. */ - protected OpenAIResponseMCPListToolsInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always 'response.mcp_list_tools.in_progress'. - * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.mcp_list_tools.in_progress'. - * - * @return type The type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_list_tools.in_progress'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and return - * the same instance. - * - * @param itemId The ID of the MCP tool call item that is being processed. - * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsInProgressEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the MCP tool call item that is being processed. - * - * @return itemId The itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param itemId The ID of the MCP tool call item that is being processed. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item that is being processed. - * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsInProgressEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that is being processed. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param outputIndex The index of the output item that is being processed. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseMCPListToolsInProgressEvent} class - */ - @Nonnull - public OpenAIResponseMCPListToolsInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseMCPListToolsInProgressEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseMCPListToolsInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseMCPListToolsInProgressEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseMCPListToolsInProgressEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseMCPListToolsInProgressEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseMCPListToolsInProgressEvent openAIResponseMCPListToolsInProgressEvent = - (OpenAIResponseMCPListToolsInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseMCPListToolsInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseMCPListToolsInProgressEvent.type) - && Objects.equals(this.itemId, openAIResponseMCPListToolsInProgressEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseMCPListToolsInProgressEvent.outputIndex) - && Objects.equals( - this.sequenceNumber, openAIResponseMCPListToolsInProgressEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, itemId, outputIndex, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseMCPListToolsInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseMCPListToolsInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (sequenceNumber) -> - new OpenAIResponseMCPListToolsInProgressEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param type The type of the event. Always 'response.mcp_list_tools.in_progress'. - * @return The OpenAIResponseMCPListToolsInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param itemId The ID of the MCP tool call item that is being processed. - * @return The OpenAIResponseMCPListToolsInProgressEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param outputIndex The index of the output item that is being processed. - * @return The OpenAIResponseMCPListToolsInProgressEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseMCPListToolsInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseMCPListToolsInProgressEvent instance. - */ - OpenAIResponseMCPListToolsInProgressEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java deleted file mode 100644 index 305194a24..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputItemAddedEvent.java +++ /dev/null @@ -1,404 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a new output item is added. */ -// CHECKSTYLE:OFF -public class OpenAIResponseOutputItemAddedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.output_item.added`. */ - public enum TypeEnum { - /** The RESPONSE_OUTPUT_ITEM_ADDED option of this OpenAIResponseOutputItemAddedEvent */ - RESPONSE_OUTPUT_ITEM_ADDED("response.output_item.added"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseOutputItemAddedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseOutputItemAddedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("item") - private OpenAIOutputItem item; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseOutputItemAddedEvent. */ - protected OpenAIResponseOutputItemAddedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseOutputItemAddedEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.output_item.added`. - * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputItemAddedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.output_item.added`. - * - * @return type The type of this {@link OpenAIResponseOutputItemAddedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param type The type of the event. Always `response.output_item.added`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} instance and return the - * same instance. - * - * @param outputIndex The index of the output item that was added. - * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputItemAddedEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that was added. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param outputIndex The index of the output item that was added. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} instance and return - * the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputItemAddedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the item of this {@link OpenAIResponseOutputItemAddedEvent} instance and return the same - * instance. - * - * @param item The output item that was added. - * @return The same instance of this {@link OpenAIResponseOutputItemAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputItemAddedEvent item(@Nonnull final OpenAIOutputItem item) { - this.item = item; - return this; - } - - /** - * The output item that was added. - * - * @return item The item of this {@link OpenAIResponseOutputItemAddedEvent} instance. - */ - @Nonnull - public OpenAIOutputItem getItem() { - return item; - } - - /** - * Set the item of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param item The output item that was added. - */ - public void setItem(@Nonnull final OpenAIOutputItem item) { - this.item = item; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseOutputItemAddedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseOutputItemAddedEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseOutputItemAddedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseOutputItemAddedEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (item != null) declaredFields.put("item", item); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseOutputItemAddedEvent} instance. If - * the map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseOutputItemAddedEvent openAIResponseOutputItemAddedEvent = - (OpenAIResponseOutputItemAddedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseOutputItemAddedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseOutputItemAddedEvent.type) - && Objects.equals(this.outputIndex, openAIResponseOutputItemAddedEvent.outputIndex) - && Objects.equals(this.sequenceNumber, openAIResponseOutputItemAddedEvent.sequenceNumber) - && Objects.equals(this.item, openAIResponseOutputItemAddedEvent.item); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, sequenceNumber, item, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseOutputItemAddedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" item: ").append(toIndentedString(item)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseOutputItemAddedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (sequenceNumber) -> - (item) -> - new OpenAIResponseOutputItemAddedEvent() - .type(type) - .outputIndex(outputIndex) - .sequenceNumber(sequenceNumber) - .item(item); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param type The type of the event. Always `response.output_item.added`. - * @return The OpenAIResponseOutputItemAddedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param outputIndex The index of the output item that was added. - * @return The OpenAIResponseOutputItemAddedEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseOutputItemAddedEvent builder. - */ - Builder3 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the item of this {@link OpenAIResponseOutputItemAddedEvent} instance. - * - * @param item The output item that was added. - * @return The OpenAIResponseOutputItemAddedEvent instance. - */ - OpenAIResponseOutputItemAddedEvent item(@Nonnull final OpenAIOutputItem item); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java deleted file mode 100644 index 0610919f6..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseOutputTextAnnotationAddedEvent.java +++ /dev/null @@ -1,585 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when an annotation is added to output text content. */ -// CHECKSTYLE:OFF -public class OpenAIResponseOutputTextAnnotationAddedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.output_text.annotation.added'. */ - public enum TypeEnum { - /** - * The RESPONSE_OUTPUT_TEXT_ANNOTATION_ADDED option of this - * OpenAIResponseOutputTextAnnotationAddedEvent - */ - RESPONSE_OUTPUT_TEXT_ANNOTATION_ADDED("response.output_text.annotation.added"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseOutputTextAnnotationAddedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseOutputTextAnnotationAddedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("content_index") - private Integer contentIndex; - - @JsonProperty("annotation_index") - private Integer annotationIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("annotation") - private OpenAIAnnotation annotation; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseOutputTextAnnotationAddedEvent. */ - protected OpenAIResponseOutputTextAnnotationAddedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and return - * the same instance. - * - * @param type The type of the event. Always 'response.output_text.annotation.added'. - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.output_text.annotation.added'. - * - * @return type The type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param type The type of the event. Always 'response.output_text.annotation.added'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and return - * the same instance. - * - * @param itemId The unique identifier of the item to which the annotation is being added. - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The unique identifier of the item to which the annotation is being added. - * - * @return itemId The itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param itemId The unique identifier of the item to which the annotation is being added. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item in the response's output array. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseOutputTextAnnotationAddedEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and - * return the same instance. - * - * @param contentIndex The index of the content part within the output item. - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent contentIndex( - @Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - return this; - } - - /** - * The index of the content part within the output item. - * - * @return contentIndex The contentIndex of this {@link - * OpenAIResponseOutputTextAnnotationAddedEvent} instance. - */ - @Nonnull - public Integer getContentIndex() { - return contentIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param contentIndex The index of the content part within the output item. - */ - public void setContentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - } - - /** - * Set the annotationIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance - * and return the same instance. - * - * @param annotationIndex The index of the annotation within the content part. - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent annotationIndex( - @Nonnull final Integer annotationIndex) { - this.annotationIndex = annotationIndex; - return this; - } - - /** - * The index of the annotation within the content part. - * - * @return annotationIndex The annotationIndex of this {@link - * OpenAIResponseOutputTextAnnotationAddedEvent} instance. - */ - @Nonnull - public Integer getAnnotationIndex() { - return annotationIndex; - } - - /** - * Set the annotationIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param annotationIndex The index of the annotation within the content part. - */ - public void setAnnotationIndex(@Nonnull final Integer annotationIndex) { - this.annotationIndex = annotationIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance - * and return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseOutputTextAnnotationAddedEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance and - * return the same instance. - * - * @param annotation The annotation object being added. (See annotation schema for details.) - * @return The same instance of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} class - */ - @Nonnull - public OpenAIResponseOutputTextAnnotationAddedEvent annotation( - @Nonnull final OpenAIAnnotation annotation) { - this.annotation = annotation; - return this; - } - - /** - * The annotation object being added. (See annotation schema for details.) - * - * @return annotation The annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} - * instance. - */ - @Nonnull - public OpenAIAnnotation getAnnotation() { - return annotation; - } - - /** - * Set the annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param annotation The annotation object being added. (See annotation schema for details.) - */ - public void setAnnotation(@Nonnull final OpenAIAnnotation annotation) { - this.annotation = annotation; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseOutputTextAnnotationAddedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseOutputTextAnnotationAddedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); - if (annotationIndex != null) declaredFields.put("annotationIndex", annotationIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (annotation != null) declaredFields.put("annotation", annotation); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseOutputTextAnnotationAddedEvent - openAIResponseOutputTextAnnotationAddedEvent = - (OpenAIResponseOutputTextAnnotationAddedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseOutputTextAnnotationAddedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseOutputTextAnnotationAddedEvent.type) - && Objects.equals(this.itemId, openAIResponseOutputTextAnnotationAddedEvent.itemId) - && Objects.equals( - this.outputIndex, openAIResponseOutputTextAnnotationAddedEvent.outputIndex) - && Objects.equals( - this.contentIndex, openAIResponseOutputTextAnnotationAddedEvent.contentIndex) - && Objects.equals( - this.annotationIndex, openAIResponseOutputTextAnnotationAddedEvent.annotationIndex) - && Objects.equals( - this.sequenceNumber, openAIResponseOutputTextAnnotationAddedEvent.sequenceNumber) - && Objects.equals(this.annotation, openAIResponseOutputTextAnnotationAddedEvent.annotation); - } - - @Override - public int hashCode() { - return Objects.hash( - type, - itemId, - outputIndex, - contentIndex, - annotationIndex, - sequenceNumber, - annotation, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseOutputTextAnnotationAddedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); - sb.append(" annotationIndex: ").append(toIndentedString(annotationIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" annotation: ").append(toIndentedString(annotation)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseOutputTextAnnotationAddedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (contentIndex) -> - (annotationIndex) -> - (sequenceNumber) -> - (annotation) -> - new OpenAIResponseOutputTextAnnotationAddedEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .contentIndex(contentIndex) - .annotationIndex(annotationIndex) - .sequenceNumber(sequenceNumber) - .annotation(annotation); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param type The type of the event. Always 'response.output_text.annotation.added'. - * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param itemId The unique identifier of the item to which the annotation is being added. - * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param outputIndex The index of the output item in the response's output array. - * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the contentIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param contentIndex The index of the content part within the output item. - * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. - */ - Builder4 contentIndex(@Nonnull final Integer contentIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the annotationIndex of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} - * instance. - * - * @param annotationIndex The index of the annotation within the content part. - * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. - */ - Builder5 annotationIndex(@Nonnull final Integer annotationIndex); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseOutputTextAnnotationAddedEvent builder. - */ - Builder6 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder6 { - /** - * Set the annotation of this {@link OpenAIResponseOutputTextAnnotationAddedEvent} instance. - * - * @param annotation The annotation object being added. (See annotation schema for details.) - * @return The OpenAIResponseOutputTextAnnotationAddedEvent instance. - */ - OpenAIResponseOutputTextAnnotationAddedEvent annotation( - @Nonnull final OpenAIAnnotation annotation); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java deleted file mode 100644 index e7b27a864..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseQueuedEvent.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a response is queued and waiting to be processed. */ -// CHECKSTYLE:OFF -public class OpenAIResponseQueuedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always 'response.queued'. */ - public enum TypeEnum { - /** The RESPONSE_QUEUED option of this OpenAIResponseQueuedEvent */ - RESPONSE_QUEUED("response.queued"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseQueuedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseQueuedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("response") - private OpenAIResponse response; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseQueuedEvent. */ - protected OpenAIResponseQueuedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseQueuedEvent} instance and return the same instance. - * - * @param type The type of the event. Always 'response.queued'. - * @return The same instance of this {@link OpenAIResponseQueuedEvent} class - */ - @Nonnull - public OpenAIResponseQueuedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always 'response.queued'. - * - * @return type The type of this {@link OpenAIResponseQueuedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseQueuedEvent} instance. - * - * @param type The type of the event. Always 'response.queued'. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the response of this {@link OpenAIResponseQueuedEvent} instance and return the same - * instance. - * - * @param response The full response object that is queued. - * @return The same instance of this {@link OpenAIResponseQueuedEvent} class - */ - @Nonnull - public OpenAIResponseQueuedEvent response(@Nonnull final OpenAIResponse response) { - this.response = response; - return this; - } - - /** - * The full response object that is queued. - * - * @return response The response of this {@link OpenAIResponseQueuedEvent} instance. - */ - @Nonnull - public OpenAIResponse getResponse() { - return response; - } - - /** - * Set the response of this {@link OpenAIResponseQueuedEvent} instance. - * - * @param response The full response object that is queued. - */ - public void setResponse(@Nonnull final OpenAIResponse response) { - this.response = response; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance and return the same - * instance. - * - * @param sequenceNumber The sequence number for this event. - * @return The same instance of this {@link OpenAIResponseQueuedEvent} class - */ - @Nonnull - public OpenAIResponseQueuedEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number for this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance. - * - * @param sequenceNumber The sequence number for this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseQueuedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseQueuedEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseQueuedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseQueuedEvent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (response != null) declaredFields.put("response", response); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseQueuedEvent} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseQueuedEvent openAIResponseQueuedEvent = (OpenAIResponseQueuedEvent) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseQueuedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseQueuedEvent.type) - && Objects.equals(this.response, openAIResponseQueuedEvent.response) - && Objects.equals(this.sequenceNumber, openAIResponseQueuedEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, response, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseQueuedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" response: ").append(toIndentedString(response)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseQueuedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (response) -> - (sequenceNumber) -> - new OpenAIResponseQueuedEvent() - .type(type) - .response(response) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseQueuedEvent} instance. - * - * @param type The type of the event. Always 'response.queued'. - * @return The OpenAIResponseQueuedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the response of this {@link OpenAIResponseQueuedEvent} instance. - * - * @param response The full response object that is queued. - * @return The OpenAIResponseQueuedEvent builder. - */ - Builder2 response(@Nonnull final OpenAIResponse response); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseQueuedEvent} instance. - * - * @param sequenceNumber The sequence number for this event. - * @return The OpenAIResponseQueuedEvent instance. - */ - OpenAIResponseQueuedEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java deleted file mode 100644 index da1251412..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEvent.java +++ /dev/null @@ -1,522 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a new reasoning summary part is added. */ -// CHECKSTYLE:OFF -public class OpenAIResponseReasoningSummaryPartAddedEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.reasoning_summary_part.added`. */ - public enum TypeEnum { - /** - * The RESPONSE_REASONING_SUMMARY_PART_ADDED option of this - * OpenAIResponseReasoningSummaryPartAddedEvent - */ - RESPONSE_REASONING_SUMMARY_PART_ADDED("response.reasoning_summary_part.added"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningSummaryPartAddedEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseReasoningSummaryPartAddedEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("summary_index") - private Integer summaryIndex; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("part") - private OpenAIResponseReasoningSummaryPartAddedEventPart part; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseReasoningSummaryPartAddedEvent. */ - protected OpenAIResponseReasoningSummaryPartAddedEvent() {} - - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and return - * the same instance. - * - * @param type The type of the event. Always `response.reasoning_summary_part.added`. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.reasoning_summary_part.added`. - * - * @return type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param type The type of the event. Always `response.reasoning_summary_part.added`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and return - * the same instance. - * - * @param itemId The ID of the item this summary part is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the item this summary part is associated with. - * - * @return itemId The itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param itemId The ID of the item this summary part is associated with. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item this summary part is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item this summary part is associated with. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseReasoningSummaryPartAddedEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param outputIndex The index of the output item this summary part is associated with. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and - * return the same instance. - * - * @param summaryIndex The index of the summary part within the reasoning summary. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEvent summaryIndex( - @Nonnull final Integer summaryIndex) { - this.summaryIndex = summaryIndex; - return this; - } - - /** - * The index of the summary part within the reasoning summary. - * - * @return summaryIndex The summaryIndex of this {@link - * OpenAIResponseReasoningSummaryPartAddedEvent} instance. - */ - @Nonnull - public Integer getSummaryIndex() { - return summaryIndex; - } - - /** - * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param summaryIndex The index of the summary part within the reasoning summary. - */ - public void setSummaryIndex(@Nonnull final Integer summaryIndex) { - this.summaryIndex = summaryIndex; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance - * and return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseReasoningSummaryPartAddedEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance and return - * the same instance. - * - * @param part The summary part that was added. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEvent part( - @Nonnull final OpenAIResponseReasoningSummaryPartAddedEventPart part) { - this.part = part; - return this; - } - - /** - * The summary part that was added. - * - * @return part The part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEventPart getPart() { - return part; - } - - /** - * Set the part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param part The summary part that was added. - */ - public void setPart(@Nonnull final OpenAIResponseReasoningSummaryPartAddedEventPart part) { - this.part = part; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseReasoningSummaryPartAddedEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseReasoningSummaryPartAddedEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (summaryIndex != null) declaredFields.put("summaryIndex", summaryIndex); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (part != null) declaredFields.put("part", part); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseReasoningSummaryPartAddedEvent - openAIResponseReasoningSummaryPartAddedEvent = - (OpenAIResponseReasoningSummaryPartAddedEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseReasoningSummaryPartAddedEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseReasoningSummaryPartAddedEvent.type) - && Objects.equals(this.itemId, openAIResponseReasoningSummaryPartAddedEvent.itemId) - && Objects.equals( - this.outputIndex, openAIResponseReasoningSummaryPartAddedEvent.outputIndex) - && Objects.equals( - this.summaryIndex, openAIResponseReasoningSummaryPartAddedEvent.summaryIndex) - && Objects.equals( - this.sequenceNumber, openAIResponseReasoningSummaryPartAddedEvent.sequenceNumber) - && Objects.equals(this.part, openAIResponseReasoningSummaryPartAddedEvent.part); - } - - @Override - public int hashCode() { - return Objects.hash( - type, itemId, outputIndex, summaryIndex, sequenceNumber, part, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseReasoningSummaryPartAddedEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" summaryIndex: ").append(toIndentedString(summaryIndex)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" part: ").append(toIndentedString(part)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseReasoningSummaryPartAddedEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (summaryIndex) -> - (sequenceNumber) -> - (part) -> - new OpenAIResponseReasoningSummaryPartAddedEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .summaryIndex(summaryIndex) - .sequenceNumber(sequenceNumber) - .part(part); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param type The type of the event. Always `response.reasoning_summary_part.added`. - * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param itemId The ID of the item this summary part is associated with. - * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param outputIndex The index of the output item this summary part is associated with. - * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param summaryIndex The index of the summary part within the reasoning summary. - * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. - */ - Builder4 summaryIndex(@Nonnull final Integer summaryIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseReasoningSummaryPartAddedEvent builder. - */ - Builder5 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the part of this {@link OpenAIResponseReasoningSummaryPartAddedEvent} instance. - * - * @param part The summary part that was added. - * @return The OpenAIResponseReasoningSummaryPartAddedEvent instance. - */ - OpenAIResponseReasoningSummaryPartAddedEvent part( - @Nonnull final OpenAIResponseReasoningSummaryPartAddedEventPart part); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java deleted file mode 100644 index 577233967..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryPartAddedEventPart.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIResponseReasoningSummaryPartAddedEventPart */ -// CHECKSTYLE:OFF -public class OpenAIResponseReasoningSummaryPartAddedEventPart -// CHECKSTYLE:ON -{ - /** Gets or Sets type */ - public enum TypeEnum { - /** The SUMMARY_TEXT option of this OpenAIResponseReasoningSummaryPartAddedEventPart */ - SUMMARY_TEXT("summary_text"), - - /** - * The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningSummaryPartAddedEventPart - */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseReasoningSummaryPartAddedEventPart - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("text") - private String text; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseReasoningSummaryPartAddedEventPart. */ - protected OpenAIResponseReasoningSummaryPartAddedEventPart() {} - - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance and - * return the same instance. - * - * @param type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEventPart type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. - * - * @param type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance and - * return the same instance. - * - * @param text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * @return The same instance of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * class - */ - @Nonnull - public OpenAIResponseReasoningSummaryPartAddedEventPart text(@Nonnull final String text) { - this.text = text; - return this; - } - - /** - * Get text - * - * @return text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * instance. - */ - @Nonnull - public String getText() { - return text; - } - - /** - * Set the text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. - * - * @param text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - */ - public void setText(@Nonnull final String text) { - this.text = text; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseReasoningSummaryPartAddedEventPart}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseReasoningSummaryPartAddedEventPart} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseReasoningSummaryPartAddedEventPart has no field with name '" - + name - + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link - * OpenAIResponseReasoningSummaryPartAddedEventPart} instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (text != null) declaredFields.put("text", text); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseReasoningSummaryPartAddedEventPart - openAIResponseReasoningSummaryPartAddedEventPart = - (OpenAIResponseReasoningSummaryPartAddedEventPart) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseReasoningSummaryPartAddedEventPart.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseReasoningSummaryPartAddedEventPart.type) - && Objects.equals(this.text, openAIResponseReasoningSummaryPartAddedEventPart.text); - } - - @Override - public int hashCode() { - return Objects.hash(type, text, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseReasoningSummaryPartAddedEventPart {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseReasoningSummaryPartAddedEventPart} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (text) -> new OpenAIResponseReasoningSummaryPartAddedEventPart().type(type).text(text); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. - * - * @param type The type of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * @return The OpenAIResponseReasoningSummaryPartAddedEventPart builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} instance. - * - * @param text The text of this {@link OpenAIResponseReasoningSummaryPartAddedEventPart} - * @return The OpenAIResponseReasoningSummaryPartAddedEventPart instance. - */ - OpenAIResponseReasoningSummaryPartAddedEventPart text(@Nonnull final String text); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java deleted file mode 100644 index db5255a80..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningSummaryTextDeltaEvent.java +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a delta is added to a reasoning summary text. */ -// CHECKSTYLE:OFF -public class OpenAIResponseReasoningSummaryTextDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.reasoning_summary_text.delta`. */ - public enum TypeEnum { - /** - * The RESPONSE_REASONING_SUMMARY_TEXT_DELTA option of this - * OpenAIResponseReasoningSummaryTextDeltaEvent - */ - RESPONSE_REASONING_SUMMARY_TEXT_DELTA("response.reasoning_summary_text.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningSummaryTextDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseReasoningSummaryTextDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("summary_index") - private Integer summaryIndex; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseReasoningSummaryTextDeltaEvent. */ - protected OpenAIResponseReasoningSummaryTextDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and return - * the same instance. - * - * @param type The type of the event. Always `response.reasoning_summary_text.delta`. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryTextDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.reasoning_summary_text.delta`. - * - * @return type The type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param type The type of the event. Always `response.reasoning_summary_text.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and return - * the same instance. - * - * @param itemId The ID of the item this summary text delta is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryTextDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the item this summary text delta is associated with. - * - * @return itemId The itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} - * instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param itemId The ID of the item this summary text delta is associated with. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item this summary text delta is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryTextDeltaEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item this summary text delta is associated with. - * - * @return outputIndex The outputIndex of this {@link - * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param outputIndex The index of the output item this summary text delta is associated with. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and - * return the same instance. - * - * @param summaryIndex The index of the summary part within the reasoning summary. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryTextDeltaEvent summaryIndex( - @Nonnull final Integer summaryIndex) { - this.summaryIndex = summaryIndex; - return this; - } - - /** - * The index of the summary part within the reasoning summary. - * - * @return summaryIndex The summaryIndex of this {@link - * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - */ - @Nonnull - public Integer getSummaryIndex() { - return summaryIndex; - } - - /** - * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param summaryIndex The index of the summary part within the reasoning summary. - */ - public void setSummaryIndex(@Nonnull final Integer summaryIndex) { - this.summaryIndex = summaryIndex; - } - - /** - * Set the delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance and return - * the same instance. - * - * @param delta The text delta that was added to the summary. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryTextDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The text delta that was added to the summary. - * - * @return delta The delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param delta The text delta that was added to the summary. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance - * and return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningSummaryTextDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseReasoningSummaryTextDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseReasoningSummaryTextDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (summaryIndex != null) declaredFields.put("summaryIndex", summaryIndex); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseReasoningSummaryTextDeltaEvent - openAIResponseReasoningSummaryTextDeltaEvent = - (OpenAIResponseReasoningSummaryTextDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseReasoningSummaryTextDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseReasoningSummaryTextDeltaEvent.type) - && Objects.equals(this.itemId, openAIResponseReasoningSummaryTextDeltaEvent.itemId) - && Objects.equals( - this.outputIndex, openAIResponseReasoningSummaryTextDeltaEvent.outputIndex) - && Objects.equals( - this.summaryIndex, openAIResponseReasoningSummaryTextDeltaEvent.summaryIndex) - && Objects.equals(this.delta, openAIResponseReasoningSummaryTextDeltaEvent.delta) - && Objects.equals( - this.sequenceNumber, openAIResponseReasoningSummaryTextDeltaEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash( - type, itemId, outputIndex, summaryIndex, delta, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseReasoningSummaryTextDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" summaryIndex: ").append(toIndentedString(summaryIndex)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseReasoningSummaryTextDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (summaryIndex) -> - (delta) -> - (sequenceNumber) -> - new OpenAIResponseReasoningSummaryTextDeltaEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .summaryIndex(summaryIndex) - .delta(delta) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param type The type of the event. Always `response.reasoning_summary_text.delta`. - * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param itemId The ID of the item this summary text delta is associated with. - * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param outputIndex The index of the output item this summary text delta is associated with. - * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the summaryIndex of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param summaryIndex The index of the summary part within the reasoning summary. - * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. - */ - Builder4 summaryIndex(@Nonnull final Integer summaryIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the delta of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param delta The text delta that was added to the summary. - * @return The OpenAIResponseReasoningSummaryTextDeltaEvent builder. - */ - Builder5 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningSummaryTextDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseReasoningSummaryTextDeltaEvent instance. - */ - OpenAIResponseReasoningSummaryTextDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java deleted file mode 100644 index 3993e406a..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseReasoningTextDeltaEvent.java +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when a delta is added to a reasoning text. */ -// CHECKSTYLE:OFF -public class OpenAIResponseReasoningTextDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.reasoning_text.delta`. */ - public enum TypeEnum { - /** The RESPONSE_REASONING_TEXT_DELTA option of this OpenAIResponseReasoningTextDeltaEvent */ - RESPONSE_REASONING_TEXT_DELTA("response.reasoning_text.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseReasoningTextDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseReasoningTextDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("content_index") - private Integer contentIndex; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseReasoningTextDeltaEvent. */ - protected OpenAIResponseReasoningTextDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.reasoning_text.delta`. - * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningTextDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.reasoning_text.delta`. - * - * @return type The type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param type The type of the event. Always `response.reasoning_text.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return the - * same instance. - * - * @param itemId The ID of the item this reasoning text delta is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningTextDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the item this reasoning text delta is associated with. - * - * @return itemId The itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param itemId The ID of the item this reasoning text delta is associated with. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return - * the same instance. - * - * @param outputIndex The index of the output item this reasoning text delta is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningTextDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item this reasoning text delta is associated with. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param outputIndex The index of the output item this reasoning text delta is associated with. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return - * the same instance. - * - * @param contentIndex The index of the reasoning content part this delta is associated with. - * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningTextDeltaEvent contentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - return this; - } - - /** - * The index of the reasoning content part this delta is associated with. - * - * @return contentIndex The contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} - * instance. - */ - @Nonnull - public Integer getContentIndex() { - return contentIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param contentIndex The index of the reasoning content part this delta is associated with. - */ - public void setContentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - } - - /** - * Set the delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and return the - * same instance. - * - * @param delta The text delta that was added to the reasoning content. - * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningTextDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The text delta that was added to the reasoning content. - * - * @return delta The delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param delta The text delta that was added to the reasoning content. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseReasoningTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseReasoningTextDeltaEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseReasoningTextDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseReasoningTextDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseReasoningTextDeltaEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseReasoningTextDeltaEvent openAIResponseReasoningTextDeltaEvent = - (OpenAIResponseReasoningTextDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseReasoningTextDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseReasoningTextDeltaEvent.type) - && Objects.equals(this.itemId, openAIResponseReasoningTextDeltaEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseReasoningTextDeltaEvent.outputIndex) - && Objects.equals(this.contentIndex, openAIResponseReasoningTextDeltaEvent.contentIndex) - && Objects.equals(this.delta, openAIResponseReasoningTextDeltaEvent.delta) - && Objects.equals( - this.sequenceNumber, openAIResponseReasoningTextDeltaEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash( - type, itemId, outputIndex, contentIndex, delta, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseReasoningTextDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseReasoningTextDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (contentIndex) -> - (delta) -> - (sequenceNumber) -> - new OpenAIResponseReasoningTextDeltaEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .contentIndex(contentIndex) - .delta(delta) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param type The type of the event. Always `response.reasoning_text.delta`. - * @return The OpenAIResponseReasoningTextDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param itemId The ID of the item this reasoning text delta is associated with. - * @return The OpenAIResponseReasoningTextDeltaEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param outputIndex The index of the output item this reasoning text delta is associated with. - * @return The OpenAIResponseReasoningTextDeltaEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the contentIndex of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param contentIndex The index of the reasoning content part this delta is associated with. - * @return The OpenAIResponseReasoningTextDeltaEvent builder. - */ - Builder4 contentIndex(@Nonnull final Integer contentIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the delta of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param delta The text delta that was added to the reasoning content. - * @return The OpenAIResponseReasoningTextDeltaEvent builder. - */ - Builder5 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseReasoningTextDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseReasoningTextDeltaEvent instance. - */ - OpenAIResponseReasoningTextDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java deleted file mode 100644 index 8a1acab6f..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseRefusalDeltaEvent.java +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when there is a partial refusal text. */ -// CHECKSTYLE:OFF -public class OpenAIResponseRefusalDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.refusal.delta`. */ - public enum TypeEnum { - /** The RESPONSE_REFUSAL_DELTA option of this OpenAIResponseRefusalDeltaEvent */ - RESPONSE_REFUSAL_DELTA("response.refusal.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseRefusalDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseRefusalDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("content_index") - private Integer contentIndex; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseRefusalDeltaEvent. */ - protected OpenAIResponseRefusalDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.refusal.delta`. - * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class - */ - @Nonnull - public OpenAIResponseRefusalDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.refusal.delta`. - * - * @return type The type of this {@link OpenAIResponseRefusalDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param type The type of the event. Always `response.refusal.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the same - * instance. - * - * @param itemId The ID of the output item that the refusal text is added to. - * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class - */ - @Nonnull - public OpenAIResponseRefusalDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the output item that the refusal text is added to. - * - * @return itemId The itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param itemId The ID of the output item that the refusal text is added to. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the - * same instance. - * - * @param outputIndex The index of the output item that the refusal text is added to. - * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class - */ - @Nonnull - public OpenAIResponseRefusalDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the refusal text is added to. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param outputIndex The index of the output item that the refusal text is added to. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the - * same instance. - * - * @param contentIndex The index of the content part that the refusal text is added to. - * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class - */ - @Nonnull - public OpenAIResponseRefusalDeltaEvent contentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - return this; - } - - /** - * The index of the content part that the refusal text is added to. - * - * @return contentIndex The contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. - */ - @Nonnull - public Integer getContentIndex() { - return contentIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param contentIndex The index of the content part that the refusal text is added to. - */ - public void setContentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - } - - /** - * Set the delta of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the same - * instance. - * - * @param delta The refusal text that is added. - * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class - */ - @Nonnull - public OpenAIResponseRefusalDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The refusal text that is added. - * - * @return delta The delta of this {@link OpenAIResponseRefusalDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param delta The refusal text that is added. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} instance and return the - * same instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The same instance of this {@link OpenAIResponseRefusalDeltaEvent} class - */ - @Nonnull - public OpenAIResponseRefusalDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseRefusalDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseRefusalDeltaEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseRefusalDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseRefusalDeltaEvent} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseRefusalDeltaEvent} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseRefusalDeltaEvent openAIResponseRefusalDeltaEvent = - (OpenAIResponseRefusalDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseRefusalDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseRefusalDeltaEvent.type) - && Objects.equals(this.itemId, openAIResponseRefusalDeltaEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseRefusalDeltaEvent.outputIndex) - && Objects.equals(this.contentIndex, openAIResponseRefusalDeltaEvent.contentIndex) - && Objects.equals(this.delta, openAIResponseRefusalDeltaEvent.delta) - && Objects.equals(this.sequenceNumber, openAIResponseRefusalDeltaEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash( - type, itemId, outputIndex, contentIndex, delta, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseRefusalDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseRefusalDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (contentIndex) -> - (delta) -> - (sequenceNumber) -> - new OpenAIResponseRefusalDeltaEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .contentIndex(contentIndex) - .delta(delta) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param type The type of the event. Always `response.refusal.delta`. - * @return The OpenAIResponseRefusalDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param itemId The ID of the output item that the refusal text is added to. - * @return The OpenAIResponseRefusalDeltaEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param outputIndex The index of the output item that the refusal text is added to. - * @return The OpenAIResponseRefusalDeltaEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the contentIndex of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param contentIndex The index of the content part that the refusal text is added to. - * @return The OpenAIResponseRefusalDeltaEvent builder. - */ - Builder4 contentIndex(@Nonnull final Integer contentIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the delta of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param delta The refusal text that is added. - * @return The OpenAIResponseRefusalDeltaEvent builder. - */ - Builder5 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseRefusalDeltaEvent} instance. - * - * @param sequenceNumber The sequence number of this event. - * @return The OpenAIResponseRefusalDeltaEvent instance. - */ - OpenAIResponseRefusalDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java deleted file mode 100644 index d88131a4b..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseStreamOptions.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Options for streaming responses. Only set this when you set `stream: true`. */ -// CHECKSTYLE:OFF -public class OpenAIResponseStreamOptions -// CHECKSTYLE:ON -{ - @JsonProperty("include_obfuscation") - private Boolean includeObfuscation; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseStreamOptions. */ - protected OpenAIResponseStreamOptions() {} - - /** - * Set the includeObfuscation of this {@link OpenAIResponseStreamOptions} instance and return the - * same instance. - * - * @param includeObfuscation When true, stream obfuscation will be enabled. Stream obfuscation - * adds random characters to an `obfuscation` field on streaming delta events to - * normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation - * fields are included by default, but add a small amount of overhead to the data stream. You - * can set `include_obfuscation` to false to optimize for bandwidth if you trust the - * network links between your application and the OpenAI API. - * @return The same instance of this {@link OpenAIResponseStreamOptions} class - */ - @Nonnull - public OpenAIResponseStreamOptions includeObfuscation( - @Nullable final Boolean includeObfuscation) { - this.includeObfuscation = includeObfuscation; - return this; - } - - /** - * When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an - * `obfuscation` field on streaming delta events to normalize payload sizes as a - * mitigation to certain side-channel attacks. These obfuscation fields are included by default, - * but add a small amount of overhead to the data stream. You can set - * `include_obfuscation` to false to optimize for bandwidth if you trust the network - * links between your application and the OpenAI API. - * - * @return includeObfuscation The includeObfuscation of this {@link OpenAIResponseStreamOptions} - * instance. - */ - @Nonnull - public Boolean isIncludeObfuscation() { - return includeObfuscation; - } - - /** - * Set the includeObfuscation of this {@link OpenAIResponseStreamOptions} instance. - * - * @param includeObfuscation When true, stream obfuscation will be enabled. Stream obfuscation - * adds random characters to an `obfuscation` field on streaming delta events to - * normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation - * fields are included by default, but add a small amount of overhead to the data stream. You - * can set `include_obfuscation` to false to optimize for bandwidth if you trust the - * network links between your application and the OpenAI API. - */ - public void setIncludeObfuscation(@Nullable final Boolean includeObfuscation) { - this.includeObfuscation = includeObfuscation; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseStreamOptions}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseStreamOptions} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseStreamOptions has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseStreamOptions} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (includeObfuscation != null) declaredFields.put("includeObfuscation", includeObfuscation); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseStreamOptions} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseStreamOptions openAIResponseStreamOptions = (OpenAIResponseStreamOptions) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseStreamOptions.cloudSdkCustomFields) - && Objects.equals(this.includeObfuscation, openAIResponseStreamOptions.includeObfuscation); - } - - @Override - public int hashCode() { - return Objects.hash(includeObfuscation, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseStreamOptions {\n"); - sb.append(" includeObfuscation: ").append(toIndentedString(includeObfuscation)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link OpenAIResponseStreamOptions} instance. No arguments are required. */ - public static OpenAIResponseStreamOptions create() { - return new OpenAIResponseStreamOptions(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java deleted file mode 100644 index 2f9d8b3bd..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextDeltaEvent.java +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Emitted when there is an additional text delta. */ -// CHECKSTYLE:OFF -public class OpenAIResponseTextDeltaEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.output_text.delta`. */ - public enum TypeEnum { - /** The RESPONSE_OUTPUT_TEXT_DELTA option of this OpenAIResponseTextDeltaEvent */ - RESPONSE_OUTPUT_TEXT_DELTA("response.output_text.delta"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseTextDeltaEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseTextDeltaEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("content_index") - private Integer contentIndex; - - @JsonProperty("delta") - private String delta; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonProperty("logprobs") - private List logprobs = new ArrayList<>(); - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseTextDeltaEvent. */ - protected OpenAIResponseTextDeltaEvent() {} - - /** - * Set the type of this {@link OpenAIResponseTextDeltaEvent} instance and return the same - * instance. - * - * @param type The type of the event. Always `response.output_text.delta`. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.output_text.delta`. - * - * @return type The type of this {@link OpenAIResponseTextDeltaEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param type The type of the event. Always `response.output_text.delta`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the itemId of this {@link OpenAIResponseTextDeltaEvent} instance and return the same - * instance. - * - * @param itemId The ID of the output item that the text delta was added to. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * The ID of the output item that the text delta was added to. - * - * @return itemId The itemId of this {@link OpenAIResponseTextDeltaEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param itemId The ID of the output item that the text delta was added to. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance and return the same - * instance. - * - * @param outputIndex The index of the output item that the text delta was added to. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the text delta was added to. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param outputIndex The index of the output item that the text delta was added to. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance and return the same - * instance. - * - * @param contentIndex The index of the content part that the text delta was added to. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent contentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - return this; - } - - /** - * The index of the content part that the text delta was added to. - * - * @return contentIndex The contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance. - */ - @Nonnull - public Integer getContentIndex() { - return contentIndex; - } - - /** - * Set the contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param contentIndex The index of the content part that the text delta was added to. - */ - public void setContentIndex(@Nonnull final Integer contentIndex) { - this.contentIndex = contentIndex; - } - - /** - * Set the delta of this {@link OpenAIResponseTextDeltaEvent} instance and return the same - * instance. - * - * @param delta The text delta that was added. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent delta(@Nonnull final String delta) { - this.delta = delta; - return this; - } - - /** - * The text delta that was added. - * - * @return delta The delta of this {@link OpenAIResponseTextDeltaEvent} instance. - */ - @Nonnull - public String getDelta() { - return delta; - } - - /** - * Set the delta of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param delta The text delta that was added. - */ - public void setDelta(@Nonnull final String delta) { - this.delta = delta; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} instance and return the - * same instance. - * - * @param sequenceNumber The sequence number for this event. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent sequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number for this event. - * - * @return sequenceNumber The sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} - * instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param sequenceNumber The sequence number for this event. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance and return the same - * instance. - * - * @param logprobs The log probabilities of the tokens in the delta. - * @return The same instance of this {@link OpenAIResponseTextDeltaEvent} class - */ - @Nonnull - public OpenAIResponseTextDeltaEvent logprobs( - @Nonnull final List logprobs) { - this.logprobs = logprobs; - return this; - } - - /** - * Add one logprobs instance to this {@link OpenAIResponseTextDeltaEvent}. - * - * @param logprobsItem The logprobs that should be added - * @return The same instance of type {@link OpenAIResponseTextDeltaEvent} - */ - @Nonnull - public OpenAIResponseTextDeltaEvent addLogprobsItem( - @Nonnull final OpenAIResponseLogProb logprobsItem) { - if (this.logprobs == null) { - this.logprobs = new ArrayList<>(); - } - this.logprobs.add(logprobsItem); - return this; - } - - /** - * The log probabilities of the tokens in the delta. - * - * @return logprobs The logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. - */ - @Nonnull - public List getLogprobs() { - return logprobs; - } - - /** - * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param logprobs The log probabilities of the tokens in the delta. - */ - public void setLogprobs(@Nonnull final List logprobs) { - this.logprobs = logprobs; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseTextDeltaEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseTextDeltaEvent} - * instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseTextDeltaEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseTextDeltaEvent} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (itemId != null) declaredFields.put("itemId", itemId); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (contentIndex != null) declaredFields.put("contentIndex", contentIndex); - if (delta != null) declaredFields.put("delta", delta); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - if (logprobs != null) declaredFields.put("logprobs", logprobs); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseTextDeltaEvent} instance. If the - * map previously contained a mapping for the key, the old value is replaced by the specified - * value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseTextDeltaEvent openAIResponseTextDeltaEvent = - (OpenAIResponseTextDeltaEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseTextDeltaEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseTextDeltaEvent.type) - && Objects.equals(this.itemId, openAIResponseTextDeltaEvent.itemId) - && Objects.equals(this.outputIndex, openAIResponseTextDeltaEvent.outputIndex) - && Objects.equals(this.contentIndex, openAIResponseTextDeltaEvent.contentIndex) - && Objects.equals(this.delta, openAIResponseTextDeltaEvent.delta) - && Objects.equals(this.sequenceNumber, openAIResponseTextDeltaEvent.sequenceNumber) - && Objects.equals(this.logprobs, openAIResponseTextDeltaEvent.logprobs); - } - - @Override - public int hashCode() { - return Objects.hash( - type, - itemId, - outputIndex, - contentIndex, - delta, - sequenceNumber, - logprobs, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseTextDeltaEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" contentIndex: ").append(toIndentedString(contentIndex)).append("\n"); - sb.append(" delta: ").append(toIndentedString(delta)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - sb.append(" logprobs: ").append(toIndentedString(logprobs)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseTextDeltaEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (itemId) -> - (outputIndex) -> - (contentIndex) -> - (delta) -> - (sequenceNumber) -> - (logprobs) -> - new OpenAIResponseTextDeltaEvent() - .type(type) - .itemId(itemId) - .outputIndex(outputIndex) - .contentIndex(contentIndex) - .delta(delta) - .sequenceNumber(sequenceNumber) - .logprobs(logprobs); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param type The type of the event. Always `response.output_text.delta`. - * @return The OpenAIResponseTextDeltaEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the itemId of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param itemId The ID of the output item that the text delta was added to. - * @return The OpenAIResponseTextDeltaEvent builder. - */ - Builder2 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputIndex of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param outputIndex The index of the output item that the text delta was added to. - * @return The OpenAIResponseTextDeltaEvent builder. - */ - Builder3 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the contentIndex of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param contentIndex The index of the content part that the text delta was added to. - * @return The OpenAIResponseTextDeltaEvent builder. - */ - Builder4 contentIndex(@Nonnull final Integer contentIndex); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the delta of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param delta The text delta that was added. - * @return The OpenAIResponseTextDeltaEvent builder. - */ - Builder5 delta(@Nonnull final String delta); - } - - /** Builder helper class. */ - public interface Builder5 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param sequenceNumber The sequence number for this event. - * @return The OpenAIResponseTextDeltaEvent builder. - */ - Builder6 sequenceNumber(@Nonnull final Integer sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder6 { - /** - * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param logprobs The log probabilities of the tokens in the delta. - * @return The OpenAIResponseTextDeltaEvent instance. - */ - OpenAIResponseTextDeltaEvent logprobs(@Nonnull final List logprobs); - - /** - * Set the logprobs of this {@link OpenAIResponseTextDeltaEvent} instance. - * - * @param logprobs The log probabilities of the tokens in the delta. - * @return The OpenAIResponseTextDeltaEvent instance. - */ - default OpenAIResponseTextDeltaEvent logprobs( - @Nonnull final OpenAIResponseLogProb... logprobs) { - return logprobs(Arrays.asList(logprobs)); - } - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java deleted file mode 100644 index df2798b49..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseTextParam.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * Configuration options for a text response from the model. Can be plain text or structured JSON - * data. Learn more: - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - */ -// CHECKSTYLE:OFF -public class OpenAIResponseTextParam -// CHECKSTYLE:ON -{ - @JsonProperty("format") - private OpenAITextResponseFormatConfiguration format; - - @JsonProperty("verbosity") - private OpenAIVerbosity verbosity; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseTextParam. */ - protected OpenAIResponseTextParam() {} - - /** - * Set the format of this {@link OpenAIResponseTextParam} instance and return the same instance. - * - * @param format The format of this {@link OpenAIResponseTextParam} - * @return The same instance of this {@link OpenAIResponseTextParam} class - */ - @Nonnull - public OpenAIResponseTextParam format( - @Nullable final OpenAITextResponseFormatConfiguration format) { - this.format = format; - return this; - } - - /** - * Get format - * - * @return format The format of this {@link OpenAIResponseTextParam} instance. - */ - @Nonnull - public OpenAITextResponseFormatConfiguration getFormat() { - return format; - } - - /** - * Set the format of this {@link OpenAIResponseTextParam} instance. - * - * @param format The format of this {@link OpenAIResponseTextParam} - */ - public void setFormat(@Nullable final OpenAITextResponseFormatConfiguration format) { - this.format = format; - } - - /** - * Set the verbosity of this {@link OpenAIResponseTextParam} instance and return the same - * instance. - * - * @param verbosity The verbosity of this {@link OpenAIResponseTextParam} - * @return The same instance of this {@link OpenAIResponseTextParam} class - */ - @Nonnull - public OpenAIResponseTextParam verbosity(@Nullable final OpenAIVerbosity verbosity) { - this.verbosity = verbosity; - return this; - } - - /** - * Get verbosity - * - * @return verbosity The verbosity of this {@link OpenAIResponseTextParam} instance. - */ - @Nullable - public OpenAIVerbosity getVerbosity() { - return verbosity; - } - - /** - * Set the verbosity of this {@link OpenAIResponseTextParam} instance. - * - * @param verbosity The verbosity of this {@link OpenAIResponseTextParam} - */ - public void setVerbosity(@Nullable final OpenAIVerbosity verbosity) { - this.verbosity = verbosity; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseTextParam}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseTextParam} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseTextParam has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseTextParam} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (format != null) declaredFields.put("format", format); - if (verbosity != null) declaredFields.put("verbosity", verbosity); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseTextParam} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseTextParam openAIResponseTextParam = (OpenAIResponseTextParam) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseTextParam.cloudSdkCustomFields) - && Objects.equals(this.format, openAIResponseTextParam.format) - && Objects.equals(this.verbosity, openAIResponseTextParam.verbosity); - } - - @Override - public int hashCode() { - return Objects.hash(format, verbosity, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseTextParam {\n"); - sb.append(" format: ").append(toIndentedString(format)).append("\n"); - sb.append(" verbosity: ").append(toIndentedString(verbosity)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** Create a new {@link OpenAIResponseTextParam} instance. No arguments are required. */ - public static OpenAIResponseTextParam create() { - return new OpenAIResponseTextParam(); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java deleted file mode 100644 index 26212d576..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsage.java +++ /dev/null @@ -1,407 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * Represents token usage details including input tokens, output tokens, a breakdown of output - * tokens, and the total tokens used. - */ -// CHECKSTYLE:OFF -public class OpenAIResponseUsage -// CHECKSTYLE:ON -{ - @JsonProperty("input_tokens") - private Integer inputTokens; - - @JsonProperty("input_tokens_details") - private OpenAIResponseUsageInputTokensDetails inputTokensDetails; - - @JsonProperty("output_tokens") - private Integer outputTokens; - - @JsonProperty("output_tokens_details") - private OpenAIResponseUsageOutputTokensDetails outputTokensDetails; - - @JsonProperty("total_tokens") - private Integer totalTokens; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseUsage. */ - protected OpenAIResponseUsage() {} - - /** - * Set the inputTokens of this {@link OpenAIResponseUsage} instance and return the same instance. - * - * @param inputTokens The number of input tokens. - * @return The same instance of this {@link OpenAIResponseUsage} class - */ - @Nonnull - public OpenAIResponseUsage inputTokens(@Nonnull final Integer inputTokens) { - this.inputTokens = inputTokens; - return this; - } - - /** - * The number of input tokens. - * - * @return inputTokens The inputTokens of this {@link OpenAIResponseUsage} instance. - */ - @Nonnull - public Integer getInputTokens() { - return inputTokens; - } - - /** - * Set the inputTokens of this {@link OpenAIResponseUsage} instance. - * - * @param inputTokens The number of input tokens. - */ - public void setInputTokens(@Nonnull final Integer inputTokens) { - this.inputTokens = inputTokens; - } - - /** - * Set the inputTokensDetails of this {@link OpenAIResponseUsage} instance and return the same - * instance. - * - * @param inputTokensDetails A detailed breakdown of the input tokens. - * @return The same instance of this {@link OpenAIResponseUsage} class - */ - @Nonnull - public OpenAIResponseUsage inputTokensDetails( - @Nonnull final OpenAIResponseUsageInputTokensDetails inputTokensDetails) { - this.inputTokensDetails = inputTokensDetails; - return this; - } - - /** - * A detailed breakdown of the input tokens. - * - * @return inputTokensDetails The inputTokensDetails of this {@link OpenAIResponseUsage} instance. - */ - @Nonnull - public OpenAIResponseUsageInputTokensDetails getInputTokensDetails() { - return inputTokensDetails; - } - - /** - * Set the inputTokensDetails of this {@link OpenAIResponseUsage} instance. - * - * @param inputTokensDetails A detailed breakdown of the input tokens. - */ - public void setInputTokensDetails( - @Nonnull final OpenAIResponseUsageInputTokensDetails inputTokensDetails) { - this.inputTokensDetails = inputTokensDetails; - } - - /** - * Set the outputTokens of this {@link OpenAIResponseUsage} instance and return the same instance. - * - * @param outputTokens The number of output tokens. - * @return The same instance of this {@link OpenAIResponseUsage} class - */ - @Nonnull - public OpenAIResponseUsage outputTokens(@Nonnull final Integer outputTokens) { - this.outputTokens = outputTokens; - return this; - } - - /** - * The number of output tokens. - * - * @return outputTokens The outputTokens of this {@link OpenAIResponseUsage} instance. - */ - @Nonnull - public Integer getOutputTokens() { - return outputTokens; - } - - /** - * Set the outputTokens of this {@link OpenAIResponseUsage} instance. - * - * @param outputTokens The number of output tokens. - */ - public void setOutputTokens(@Nonnull final Integer outputTokens) { - this.outputTokens = outputTokens; - } - - /** - * Set the outputTokensDetails of this {@link OpenAIResponseUsage} instance and return the same - * instance. - * - * @param outputTokensDetails A detailed breakdown of the output tokens. - * @return The same instance of this {@link OpenAIResponseUsage} class - */ - @Nonnull - public OpenAIResponseUsage outputTokensDetails( - @Nonnull final OpenAIResponseUsageOutputTokensDetails outputTokensDetails) { - this.outputTokensDetails = outputTokensDetails; - return this; - } - - /** - * A detailed breakdown of the output tokens. - * - * @return outputTokensDetails The outputTokensDetails of this {@link OpenAIResponseUsage} - * instance. - */ - @Nonnull - public OpenAIResponseUsageOutputTokensDetails getOutputTokensDetails() { - return outputTokensDetails; - } - - /** - * Set the outputTokensDetails of this {@link OpenAIResponseUsage} instance. - * - * @param outputTokensDetails A detailed breakdown of the output tokens. - */ - public void setOutputTokensDetails( - @Nonnull final OpenAIResponseUsageOutputTokensDetails outputTokensDetails) { - this.outputTokensDetails = outputTokensDetails; - } - - /** - * Set the totalTokens of this {@link OpenAIResponseUsage} instance and return the same instance. - * - * @param totalTokens The total number of tokens used. - * @return The same instance of this {@link OpenAIResponseUsage} class - */ - @Nonnull - public OpenAIResponseUsage totalTokens(@Nonnull final Integer totalTokens) { - this.totalTokens = totalTokens; - return this; - } - - /** - * The total number of tokens used. - * - * @return totalTokens The totalTokens of this {@link OpenAIResponseUsage} instance. - */ - @Nonnull - public Integer getTotalTokens() { - return totalTokens; - } - - /** - * Set the totalTokens of this {@link OpenAIResponseUsage} instance. - * - * @param totalTokens The total number of tokens used. - */ - public void setTotalTokens(@Nonnull final Integer totalTokens) { - this.totalTokens = totalTokens; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIResponseUsage}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIResponseUsage} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseUsage has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseUsage} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (inputTokens != null) declaredFields.put("inputTokens", inputTokens); - if (inputTokensDetails != null) declaredFields.put("inputTokensDetails", inputTokensDetails); - if (outputTokens != null) declaredFields.put("outputTokens", outputTokens); - if (outputTokensDetails != null) declaredFields.put("outputTokensDetails", outputTokensDetails); - if (totalTokens != null) declaredFields.put("totalTokens", totalTokens); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseUsage} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseUsage openAIResponseUsage = (OpenAIResponseUsage) o; - return Objects.equals(this.cloudSdkCustomFields, openAIResponseUsage.cloudSdkCustomFields) - && Objects.equals(this.inputTokens, openAIResponseUsage.inputTokens) - && Objects.equals(this.inputTokensDetails, openAIResponseUsage.inputTokensDetails) - && Objects.equals(this.outputTokens, openAIResponseUsage.outputTokens) - && Objects.equals(this.outputTokensDetails, openAIResponseUsage.outputTokensDetails) - && Objects.equals(this.totalTokens, openAIResponseUsage.totalTokens); - } - - @Override - public int hashCode() { - return Objects.hash( - inputTokens, - inputTokensDetails, - outputTokens, - outputTokensDetails, - totalTokens, - cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseUsage {\n"); - sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); - sb.append(" inputTokensDetails: ").append(toIndentedString(inputTokensDetails)).append("\n"); - sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); - sb.append(" outputTokensDetails: ") - .append(toIndentedString(outputTokensDetails)) - .append("\n"); - sb.append(" totalTokens: ").append(toIndentedString(totalTokens)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIResponseUsage} - * instance with all required arguments. - */ - public static Builder create() { - return (inputTokens) -> - (inputTokensDetails) -> - (outputTokens) -> - (outputTokensDetails) -> - (totalTokens) -> - new OpenAIResponseUsage() - .inputTokens(inputTokens) - .inputTokensDetails(inputTokensDetails) - .outputTokens(outputTokens) - .outputTokensDetails(outputTokensDetails) - .totalTokens(totalTokens); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the inputTokens of this {@link OpenAIResponseUsage} instance. - * - * @param inputTokens The number of input tokens. - * @return The OpenAIResponseUsage builder. - */ - Builder1 inputTokens(@Nonnull final Integer inputTokens); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the inputTokensDetails of this {@link OpenAIResponseUsage} instance. - * - * @param inputTokensDetails A detailed breakdown of the input tokens. - * @return The OpenAIResponseUsage builder. - */ - Builder2 inputTokensDetails( - @Nonnull final OpenAIResponseUsageInputTokensDetails inputTokensDetails); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the outputTokens of this {@link OpenAIResponseUsage} instance. - * - * @param outputTokens The number of output tokens. - * @return The OpenAIResponseUsage builder. - */ - Builder3 outputTokens(@Nonnull final Integer outputTokens); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the outputTokensDetails of this {@link OpenAIResponseUsage} instance. - * - * @param outputTokensDetails A detailed breakdown of the output tokens. - * @return The OpenAIResponseUsage builder. - */ - Builder4 outputTokensDetails( - @Nonnull final OpenAIResponseUsageOutputTokensDetails outputTokensDetails); - } - - /** Builder helper class. */ - public interface Builder4 { - /** - * Set the totalTokens of this {@link OpenAIResponseUsage} instance. - * - * @param totalTokens The total number of tokens used. - * @return The OpenAIResponseUsage instance. - */ - OpenAIResponseUsage totalTokens(@Nonnull final Integer totalTokens); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java deleted file mode 100644 index 2643b77dd..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageInputTokensDetails.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIResponseUsageInputTokensDetails */ -// CHECKSTYLE:OFF -public class OpenAIResponseUsageInputTokensDetails -// CHECKSTYLE:ON -{ - @JsonProperty("cached_tokens") - private Integer cachedTokens; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseUsageInputTokensDetails. */ - protected OpenAIResponseUsageInputTokensDetails() {} - - /** - * Set the cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} instance and return - * the same instance. - * - * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} - * @return The same instance of this {@link OpenAIResponseUsageInputTokensDetails} class - */ - @Nonnull - public OpenAIResponseUsageInputTokensDetails cachedTokens(@Nonnull final Integer cachedTokens) { - this.cachedTokens = cachedTokens; - return this; - } - - /** - * Get cachedTokens - * - * @return cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} - * instance. - */ - @Nonnull - public Integer getCachedTokens() { - return cachedTokens; - } - - /** - * Set the cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} instance. - * - * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} - */ - public void setCachedTokens(@Nonnull final Integer cachedTokens) { - this.cachedTokens = cachedTokens; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseUsageInputTokensDetails}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseUsageInputTokensDetails} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseUsageInputTokensDetails has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseUsageInputTokensDetails} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (cachedTokens != null) declaredFields.put("cachedTokens", cachedTokens); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseUsageInputTokensDetails} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseUsageInputTokensDetails openAIResponseUsageInputTokensDetails = - (OpenAIResponseUsageInputTokensDetails) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseUsageInputTokensDetails.cloudSdkCustomFields) - && Objects.equals(this.cachedTokens, openAIResponseUsageInputTokensDetails.cachedTokens); - } - - @Override - public int hashCode() { - return Objects.hash(cachedTokens, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseUsageInputTokensDetails {\n"); - sb.append(" cachedTokens: ").append(toIndentedString(cachedTokens)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseUsageInputTokensDetails} instance with all required arguments. - */ - public static Builder create() { - return (cachedTokens) -> new OpenAIResponseUsageInputTokensDetails().cachedTokens(cachedTokens); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} instance. - * - * @param cachedTokens The cachedTokens of this {@link OpenAIResponseUsageInputTokensDetails} - * @return The OpenAIResponseUsageInputTokensDetails instance. - */ - OpenAIResponseUsageInputTokensDetails cachedTokens(@Nonnull final Integer cachedTokens); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java deleted file mode 100644 index 0883b622c..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseUsageOutputTokensDetails.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** OpenAIResponseUsageOutputTokensDetails */ -// CHECKSTYLE:OFF -public class OpenAIResponseUsageOutputTokensDetails -// CHECKSTYLE:ON -{ - @JsonProperty("reasoning_tokens") - private Integer reasoningTokens; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseUsageOutputTokensDetails. */ - protected OpenAIResponseUsageOutputTokensDetails() {} - - /** - * Set the reasoningTokens of this {@link OpenAIResponseUsageOutputTokensDetails} instance and - * return the same instance. - * - * @param reasoningTokens The reasoningTokens of this {@link - * OpenAIResponseUsageOutputTokensDetails} - * @return The same instance of this {@link OpenAIResponseUsageOutputTokensDetails} class - */ - @Nonnull - public OpenAIResponseUsageOutputTokensDetails reasoningTokens( - @Nonnull final Integer reasoningTokens) { - this.reasoningTokens = reasoningTokens; - return this; - } - - /** - * Get reasoningTokens - * - * @return reasoningTokens The reasoningTokens of this {@link - * OpenAIResponseUsageOutputTokensDetails} instance. - */ - @Nonnull - public Integer getReasoningTokens() { - return reasoningTokens; - } - - /** - * Set the reasoningTokens of this {@link OpenAIResponseUsageOutputTokensDetails} instance. - * - * @param reasoningTokens The reasoningTokens of this {@link - * OpenAIResponseUsageOutputTokensDetails} - */ - public void setReasoningTokens(@Nonnull final Integer reasoningTokens) { - this.reasoningTokens = reasoningTokens; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseUsageOutputTokensDetails}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseUsageOutputTokensDetails} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseUsageOutputTokensDetails has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseUsageOutputTokensDetails} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (reasoningTokens != null) declaredFields.put("reasoningTokens", reasoningTokens); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseUsageOutputTokensDetails} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseUsageOutputTokensDetails openAIResponseUsageOutputTokensDetails = - (OpenAIResponseUsageOutputTokensDetails) o; - return Objects.equals( - this.cloudSdkCustomFields, openAIResponseUsageOutputTokensDetails.cloudSdkCustomFields) - && Objects.equals( - this.reasoningTokens, openAIResponseUsageOutputTokensDetails.reasoningTokens); - } - - @Override - public int hashCode() { - return Objects.hash(reasoningTokens, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseUsageOutputTokensDetails {\n"); - sb.append(" reasoningTokens: ").append(toIndentedString(reasoningTokens)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseUsageOutputTokensDetails} instance with all required arguments. - */ - public static Builder create() { - return (reasoningTokens) -> - new OpenAIResponseUsageOutputTokensDetails().reasoningTokens(reasoningTokens); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the reasoningTokens of this {@link OpenAIResponseUsageOutputTokensDetails} instance. - * - * @param reasoningTokens The reasoningTokens of this {@link - * OpenAIResponseUsageOutputTokensDetails} - * @return The OpenAIResponseUsageOutputTokensDetails instance. - */ - OpenAIResponseUsageOutputTokensDetails reasoningTokens(@Nonnull final Integer reasoningTokens); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java deleted file mode 100644 index 81dcdfa36..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallInProgressEvent.java +++ /dev/null @@ -1,412 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Note: web_search is not yet available via Azure OpenAI. */ -// CHECKSTYLE:OFF -public class OpenAIResponseWebSearchCallInProgressEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.web_search_call.in_progress`. */ - public enum TypeEnum { - /** - * The RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS option of this - * OpenAIResponseWebSearchCallInProgressEvent - */ - RESPONSE_WEB_SEARCH_CALL_IN_PROGRESS("response.web_search_call.in_progress"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseWebSearchCallInProgressEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseWebSearchCallInProgressEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseWebSearchCallInProgressEvent. */ - protected OpenAIResponseWebSearchCallInProgressEvent() {} - - /** - * Set the type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always `response.web_search_call.in_progress`. - * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallInProgressEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.web_search_call.in_progress`. - * - * @return type The type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param type The type of the event. Always `response.web_search_call.in_progress`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item that the web search call is associated with. - * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallInProgressEvent outputIndex( - @Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the web search call is associated with. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item that the web search call is associated with. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and return - * the same instance. - * - * @param itemId Unique ID for the output item associated with the web search call. - * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallInProgressEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * Unique ID for the output item associated with the web search call. - * - * @return itemId The itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param itemId Unique ID for the output item associated with the web search call. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of the web search call being processed. - * @return The same instance of this {@link OpenAIResponseWebSearchCallInProgressEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of the web search call being processed. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseWebSearchCallInProgressEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of the web search call being processed. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseWebSearchCallInProgressEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseWebSearchCallInProgressEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseWebSearchCallInProgressEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseWebSearchCallInProgressEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseWebSearchCallInProgressEvent openAIResponseWebSearchCallInProgressEvent = - (OpenAIResponseWebSearchCallInProgressEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseWebSearchCallInProgressEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseWebSearchCallInProgressEvent.type) - && Objects.equals(this.outputIndex, openAIResponseWebSearchCallInProgressEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseWebSearchCallInProgressEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseWebSearchCallInProgressEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseWebSearchCallInProgressEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseWebSearchCallInProgressEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseWebSearchCallInProgressEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param type The type of the event. Always `response.web_search_call.in_progress`. - * @return The OpenAIResponseWebSearchCallInProgressEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param outputIndex The index of the output item that the web search call is associated with. - * @return The OpenAIResponseWebSearchCallInProgressEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param itemId Unique ID for the output item associated with the web search call. - * @return The OpenAIResponseWebSearchCallInProgressEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallInProgressEvent} instance. - * - * @param sequenceNumber The sequence number of the web search call being processed. - * @return The OpenAIResponseWebSearchCallInProgressEvent instance. - */ - OpenAIResponseWebSearchCallInProgressEvent sequenceNumber( - @Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java deleted file mode 100644 index 99cf4b92d..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIResponseWebSearchCallSearchingEvent.java +++ /dev/null @@ -1,410 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** Note: web_search is not yet available via Azure OpenAI. */ -// CHECKSTYLE:OFF -public class OpenAIResponseWebSearchCallSearchingEvent -// CHECKSTYLE:ON -{ - /** The type of the event. Always `response.web_search_call.searching`. */ - public enum TypeEnum { - /** - * The RESPONSE_WEB_SEARCH_CALL_SEARCHING option of this - * OpenAIResponseWebSearchCallSearchingEvent - */ - RESPONSE_WEB_SEARCH_CALL_SEARCHING("response.web_search_call.searching"), - - /** The UNKNOWN_DEFAULT_OPEN_API option of this OpenAIResponseWebSearchCallSearchingEvent */ - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private String value; - - TypeEnum(String value) { - this.value = value; - } - - /** - * Get the value of the enum - * - * @return The enum value - */ - @JsonValue - @Nonnull - public String getValue() { - return value; - } - - /** - * Get the String value of the enum value. - * - * @return The enum value as String - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Get the enum value from a String value - * - * @param value The String value - * @return The enum value of type OpenAIResponseWebSearchCallSearchingEvent - */ - @JsonCreator - @Nonnull - public static TypeEnum fromValue(@Nonnull final String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return UNKNOWN_DEFAULT_OPEN_API; - } - } - - @JsonProperty("type") - private TypeEnum type; - - @JsonProperty("output_index") - private Integer outputIndex; - - @JsonProperty("item_id") - private String itemId; - - @JsonProperty("sequence_number") - private Integer sequenceNumber; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIResponseWebSearchCallSearchingEvent. */ - protected OpenAIResponseWebSearchCallSearchingEvent() {} - - /** - * Set the type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and return the - * same instance. - * - * @param type The type of the event. Always `response.web_search_call.searching`. - * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallSearchingEvent type(@Nonnull final TypeEnum type) { - this.type = type; - return this; - } - - /** - * The type of the event. Always `response.web_search_call.searching`. - * - * @return type The type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - */ - @Nonnull - public TypeEnum getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param type The type of the event. Always `response.web_search_call.searching`. - */ - public void setType(@Nonnull final TypeEnum type) { - this.type = type; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and - * return the same instance. - * - * @param outputIndex The index of the output item that the web search call is associated with. - * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallSearchingEvent outputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - return this; - } - - /** - * The index of the output item that the web search call is associated with. - * - * @return outputIndex The outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} - * instance. - */ - @Nonnull - public Integer getOutputIndex() { - return outputIndex; - } - - /** - * Set the outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param outputIndex The index of the output item that the web search call is associated with. - */ - public void setOutputIndex(@Nonnull final Integer outputIndex) { - this.outputIndex = outputIndex; - } - - /** - * Set the itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and return - * the same instance. - * - * @param itemId Unique ID for the output item associated with the web search call. - * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallSearchingEvent itemId(@Nonnull final String itemId) { - this.itemId = itemId; - return this; - } - - /** - * Unique ID for the output item associated with the web search call. - * - * @return itemId The itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - */ - @Nonnull - public String getItemId() { - return itemId; - } - - /** - * Set the itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param itemId Unique ID for the output item associated with the web search call. - */ - public void setItemId(@Nonnull final String itemId) { - this.itemId = itemId; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance and - * return the same instance. - * - * @param sequenceNumber The sequence number of the web search call being processed. - * @return The same instance of this {@link OpenAIResponseWebSearchCallSearchingEvent} class - */ - @Nonnull - public OpenAIResponseWebSearchCallSearchingEvent sequenceNumber( - @Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - return this; - } - - /** - * The sequence number of the web search call being processed. - * - * @return sequenceNumber The sequenceNumber of this {@link - * OpenAIResponseWebSearchCallSearchingEvent} instance. - */ - @Nonnull - public Integer getSequenceNumber() { - return sequenceNumber; - } - - /** - * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param sequenceNumber The sequence number of the web search call being processed. - */ - public void setSequenceNumber(@Nonnull final Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAIResponseWebSearchCallSearchingEvent}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIResponseWebSearchCallSearchingEvent has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIResponseWebSearchCallSearchingEvent} - * instance including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - if (outputIndex != null) declaredFields.put("outputIndex", outputIndex); - if (itemId != null) declaredFields.put("itemId", itemId); - if (sequenceNumber != null) declaredFields.put("sequenceNumber", sequenceNumber); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIResponseWebSearchCallSearchingEvent} - * instance. If the map previously contained a mapping for the key, the old value is replaced by - * the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIResponseWebSearchCallSearchingEvent openAIResponseWebSearchCallSearchingEvent = - (OpenAIResponseWebSearchCallSearchingEvent) o; - return Objects.equals( - this.cloudSdkCustomFields, - openAIResponseWebSearchCallSearchingEvent.cloudSdkCustomFields) - && Objects.equals(this.type, openAIResponseWebSearchCallSearchingEvent.type) - && Objects.equals(this.outputIndex, openAIResponseWebSearchCallSearchingEvent.outputIndex) - && Objects.equals(this.itemId, openAIResponseWebSearchCallSearchingEvent.itemId) - && Objects.equals( - this.sequenceNumber, openAIResponseWebSearchCallSearchingEvent.sequenceNumber); - } - - @Override - public int hashCode() { - return Objects.hash(type, outputIndex, itemId, sequenceNumber, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIResponseWebSearchCallSearchingEvent {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" outputIndex: ").append(toIndentedString(outputIndex)).append("\n"); - sb.append(" itemId: ").append(toIndentedString(itemId)).append("\n"); - sb.append(" sequenceNumber: ").append(toIndentedString(sequenceNumber)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAIResponseWebSearchCallSearchingEvent} instance with all required arguments. - */ - public static Builder create() { - return (type) -> - (outputIndex) -> - (itemId) -> - (sequenceNumber) -> - new OpenAIResponseWebSearchCallSearchingEvent() - .type(type) - .outputIndex(outputIndex) - .itemId(itemId) - .sequenceNumber(sequenceNumber); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param type The type of the event. Always `response.web_search_call.searching`. - * @return The OpenAIResponseWebSearchCallSearchingEvent builder. - */ - Builder1 type(@Nonnull final TypeEnum type); - } - - /** Builder helper class. */ - public interface Builder1 { - /** - * Set the outputIndex of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param outputIndex The index of the output item that the web search call is associated with. - * @return The OpenAIResponseWebSearchCallSearchingEvent builder. - */ - Builder2 outputIndex(@Nonnull final Integer outputIndex); - } - - /** Builder helper class. */ - public interface Builder2 { - /** - * Set the itemId of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param itemId Unique ID for the output item associated with the web search call. - * @return The OpenAIResponseWebSearchCallSearchingEvent builder. - */ - Builder3 itemId(@Nonnull final String itemId); - } - - /** Builder helper class. */ - public interface Builder3 { - /** - * Set the sequenceNumber of this {@link OpenAIResponseWebSearchCallSearchingEvent} instance. - * - * @param sequenceNumber The sequence number of the web search call being processed. - * @return The OpenAIResponseWebSearchCallSearchingEvent instance. - */ - OpenAIResponseWebSearchCallSearchingEvent sequenceNumber(@Nonnull final Integer sequenceNumber); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java deleted file mode 100644 index d67cc888e..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfiguration.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * An object specifying the format that the model must output. Configuring `{ - * \"type\": \"json_schema\" }` enables Structured Outputs, which ensures - * the model will match your supplied JSON schema. Learn more in the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). The default format is `{ - * \"type\": \"text\" }` with no additional options. *Not recommended for - * gpt-4o and newer models:** Setting to `{ \"type\": \"json_object\" - * }` enables the older JSON mode, which ensures the message the model generates is valid JSON. - * Using `json_schema` is preferred for models that support it. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAITextResponseFormatConfiguration -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAITextResponseFormatConfigurationType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAITextResponseFormatConfiguration. */ - protected OpenAITextResponseFormatConfiguration() {} - - /** - * Set the type of this {@link OpenAITextResponseFormatConfiguration} instance and return the same - * instance. - * - * @param type The type of this {@link OpenAITextResponseFormatConfiguration} - * @return The same instance of this {@link OpenAITextResponseFormatConfiguration} class - */ - @Nonnull - public OpenAITextResponseFormatConfiguration type( - @Nonnull final OpenAITextResponseFormatConfigurationType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAITextResponseFormatConfiguration} instance. - */ - @Nonnull - public OpenAITextResponseFormatConfigurationType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAITextResponseFormatConfiguration} instance. - * - * @param type The type of this {@link OpenAITextResponseFormatConfiguration} - */ - public void setType(@Nonnull final OpenAITextResponseFormatConfigurationType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link - * OpenAITextResponseFormatConfiguration}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link - * OpenAITextResponseFormatConfiguration} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAITextResponseFormatConfiguration has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAITextResponseFormatConfiguration} instance - * including unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAITextResponseFormatConfiguration} instance. - * If the map previously contained a mapping for the key, the old value is replaced by the - * specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAITextResponseFormatConfiguration openAITextResponseFormatConfiguration = - (OpenAITextResponseFormatConfiguration) o; - return Objects.equals( - this.cloudSdkCustomFields, openAITextResponseFormatConfiguration.cloudSdkCustomFields) - && Objects.equals(this.type, openAITextResponseFormatConfiguration.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAITextResponseFormatConfiguration {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link - * OpenAITextResponseFormatConfiguration} instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAITextResponseFormatConfiguration().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAITextResponseFormatConfiguration} instance. - * - * @param type The type of this {@link OpenAITextResponseFormatConfiguration} - * @return The OpenAITextResponseFormatConfiguration instance. - */ - OpenAITextResponseFormatConfiguration type( - @Nonnull final OpenAITextResponseFormatConfigurationType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java deleted file mode 100644 index 9193f4d00..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITextResponseFormatConfigurationType.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAITextResponseFormatConfigurationType */ -public interface OpenAITextResponseFormatConfigurationType { - /** - * Helper class to create {@code String } that implements {@link - * OpenAITextResponseFormatConfigurationType}. - */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAITextResponseFormatConfigurationType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java deleted file mode 100644 index be2685852..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAITool.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** A tool that can be used to generate a response. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAITool -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIToolType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAITool. */ - protected OpenAITool() {} - - /** - * Set the type of this {@link OpenAITool} instance and return the same instance. - * - * @param type The type of this {@link OpenAITool} - * @return The same instance of this {@link OpenAITool} class - */ - @Nonnull - public OpenAITool type(@Nonnull final OpenAIToolType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAITool} instance. - */ - @Nonnull - public OpenAIToolType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAITool} instance. - * - * @param type The type of this {@link OpenAITool} - */ - public void setType(@Nonnull final OpenAIToolType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAITool}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAITool} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException("OpenAITool has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAITool} instance including unrecognized - * properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAITool} instance. If the map previously - * contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAITool openAITool = (OpenAITool) o; - return Objects.equals(this.cloudSdkCustomFields, openAITool.cloudSdkCustomFields) - && Objects.equals(this.type, openAITool.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAITool {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAITool} instance - * with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAITool().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAITool} instance. - * - * @param type The type of this {@link OpenAITool} - * @return The OpenAITool instance. - */ - OpenAITool type(@Nonnull final OpenAIToolType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java deleted file mode 100644 index a29dd85a6..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParam.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.Objects; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * How the model should select which tool (or tools) to use when generating a response. See the - * `tools` parameter to see how to specify which tools the model can call. - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true) -@JsonSubTypes({}) -// CHECKSTYLE:OFF -public class OpenAIToolChoiceParam -// CHECKSTYLE:ON -{ - @JsonProperty("type") - private OpenAIToolChoiceParamType type; - - @JsonAnySetter @JsonAnyGetter - private final Map cloudSdkCustomFields = new LinkedHashMap<>(); - - /** Default constructor for OpenAIToolChoiceParam. */ - protected OpenAIToolChoiceParam() {} - - /** - * Set the type of this {@link OpenAIToolChoiceParam} instance and return the same instance. - * - * @param type The type of this {@link OpenAIToolChoiceParam} - * @return The same instance of this {@link OpenAIToolChoiceParam} class - */ - @Nonnull - public OpenAIToolChoiceParam type(@Nonnull final OpenAIToolChoiceParamType type) { - this.type = type; - return this; - } - - /** - * Get type - * - * @return type The type of this {@link OpenAIToolChoiceParam} instance. - */ - @Nonnull - public OpenAIToolChoiceParamType getType() { - return type; - } - - /** - * Set the type of this {@link OpenAIToolChoiceParam} instance. - * - * @param type The type of this {@link OpenAIToolChoiceParam} - */ - public void setType(@Nonnull final OpenAIToolChoiceParamType type) { - this.type = type; - } - - /** - * Get the names of the unrecognizable properties of the {@link OpenAIToolChoiceParam}. - * - * @return The set of properties names - */ - @JsonIgnore - @Nonnull - public Set getCustomFieldNames() { - return cloudSdkCustomFields.keySet(); - } - - /** - * Get the value of an unrecognizable property of this {@link OpenAIToolChoiceParam} instance. - * - * @deprecated Use {@link #toMap()} instead. - * @param name The name of the property - * @return The value of the property - * @throws NoSuchElementException If no property with the given name could be found. - */ - @Nullable - @Deprecated - public Object getCustomField(@Nonnull final String name) throws NoSuchElementException { - if (!cloudSdkCustomFields.containsKey(name)) { - throw new NoSuchElementException( - "OpenAIToolChoiceParam has no field with name '" + name + "'."); - } - return cloudSdkCustomFields.get(name); - } - - /** - * Get the value of all properties of this {@link OpenAIToolChoiceParam} instance including - * unrecognized properties. - * - * @return The map of all properties - */ - @JsonIgnore - @Nonnull - public Map toMap() { - final Map declaredFields = new LinkedHashMap<>(cloudSdkCustomFields); - if (type != null) declaredFields.put("type", type); - return declaredFields; - } - - /** - * Set an unrecognizable property of this {@link OpenAIToolChoiceParam} instance. If the map - * previously contained a mapping for the key, the old value is replaced by the specified value. - * - * @param customFieldName The name of the property - * @param customFieldValue The value of the property - */ - @JsonIgnore - public void setCustomField(@Nonnull String customFieldName, @Nullable Object customFieldValue) { - cloudSdkCustomFields.put(customFieldName, customFieldValue); - } - - @Override - public boolean equals(@Nullable final java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - final OpenAIToolChoiceParam openAIToolChoiceParam = (OpenAIToolChoiceParam) o; - return Objects.equals(this.cloudSdkCustomFields, openAIToolChoiceParam.cloudSdkCustomFields) - && Objects.equals(this.type, openAIToolChoiceParam.type); - } - - @Override - public int hashCode() { - return Objects.hash(type, cloudSdkCustomFields); - } - - @Override - @Nonnull - public String toString() { - final StringBuilder sb = new StringBuilder(); - sb.append("class OpenAIToolChoiceParam {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - cloudSdkCustomFields.forEach( - (k, v) -> - sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n")); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(final java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Create a type-safe, fluent-api builder object to construct a new {@link OpenAIToolChoiceParam} - * instance with all required arguments. - */ - public static Builder create() { - return (type) -> new OpenAIToolChoiceParam().type(type); - } - - /** Builder helper class. */ - public interface Builder { - /** - * Set the type of this {@link OpenAIToolChoiceParam} instance. - * - * @param type The type of this {@link OpenAIToolChoiceParam} - * @return The OpenAIToolChoiceParam instance. - */ - OpenAIToolChoiceParam type(@Nonnull final OpenAIToolChoiceParamType type); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java deleted file mode 100644 index ee210e6e1..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolChoiceParamType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIToolChoiceParamType */ -public interface OpenAIToolChoiceParamType { - /** Helper class to create {@code String } that implements {@link OpenAIToolChoiceParamType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIToolChoiceParamType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java deleted file mode 100644 index 6d2d8a38d..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIToolType.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import javax.annotation.Nonnull; - -/** OpenAIToolType */ -public interface OpenAIToolType { - /** Helper class to create {@code String } that implements {@link OpenAIToolType}. */ - record InnerString(@com.fasterxml.jackson.annotation.JsonValue @Nonnull String value) - implements OpenAIToolType {} - - /** - * Creator to enable deserialization of {@code String }. - * - * @param val the value to use - * @return a new instance of {@link InnerString}. - */ - @com.fasterxml.jackson.annotation.JsonCreator - @Nonnull - static InnerString create(@Nonnull final String val) { - return new InnerString(val); - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java deleted file mode 100644 index e1763bef2..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/generated/model/OpenAIVerbosity.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Azure AI Foundry Models Service - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - * - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.sap.ai.sdk.foundationmodels.openai.responses.generated.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import javax.annotation.Nonnull; - -/** Gets or Sets OpenAI.Verbosity */ -public enum OpenAIVerbosity { - LOW("low"), - - MEDIUM("medium"), - - HIGH("high"), - - UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api"); - - private final String value; - - OpenAIVerbosity(String value) { - this.value = value; - } - - /** - * @return The enum value. - */ - @JsonValue - public String getValue() { - return value; - } - - /** - * @return The String representation of the enum value. - */ - @Override - @Nonnull - public String toString() { - return String.valueOf(value); - } - - /** - * Converts the given value to its enum representation. - * - * @param value The input value. - * @return The enum representation of the given value. - */ - @JsonCreator - public static OpenAIVerbosity fromValue(@Nonnull final String value) { - for (final OpenAIVerbosity b : OpenAIVerbosity.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } -} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java index 42107d8e1..5f8003c7b 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java @@ -2,26 +2,96 @@ import static org.assertj.core.api.Assertions.assertThat; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.openai.core.ObjectMappers; import com.openai.models.ChatModel; import com.openai.models.responses.ResponseCreateParams; +import jdk.jfr.Description; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; class OpenAiResponseClientTest { - private static final OpenAiResponsesClient client = new OpenAiResponsesClient(); @Test @Disabled("Integration test - requires actual API credentials") void createResponse() { + final ResponseCreateParams request = ResponseCreateParams.builder() - .model(ChatModel.GPT_4O) + .model(ChatModel.GPT_5) .input("List 5 famous late twentieth century novels.") .build(); + final OpenAiResponsesClient client = new OpenAiResponsesClient(); final var response = client.createResponse(request); assertThat(response).isNotNull(); assertThat(response.output()).isNotEmpty(); } + + @Test + @Description("Demo OpenAI DTOs are jackson incompatible") + void testResponseCreateParamsSerializationIssue() throws Exception { + // Build a ResponseCreateParams object + final ResponseCreateParams params = + ResponseCreateParams.builder() + .model(ChatModel.GPT_4O) + .input("What is the capital of France?") + .temperature(0.7) + .build(); + + // Attempt to serialize with Jackson + final ObjectMapper mapper = new ObjectMapper(); + final String json = mapper.writeValueAsString(params); + + // Assert that the serialization produces empty or nearly empty JSON + // The issue is that Jackson doesn't serialize the private 'body' field + // It only sees public methods that return Optional, which Jackson doesn't serialize by + // default + assertThat(json) + .describedAs("ResponseCreateParams should serialize to empty JSON") + .isEqualTo("{}"); + } + + @Test + @Description("Demo OpenAI DTOs are jackson compatible with body attribute") + void testResponseCreateParamsSerialization() throws Exception { + // Build a ResponseCreateParams object + final ResponseCreateParams params = + ResponseCreateParams.builder() + .model(ChatModel.GPT_4O) + .input("What is the capital of France?") + .temperature(0.7) + .build(); + + // Attempt to serialize with Jackson + final ObjectMapper mapper = new ObjectMapper(); + final String json = mapper.writeValueAsString(params._body()); + + assertThat(json) + .describedAs("ResponseCreateParams should serialize to empty JSON") + .isEqualTo( + "{\"input\":\"What is the capital of France?\",\"model\":\"gpt-4o\",\"temperature\":0.7,\"valid\":true}"); + } + + @Test + void testResponseCreateParamsSerializationWithOpenAiMapper() throws Exception { + final ResponseCreateParams params = + ResponseCreateParams.builder() + .model(ChatModel.GPT_4O) + .input("What is the capital of France?") + .temperature(0.7) + .build(); + + // Use OpenAI SDK's mapper + final ObjectMapper mapper = ObjectMappers.jsonMapper(); + final String json = mapper.writeValueAsString(params._body()); + + System.out.println("Serialized JSON: " + json); + + // Now it should NOT be empty! + assertThat(json).isNotEqualTo("{}"); + assertThat(json).contains("gpt-4o"); + assertThat(json).contains("What is the capital of France?"); + } } From 37260894612707c9dd67f0eabf270cb6817b7bb5 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 20 Mar 2026 13:17:15 +0100 Subject: [PATCH 08/31] Version 1 --- foundation-models/openai-responses/pom.xml | 99 ++++++---------- .../openai/responses/OpenAiClientFactory.java | 112 ++++++++++++++++++ .../responses/OpenAiResponsesClient.java | 83 ------------- .../OpenAiResponsesClientException.java | 28 ----- .../responses/OpenAiResponsesError.java | 29 ----- .../responses/OpenAiClientFactoryTest.java | 48 ++++++++ .../responses/OpenAiResponseClientTest.java | 97 --------------- logback.xml | 2 + 8 files changed, 200 insertions(+), 298 deletions(-) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java create mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java delete mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index 4423caeb3..9ef8b78b7 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -45,95 +45,72 @@ 100% 100% 100% + 4.29.0 + 1.9.10 + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin-stdlib-jdk8.version} + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin-stdlib-jdk8.version} + + + - + com.sap.ai.sdk core + + com.sap.cloud.sdk.cloudplatform + cloudplatform-connectivity + com.openai - openai-java - 4.28.0 + openai-java-client-okhttp + ${openai-java.version} - com.google.code.findbugs - jsr305 + com.openai + openai-java-core + ${openai-java.version} - com.fasterxml.jackson.core - jackson-annotations + org.slf4j + slf4j-api + + com.google.code.findbugs + jsr305 + + org.projectlombok lombok provided + org.junit.jupiter junit-jupiter-api test - org.junit.jupiter - junit-jupiter-params + org.assertj + assertj-core test - org.assertj - assertj-core + com.sap.ai.sdk.foundationmodels + openai test - - - generate - - false - - generate - - - - - - com.sap.cloud.sdk.datamodel - openapi-generator-maven-plugin - - ${project.basedir}/src/main/java - true - COMPILE - true - - - - openai - - generate - - generate-sources - - ${project.basedir}/src/main/resources/spec/azure-responses-only.yaml - com.sap.ai.sdk.foundationmodels.openai.responses.generated.model - com.sap.ai.sdk.foundationmodels.openai.responses.generated.client - true - - apache-httpclient - create - protected - true - true - true - true - - - - - - - - - - diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java new file mode 100644 index 000000000..5104601d3 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java @@ -0,0 +1,112 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.credential.BearerTokenCredential; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.core.AiModel; +import com.sap.ai.sdk.core.DeploymentResolutionException; +import com.sap.cloud.sdk.cloudplatform.connectivity.Header; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import java.util.function.Supplier; +import javax.annotation.Nonnull; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +/** + * Provides factory methods for creating OpenAI SDK clients configured for SAP AI Core deployments. + * + *

This class handles deployment URL resolution, authentication credential extraction, and + * automatic OAuth token refresh required for SAP AI Core integration. + * + *

Example usage: + * + *

{@code
+ * OpenAIClient client = OpenAiClientFactory.forModel(OpenAiModel.GPT_4);
+ * }
+ */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class OpenAiClientFactory { + + private static final String AUTHORIZATION_HEADER = "Authorization"; + private static final String DEFAULT_RESOURCE_GROUP = "default"; + + /** + * Create an OpenAI client configured for a deployment that serves the specified model using the + * default resource group. If multiple deployments serve the model, the first one found will be + * used. + * + * @param model The AI model to target. + * @return A configured OpenAI client instance. + * @throws DeploymentResolutionException If no running deployment is found for the model. + */ + @Nonnull + public static OpenAIClient forModel(@Nonnull final AiModel model) { + return forModel(model, DEFAULT_RESOURCE_GROUP); + } + + /** + * Create an OpenAI client configured for a deployment that serves the specified model in the + * given resource group. If multiple deployments serve the model, the first one found will be + * used. + * + * @param model The AI model to target. + * @param resourceGroup The resource group containing the deployment. + * @return A configured OpenAI client instance. + * @throws DeploymentResolutionException If no running deployment is found for the model. + */ + @Nonnull + public static OpenAIClient forModel( + @Nonnull final AiModel model, @Nonnull final String resourceGroup) { + final HttpDestination destination = + new AiCoreService().getInferenceDestination(resourceGroup).forModel(model); + return fromDestination(destination); + } + + /** + * Create an OpenAI client from an HttpDestination. + * + *

The client uses a token supplier for automatic OAuth token refresh and includes custom + * headers from the destination for SAP AI Core routing. + * + * @param destination The destination to use for the OpenAI client. + * @return A configured OpenAI client instance. + */ + @Nonnull + static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) { + final String baseUrl = destination.getUri().toString(); + final Supplier tokenSupplier = () -> getAuthToken(destination); + + final OpenAIOkHttpClient.Builder builder = + OpenAIOkHttpClient.builder() + .baseUrl(baseUrl) + .credential(BearerTokenCredential.create(tokenSupplier)); + + addCustomHeaders(builder, destination); + + return builder.build(); + } + + @Nonnull + private static String getAuthToken(@Nonnull final HttpDestination destination) { + return destination.getHeaders().stream() + .filter(header -> AUTHORIZATION_HEADER.equalsIgnoreCase(header.getName())) + .findFirst() + .map(Header::getValue) + .map(authValue -> authValue.replace("Bearer", "").trim()) + .orElseThrow( + () -> + new IllegalStateException( + "No Authorization header found in destination. Unable to extract bearer token.")); + } + + private static void addCustomHeaders( + @Nonnull final OpenAIOkHttpClient.Builder builder, + @Nonnull final HttpDestination destination) { + destination.getHeaders().stream() + .filter(header -> !AUTHORIZATION_HEADER.equalsIgnoreCase(header.getName())) + .forEach(header -> builder.putHeader(header.getName(), header.getValue())); + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java deleted file mode 100644 index 0ae67a54d..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClient.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import static com.sap.ai.sdk.foundationmodels.openai.responses.OpenAiResponsesClientException.FACTORY; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.openai.core.ObjectMappers; -import com.openai.models.ChatModel; -import com.openai.models.responses.Response; -import com.openai.models.responses.ResponseCreateParams; -import com.sap.ai.sdk.core.AiCoreService; -import com.sap.ai.sdk.core.AiModel; -import com.sap.ai.sdk.core.common.ClientResponseHandler; -import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; -import com.sap.cloud.sdk.cloudplatform.connectivity.Destination; -import java.io.IOException; -import javax.annotation.Nonnull; -import org.apache.hc.client5.http.classic.methods.HttpPost; -import org.apache.hc.core5.http.ContentType; -import org.apache.hc.core5.http.io.entity.StringEntity; - -/** - * Client for interacting with the OpenAI Responses API. - * - *

This client provides access to OpenAI's Responses API, which is a newer API that supersedes - * the legacy Chat Completions API. It supports both synchronous and streaming responses. - * - * @since 1.17.0 - */ -public class OpenAiResponsesClient { - private final Destination destination; - private static final ObjectMapper JACKSON = ObjectMappers.jsonMapper(); - - /** Creates a new OpenAI Responses API client using the default resource group. */ - public OpenAiResponsesClient() { - destination = - new AiCoreService() - .getInferenceDestination() - .forModel( - new AiModel() { - @Override - public @Nonnull String name() { - return ChatModel.GPT_5.asString(); - } - - @Override - public @Nonnull String version() { - return "latest"; - } - }); - } - - /** - * Creates a response synchronously for the given request. - * - * @param request The request configuration for the response - * @return The complete response from the model - * @throws OpenAiResponsesClientException if the request fails - */ - @Nonnull - public Response createResponse(@Nonnull final ResponseCreateParams request) - throws OpenAiResponsesClientException { - return execute("/v1/responses", request); - } - - @Nonnull - private Response execute(@Nonnull final String path, @Nonnull final ResponseCreateParams request) - throws OpenAiResponsesClientException { - try { - final var httpPost = new HttpPost(path); - String json = JACKSON.writeValueAsString(request._body()); - httpPost.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON)); - - final var client = ApacheHttpClient5Accessor.getHttpClient(destination); - - return client.execute( - httpPost, - new ClientResponseHandler<>(Response.class, OpenAiResponsesError.class, FACTORY) - .objectMapper(ObjectMappers.jsonMapper())); - } catch (final IOException e) { - throw new OpenAiResponsesClientException("Failed to serialize request", e); - } - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java deleted file mode 100644 index 0af548de0..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesClientException.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import com.google.common.annotations.Beta; -import com.openai.models.responses.Response; -import com.openai.models.responses.ResponseError; -import com.sap.ai.sdk.core.common.ClientException; -import com.sap.ai.sdk.core.common.ClientExceptionFactory; -import javax.annotation.Nullable; -import lombok.experimental.StandardException; - -@StandardException -public class OpenAiResponsesClientException extends ClientException { - - static final ClientExceptionFactory - FACTORY = - (message, error, cause) -> - new OpenAiResponsesClientException(message, cause).setClientError(error); - - @Beta - @Nullable - public Response getErrorResponse() { - final var clientError = super.getClientError(); - if (clientError instanceof OpenAiResponsesError openAiError) { - return openAiError.getErrorResponse(); - } - return null; - } -} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java deleted file mode 100644 index 44f98533b..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponsesError.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.openai.models.responses.Response; -import com.openai.models.responses.ResponseError; -import com.sap.ai.sdk.core.common.ClientError; -import javax.annotation.Nonnull; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Value; - -/** - * Wrapper for Azure OpenAI Responses API error responses. - * - *

This class wraps Azure's {@link ResponseError} and provides deserialization support using - * Azure's JSON framework. - * - * @since 1.17.0 - */ -@Value -@AllArgsConstructor(onConstructor = @__({@JsonCreator}), access = AccessLevel.PROTECTED) -public class OpenAiResponsesError implements ClientError { - Response errorResponse; - - @Nonnull - public String getMessage() { - return errorResponse.error().get().message(); - } -} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java new file mode 100644 index 000000000..c2b2bf69b --- /dev/null +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java @@ -0,0 +1,48 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import com.openai.client.OpenAIClient; +import com.openai.models.ChatModel; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.sap.ai.sdk.foundationmodels.openai.OpenAiModel; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** Unit tests for {@link OpenAiClientFactory}. */ +class OpenAiClientFactoryTest { + + private static final String BASE_URL = "http://localhost:8080"; + + @Test + @Disabled("Integration test that requires a running SAP AI Core deployment") + void testCreateOpenAiClientFromAiModel() { + final OpenAIClient client = OpenAiClientFactory.forModel(OpenAiModel.GPT_5); + + final ResponseCreateParams request = + ResponseCreateParams.builder() + .model(ChatModel.GPT_5) // Utilizes a different model list that earlier + .input("List 5 famous late twentieth century novels.") + .build(); + + final Response response = client.responses().create(request); + + assertThat(response).isNotNull(); + assertThat(response.id()).isNotNull(); + assertThat(response.status()).isPresent(); + assertThat(response.output()).isNotEmpty(); + } + + @Test + void testFromDestinationWithoutAuthorizationHeader() { + final HttpDestination destination = DefaultHttpDestination.builder(BASE_URL).build(); + + assertThatThrownBy(() -> OpenAiClientFactory.fromDestination(destination)) + .isInstanceOf(IllegalStateException.class) + .hasMessageContaining("No Authorization header found"); + } +} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java deleted file mode 100644 index 5f8003c7b..000000000 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiResponseClientTest.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import static org.assertj.core.api.Assertions.assertThat; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.openai.core.ObjectMappers; -import com.openai.models.ChatModel; -import com.openai.models.responses.ResponseCreateParams; -import jdk.jfr.Description; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -class OpenAiResponseClientTest { - - @Test - @Disabled("Integration test - requires actual API credentials") - void createResponse() { - - final ResponseCreateParams request = - ResponseCreateParams.builder() - .model(ChatModel.GPT_5) - .input("List 5 famous late twentieth century novels.") - .build(); - - final OpenAiResponsesClient client = new OpenAiResponsesClient(); - final var response = client.createResponse(request); - - assertThat(response).isNotNull(); - assertThat(response.output()).isNotEmpty(); - } - - @Test - @Description("Demo OpenAI DTOs are jackson incompatible") - void testResponseCreateParamsSerializationIssue() throws Exception { - // Build a ResponseCreateParams object - final ResponseCreateParams params = - ResponseCreateParams.builder() - .model(ChatModel.GPT_4O) - .input("What is the capital of France?") - .temperature(0.7) - .build(); - - // Attempt to serialize with Jackson - final ObjectMapper mapper = new ObjectMapper(); - final String json = mapper.writeValueAsString(params); - - // Assert that the serialization produces empty or nearly empty JSON - // The issue is that Jackson doesn't serialize the private 'body' field - // It only sees public methods that return Optional, which Jackson doesn't serialize by - // default - assertThat(json) - .describedAs("ResponseCreateParams should serialize to empty JSON") - .isEqualTo("{}"); - } - - @Test - @Description("Demo OpenAI DTOs are jackson compatible with body attribute") - void testResponseCreateParamsSerialization() throws Exception { - // Build a ResponseCreateParams object - final ResponseCreateParams params = - ResponseCreateParams.builder() - .model(ChatModel.GPT_4O) - .input("What is the capital of France?") - .temperature(0.7) - .build(); - - // Attempt to serialize with Jackson - final ObjectMapper mapper = new ObjectMapper(); - final String json = mapper.writeValueAsString(params._body()); - - assertThat(json) - .describedAs("ResponseCreateParams should serialize to empty JSON") - .isEqualTo( - "{\"input\":\"What is the capital of France?\",\"model\":\"gpt-4o\",\"temperature\":0.7,\"valid\":true}"); - } - - @Test - void testResponseCreateParamsSerializationWithOpenAiMapper() throws Exception { - final ResponseCreateParams params = - ResponseCreateParams.builder() - .model(ChatModel.GPT_4O) - .input("What is the capital of France?") - .temperature(0.7) - .build(); - - // Use OpenAI SDK's mapper - final ObjectMapper mapper = ObjectMappers.jsonMapper(); - final String json = mapper.writeValueAsString(params._body()); - - System.out.println("Serialized JSON: " + json); - - // Now it should NOT be empty! - assertThat(json).isNotEqualTo("{}"); - assertThat(json).contains("gpt-4o"); - assertThat(json).contains("What is the capital of France?"); - } -} diff --git a/logback.xml b/logback.xml index 2bbaaa365..2cb6d6ee0 100644 --- a/logback.xml +++ b/logback.xml @@ -17,4 +17,6 @@ + + From 01c7f619ef7238f1ec2e996d4263e553bb965d82 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 20 Mar 2026 13:24:43 +0100 Subject: [PATCH 09/31] Stable api --- foundation-models/openai-responses/pom.xml | 10 +++++----- .../openai/responses/OpenAiClientFactoryTest.java | 13 +++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index 9ef8b78b7..e83f7c3f4 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -39,11 +39,11 @@ ${project.basedir}/../../ - 100% - 100% - 100% - 100% - 100% + 69% + 74% + 74% + 50% + 75% 100% 4.29.0 1.9.10 diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java index c2b2bf69b..063528e45 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java @@ -17,6 +17,7 @@ class OpenAiClientFactoryTest { private static final String BASE_URL = "http://localhost:8080"; + private static final String AUTH_TOKEN = "test-token-123"; @Test @Disabled("Integration test that requires a running SAP AI Core deployment") @@ -45,4 +46,16 @@ void testFromDestinationWithoutAuthorizationHeader() { .isInstanceOf(IllegalStateException.class) .hasMessageContaining("No Authorization header found"); } + + @Test + void testFromDestinationWithValidAuthorizationHeader() { + final HttpDestination destination = + DefaultHttpDestination.builder(BASE_URL) + .header("Authorization", "Bearer " + AUTH_TOKEN) + .build(); + + final OpenAIClient client = OpenAiClientFactory.fromDestination(destination); + + assertThat(client).isNotNull(); + } } From c921a86d811f31c79c6dae29796d0fc0824c0137 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 20 Mar 2026 13:25:58 +0100 Subject: [PATCH 10/31] Change class name --- .../{OpenAiClientFactory.java => OpenAiV1Client.java} | 2 +- .../openai/responses/OpenAiClientFactoryTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/{OpenAiClientFactory.java => OpenAiV1Client.java} (99%) diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java similarity index 99% rename from foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java rename to foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java index 5104601d3..76a27fc1c 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactory.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java @@ -28,7 +28,7 @@ */ @Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class OpenAiClientFactory { +public final class OpenAiV1Client { private static final String AUTHORIZATION_HEADER = "Authorization"; private static final String DEFAULT_RESOURCE_GROUP = "default"; diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java index 063528e45..af14c3e14 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java @@ -13,7 +13,7 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -/** Unit tests for {@link OpenAiClientFactory}. */ +/** Unit tests for {@link OpenAiV1Client}. */ class OpenAiClientFactoryTest { private static final String BASE_URL = "http://localhost:8080"; @@ -22,7 +22,7 @@ class OpenAiClientFactoryTest { @Test @Disabled("Integration test that requires a running SAP AI Core deployment") void testCreateOpenAiClientFromAiModel() { - final OpenAIClient client = OpenAiClientFactory.forModel(OpenAiModel.GPT_5); + final OpenAIClient client = OpenAiV1Client.forModel(OpenAiModel.GPT_5); final ResponseCreateParams request = ResponseCreateParams.builder() @@ -42,7 +42,7 @@ void testCreateOpenAiClientFromAiModel() { void testFromDestinationWithoutAuthorizationHeader() { final HttpDestination destination = DefaultHttpDestination.builder(BASE_URL).build(); - assertThatThrownBy(() -> OpenAiClientFactory.fromDestination(destination)) + assertThatThrownBy(() -> OpenAiV1Client.fromDestination(destination)) .isInstanceOf(IllegalStateException.class) .hasMessageContaining("No Authorization header found"); } @@ -54,7 +54,7 @@ void testFromDestinationWithValidAuthorizationHeader() { .header("Authorization", "Bearer " + AUTH_TOKEN) .build(); - final OpenAIClient client = OpenAiClientFactory.fromDestination(destination); + final OpenAIClient client = OpenAiV1Client.fromDestination(destination); assertThat(client).isNotNull(); } From 2491d070d2d1e534cf6c1b262262d27a1b49c0e9 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 20 Mar 2026 15:52:28 +0100 Subject: [PATCH 11/31] Add tests --- foundation-models/openai-responses/pom.xml | 28 ++-- .../responses/OpenAiClientFactoryTest.java | 61 ------- .../OpenAiV1ClientResponsesTest.java | 89 ++++++++++ .../resources/mappings/createResponse.json | 158 ++++++++++++++++++ pom.xml | 29 +++- sample-code/spring-app/pom.xml | 14 ++ .../ai/sdk/app/services/OpenAiV1Service.java | 34 ++++ .../ai/sdk/app/controllers/OpenAiV1Test.java | 26 +++ 8 files changed, 358 insertions(+), 81 deletions(-) delete mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java create mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java create mode 100644 foundation-models/openai-responses/src/test/resources/mappings/createResponse.json create mode 100644 sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java create mode 100644 sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index e83f7c3f4..c0e2fe022 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -45,23 +45,7 @@ 50% 75% 100% - 4.29.0 - 1.9.10 - - - - org.jetbrains.kotlin - kotlin-stdlib-jdk8 - ${kotlin-stdlib-jdk8.version} - - - org.jetbrains.kotlin - kotlin-stdlib - ${kotlin-stdlib-jdk8.version} - - - @@ -75,12 +59,10 @@ com.openai openai-java-client-okhttp - ${openai-java.version} com.openai openai-java-core - ${openai-java.version} org.slf4j @@ -112,5 +94,15 @@ openai test + + org.wiremock + wiremock + test + + + com.sap.cloud.sdk.cloudplatform + connectivity-apache-httpclient5 + test + diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java deleted file mode 100644 index af14c3e14..000000000 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiClientFactoryTest.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import com.openai.client.OpenAIClient; -import com.openai.models.ChatModel; -import com.openai.models.responses.Response; -import com.openai.models.responses.ResponseCreateParams; -import com.sap.ai.sdk.foundationmodels.openai.OpenAiModel; -import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; -import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -/** Unit tests for {@link OpenAiV1Client}. */ -class OpenAiClientFactoryTest { - - private static final String BASE_URL = "http://localhost:8080"; - private static final String AUTH_TOKEN = "test-token-123"; - - @Test - @Disabled("Integration test that requires a running SAP AI Core deployment") - void testCreateOpenAiClientFromAiModel() { - final OpenAIClient client = OpenAiV1Client.forModel(OpenAiModel.GPT_5); - - final ResponseCreateParams request = - ResponseCreateParams.builder() - .model(ChatModel.GPT_5) // Utilizes a different model list that earlier - .input("List 5 famous late twentieth century novels.") - .build(); - - final Response response = client.responses().create(request); - - assertThat(response).isNotNull(); - assertThat(response.id()).isNotNull(); - assertThat(response.status()).isPresent(); - assertThat(response.output()).isNotEmpty(); - } - - @Test - void testFromDestinationWithoutAuthorizationHeader() { - final HttpDestination destination = DefaultHttpDestination.builder(BASE_URL).build(); - - assertThatThrownBy(() -> OpenAiV1Client.fromDestination(destination)) - .isInstanceOf(IllegalStateException.class) - .hasMessageContaining("No Authorization header found"); - } - - @Test - void testFromDestinationWithValidAuthorizationHeader() { - final HttpDestination destination = - DefaultHttpDestination.builder(BASE_URL) - .header("Authorization", "Bearer " + AUTH_TOKEN) - .build(); - - final OpenAIClient client = OpenAiV1Client.fromDestination(destination); - - assertThat(client).isNotNull(); - } -} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java new file mode 100644 index 000000000..28ebbf19a --- /dev/null +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java @@ -0,0 +1,89 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; +import com.github.tomakehurst.wiremock.junit5.WireMockTest; +import com.openai.client.OpenAIClient; +import com.openai.models.ChatModel; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** Unit tests for {@link OpenAiV1Client} Responses API calls using WireMock. */ +@WireMockTest +class OpenAiV1ClientResponsesTest { + + private static final String BASE_URL = "http://localhost:8080"; + private static final String AUTH_TOKEN = "test-token-123"; + private OpenAIClient client; + + @BeforeEach + void setup(final WireMockRuntimeInfo server) { + final var destination = + DefaultHttpDestination.builder( + server.getHttpBaseUrl() + "/v2/inference/deployments/test-deployment") + .header("Authorization", "Bearer test-token-123") + .header("AI-Client-Type", "AI SDK Java") + .header("AI-Resource-Group", "default") + .build(); + + client = OpenAiV1Client.fromDestination(destination); + ApacheHttpClient5Accessor.setHttpClientCache(ApacheHttpClient5Cache.DISABLED); + } + + @Test + void testFromDestinationWithoutAuthorizationHeader() { + final HttpDestination destination = DefaultHttpDestination.builder(BASE_URL).build(); + + assertThatThrownBy(() -> OpenAiV1Client.fromDestination(destination)) + .isInstanceOf(IllegalStateException.class) + .hasMessageContaining("No Authorization header found"); + } + + @Test + void testFromDestinationWithAuthorizationHeader() { + final HttpDestination destination = + DefaultHttpDestination.builder(BASE_URL) + .header("Authorization", "Bearer " + AUTH_TOKEN) + .build(); + + final OpenAIClient client = OpenAiV1Client.fromDestination(destination); + + assertThat(client).isNotNull(); + } + + @Test + void testCreateResponse() { + final var params = + ResponseCreateParams.builder() + .input("What is the capital of France?") + .model(ChatModel.GPT_5) + .build(); + + final Response response = client.responses().create(params); + + assertThat(response).isNotNull(); + assertThat(response.id()).isEqualTo("resp_01a38d2783b385be0069bd43d260108193aef990678aa8a0af"); + assertThat(response.status()).isPresent(); + assertThat(response.status().orElseThrow().asString()).isEqualTo("completed"); + assertThat(response.model().toString()).contains("gpt-5-2025-08-07-dz-std"); + + assertThat(response.output()).isNotNull(); + assertThat(response.output()).hasSize(2); + + assertThat(response.usage()).isPresent(); + final var usage = response.usage().get(); + assertThat(usage.inputTokens()).isEqualTo(13); + assertThat(usage.outputTokens()).isEqualTo(59); + assertThat(usage.totalTokens()).isEqualTo(72); + + + } +} diff --git a/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json b/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json new file mode 100644 index 000000000..b8f3b3564 --- /dev/null +++ b/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json @@ -0,0 +1,158 @@ +{ + "request": { + "method": "POST", + "urlPattern": "/v2/inference/deployments/.*/responses", + "bodyPatterns": [ + { + "equalToJson": { + "input": "What is the capital of France?", + "model": "gpt-5" + } + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json", + "x-request-id": "a1c0c7e7-58a0-957c-bda8-1cf971154766", + "ai-inference-id": "a1c0c7e7-58a0-957c-bda8-1cf971154766", + "x-upstream-service-time": "1474" + }, + "jsonBody": { + "background": false, + "completed_at": 1774011347, + "content_filters": [ + { + "blocked": false, + "content_filter_offsets": { + "check_offset": 0, + "end_offset": 60, + "start_offset": 30 + }, + "content_filter_raw": [], + "content_filter_results": { + "hate": { + "filtered": false, + "severity": "safe" + }, + "self_harm": { + "filtered": false, + "severity": "safe" + }, + "sexual": { + "filtered": false, + "severity": "safe" + }, + "violence": { + "filtered": false, + "severity": "safe" + } + }, + "source_type": "prompt" + }, + { + "blocked": false, + "content_filter_offsets": { + "check_offset": 0, + "end_offset": 221, + "start_offset": 0 + }, + "content_filter_raw": [], + "content_filter_results": { + "hate": { + "filtered": false, + "severity": "safe" + }, + "protected_material_code": { + "detected": false, + "filtered": false + }, + "self_harm": { + "filtered": false, + "severity": "safe" + }, + "sexual": { + "filtered": false, + "severity": "safe" + }, + "violence": { + "filtered": false, + "severity": "safe" + } + }, + "source_type": "completion" + } + ], + "created_at": 1774011346, + "error": null, + "frequency_penalty": 0.0, + "id": "resp_01a38d2783b385be0069bd43d260108193aef990678aa8a0af", + "incomplete_details": null, + "instructions": null, + "max_output_tokens": null, + "max_tool_calls": null, + "metadata": {}, + "model": "gpt-5-2025-08-07-dz-std", + "object": "response", + "output": [ + { + "id": "rs_01a38d2783b385be0069bd43d2de808193a34727b53738d2e1", + "summary": [], + "type": "reasoning" + }, + { + "content": [ + { + "annotations": [], + "logprobs": [], + "text": "Paris.", + "type": "output_text" + } + ], + "id": "msg_01a38d2783b385be0069bd43d354388193a870074cabde1603", + "role": "assistant", + "status": "completed", + "type": "message" + } + ], + "parallel_tool_calls": true, + "presence_penalty": 0.0, + "previous_response_id": null, + "prompt_cache_key": null, + "prompt_cache_retention": null, + "reasoning": { + "effort": "medium", + "summary": null + }, + "safety_identifier": null, + "service_tier": "default", + "status": "completed", + "store": true, + "temperature": 1.0, + "text": { + "format": { + "type": "text" + }, + "verbosity": "medium" + }, + "tool_choice": "auto", + "tools": [], + "top_logprobs": 0, + "top_p": 1.0, + "truncation": "disabled", + "usage": { + "input_tokens": 13, + "input_tokens_details": { + "cached_tokens": 0 + }, + "output_tokens": 59, + "output_tokens_details": { + "reasoning_tokens": 0 + }, + "total_tokens": 72 + }, + "user": null + } + } +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 50df289bb..e8a2e983e 100644 --- a/pom.xml +++ b/pom.xml @@ -74,6 +74,8 @@ 4.38.0 2.21.1 1.5.32 + 1.9.10 + 4.29.0 1.16.4 20251224 @@ -267,6 +269,27 @@ spring-app ${project.version} + + com.openai + openai-java-client-okhttp + ${openai-java.version} + + + com.openai + openai-java-core + ${openai-java.version} + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + ${kotlin-stdlib-jdk8.version} + + + org.jetbrains.kotlin + kotlin-stdlib + ${kotlin-stdlib-jdk8.version} + @@ -440,7 +463,8 @@ Do not use JUnit 4.X, instead exclusively use Junit Jupiter. JUnit 4 tests will (silently) - simply not be executed. + simply not be executed. + junit:junit @@ -530,7 +554,8 @@ Apache Software License - Version 2.0|Apache License Version 2.0|Apache 2.0| The Apache License, Version 2.0|Apache License, Version 2.0|Apache-2.0| - The Apache Software License, Version 2.0|Apache License 2.0 + The Apache Software License, Version 2.0|Apache License 2.0 + The MIT License|MIT License|The MIT License (MIT)|MIT|MIT-0 The BSD 3-Clause License|BSD License 3|The BSD License|BSD-3-Clause|BSD-2-Clause|BSD licence Eclipse Distribution License - v 1.0|EDL 1.0 diff --git a/sample-code/spring-app/pom.xml b/sample-code/spring-app/pom.xml index 355da3f66..25a50fc8d 100644 --- a/sample-code/spring-app/pom.xml +++ b/sample-code/spring-app/pom.xml @@ -58,6 +58,12 @@ tomcat-embed-websocket ${apache-tomcat-embed.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + 2.19.4 + @@ -71,6 +77,14 @@ com.sap.ai.sdk.foundationmodels openai + + com.sap.ai.sdk.foundationmodels + openai-responses + + + com.openai + openai-java-core + com.sap.ai.sdk orchestration diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java new file mode 100644 index 000000000..c48f7cc44 --- /dev/null +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java @@ -0,0 +1,34 @@ +package com.sap.ai.sdk.app.services; + +import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_5; + +import com.openai.client.OpenAIClient; +import com.openai.models.ChatModel; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.sap.ai.sdk.foundationmodels.openai.responses.OpenAiV1Client; +import javax.annotation.Nonnull; +import lombok.extern.slf4j.Slf4j; +import lombok.val; +import org.springframework.stereotype.Service; + +/** Service class for the OpenAI Responses API */ +@Service +@Slf4j +public class OpenAiV1Service { + + private static final OpenAIClient client = OpenAiV1Client.forModel(GPT_5, "ai-sdk-java-e2e"); + + /** + * Create a simple response using the Responses API + * + * @param input the input text to send to the model + * @return the response object from the Responses API + */ + @Nonnull + public Response createResponse(@Nonnull final String input) { + val params = + ResponseCreateParams.builder().input(input).model(ChatModel.GPT_5).store(false).build(); + return client.responses().create(params); + } +} diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java new file mode 100644 index 000000000..344f7b90a --- /dev/null +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java @@ -0,0 +1,26 @@ +package com.sap.ai.sdk.app.controllers; + +import static org.assertj.core.api.Assertions.assertThat; + +import com.sap.ai.sdk.app.services.OpenAiV1Service; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@Slf4j +class OpenAiV1Test { + OpenAiV1Service service; + + @BeforeEach + void setUp() { + service = new OpenAiV1Service(); + } + + @Test + void testCreateResponse() { + final var response = service.createResponse("What is the capital of France?"); + assertThat(response).isNotNull(); + assertThat(response.output()).isNotNull(); + assertThat(response.output()).isNotEmpty(); + } +} From c004481cb812a1e88a748218499d27863a6535b2 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Fri, 20 Mar 2026 15:53:56 +0100 Subject: [PATCH 12/31] fix dependency analyse issues --- foundation-models/openai-responses/pom.xml | 5 ----- .../openai/responses/OpenAiV1ClientResponsesTest.java | 2 -- 2 files changed, 7 deletions(-) diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index c0e2fe022..bc6b1d3a8 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -89,11 +89,6 @@ assertj-core test - - com.sap.ai.sdk.foundationmodels - openai - test - org.wiremock wiremock diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java index 28ebbf19a..2c6274252 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java @@ -83,7 +83,5 @@ void testCreateResponse() { assertThat(usage.inputTokens()).isEqualTo(13); assertThat(usage.outputTokens()).isEqualTo(59); assertThat(usage.totalTokens()).isEqualTo(72); - - } } From fbff9b03da92915105e1447e56116c04506f95bf Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Sat, 21 Mar 2026 13:11:06 +0100 Subject: [PATCH 13/31] Initial draft untested --- foundation-models/openai-responses/pom.xml | 14 +- .../openai/responses/AiCoreOpenAiClient.java | 281 ++++++++++++++++++ .../openai/responses/OpenAiV1Client.java | 112 ------- .../responses/AiCoreOpenAiClientTest.java | 68 +++++ .../OpenAiV1ClientResponsesTest.java | 87 ------ .../resources/mappings/createResponse.json | 2 +- pom.xml | 5 + 7 files changed, 362 insertions(+), 207 deletions(-) create mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java delete mode 100644 foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java create mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java delete mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index bc6b1d3a8..b69a6bc44 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -57,13 +57,18 @@ cloudplatform-connectivity - com.openai - openai-java-client-okhttp + com.sap.cloud.sdk.cloudplatform + connectivity-apache-httpclient5 com.openai openai-java-core + + com.openai + openai-java + test + org.slf4j slf4j-api @@ -94,10 +99,5 @@ wiremock test - - com.sap.cloud.sdk.cloudplatform - connectivity-apache-httpclient5 - test - diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java new file mode 100644 index 000000000..6fa635976 --- /dev/null +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java @@ -0,0 +1,281 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import com.openai.client.OpenAIClient; +import com.openai.client.OpenAIClientImpl; +import com.openai.core.ClientOptions; +import com.openai.core.RequestOptions; +import com.openai.core.http.Headers; +import com.openai.core.http.HttpClient; +import com.openai.core.http.HttpRequest; +import com.openai.core.http.HttpRequestBody; +import com.openai.core.http.HttpResponse; +import com.sap.ai.sdk.core.AiCoreService; +import com.sap.ai.sdk.core.AiModel; +import com.sap.ai.sdk.core.DeploymentResolutionException; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import javax.annotation.Nonnull; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.hc.client5.http.classic.methods.HttpDelete; +import org.apache.hc.client5.http.classic.methods.HttpGet; +import org.apache.hc.client5.http.classic.methods.HttpHead; +import org.apache.hc.client5.http.classic.methods.HttpOptions; +import org.apache.hc.client5.http.classic.methods.HttpPatch; +import org.apache.hc.client5.http.classic.methods.HttpPost; +import org.apache.hc.client5.http.classic.methods.HttpPut; +import org.apache.hc.core5.http.ClassicHttpResponse; +import org.apache.hc.core5.http.ContentType; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.io.entity.ByteArrayEntity; +import org.apache.hc.core5.http.io.entity.EntityUtils; +import org.apache.hc.core5.http.message.BasicClassicHttpRequest; + +/** + * Factory for creating OpenAI SDK clients configured for SAP AI Core deployments. + * + *

This class provides factory methods that return fully configured OpenAI SDK clients using SAP + * Cloud SDK's Apache HttpClient with automatic OAuth token refresh. + * + *

The returned clients are long-lived and thread-safe. OAuth tokens are automatically refreshed + * on each request via the Cloud SDK's {@link ApacheHttpClient5Accessor}. + * + *

Example usage: + * + *

{@code
+ * OpenAIClient client = AiCoreOpenAiClient.forModel(OpenAiModel.GPT_4);
+ *
+ * ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
+ *     .addMessage(ChatCompletionUserMessageParam.builder()
+ *         .content(ChatCompletionUserMessageParam.Content.ofTextContent("Hello!"))
+ *         .build())
+ *     .model("gpt-4")
+ *     .build();
+ *
+ * ChatCompletion response = client.chat().completions().create(params);
+ * }
+ */ +@Slf4j +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class AiCoreOpenAiClient { + + private static final String DEFAULT_RESOURCE_GROUP = "default"; + + /** + * Create an OpenAI client for a deployment serving the specified model using the default resource + * group. + * + * @param model The AI model to target. + * @return A configured OpenAI client instance. + * @throws DeploymentResolutionException If no running deployment is found for the model. + */ + @Nonnull + public static OpenAIClient forModel(@Nonnull final AiModel model) { + return forModel(model, DEFAULT_RESOURCE_GROUP); + } + + /** + * Create an OpenAI client for a deployment serving the specified model in the given resource + * group. + * + * @param model The AI model to target. + * @param resourceGroup The resource group containing the deployment. + * @return A configured OpenAI client instance. + * @throws DeploymentResolutionException If no running deployment is found for the model. + */ + @Nonnull + public static OpenAIClient forModel( + @Nonnull final AiModel model, @Nonnull final String resourceGroup) { + final HttpDestination destination = + new AiCoreService().getInferenceDestination(resourceGroup).forModel(model); + + return fromDestination(destination); + } + + /** + * Create an OpenAI client from a pre-resolved destination. + * + *

The destination should point to an OpenAI-compatible deployment. This method is useful for + * advanced scenarios where you need custom destination configuration. + * + * @param destination The destination to use. + * @return A configured OpenAI client instance. + */ + @Nonnull + static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) { + final String baseUrl = destination.getUri().toString(); + final HttpClient httpClient = new AiCoreHttpClientImpl(destination); + + // Build ClientOptions with our custom HttpClient + final ClientOptions clientOptions = + ClientOptions.builder().baseUrl(baseUrl).httpClient(httpClient).build(); + + return new OpenAIClientImpl(clientOptions); + } + + /** + * Internal implementation of OpenAI SDK's HttpClient interface using Apache HttpClient from SAP + * Cloud SDK. + * + *

This client leverages Cloud SDK's {@link ApacheHttpClient5Accessor} which provides: - + * Automatic OAuth token refresh via {@code ApacheHttpClient5Wrapper} - Connection pooling and + * lifecycle management - Custom headers from destination (including AI-Resource-Group) - + * Thread-safe request execution + * + *

Package-private for testing purposes. + */ + @Slf4j + static final class AiCoreHttpClientImpl implements HttpClient { + + private final org.apache.hc.client5.http.classic.HttpClient apacheClient; + + AiCoreHttpClientImpl(@Nonnull final HttpDestination destination) { + // Get Apache HttpClient from Cloud SDK + // This client is wrapped by ApacheHttpClient5Wrapper which handles: + // - OAuth token refresh on each request via destination.getHeaders() + // - Custom headers from destination + // - URI path merging + this.apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); + + log.debug("Created HTTP client for destination: {}", destination.getUri()); + } + + @Override + public HttpResponse execute( + @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { + final BasicClassicHttpRequest apacheRequest = toApacheRequest(request); + + try { + // Execute request - OAuth token automatically refreshed by ApacheHttpClient5Wrapper + return apacheClient.execute(apacheRequest, this::toOpenAiResponse); + } catch (final IOException e) { + // Wrap IOException as the interface doesn't declare checked exceptions + throw new RuntimeException("HTTP request execution failed", e); + } + } + + @Override + public CompletableFuture executeAsync( + @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { + return CompletableFuture.supplyAsync(() -> execute(request, requestOptions)); + } + + @Override + public void close() { + // Apache HttpClient from Cloud SDK is managed externally + // No cleanup needed here + log.debug("HttpClient close() called - no-op as client is managed by Cloud SDK"); + } + + @Nonnull + private BasicClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { + // Build full URL from baseUrl + pathSegments + queryParams + final String fullUrl = request.url(); + + // Create Apache request with appropriate HTTP method + final BasicClassicHttpRequest apacheRequest = + createRequestByMethod(request.method().toString(), fullUrl); + + // Add headers from OpenAI SDK + // Note: Destination headers (OAuth, AI-Resource-Group, etc.) are added automatically + // by ApacheHttpClient5Wrapper.wrapRequest() on each request execution + request.headers() + .names() + .forEach( + name -> { + request + .headers() + .values(name) + .forEach(value -> apacheRequest.addHeader(name, value)); + }); + + // Add request body if present + final HttpRequestBody body = request.body(); + if (body != null) { + try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) { + body.writeTo(baos); + final byte[] bodyBytes = baos.toByteArray(); + final String contentType = + body.contentType() != null ? body.contentType() : "application/json"; + apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, ContentType.parse(contentType))); + } catch (final IOException e) { + throw new RuntimeException("Failed to read request body", e); + } + } + + return apacheRequest; + } + + @Nonnull + private BasicClassicHttpRequest createRequestByMethod( + @Nonnull final String method, @Nonnull final String url) { + return switch (method.toUpperCase()) { + case "GET" -> new HttpGet(url); + case "POST" -> new HttpPost(url); + case "PUT" -> new HttpPut(url); + case "DELETE" -> new HttpDelete(url); + case "PATCH" -> new HttpPatch(url); + case "HEAD" -> new HttpHead(url); + case "OPTIONS" -> new HttpOptions(url); + default -> throw new IllegalArgumentException("Unsupported HTTP method: " + method); + }; + } + + @Nonnull + private HttpResponse toOpenAiResponse(@Nonnull final ClassicHttpResponse apacheResponse) + throws IOException { + // Map status code + final int statusCode = apacheResponse.getCode(); + + // Map headers + final Map> headers = new HashMap<>(); + for (final Header header : apacheResponse.getHeaders()) { + headers.computeIfAbsent(header.getName(), k -> new ArrayList<>()).add(header.getValue()); + } + + // Map response body + final byte[] body = + apacheResponse.getEntity() != null + ? EntityUtils.toByteArray(apacheResponse.getEntity()) + : new byte[0]; + + // Build Headers object from map + final Headers.Builder headersBuilder = Headers.builder(); + headers.forEach((name, values) -> headersBuilder.put(name, values)); + final Headers responseHeaders = headersBuilder.build(); + + // Return anonymous implementation of HttpResponse interface + return new HttpResponse() { + @Override + public int statusCode() { + return statusCode; + } + + @Override + public Headers headers() { + return responseHeaders; + } + + @Override + public InputStream body() { + return new ByteArrayInputStream(body); + } + + @Override + public void close() { + // Body already consumed and stored in byte array + } + }; + } + } +} diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java deleted file mode 100644 index 76a27fc1c..000000000 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1Client.java +++ /dev/null @@ -1,112 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import com.openai.client.OpenAIClient; -import com.openai.client.okhttp.OpenAIOkHttpClient; -import com.openai.credential.BearerTokenCredential; -import com.sap.ai.sdk.core.AiCoreService; -import com.sap.ai.sdk.core.AiModel; -import com.sap.ai.sdk.core.DeploymentResolutionException; -import com.sap.cloud.sdk.cloudplatform.connectivity.Header; -import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; -import java.util.function.Supplier; -import javax.annotation.Nonnull; -import lombok.AccessLevel; -import lombok.NoArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -/** - * Provides factory methods for creating OpenAI SDK clients configured for SAP AI Core deployments. - * - *

This class handles deployment URL resolution, authentication credential extraction, and - * automatic OAuth token refresh required for SAP AI Core integration. - * - *

Example usage: - * - *

{@code
- * OpenAIClient client = OpenAiClientFactory.forModel(OpenAiModel.GPT_4);
- * }
- */ -@Slf4j -@NoArgsConstructor(access = AccessLevel.PRIVATE) -public final class OpenAiV1Client { - - private static final String AUTHORIZATION_HEADER = "Authorization"; - private static final String DEFAULT_RESOURCE_GROUP = "default"; - - /** - * Create an OpenAI client configured for a deployment that serves the specified model using the - * default resource group. If multiple deployments serve the model, the first one found will be - * used. - * - * @param model The AI model to target. - * @return A configured OpenAI client instance. - * @throws DeploymentResolutionException If no running deployment is found for the model. - */ - @Nonnull - public static OpenAIClient forModel(@Nonnull final AiModel model) { - return forModel(model, DEFAULT_RESOURCE_GROUP); - } - - /** - * Create an OpenAI client configured for a deployment that serves the specified model in the - * given resource group. If multiple deployments serve the model, the first one found will be - * used. - * - * @param model The AI model to target. - * @param resourceGroup The resource group containing the deployment. - * @return A configured OpenAI client instance. - * @throws DeploymentResolutionException If no running deployment is found for the model. - */ - @Nonnull - public static OpenAIClient forModel( - @Nonnull final AiModel model, @Nonnull final String resourceGroup) { - final HttpDestination destination = - new AiCoreService().getInferenceDestination(resourceGroup).forModel(model); - return fromDestination(destination); - } - - /** - * Create an OpenAI client from an HttpDestination. - * - *

The client uses a token supplier for automatic OAuth token refresh and includes custom - * headers from the destination for SAP AI Core routing. - * - * @param destination The destination to use for the OpenAI client. - * @return A configured OpenAI client instance. - */ - @Nonnull - static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) { - final String baseUrl = destination.getUri().toString(); - final Supplier tokenSupplier = () -> getAuthToken(destination); - - final OpenAIOkHttpClient.Builder builder = - OpenAIOkHttpClient.builder() - .baseUrl(baseUrl) - .credential(BearerTokenCredential.create(tokenSupplier)); - - addCustomHeaders(builder, destination); - - return builder.build(); - } - - @Nonnull - private static String getAuthToken(@Nonnull final HttpDestination destination) { - return destination.getHeaders().stream() - .filter(header -> AUTHORIZATION_HEADER.equalsIgnoreCase(header.getName())) - .findFirst() - .map(Header::getValue) - .map(authValue -> authValue.replace("Bearer", "").trim()) - .orElseThrow( - () -> - new IllegalStateException( - "No Authorization header found in destination. Unable to extract bearer token.")); - } - - private static void addCustomHeaders( - @Nonnull final OpenAIOkHttpClient.Builder builder, - @Nonnull final HttpDestination destination) { - destination.getHeaders().stream() - .filter(header -> !AUTHORIZATION_HEADER.equalsIgnoreCase(header.getName())) - .forEach(header -> builder.putHeader(header.getName(), header.getValue())); - } -} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java new file mode 100644 index 000000000..c57a1c54b --- /dev/null +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java @@ -0,0 +1,68 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import static com.github.tomakehurst.wiremock.client.WireMock.*; +import static org.assertj.core.api.Assertions.assertThat; + +import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; +import com.github.tomakehurst.wiremock.junit5.WireMockTest; +import com.openai.client.OpenAIClient; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseStatus; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@WireMockTest +class AiCoreOpenAiClientTest { + + private OpenAIClient client; + + @BeforeEach + void setup(WireMockRuntimeInfo server) { + // Create destination pointing to WireMock server + final var destination = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); + + // Create OpenAI client using our custom implementation + client = AiCoreOpenAiClient.fromDestination(destination); + + // Disable HTTP client caching for tests to ensure fresh clients + ApacheHttpClient5Accessor.setHttpClientCache(ApacheHttpClient5Cache.DISABLED); + } + + @AfterEach + void reset() { + ApacheHttpClient5Accessor.setHttpClientCache(null); + ApacheHttpClient5Accessor.setHttpClientFactory(null); + } + + @Test + void testResponseSuccess() { + // Create response request matching the WireMock mapping + final var params = + ResponseCreateParams.builder() + .input("What is the capital of France?") + .model("gpt-5") + .build(); + + // Execute request + final Response response = client.responses().create(params); + + // Verify response + assertThat(response).isNotNull(); + assertThat(response.id()).isEqualTo("resp_01a38d2783b385be0069bd43d260108193aef990678aa8a0af"); + assertThat(response.status().orElseThrow()).isEqualTo(ResponseStatus.COMPLETED); + assertThat(response.output()).isNotEmpty(); + + // Verify the request was made correctly + verify( + postRequestedFor(urlPathMatching("/responses")) + .withHeader("Content-Type", equalTo("application/json")) + .withRequestBody( + matchingJsonPath("$.input", equalTo("What is the capital of France?")) + .and(matchingJsonPath("$.model", equalTo("gpt-5"))))); + } +} diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java deleted file mode 100644 index 2c6274252..000000000 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/OpenAiV1ClientResponsesTest.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; - -import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; -import com.github.tomakehurst.wiremock.junit5.WireMockTest; -import com.openai.client.OpenAIClient; -import com.openai.models.ChatModel; -import com.openai.models.responses.Response; -import com.openai.models.responses.ResponseCreateParams; -import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; -import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; -import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; -import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -/** Unit tests for {@link OpenAiV1Client} Responses API calls using WireMock. */ -@WireMockTest -class OpenAiV1ClientResponsesTest { - - private static final String BASE_URL = "http://localhost:8080"; - private static final String AUTH_TOKEN = "test-token-123"; - private OpenAIClient client; - - @BeforeEach - void setup(final WireMockRuntimeInfo server) { - final var destination = - DefaultHttpDestination.builder( - server.getHttpBaseUrl() + "/v2/inference/deployments/test-deployment") - .header("Authorization", "Bearer test-token-123") - .header("AI-Client-Type", "AI SDK Java") - .header("AI-Resource-Group", "default") - .build(); - - client = OpenAiV1Client.fromDestination(destination); - ApacheHttpClient5Accessor.setHttpClientCache(ApacheHttpClient5Cache.DISABLED); - } - - @Test - void testFromDestinationWithoutAuthorizationHeader() { - final HttpDestination destination = DefaultHttpDestination.builder(BASE_URL).build(); - - assertThatThrownBy(() -> OpenAiV1Client.fromDestination(destination)) - .isInstanceOf(IllegalStateException.class) - .hasMessageContaining("No Authorization header found"); - } - - @Test - void testFromDestinationWithAuthorizationHeader() { - final HttpDestination destination = - DefaultHttpDestination.builder(BASE_URL) - .header("Authorization", "Bearer " + AUTH_TOKEN) - .build(); - - final OpenAIClient client = OpenAiV1Client.fromDestination(destination); - - assertThat(client).isNotNull(); - } - - @Test - void testCreateResponse() { - final var params = - ResponseCreateParams.builder() - .input("What is the capital of France?") - .model(ChatModel.GPT_5) - .build(); - - final Response response = client.responses().create(params); - - assertThat(response).isNotNull(); - assertThat(response.id()).isEqualTo("resp_01a38d2783b385be0069bd43d260108193aef990678aa8a0af"); - assertThat(response.status()).isPresent(); - assertThat(response.status().orElseThrow().asString()).isEqualTo("completed"); - assertThat(response.model().toString()).contains("gpt-5-2025-08-07-dz-std"); - - assertThat(response.output()).isNotNull(); - assertThat(response.output()).hasSize(2); - - assertThat(response.usage()).isPresent(); - final var usage = response.usage().get(); - assertThat(usage.inputTokens()).isEqualTo(13); - assertThat(usage.outputTokens()).isEqualTo(59); - assertThat(usage.totalTokens()).isEqualTo(72); - } -} diff --git a/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json b/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json index b8f3b3564..bf013a069 100644 --- a/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json +++ b/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json @@ -1,7 +1,7 @@ { "request": { "method": "POST", - "urlPattern": "/v2/inference/deployments/.*/responses", + "urlPattern": "/responses", "bodyPatterns": [ { "equalToJson": { diff --git a/pom.xml b/pom.xml index e8a2e983e..87f6e542e 100644 --- a/pom.xml +++ b/pom.xml @@ -279,6 +279,11 @@ openai-java-core ${openai-java.version} + + com.openai + openai-java + ${openai-java.version} + org.jetbrains.kotlin From 68524b2f248fc4f2cadb102c020874cc000c597e Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Sat, 21 Mar 2026 14:24:31 +0100 Subject: [PATCH 14/31] Second draft - Streaming no fully enabled --- foundation-models/openai-responses/pom.xml | 8 ++ .../openai/responses/AiCoreOpenAiClient.java | 80 ++++++++++--------- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index b69a6bc44..82f5a3aa0 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -64,6 +64,14 @@ com.openai openai-java-core + + org.apache.httpcomponents.client5 + httpclient5 + + + org.apache.httpcomponents.core5 + httpcore5 + com.openai openai-java diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java index 6fa635976..213cfbf40 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java @@ -9,6 +9,7 @@ import com.openai.core.http.HttpRequest; import com.openai.core.http.HttpRequestBody; import com.openai.core.http.HttpResponse; +import com.openai.errors.OpenAIIoException; import com.sap.ai.sdk.core.AiCoreService; import com.sap.ai.sdk.core.AiModel; import com.sap.ai.sdk.core.DeploymentResolutionException; @@ -22,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; import lombok.AccessLevel; @@ -117,8 +119,9 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) final HttpClient httpClient = new AiCoreHttpClientImpl(destination); // Build ClientOptions with our custom HttpClient + // Note: apiKey is required by SDK but unused since we handle auth via destination headers final ClientOptions clientOptions = - ClientOptions.builder().baseUrl(baseUrl).httpClient(httpClient).build(); + ClientOptions.builder().baseUrl(baseUrl).httpClient(httpClient).apiKey("unused").build(); return new OpenAIClientImpl(clientOptions); } @@ -137,44 +140,48 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) @Slf4j static final class AiCoreHttpClientImpl implements HttpClient { - private final org.apache.hc.client5.http.classic.HttpClient apacheClient; + private final HttpDestination destination; AiCoreHttpClientImpl(@Nonnull final HttpDestination destination) { - // Get Apache HttpClient from Cloud SDK - // This client is wrapped by ApacheHttpClient5Wrapper which handles: - // - OAuth token refresh on each request via destination.getHeaders() - // - Custom headers from destination - // - URI path merging - this.apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); - - log.debug("Created HTTP client for destination: {}", destination.getUri()); + this.destination = destination; + log.debug("Created HTTP client wrapper for destination: {}", destination.getUri()); } @Override + @Nonnull public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { + final org.apache.hc.client5.http.classic.HttpClient apacheClient = + ApacheHttpClient5Accessor.getHttpClient(destination); + final BasicClassicHttpRequest apacheRequest = toApacheRequest(request); try { - // Execute request - OAuth token automatically refreshed by ApacheHttpClient5Wrapper return apacheClient.execute(apacheRequest, this::toOpenAiResponse); } catch (final IOException e) { - // Wrap IOException as the interface doesn't declare checked exceptions - throw new RuntimeException("HTTP request execution failed", e); + throw new OpenAIIoException("HTTP request execution failed", e); + } finally { + Optional.ofNullable(request.body()).ifPresent(HttpRequestBody::close); } } @Override + @Nonnull public CompletableFuture executeAsync( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { - return CompletableFuture.supplyAsync(() -> execute(request, requestOptions)); + return CompletableFuture.supplyAsync(() -> execute(request, requestOptions)) + .whenComplete( + (response, error) -> + Optional.ofNullable(request.body()).ifPresent(HttpRequestBody::close)); } @Override public void close() { - // Apache HttpClient from Cloud SDK is managed externally - // No cleanup needed here - log.debug("HttpClient close() called - no-op as client is managed by Cloud SDK"); + // No-op: Apache HttpClient lifecycle is managed by Cloud SDK's ApacheHttpClient5Cache + // The cache maintains shared instances with automatic cleanup on expiration (default 1h TTL) + // We fetch the client on each request, so we don't hold any resources to clean up + log.debug( + "HttpClient close() called - no action needed, lifecycle managed by Cloud SDK cache"); } @Nonnull @@ -182,34 +189,29 @@ private BasicClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest reque // Build full URL from baseUrl + pathSegments + queryParams final String fullUrl = request.url(); - // Create Apache request with appropriate HTTP method + // Create request with appropriate HTTP method final BasicClassicHttpRequest apacheRequest = createRequestByMethod(request.method().toString(), fullUrl); - // Add headers from OpenAI SDK - // Note: Destination headers (OAuth, AI-Resource-Group, etc.) are added automatically - // by ApacheHttpClient5Wrapper.wrapRequest() on each request execution - request.headers() - .names() - .forEach( - name -> { - request - .headers() - .values(name) - .forEach(value -> apacheRequest.addHeader(name, value)); - }); + // Add headers from OpenAI SDK request + final Headers headers = request.headers(); + for (final String name : headers.names()) { + for (final String value : headers.values(name)) { + apacheRequest.addHeader(name, value); + } + } // Add request body if present - final HttpRequestBody body = request.body(); - if (body != null) { - try (final ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - body.writeTo(baos); - final byte[] bodyBytes = baos.toByteArray(); + final HttpRequestBody requestBody = request.body(); + if (requestBody != null) { + try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + requestBody.writeTo(outputStream); + final byte[] bodyBytes = outputStream.toByteArray(); final String contentType = - body.contentType() != null ? body.contentType() : "application/json"; + requestBody.contentType() != null ? requestBody.contentType() : "application/json"; apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, ContentType.parse(contentType))); } catch (final IOException e) { - throw new RuntimeException("Failed to read request body", e); + throw new OpenAIIoException("Failed to read request body", e); } } @@ -251,7 +253,7 @@ private HttpResponse toOpenAiResponse(@Nonnull final ClassicHttpResponse apacheR // Build Headers object from map final Headers.Builder headersBuilder = Headers.builder(); - headers.forEach((name, values) -> headersBuilder.put(name, values)); + headers.forEach(headersBuilder::put); final Headers responseHeaders = headersBuilder.build(); // Return anonymous implementation of HttpResponse interface @@ -261,11 +263,13 @@ public int statusCode() { return statusCode; } + @Nonnull @Override public Headers headers() { return responseHeaders; } + @Nonnull @Override public InputStream body() { return new ByteArrayInputStream(body); From 37ea275595ca7aa64d60f3ae03b333dcbf2a80b8 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 23 Mar 2026 10:32:48 +0100 Subject: [PATCH 15/31] Successful E2E --- .../openai/responses/AiCoreOpenAiClient.java | 3 +++ .../openai/responses/AiCoreOpenAiClientTest.java | 14 ++------------ logback.xml | 2 -- .../sap/ai/sdk/app/services/OpenAiV1Service.java | 4 ++-- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java index 213cfbf40..417d3bf79 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java @@ -196,6 +196,9 @@ private BasicClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest reque // Add headers from OpenAI SDK request final Headers headers = request.headers(); for (final String name : headers.names()) { + if (name.equals("Authorization")) { + continue; + } for (final String value : headers.values(name)) { apacheRequest.addHeader(name, value); } diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java index c57a1c54b..63a6257f4 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java @@ -12,6 +12,7 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import javax.annotation.Nonnull; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -22,7 +23,7 @@ class AiCoreOpenAiClientTest { private OpenAIClient client; @BeforeEach - void setup(WireMockRuntimeInfo server) { + void setup(@Nonnull final WireMockRuntimeInfo server) { // Create destination pointing to WireMock server final var destination = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); @@ -41,28 +42,17 @@ void reset() { @Test void testResponseSuccess() { - // Create response request matching the WireMock mapping final var params = ResponseCreateParams.builder() .input("What is the capital of France?") .model("gpt-5") .build(); - // Execute request final Response response = client.responses().create(params); - // Verify response assertThat(response).isNotNull(); assertThat(response.id()).isEqualTo("resp_01a38d2783b385be0069bd43d260108193aef990678aa8a0af"); assertThat(response.status().orElseThrow()).isEqualTo(ResponseStatus.COMPLETED); assertThat(response.output()).isNotEmpty(); - - // Verify the request was made correctly - verify( - postRequestedFor(urlPathMatching("/responses")) - .withHeader("Content-Type", equalTo("application/json")) - .withRequestBody( - matchingJsonPath("$.input", equalTo("What is the capital of France?")) - .and(matchingJsonPath("$.model", equalTo("gpt-5"))))); } } diff --git a/logback.xml b/logback.xml index 2cb6d6ee0..2bbaaa365 100644 --- a/logback.xml +++ b/logback.xml @@ -17,6 +17,4 @@ - - diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java index c48f7cc44..e7514b241 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java @@ -6,7 +6,7 @@ import com.openai.models.ChatModel; import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; -import com.sap.ai.sdk.foundationmodels.openai.responses.OpenAiV1Client; +import com.sap.ai.sdk.foundationmodels.openai.responses.AiCoreOpenAiClient; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -17,7 +17,7 @@ @Slf4j public class OpenAiV1Service { - private static final OpenAIClient client = OpenAiV1Client.forModel(GPT_5, "ai-sdk-java-e2e"); + private static final OpenAIClient client = AiCoreOpenAiClient.forModel(GPT_5, "ai-sdk-java-e2e"); /** * Create a simple response using the Responses API From 3bda22a4616f07f63daac28bd1f32a80d981cf11 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 23 Mar 2026 16:17:00 +0100 Subject: [PATCH 16/31] Streaming initial draft --- .../openai/responses/AiCoreOpenAiClient.java | 182 +++++++++++++----- 1 file changed, 130 insertions(+), 52 deletions(-) diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java index 417d3bf79..3244c879b 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java @@ -6,6 +6,7 @@ import com.openai.core.RequestOptions; import com.openai.core.http.Headers; import com.openai.core.http.HttpClient; +import com.openai.core.http.HttpMethod; import com.openai.core.http.HttpRequest; import com.openai.core.http.HttpRequestBody; import com.openai.core.http.HttpResponse; @@ -19,10 +20,7 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.nio.charset.StandardCharsets; import java.util.Optional; import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; @@ -38,7 +36,6 @@ import org.apache.hc.client5.http.classic.methods.HttpPut; import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.ContentType; -import org.apache.hc.core5.http.Header; import org.apache.hc.core5.http.io.entity.ByteArrayEntity; import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.message.BasicClassicHttpRequest; @@ -151,13 +148,19 @@ static final class AiCoreHttpClientImpl implements HttpClient { @Nonnull public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { - final org.apache.hc.client5.http.classic.HttpClient apacheClient = - ApacheHttpClient5Accessor.getHttpClient(destination); - - final BasicClassicHttpRequest apacheRequest = toApacheRequest(request); + final var apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); + final var apacheRequest = toApacheRequest(request); + final var isStreaming = isStreamingRequest(request); try { - return apacheClient.execute(apacheRequest, this::toOpenAiResponse); + if (isStreaming) { + // For streaming, use executeOpen to keep connection open until explicitly closed + final var apacheResponse = apacheClient.executeOpen(null, apacheRequest, null); + return createStreamingResponse(apacheResponse); + } else { + // For non-streaming, use response handler which auto-closes the response + return apacheClient.execute(apacheRequest, this::createBufferedResponse); + } } catch (final IOException e) { throw new OpenAIIoException("HTTP request execution failed", e); } finally { @@ -177,42 +180,35 @@ public CompletableFuture executeAsync( @Override public void close() { - // No-op: Apache HttpClient lifecycle is managed by Cloud SDK's ApacheHttpClient5Cache - // The cache maintains shared instances with automatic cleanup on expiration (default 1h TTL) - // We fetch the client on each request, so we don't hold any resources to clean up - log.debug( - "HttpClient close() called - no action needed, lifecycle managed by Cloud SDK cache"); + // Apache HttpClient lifecycle is managed by Cloud SDK's ApacheHttpClient5Cache } @Nonnull private BasicClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { - // Build full URL from baseUrl + pathSegments + queryParams - final String fullUrl = request.url(); + final var fullUrl = request.url(); + final var httpMethod = request.method(); + final var apacheRequest = createRequestByMethod(httpMethod, fullUrl); - // Create request with appropriate HTTP method - final BasicClassicHttpRequest apacheRequest = - createRequestByMethod(request.method().toString(), fullUrl); - - // Add headers from OpenAI SDK request - final Headers headers = request.headers(); - for (final String name : headers.names()) { + final var headers = request.headers(); + for (final var name : headers.names()) { if (name.equals("Authorization")) { continue; } - for (final String value : headers.values(name)) { + for (final var value : headers.values(name)) { apacheRequest.addHeader(name, value); } } // Add request body if present - final HttpRequestBody requestBody = request.body(); - if (requestBody != null) { - try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { - requestBody.writeTo(outputStream); - final byte[] bodyBytes = outputStream.toByteArray(); - final String contentType = - requestBody.contentType() != null ? requestBody.contentType() : "application/json"; - apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, ContentType.parse(contentType))); + final var body = request.body(); + if (body != null) { + try (final var outputStream = new ByteArrayOutputStream()) { + body.writeTo(outputStream); + final var bodyBytes = outputStream.toByteArray(); + final var contentType = + Optional.ofNullable(ContentType.parse(body.contentType())) + .orElse(ContentType.APPLICATION_JSON); + apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, contentType)); } catch (final IOException e) { throw new OpenAIIoException("Failed to read request body", e); } @@ -223,8 +219,8 @@ private BasicClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest reque @Nonnull private BasicClassicHttpRequest createRequestByMethod( - @Nonnull final String method, @Nonnull final String url) { - return switch (method.toUpperCase()) { + @Nonnull final HttpMethod method, @Nonnull final String url) { + return switch (method.toString().toUpperCase()) { case "GET" -> new HttpGet(url); case "POST" -> new HttpPost(url); case "PUT" -> new HttpPut(url); @@ -236,30 +232,112 @@ private BasicClassicHttpRequest createRequestByMethod( }; } + /** + * Detects if the current request is a streaming request by checking for the stream parameter. + * + * @param request The HTTP request to check + * @return true if this is a streaming request, false otherwise + */ + private boolean isStreamingRequest(@Nonnull final HttpRequest request) { + final HttpRequestBody requestBody = request.body(); + if (requestBody != null) { + try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { + requestBody.writeTo(outputStream); + final String bodyContent = outputStream.toString(StandardCharsets.UTF_8); + // Check for "stream":true or "stream": true in JSON body + return bodyContent.contains("\"stream\":true") + || bodyContent.contains("\"stream\": true"); + } catch (final IOException e) { + log.warn("Failed to read request body for streaming detection", e); + return false; + } + } + return false; + } + + @Nonnull + private Headers extractResponseHeaders(@Nonnull final ClassicHttpResponse apacheResponse) { + final var builder = Headers.builder(); + for (final var header : apacheResponse.getHeaders()) { + builder.put(header.getName(), header.getValue()); + } + return builder.build(); + } + + /** + * Creates a streaming HttpResponse that keeps the connection open and provides a live + * InputStream. + * + * @param apacheResponse Apache HTTP response (must be kept open) + * @return HttpResponse with live stream + * @throws IOException if getting the stream fails + */ @Nonnull - private HttpResponse toOpenAiResponse(@Nonnull final ClassicHttpResponse apacheResponse) + private HttpResponse createStreamingResponse(@Nonnull final ClassicHttpResponse apacheResponse) throws IOException { - // Map status code - final int statusCode = apacheResponse.getCode(); - // Map headers - final Map> headers = new HashMap<>(); - for (final Header header : apacheResponse.getHeaders()) { - headers.computeIfAbsent(header.getName(), k -> new ArrayList<>()).add(header.getValue()); - } + final var statusCode = apacheResponse.getCode(); + final var headers = extractResponseHeaders(apacheResponse); + + // Get live stream - do NOT buffer for streaming responses + final InputStream liveStream = + apacheResponse.getEntity() != null + ? apacheResponse.getEntity().getContent() + : InputStream.nullInputStream(); + + // Return response that keeps connection open until stream is closed + return new HttpResponse() { + @Override + public int statusCode() { + return statusCode; + } + + @Nonnull + @Override + public Headers headers() { + return headers; + } + + @Nonnull + @Override + public InputStream body() { + return liveStream; + } + + @Override + public void close() { + try { + liveStream.close(); + apacheResponse.close(); + log.debug("Closed streaming response connection"); + } catch (final IOException e) { + log.warn("Failed to close streaming response", e); + } + } + }; + } - // Map response body + /** + * Creates a buffered HttpResponse with the entire response body loaded into memory. + * + * @param apacheResponse Apache HTTP response (will be consumed and closed) + * @return HttpResponse with buffered body + * @throws IOException if reading the response body fails + */ + @Nonnull + private HttpResponse createBufferedResponse(@Nonnull final ClassicHttpResponse apacheResponse) + throws IOException { + + final int statusCode = apacheResponse.getCode(); + final Headers headers = extractResponseHeaders(apacheResponse); + + // Buffer response body for non-streaming requests final byte[] body = apacheResponse.getEntity() != null ? EntityUtils.toByteArray(apacheResponse.getEntity()) : new byte[0]; - // Build Headers object from map - final Headers.Builder headersBuilder = Headers.builder(); - headers.forEach(headersBuilder::put); - final Headers responseHeaders = headersBuilder.build(); - - // Return anonymous implementation of HttpResponse interface + // Return response with buffered body return new HttpResponse() { @Override public int statusCode() { @@ -269,7 +347,7 @@ public int statusCode() { @Nonnull @Override public Headers headers() { - return responseHeaders; + return headers; } @Nonnull @@ -280,7 +358,7 @@ public InputStream body() { @Override public void close() { - // Body already consumed and stored in byte array + // Body already consumed and stored in byte array, nothing to close } }; } From 229db60ca0a5474731a0f0407b1904d2e9f6d929 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 24 Mar 2026 15:42:46 +0100 Subject: [PATCH 17/31] Streaming E2E with chat completion --- foundation-models/openai-responses/pom.xml | 12 +- .../openai/responses/AiCoreOpenAiClient.java | 257 ++++++++--------- .../responses/AiCoreHttpClientImplTest.java | 267 ++++++++++++++++++ logback.xml | 4 +- .../ai/sdk/app/services/OpenAiV1Service.java | 54 ++++ .../ai/sdk/app/controllers/OpenAiV1Test.java | 46 +++ 6 files changed, 497 insertions(+), 143 deletions(-) create mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-responses/pom.xml index 82f5a3aa0..ab3c8ad37 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-responses/pom.xml @@ -39,7 +39,7 @@ ${project.basedir}/../../ - 69% + 55% 74% 74% 50% @@ -72,11 +72,6 @@ org.apache.httpcomponents.core5 httpcore5 - - com.openai - openai-java - test - org.slf4j slf4j-api @@ -107,5 +102,10 @@ wiremock test + + org.mockito + mockito-core + test + diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java index 3244c879b..d4a661e7d 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java @@ -6,7 +6,6 @@ import com.openai.core.RequestOptions; import com.openai.core.http.Headers; import com.openai.core.http.HttpClient; -import com.openai.core.http.HttpMethod; import com.openai.core.http.HttpRequest; import com.openai.core.http.HttpRequestBody; import com.openai.core.http.HttpResponse; @@ -20,25 +19,25 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; import java.nio.charset.StandardCharsets; import java.util.Optional; import java.util.concurrent.CompletableFuture; +import java.util.regex.Pattern; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import lombok.AccessLevel; import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.hc.client5.http.classic.methods.HttpDelete; -import org.apache.hc.client5.http.classic.methods.HttpGet; -import org.apache.hc.client5.http.classic.methods.HttpHead; -import org.apache.hc.client5.http.classic.methods.HttpOptions; -import org.apache.hc.client5.http.classic.methods.HttpPatch; -import org.apache.hc.client5.http.classic.methods.HttpPost; -import org.apache.hc.client5.http.classic.methods.HttpPut; +import org.apache.hc.core5.http.ClassicHttpRequest; import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.ContentType; import org.apache.hc.core5.http.io.entity.ByteArrayEntity; import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.message.BasicClassicHttpRequest; +import org.apache.hc.core5.net.URIBuilder; /** * Factory for creating OpenAI SDK clients configured for SAP AI Core deployments. @@ -111,9 +110,10 @@ public static OpenAIClient forModel( * @return A configured OpenAI client instance. */ @Nonnull + @SuppressWarnings("PMD.CloseResource") static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) { - final String baseUrl = destination.getUri().toString(); - final HttpClient httpClient = new AiCoreHttpClientImpl(destination); + final var baseUrl = destination.getUri().toString(); + final var httpClient = new AiCoreHttpClientImpl(destination); // Build ClientOptions with our custom HttpClient // Note: apiKey is required by SDK but unused since we handle auth via destination headers @@ -135,31 +135,30 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) *

Package-private for testing purposes. */ @Slf4j + @RequiredArgsConstructor(access = AccessLevel.PACKAGE) static final class AiCoreHttpClientImpl implements HttpClient { - private final HttpDestination destination; - AiCoreHttpClientImpl(@Nonnull final HttpDestination destination) { - this.destination = destination; - log.debug("Created HTTP client wrapper for destination: {}", destination.getUri()); - } + private static final Pattern STREAM_PATTERN = Pattern.compile("\"stream\"\\s*:\\s*true"); @Override @Nonnull + @SuppressWarnings("PMD.CloseResource") public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { final var apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); - final var apacheRequest = toApacheRequest(request); - final var isStreaming = isStreamingRequest(request); + final var preparedRequest = prepareRequest(request); + final boolean isStreaming = + isStreamingBody(preparedRequest.bodyBytes()) || isStreamingQuery(request); try { if (isStreaming) { - // For streaming, use executeOpen to keep connection open until explicitly closed - final var apacheResponse = apacheClient.executeOpen(null, apacheRequest, null); + final var apacheResponse = + apacheClient.executeOpen(null, preparedRequest.apacheRequest(), null); return createStreamingResponse(apacheResponse); } else { - // For non-streaming, use response handler which auto-closes the response - return apacheClient.execute(apacheRequest, this::createBufferedResponse); + return apacheClient.execute( + preparedRequest.apacheRequest(), this::createBufferedResponse); } } catch (final IOException e) { throw new OpenAIIoException("HTTP request execution failed", e); @@ -172,10 +171,7 @@ public HttpResponse execute( @Nonnull public CompletableFuture executeAsync( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { - return CompletableFuture.supplyAsync(() -> execute(request, requestOptions)) - .whenComplete( - (response, error) -> - Optional.ofNullable(request.body()).ifPresent(HttpRequestBody::close)); + return CompletableFuture.supplyAsync(() -> execute(request, requestOptions)); } @Override @@ -184,79 +180,80 @@ public void close() { } @Nonnull - private BasicClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { - final var fullUrl = request.url(); - final var httpMethod = request.method(); - final var apacheRequest = createRequestByMethod(httpMethod, fullUrl); - - final var headers = request.headers(); - for (final var name : headers.names()) { - if (name.equals("Authorization")) { - continue; - } - for (final var value : headers.values(name)) { - apacheRequest.addHeader(name, value); - } - } - - // Add request body if present - final var body = request.body(); - if (body != null) { - try (final var outputStream = new ByteArrayOutputStream()) { - body.writeTo(outputStream); + @SuppressWarnings("PMD.CloseResource") + private PreparedRequest prepareRequest(@Nonnull final HttpRequest request) { + final var fullUri = buildUrlWithQueryParams(request); + final var method = request.method(); + final var apacheRequest = new BasicClassicHttpRequest(method.name(), fullUri.toString()); + applyRequestHeaders(request, apacheRequest); + + final var requestBody = request.body(); + if (requestBody != null) { + try (var outputStream = new ByteArrayOutputStream()) { + requestBody.writeTo(outputStream); final var bodyBytes = outputStream.toByteArray(); - final var contentType = - Optional.ofNullable(ContentType.parse(body.contentType())) + + final var apacheContentType = + Optional.ofNullable(requestBody.contentType()) + .map(ContentType::parse) .orElse(ContentType.APPLICATION_JSON); - apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, contentType)); + + apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, apacheContentType)); + return new PreparedRequest(apacheRequest, bodyBytes); } catch (final IOException e) { throw new OpenAIIoException("Failed to read request body", e); } } - return apacheRequest; + return new PreparedRequest(apacheRequest, null); } - @Nonnull - private BasicClassicHttpRequest createRequestByMethod( - @Nonnull final HttpMethod method, @Nonnull final String url) { - return switch (method.toString().toUpperCase()) { - case "GET" -> new HttpGet(url); - case "POST" -> new HttpPost(url); - case "PUT" -> new HttpPut(url); - case "DELETE" -> new HttpDelete(url); - case "PATCH" -> new HttpPatch(url); - case "HEAD" -> new HttpHead(url); - case "OPTIONS" -> new HttpOptions(url); - default -> throw new IllegalArgumentException("Unsupported HTTP method: " + method); - }; + private static URI buildUrlWithQueryParams(@Nonnull final HttpRequest request) { + try { + final var uriBuilder = new URIBuilder(request.url()); + final var queryParams = request.queryParams(); + + for (final var key : queryParams.keys()) { + for (final var value : queryParams.values(key)) { + uriBuilder.addParameter(key, value); + } + } + + return uriBuilder.build(); + } catch (URISyntaxException e) { + throw new OpenAIIoException("Failed to build URI with query parameters", e); + } } - /** - * Detects if the current request is a streaming request by checking for the stream parameter. - * - * @param request The HTTP request to check - * @return true if this is a streaming request, false otherwise - */ - private boolean isStreamingRequest(@Nonnull final HttpRequest request) { - final HttpRequestBody requestBody = request.body(); - if (requestBody != null) { - try (final ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) { - requestBody.writeTo(outputStream); - final String bodyContent = outputStream.toString(StandardCharsets.UTF_8); - // Check for "stream":true or "stream": true in JSON body - return bodyContent.contains("\"stream\":true") - || bodyContent.contains("\"stream\": true"); - } catch (final IOException e) { - log.warn("Failed to read request body for streaming detection", e); - return false; + private static void applyRequestHeaders( + @Nonnull final HttpRequest request, @Nonnull final BasicClassicHttpRequest apacheRequest) { + final var headers = request.headers(); + for (final var name : headers.names()) { + if ("Authorization".equalsIgnoreCase(name)) { + continue; } + for (final var value : headers.values(name)) { + apacheRequest.addHeader(name, value); + } + } + } + + private static boolean isStreamingBody(@Nullable final byte[] bodyBytes) { + if (bodyBytes == null || bodyBytes.length == 0) { + return false; } - return false; + final var bodyContent = new String(bodyBytes, StandardCharsets.UTF_8); + return STREAM_PATTERN.matcher(bodyContent).find(); + } + + private static boolean isStreamingQuery(@Nonnull final HttpRequest request) { + return request.queryParams().values("stream").stream() + .anyMatch(value -> "true".equalsIgnoreCase(value)); } @Nonnull - private Headers extractResponseHeaders(@Nonnull final ClassicHttpResponse apacheResponse) { + private static Headers extractResponseHeaders( + @Nonnull final ClassicHttpResponse apacheResponse) { final var builder = Headers.builder(); for (final var header : apacheResponse.getHeaders()) { builder.put(header.getName(), header.getValue()); @@ -279,42 +276,13 @@ private HttpResponse createStreamingResponse(@Nonnull final ClassicHttpResponse final var statusCode = apacheResponse.getCode(); final var headers = extractResponseHeaders(apacheResponse); - // Get live stream - do NOT buffer for streaming responses - final InputStream liveStream = + final var liveStream = apacheResponse.getEntity() != null ? apacheResponse.getEntity().getContent() : InputStream.nullInputStream(); // Return response that keeps connection open until stream is closed - return new HttpResponse() { - @Override - public int statusCode() { - return statusCode; - } - - @Nonnull - @Override - public Headers headers() { - return headers; - } - - @Nonnull - @Override - public InputStream body() { - return liveStream; - } - - @Override - public void close() { - try { - liveStream.close(); - apacheResponse.close(); - log.debug("Closed streaming response connection"); - } catch (final IOException e) { - log.warn("Failed to close streaming response", e); - } - } - }; + return new StreamingHttpResponse(statusCode, headers, liveStream, apacheResponse); } /** @@ -327,40 +295,59 @@ public void close() { @Nonnull private HttpResponse createBufferedResponse(@Nonnull final ClassicHttpResponse apacheResponse) throws IOException { - final int statusCode = apacheResponse.getCode(); final Headers headers = extractResponseHeaders(apacheResponse); - // Buffer response body for non-streaming requests final byte[] body = apacheResponse.getEntity() != null ? EntityUtils.toByteArray(apacheResponse.getEntity()) : new byte[0]; - // Return response with buffered body - return new HttpResponse() { - @Override - public int statusCode() { - return statusCode; - } + return new BufferedHttpResponse(statusCode, headers, body); + } - @Nonnull - @Override - public Headers headers() { - return headers; - } + record PreparedRequest(@Nonnull ClassicHttpRequest apacheRequest, @Nullable byte[] bodyBytes) {} - @Nonnull - @Override - public InputStream body() { - return new ByteArrayInputStream(body); + /** + * HTTP response for streaming requests. Keeps the connection open and provides a live stream. + * The stream must be closed by calling {@link #close()}. + */ + record StreamingHttpResponse( + int statusCode, + @Nonnull Headers headers, + @Nonnull InputStream body, + @Nonnull ClassicHttpResponse apacheResponse) + implements HttpResponse { + + @Override + public void close() { + try { + body.close(); + apacheResponse.close(); + log.debug("Closed streaming response connection"); + } catch (final IOException e) { + log.warn("Failed to close streaming response", e); } + } + } - @Override - public void close() { - // Body already consumed and stored in byte array, nothing to close - } - }; + /** + * HTTP response for buffered requests. The entire response body is loaded into memory. No + * resources need to be closed. + */ + record BufferedHttpResponse(int statusCode, @Nonnull Headers headers, @Nonnull byte[] bodyBytes) + implements HttpResponse { + + @Nonnull + @Override + public InputStream body() { + return new ByteArrayInputStream(bodyBytes); + } + + @Override + public void close() { + // Body already consumed and buffered, nothing to close + } } } } diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java new file mode 100644 index 000000000..328ff1680 --- /dev/null +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java @@ -0,0 +1,267 @@ +package com.sap.ai.sdk.foundationmodels.openai.responses; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.openai.core.RequestOptions; +import com.openai.core.http.Headers; +import com.openai.core.http.HttpMethod; +import com.openai.core.http.HttpRequest; +import com.openai.core.http.HttpRequestBody; +import com.openai.errors.OpenAIIoException; +import com.sap.ai.sdk.foundationmodels.openai.responses.AiCoreOpenAiClient.AiCoreHttpClientImpl; +import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; +import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.hc.core5.http.ClassicHttpResponse; +import org.apache.hc.core5.http.Header; +import org.apache.hc.core5.http.HttpEntity; +import org.apache.hc.core5.http.io.HttpClientResponseHandler; +import org.apache.hc.core5.http.message.BasicClassicHttpRequest; +import org.apache.hc.core5.http.message.BasicHeader; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; + +class AiCoreHttpClientImplTest { + + private static final String TEST_URL = "https://test.api.com/v1/chat/completions"; + private static final DefaultHttpDestination TEST_DESTINATION = + DefaultHttpDestination.builder("https://test.api.com").build(); + + @Test + void testNonStreamingRequest() throws IOException { + // Setup: Create a non-streaming request (no "stream":true in body) + final String requestBodyContent = + "{\"model\":\"gpt-4\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"; + final String responseBodyContent = "{\"id\":\"resp_123\",\"output\":\"Hi there!\"}"; + + final HttpRequest request = mockHttpRequest(requestBodyContent, false); + final HttpClient mockApacheClient = mock(HttpClient.class); + final ClassicHttpResponse mockResponse = mockClassicHttpResponse(200, responseBodyContent); + + // Mock the execute method to call the response handler + when(mockApacheClient.execute( + any(BasicClassicHttpRequest.class), any(HttpClientResponseHandler.class))) + .thenAnswer( + invocation -> { + HttpClientResponseHandler handler = + invocation.getArgument(1); + return handler.handleResponse(mockResponse); + }); + + try (MockedStatic mockedAccessor = + mockStatic(ApacheHttpClient5Accessor.class)) { + mockedAccessor + .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) + .thenReturn(mockApacheClient); + + // Execute: Make a non-streaming request + final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); + final com.openai.core.http.HttpResponse response = + client.execute(request, RequestOptions.none()); + + // Verify: Response is buffered and can be read + assertThat(response.statusCode()).isEqualTo(200); + final String body = new String(response.body().readAllBytes(), StandardCharsets.UTF_8); + assertThat(body).isEqualTo(responseBodyContent); + + // Verify: Request body was closed + verify(request.body()).close(); + } + } + + @Test + void testStreamingRequest() throws IOException { + // Setup: Create a streaming request (with "stream":true in body) + final String requestBodyContent = "{\"model\":\"gpt-4\",\"messages\":[],\"stream\":true}"; + + final HttpRequest request = mockHttpRequest(requestBodyContent, false); + final HttpClient mockApacheClient = mock(HttpClient.class); + final ClassicHttpResponse mockResponse = mockStreamingResponse(); + + // Mock executeOpen for streaming + when(mockApacheClient.executeOpen(isNull(), any(BasicClassicHttpRequest.class), isNull())) + .thenReturn(mockResponse); + + try (MockedStatic mockedAccessor = + mockStatic(ApacheHttpClient5Accessor.class)) { + mockedAccessor + .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) + .thenReturn(mockApacheClient); + + // Execute: Make a streaming request + final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); + final com.openai.core.http.HttpResponse response = + client.execute(request, RequestOptions.none()); + + // Verify: Response is streaming (connection kept open) + assertThat(response.statusCode()).isEqualTo(200); + assertThat(response.body()).isNotNull(); + + // Verify: Can read from stream + final byte[] chunk = new byte[10]; + final int read = response.body().read(chunk); + assertThat(read).isGreaterThan(0); + + // Cleanup: Close the response + response.close(); + + // Verify: Request body was closed + verify(request.body()).close(); + } + } + + @Test + void testStreamingRequestViaQueryParam() throws IOException { + // Setup: Create a streaming request (with "stream=true" in query params) + final String requestBodyContent = "{\"model\":\"gpt-4\",\"messages\":[]}"; + + final HttpRequest request = mockHttpRequest(requestBodyContent, true); + final HttpClient mockApacheClient = mock(HttpClient.class); + final ClassicHttpResponse mockResponse = mockStreamingResponse(); + + // Mock executeOpen for streaming + when(mockApacheClient.executeOpen(isNull(), any(BasicClassicHttpRequest.class), isNull())) + .thenReturn(mockResponse); + + try (MockedStatic mockedAccessor = + mockStatic(ApacheHttpClient5Accessor.class)) { + mockedAccessor + .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) + .thenReturn(mockApacheClient); + + // Execute: Make a streaming request via query param + final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); + final com.openai.core.http.HttpResponse response = + client.execute(request, RequestOptions.none()); + + // Verify: Response is streaming + assertThat(response.statusCode()).isEqualTo(200); + assertThat(response.body()).isNotNull(); + + // Cleanup + response.close(); + + // Verify: Request body was closed + verify(request.body()).close(); + } + } + + @Test + void testRequestBodyClosedOnException() throws IOException { + // Setup: Create a request that will fail + final String requestBodyContent = "{\"model\":\"gpt-4\"}"; + + final HttpRequest request = mockHttpRequest(requestBodyContent, false); + final HttpClient mockApacheClient = mock(HttpClient.class); + + // Mock execute to throw IOException + when(mockApacheClient.execute( + any(BasicClassicHttpRequest.class), any(HttpClientResponseHandler.class))) + .thenThrow(new IOException("Network error")); + + try (MockedStatic mockedAccessor = + mockStatic(ApacheHttpClient5Accessor.class)) { + mockedAccessor + .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) + .thenReturn(mockApacheClient); + + // Execute: Request fails with exception + final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); + + assertThatThrownBy(() -> client.execute(request, RequestOptions.none())) + .isInstanceOf(OpenAIIoException.class) + .hasMessageContaining("HTTP request execution failed"); + + // Verify: Request body was still closed despite exception + verify(request.body()).close(); + } + } + + // Helper methods + + private HttpRequest mockHttpRequest(String bodyContent, boolean addStreamQueryParam) + throws IOException { + final HttpRequest request = mock(HttpRequest.class); + final HttpRequestBody requestBody = mock(HttpRequestBody.class); + + when(request.url()).thenReturn(TEST_URL); + when(request.method()).thenReturn(HttpMethod.POST); + when(request.headers()) + .thenReturn(Headers.builder().put("Content-Type", "application/json").build()); + when(request.body()).thenReturn(requestBody); + when(requestBody.contentType()).thenReturn("application/json"); + + // Mock queryParams - return a mock QueryParams object + final com.openai.core.http.QueryParams queryParams = + mock(com.openai.core.http.QueryParams.class); + when(request.queryParams()).thenReturn(queryParams); + + // Mock values() method for streaming detection + if (addStreamQueryParam) { + when(queryParams.values("stream")).thenReturn(java.util.Collections.singletonList("true")); + } else { + when(queryParams.values("stream")).thenReturn(java.util.Collections.emptyList()); + } + + // Mock the writeTo method to write body content + doAnswer( + invocation -> { + ByteArrayOutputStream out = invocation.getArgument(0); + out.write(bodyContent.getBytes(StandardCharsets.UTF_8)); + return null; + }) + .when(requestBody) + .writeTo(any(ByteArrayOutputStream.class)); + + return request; + } + + private ClassicHttpResponse mockClassicHttpResponse(int statusCode, String bodyContent) + throws IOException { + final ClassicHttpResponse response = mock(ClassicHttpResponse.class); + final HttpEntity entity = mock(HttpEntity.class); + final InputStream bodyStream = + new ByteArrayInputStream(bodyContent.getBytes(StandardCharsets.UTF_8)); + + when(response.getCode()).thenReturn(statusCode); + when(response.getHeaders()) + .thenReturn(new Header[] {new BasicHeader("Content-Type", "application/json")}); + when(response.getEntity()).thenReturn(entity); + when(entity.getContent()).thenReturn(bodyStream); + + return response; + } + + private ClassicHttpResponse mockStreamingResponse() throws IOException { + final ClassicHttpResponse response = mock(ClassicHttpResponse.class); + final HttpEntity entity = mock(HttpEntity.class); + // Create a stream that simulates continuous data + final InputStream liveStream = + new ByteArrayInputStream("data: chunk1\ndata: chunk2\n".getBytes(StandardCharsets.UTF_8)); + + when(response.getCode()).thenReturn(200); + when(response.getHeaders()) + .thenReturn( + new Header[] { + new BasicHeader("Content-Type", "text/event-stream"), + new BasicHeader("Transfer-Encoding", "chunked") + }); + when(response.getEntity()).thenReturn(entity); + when(entity.getContent()).thenReturn(liveStream); + + return response; + } +} diff --git a/logback.xml b/logback.xml index 2bbaaa365..5fe30b5bf 100644 --- a/logback.xml +++ b/logback.xml @@ -12,8 +12,8 @@ - - + + diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java index e7514b241..5d2973572 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java @@ -3,9 +3,15 @@ import static com.sap.ai.sdk.foundationmodels.openai.OpenAiModel.GPT_5; import com.openai.client.OpenAIClient; +import com.openai.core.http.QueryParams; +import com.openai.core.http.StreamResponse; import com.openai.models.ChatModel; +import com.openai.models.chat.completions.ChatCompletion; +import com.openai.models.chat.completions.ChatCompletionChunk; +import com.openai.models.chat.completions.ChatCompletionCreateParams; import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseStreamEvent; import com.sap.ai.sdk.foundationmodels.openai.responses.AiCoreOpenAiClient; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; @@ -31,4 +37,52 @@ public Response createResponse(@Nonnull final String input) { ResponseCreateParams.builder().input(input).model(ChatModel.GPT_5).store(false).build(); return client.responses().create(params); } + + /** + * Create a streaming response using the Responses API + * + * @param input the input text to send to the model + * @return the streaming response object from the Responses API + */ + @Nonnull + public StreamResponse createStreamingResponse(@Nonnull final String input) { + val params = + ResponseCreateParams.builder().input(input).model(ChatModel.GPT_5).store(false).build(); + return client.responses().createStreaming(params); + } + + /** + * Create a chat completion using the Chat Completions API + * + * @param input the input text to send to the model + * @return the chat completion response from the Chat Completions API + */ + @Nonnull + public ChatCompletion createChatCompletion(@Nonnull final String input) { + val params = + ChatCompletionCreateParams.builder() + .addUserMessage(input) + .model(ChatModel.GPT_5) + .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) + .build(); + return client.chat().completions().create(params); + } + + /** + * Create a streaming chat completion using the Chat Completions API + * + * @param input the input text to send to the model + * @return the streaming chat completion response from the Chat Completions API + */ + @Nonnull + public StreamResponse createStreamingChatCompletion( + @Nonnull final String input) { + val params = + ChatCompletionCreateParams.builder() + .addUserMessage("Say this is a test") + .model(ChatModel.GPT_5) + .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) + .build(); + return client.chat().completions().createStreaming(params); + } } diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java index 344f7b90a..f05007b3d 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import com.sap.ai.sdk.app.services.OpenAiV1Service; +import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -23,4 +24,49 @@ void testCreateResponse() { assertThat(response.output()).isNotNull(); assertThat(response.output()).isNotEmpty(); } + + @Test + void testCreateStreamingResponse() { + try (final var streamResponse = + service.createStreamingResponse("What is the capital of France?")) { + final var events = streamResponse.stream().collect(Collectors.toList()); + + assertThat(events).isNotNull(); + assertThat(events).isNotEmpty(); + + // Verify we got text deltas + final var hasTextDeltas = + events.stream().anyMatch(event -> event.outputTextDelta().isPresent()); + assertThat(hasTextDeltas).isTrue(); + } + } + + @Test + void testCreateChatCompletion() { + final var response = service.createChatCompletion("What is the capital of France?"); + assertThat(response).isNotNull(); + assertThat(response.choices()).isNotEmpty(); + assertThat(response.choices().get(0).message().content()).isPresent(); + assertThat(response.choices().get(0).message().content().get()).isNotEmpty(); + } + + @Test + void testCreateStreamingChatCompletion() { + try (final var streamResponse = + service.createStreamingChatCompletion("What is the capital of France?")) { + final var events = streamResponse.stream().collect(Collectors.toList()); + + assertThat(events).isNotNull(); + assertThat(events).isNotEmpty(); + + // Verify we got content deltas + final var hasContentDeltas = + events.stream() + .anyMatch( + event -> + !event.choices().isEmpty() + && event.choices().get(0).delta().content().isPresent()); + assertThat(hasContentDeltas).isTrue(); + } + } } From 7ffe122a51e1c2d53ac0068a0eef6c32cb187692 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 24 Mar 2026 15:59:49 +0100 Subject: [PATCH 18/31] isStreaming check simplified --- .../openai/responses/AiCoreOpenAiClient.java | 63 ++++++------------- .../responses/AiCoreHttpClientImplTest.java | 31 ++++----- 2 files changed, 35 insertions(+), 59 deletions(-) diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java index d4a661e7d..6b2563279 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java +++ b/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java @@ -21,12 +21,11 @@ import java.io.InputStream; import java.net.URI; import java.net.URISyntaxException; -import java.nio.charset.StandardCharsets; +import java.util.Locale; +import java.util.Objects; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import java.util.regex.Pattern; import javax.annotation.Nonnull; -import javax.annotation.Nullable; import lombok.AccessLevel; import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; @@ -139,7 +138,7 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) static final class AiCoreHttpClientImpl implements HttpClient { private final HttpDestination destination; - private static final Pattern STREAM_PATTERN = Pattern.compile("\"stream\"\\s*:\\s*true"); + private static final String SSE_MEDIA_TYPE = "text/event-stream"; @Override @Nonnull @@ -147,18 +146,18 @@ static final class AiCoreHttpClientImpl implements HttpClient { public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { final var apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); - final var preparedRequest = prepareRequest(request); - final boolean isStreaming = - isStreamingBody(preparedRequest.bodyBytes()) || isStreamingQuery(request); + final var apacheRequest = toApacheRequest(request); try { - if (isStreaming) { - final var apacheResponse = - apacheClient.executeOpen(null, preparedRequest.apacheRequest(), null); - return createStreamingResponse(apacheResponse); + if (isStreaming(request)) { + final var apacheResponse = apacheClient.executeOpen(null, apacheRequest, null); + final int statusCode = apacheResponse.getCode(); + if (statusCode >= 200 && statusCode < 300) { + return createStreamingResponse(apacheResponse); + } + return createBufferedResponse(apacheResponse); } else { - return apacheClient.execute( - preparedRequest.apacheRequest(), this::createBufferedResponse); + return apacheClient.execute(apacheRequest, this::createBufferedResponse); } } catch (final IOException e) { throw new OpenAIIoException("HTTP request execution failed", e); @@ -181,7 +180,7 @@ public void close() { @Nonnull @SuppressWarnings("PMD.CloseResource") - private PreparedRequest prepareRequest(@Nonnull final HttpRequest request) { + private ClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { final var fullUri = buildUrlWithQueryParams(request); final var method = request.method(); final var apacheRequest = new BasicClassicHttpRequest(method.name(), fullUri.toString()); @@ -199,13 +198,13 @@ private PreparedRequest prepareRequest(@Nonnull final HttpRequest request) { .orElse(ContentType.APPLICATION_JSON); apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, apacheContentType)); - return new PreparedRequest(apacheRequest, bodyBytes); + return apacheRequest; } catch (final IOException e) { throw new OpenAIIoException("Failed to read request body", e); } } - return new PreparedRequest(apacheRequest, null); + return apacheRequest; } private static URI buildUrlWithQueryParams(@Nonnull final HttpRequest request) { @@ -238,17 +237,10 @@ private static void applyRequestHeaders( } } - private static boolean isStreamingBody(@Nullable final byte[] bodyBytes) { - if (bodyBytes == null || bodyBytes.length == 0) { - return false; - } - final var bodyContent = new String(bodyBytes, StandardCharsets.UTF_8); - return STREAM_PATTERN.matcher(bodyContent).find(); - } - - private static boolean isStreamingQuery(@Nonnull final HttpRequest request) { - return request.queryParams().values("stream").stream() - .anyMatch(value -> "true".equalsIgnoreCase(value)); + private static boolean isStreaming(@Nonnull final HttpRequest request) { + return request.headers().values("Accept").stream() + .map(value -> Objects.toString(value, "").toLowerCase(Locale.ROOT)) + .anyMatch(value -> value.contains(SSE_MEDIA_TYPE)); } @Nonnull @@ -261,14 +253,6 @@ private static Headers extractResponseHeaders( return builder.build(); } - /** - * Creates a streaming HttpResponse that keeps the connection open and provides a live - * InputStream. - * - * @param apacheResponse Apache HTTP response (must be kept open) - * @return HttpResponse with live stream - * @throws IOException if getting the stream fails - */ @Nonnull private HttpResponse createStreamingResponse(@Nonnull final ClassicHttpResponse apacheResponse) throws IOException { @@ -285,13 +269,6 @@ private HttpResponse createStreamingResponse(@Nonnull final ClassicHttpResponse return new StreamingHttpResponse(statusCode, headers, liveStream, apacheResponse); } - /** - * Creates a buffered HttpResponse with the entire response body loaded into memory. - * - * @param apacheResponse Apache HTTP response (will be consumed and closed) - * @return HttpResponse with buffered body - * @throws IOException if reading the response body fails - */ @Nonnull private HttpResponse createBufferedResponse(@Nonnull final ClassicHttpResponse apacheResponse) throws IOException { @@ -306,8 +283,6 @@ private HttpResponse createBufferedResponse(@Nonnull final ClassicHttpResponse a return new BufferedHttpResponse(statusCode, headers, body); } - record PreparedRequest(@Nonnull ClassicHttpRequest apacheRequest, @Nullable byte[] bodyBytes) {} - /** * HTTP response for streaming requests. Keeps the connection open and provides a live stream. * The stream must be closed by calling {@link #close()}. diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java index 328ff1680..bc1bb3e13 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java +++ b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java @@ -84,10 +84,10 @@ void testNonStreamingRequest() throws IOException { @Test void testStreamingRequest() throws IOException { - // Setup: Create a streaming request (with "stream":true in body) + // Setup: Create a streaming request (with Accept: text/event-stream header) final String requestBodyContent = "{\"model\":\"gpt-4\",\"messages\":[],\"stream\":true}"; - final HttpRequest request = mockHttpRequest(requestBodyContent, false); + final HttpRequest request = mockHttpRequest(requestBodyContent, true); final HttpClient mockApacheClient = mock(HttpClient.class); final ClassicHttpResponse mockResponse = mockStreamingResponse(); @@ -125,7 +125,7 @@ void testStreamingRequest() throws IOException { @Test void testStreamingRequestViaQueryParam() throws IOException { - // Setup: Create a streaming request (with "stream=true" in query params) + // Setup: Create a streaming request (with Accept: text/event-stream header) final String requestBodyContent = "{\"model\":\"gpt-4\",\"messages\":[]}"; final HttpRequest request = mockHttpRequest(requestBodyContent, true); @@ -192,29 +192,30 @@ void testRequestBodyClosedOnException() throws IOException { // Helper methods - private HttpRequest mockHttpRequest(String bodyContent, boolean addStreamQueryParam) - throws IOException { + private HttpRequest mockHttpRequest(String bodyContent, boolean isStreaming) { final HttpRequest request = mock(HttpRequest.class); final HttpRequestBody requestBody = mock(HttpRequestBody.class); when(request.url()).thenReturn(TEST_URL); when(request.method()).thenReturn(HttpMethod.POST); - when(request.headers()) - .thenReturn(Headers.builder().put("Content-Type", "application/json").build()); + + // Build headers based on streaming flag + final Headers.Builder headersBuilder = + Headers.builder().put("Content-Type", "application/json"); + + if (isStreaming) { + headersBuilder.put("Accept", "text/event-stream"); + } + + when(request.headers()).thenReturn(headersBuilder.build()); when(request.body()).thenReturn(requestBody); when(requestBody.contentType()).thenReturn("application/json"); - // Mock queryParams - return a mock QueryParams object + // Mock queryParams final com.openai.core.http.QueryParams queryParams = mock(com.openai.core.http.QueryParams.class); when(request.queryParams()).thenReturn(queryParams); - - // Mock values() method for streaming detection - if (addStreamQueryParam) { - when(queryParams.values("stream")).thenReturn(java.util.Collections.singletonList("true")); - } else { - when(queryParams.values("stream")).thenReturn(java.util.Collections.emptyList()); - } + when(queryParams.keys()).thenReturn(java.util.Collections.emptySet()); // Mock the writeTo method to write body content doAnswer( From 5553e1b72b6400a5f7c193664c967b50699a7b39 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 24 Mar 2026 18:00:58 +0100 Subject: [PATCH 19/31] Cleanup PoC and rename module --- .../resources/spec/azure-responses-only.yaml | 3972 ----------------- .../main/resources/spec/filter-config.yaml | 12 - .../responses/AiCoreHttpClientImplTest.java | 268 -- .../{openai-responses => openai-v1}/pom.xml | 23 +- .../openai/v1}/AiCoreOpenAiClient.java | 19 +- .../openai/v1}/AiCoreOpenAiClientTest.java | 3 +- .../resources/mappings/createResponse.json | 0 logback.xml | 4 +- pom.xml | 12 +- sample-code/spring-app/pom.xml | 2 +- .../ai/sdk/app/services/OpenAiV1Service.java | 20 +- .../ai/sdk/app/controllers/OpenAiV1Test.java | 11 +- 12 files changed, 29 insertions(+), 4317 deletions(-) delete mode 100644 foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml delete mode 100644 foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml delete mode 100644 foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java rename foundation-models/{openai-responses => openai-v1}/pom.xml (85%) rename foundation-models/{openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses => openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1}/AiCoreOpenAiClient.java (95%) rename foundation-models/{openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses => openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1}/AiCoreOpenAiClientTest.java (94%) rename foundation-models/{openai-responses => openai-v1}/src/test/resources/mappings/createResponse.json (100%) diff --git a/foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml b/foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml deleted file mode 100644 index 28905b482..000000000 --- a/foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml +++ /dev/null @@ -1,3972 +0,0 @@ -openapi: 3.1.0 -info: - title: Azure AI Foundry Models Service - license: - name: MIT - url: 'https://github.com/openai/openai-openapi/blob/master/LICENSE' - version: v1 -tags: - - name: Batch - - name: Chat - - name: Completions - - name: Containers - - name: Conversations - - name: Evals - - name: Files - - name: Embeddings - - name: Fine-tuning - - name: Models - - name: Realtime - - name: Responses - - name: Threads - - name: Vector Stores -paths: - /responses: - post: - operationId: createResponse - description: Creates a model response. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - text/event-stream: - itemSchema: - type: object - properties: - event: - type: string - data: - type: string - required: - - event - oneOf: - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseAudioDeltaEvent' - event: - const: response.audio.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseAudioTranscriptDeltaEvent' - event: - const: response.audio.transcript.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent' - event: - const: response.code_interpreter_call_code.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInProgressEvent' - event: - const: response.code_interpreter_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCodeInterpreterCallInterpretingEvent' - event: - const: response.code_interpreter_call.interpreting - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseContentPartAddedEvent' - event: - const: response.content_part.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCreatedEvent' - event: - const: response.created - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseErrorEvent' - event: - const: error - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallInProgressEvent' - event: - const: response.file_search_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFileSearchCallSearchingEvent' - event: - const: response.file_search_call.searching - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFunctionCallArgumentsDeltaEvent' - event: - const: response.function_call_arguments.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseInProgressEvent' - event: - const: response.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseFailedEvent' - event: - const: response.failed - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseIncompleteEvent' - event: - const: response.incomplete - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseOutputItemAddedEvent' - event: - const: response.output_item.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEvent' - event: - const: response.reasoning_summary_part.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryTextDeltaEvent' - event: - const: response.reasoning_summary_text.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseReasoningTextDeltaEvent' - event: - const: response.reasoning_text.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseRefusalDeltaEvent' - event: - const: response.refusal.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseTextDeltaEvent' - event: - const: response.output_text.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallInProgressEvent' - event: - const: response.web_search_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseWebSearchCallSearchingEvent' - event: - const: response.web_search_call.searching - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallGeneratingEvent' - event: - const: response.image_generation_call.generating - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallInProgressEvent' - event: - const: response.image_generation_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseImageGenCallPartialImageEvent' - event: - const: response.image_generation_call.partial_image - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPCallArgumentsDeltaEvent' - event: - const: response.mcp_call_arguments.delta - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPCallFailedEvent' - event: - const: response.mcp_call.failed - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPCallInProgressEvent' - event: - const: response.mcp_call.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsFailedEvent' - event: - const: response.mcp_list_tools.failed - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseMCPListToolsInProgressEvent' - event: - const: response.mcp_list_tools.in_progress - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseOutputTextAnnotationAddedEvent' - event: - const: response.output_text.annotation.added - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseQueuedEvent' - event: - const: response.queued - - properties: - data: - contentMediaType: application/json - contentSchema: - $ref: '#/components/schemas/OpenAI.ResponseCustomToolCallInputDeltaEvent' - event: - const: response.custom_tool_call_input.delta - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - - properties: - data: - contentMediaType: application/json - x-ms-sse-terminal-event: true - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - required: - - code - - message - - param - - type - tags: - - Responses - requestBody: - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.CreateResponse' - '/responses/{response_id}': - get: - operationId: getResponse - description: Retrieves a model response with the given ID. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - - name: 'include[]' - in: query - required: false - description: Additional fields to include in the response. See the include parameter for Response creation above for more information. - schema: - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - default: [] - - name: stream - in: query - required: false - description: 'If set to true, the model response data will be streamed to the client as it is generated using server-sent events.' - schema: - type: boolean - explode: false - - name: starting_after - in: query - required: false - description: The sequence number of the event after which to start streaming. - schema: - type: integer - format: int32 - explode: false - - name: include_obfuscation - in: query - required: false - description: 'When true, stream obfuscation will be enabled. Stream obfuscation adds random characters to an `obfuscation` field on streaming delta events to normalize payload sizes as a mitigation to certain side-channel attacks. These obfuscation fields are included by default, but add a small amount of overhead to the data stream. You can set `include_obfuscation` to false to optimize for bandwidth if you trust the network links between your application and the OpenAI API.' - schema: - type: boolean - default: true - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - required: - - code - - message - - param - - type - tags: - - Responses - '/responses/{response_id}/cancel': - post: - operationId: cancelResponse - description: Cancels a model response with the given ID. Only responses created with the background parameter set to true can be cancelled. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - required: - - code - - message - - param - - type - tags: - - Responses - '/responses/{response_id}/input_items': - get: - operationId: listInputItems - description: Returns a list of input items for a given response. - parameters: - - name: api-version - in: query - required: false - description: |- - The explicit Azure AI Foundry Models API version to use for this request. - `v1` if not otherwise specified. - schema: - $ref: '#/components/schemas/AzureAIFoundryModelsApiVersion' - default: v1 - - name: response_id - in: path - required: true - schema: - type: string - - name: limit - in: query - required: false - description: |- - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - default is 20. - schema: - type: integer - format: int32 - default: 20 - explode: false - - name: order - in: query - required: false - description: |- - Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - for descending order. - schema: - type: string - enum: - - asc - - desc - explode: false - - name: after - in: query - required: false - description: |- - A cursor for use in pagination. `after` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include after=obj_foo in order to fetch the next page of the list. - schema: - type: string - explode: false - - name: before - in: query - required: false - description: |- - A cursor for use in pagination. `before` is an object ID that defines your place in the list. - For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - subsequent call can include before=obj_foo in order to fetch the previous page of the list. - schema: - type: string - explode: false - responses: - '200': - description: The request has succeeded. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAI.ResponseItemList' - default: - description: An unexpected error response. - headers: - apim-request-id: - required: false - description: A request ID used for troubleshooting purposes. - schema: - type: string - content: - application/json: - schema: - type: object - properties: - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - param: - anyOf: - - type: string - - type: 'null' - type: - type: string - required: - - code - - message - - param - - type - tags: - - Responses -security: - - ApiKeyAuth: [] - - ApiKeyAuth_: [] - - OAuth2Auth: - - 'https://cognitiveservices.azure.com/.default' -components: - schemas: - AzureAIFoundryModelsApiVersion: - type: string - enum: - - v1 - - preview - AzureContentFilterBlocklistResult: - type: object - required: - - filtered - properties: - filtered: - type: boolean - description: A value indicating whether any of the detailed blocklists resulted in a filtering action. - details: - type: array - items: - type: object - properties: - filtered: - type: boolean - description: A value indicating whether the blocklist produced a filtering action. - id: - type: string - description: The ID of the custom blocklist evaluated. - required: - - filtered - - id - description: The pairs of individual blocklist IDs and whether they resulted in a filtering action. - description: A collection of true/false filtering results for configured custom blocklists. - AzureContentFilterCompletionTextSpan: - type: object - required: - - completion_start_offset - - completion_end_offset - properties: - completion_start_offset: - type: integer - format: int32 - description: Offset of the UTF32 code point which begins the span. - completion_end_offset: - type: integer - format: int32 - description: Offset of the first UTF32 code point which is excluded from the span. This field is always equal to completion_start_offset for empty spans. This field is always larger than completion_start_offset for non-empty spans. - description: A representation of a span of completion text as used by Azure OpenAI content filter results. - AzureContentFilterCompletionTextSpanDetectionResult: - type: object - required: - - filtered - - detected - - details - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - details: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterCompletionTextSpan' - description: Detailed information about the detected completion text spans. - AzureContentFilterCustomTopicResult: - type: object - required: - - filtered - properties: - filtered: - type: boolean - description: A value indicating whether any of the detailed topics resulted in a filtering action. - details: - type: array - items: - type: object - properties: - detected: - type: boolean - description: A value indicating whether the topic is detected. - id: - type: string - description: The ID of the custom topic evaluated. - required: - - detected - - id - description: The pairs of individual topic IDs and whether they are detected. - description: A collection of true/false filtering results for configured custom topics. - AzureContentFilterDetectionResult: - type: object - required: - - filtered - - detected - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - description: |- - A labeled content filter result item that indicates whether the content was detected and whether the content was - filtered. - AzureContentFilterForResponsesAPI: - type: object - required: - - blocked - - source_type - - content_filter_results - - content_filter_offsets - properties: - blocked: - type: boolean - description: Indicate if the response is blocked. - source_type: - type: string - description: The name of the source type of the message. - content_filter_results: - allOf: - - $ref: '#/components/schemas/AzureContentFilterResultsForResponsesAPI' - description: A content filter result for a single response item produced by a generative AI system. - content_filter_offsets: - $ref: '#/components/schemas/AzureContentFilterResultOffsets' - AzureContentFilterPersonallyIdentifiableInformationResult: - type: object - properties: - redacted_text: - type: string - description: The redacted text with PII information removed or masked. - sub_categories: - type: array - items: - $ref: '#/components/schemas/AzurePiiSubCategoryResult' - description: Detailed results for individual PIIHarmSubCategory(s). - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A content filter detection result for Personally Identifiable Information that includes harm extensions. - AzureContentFilterResultOffsets: - type: object - required: - - start_offset - - end_offset - - check_offset - properties: - start_offset: - type: integer - format: int32 - end_offset: - type: integer - format: int32 - check_offset: - type: integer - format: int32 - AzureContentFilterResultsForResponsesAPI: - type: object - required: - - jailbreak - - task_adherence - properties: - sexual: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to anatomical organs and genitals, romantic relationships, acts - portrayed in erotic or affectionate terms, pregnancy, physical sexual acts, including those portrayed as an - assault or a forced sexual violent act against one's will, prostitution, pornography, and abuse. - hate: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that can refer to any content that attacks or uses pejorative or discriminatory - language with reference to a person or identity group based on certain differentiating attributes of these groups - including but not limited to race, ethnicity, nationality, gender identity and expression, sexual orientation, - religion, immigration status, ability status, personal appearance, and body size. - violence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category for language related to physical actions intended to hurt, injure, damage, or kill - someone or something; describes weapons, guns and related entities, such as manufactures, associations, - legislation, and so on. - self_harm: - allOf: - - $ref: '#/components/schemas/AzureContentFilterSeverityResult' - description: |- - A content filter category that describes language related to physical actions intended to purposely hurt, injure, - damage one's body or kill oneself. - profanity: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that identifies whether crude, vulgar, or otherwise objection language is present in the - content. - custom_blocklists: - allOf: - - $ref: '#/components/schemas/AzureContentFilterBlocklistResult' - description: A collection of binary filtering outcomes for configured custom blocklists. - custom_topics: - allOf: - - $ref: '#/components/schemas/AzureContentFilterCustomTopicResult' - description: A collection of binary filtering outcomes for configured custom topics. - error: - type: object - properties: - code: - type: integer - format: int32 - description: 'A distinct, machine-readable code associated with the error.' - message: - type: string - description: A human-readable message associated with the error. - required: - - code - - message - description: 'If present, details about an error that prevented content filtering from completing its evaluation.' - jailbreak: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes user prompt injection attacks, where malicious users deliberately exploit - system vulnerabilities to elicit unauthorized behavior from the LLM. This could lead to inappropriate content - generation or violations of system-imposed restrictions. - task_adherence: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A detection result that indicates if the execution flow still sticks the plan. - protected_material_text: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: A detection result that describes a match against text protected under copyright or other status. - protected_material_code: - type: object - properties: - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action. - detected: - type: boolean - description: Whether the labeled content category was detected in the content. - citation: - type: object - properties: - license: - type: string - description: The name or identifier of the license associated with the detection. - URL: - type: string - format: uri - description: The URL associated with the license. - description: 'If available, the citation details describing the associated license and its location.' - required: - - filtered - - detected - description: A detection result that describes a match against licensed code or other protected source material. - ungrounded_material: - $ref: '#/components/schemas/AzureContentFilterCompletionTextSpanDetectionResult' - personally_identifiable_information: - allOf: - - $ref: '#/components/schemas/AzureContentFilterPersonallyIdentifiableInformationResult' - description: A detection result that describes matches against Personal Identifiable Information with configurable subcategories. - indirect_attack: - allOf: - - $ref: '#/components/schemas/AzureContentFilterDetectionResult' - description: |- - A detection result that describes attacks on systems powered by Generative AI models that can happen every time - an application processes information that wasn’t directly authored by either the developer of the application or - the user. - AzureContentFilterSeverityResult: - type: object - required: - - filtered - - severity - properties: - filtered: - type: boolean - description: Whether the content severity resulted in a content filtering action. - severity: - type: string - enum: - - safe - - low - - medium - - high - description: The labeled severity of the content. - description: |- - A labeled content filter result item that indicates whether the content was filtered and what the qualitative - severity level of the content was, as evaluated against content filter configuration for the category. - AzurePiiSubCategoryResult: - type: object - required: - - sub_category - - filtered - - detected - - redacted - properties: - sub_category: - type: string - description: The PIIHarmSubCategory that was evaluated. - filtered: - type: boolean - description: Whether the content detection resulted in a content filtering action for this subcategory. - detected: - type: boolean - description: Whether the labeled content subcategory was detected in the content. - redacted: - type: boolean - description: Whether the content was redacted for this subcategory. - description: Result details for individual PIIHarmSubCategory(s). - OpenAI.Annotation: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.AnnotationType' - discriminator: - propertyName: type - mapping: - file_citation: '#/components/schemas/OpenAI.FileCitationBody' - url_citation: '#/components/schemas/OpenAI.UrlCitationBody' - container_file_citation: '#/components/schemas/OpenAI.ContainerFileCitationBody' - file_path: '#/components/schemas/OpenAI.FilePath' - description: An annotation that applies to a span of output text. - OpenAI.AnnotationType: - anyOf: - - type: string - - type: string - enum: - - file_citation - - url_citation - - container_file_citation - - file_path - OpenAI.ConversationParam: - anyOf: - - type: string - - $ref: '#/components/schemas/OpenAI.ConversationParam-2' - description: |- - The conversation that this response belongs to. Items from this conversation are prepended to `input_items` for this response request. - Input items and output items from this response are automatically added to this conversation after this response completes. - OpenAI.ConversationParam-2: - type: object - required: - - id - properties: - id: - type: string - description: The unique ID of the conversation. - description: The conversation that this response belongs to. - title: Conversation object - OpenAI.ConversationReference: - type: object - required: - - id - properties: - id: - type: string - description: The unique ID of the conversation that this response was associated with. - description: The conversation that this response belonged to. Input items and output items from this response were automatically added to this conversation. - title: Conversation - OpenAI.CreateResponse: - type: object - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - description: |- - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. - - The two categories of tools you can provide the model are: - - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like file search. - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code. - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - input: - $ref: '#/components/schemas/OpenAI.InputParam' - include: - anyOf: - - type: array - items: - $ref: '#/components/schemas/OpenAI.IncludeEnum' - - type: 'null' - parallel_tool_calls: - anyOf: - - type: boolean - - type: 'null' - default: true - store: - anyOf: - - type: boolean - - type: 'null' - default: true - instructions: - anyOf: - - type: string - - type: 'null' - stream: - anyOf: - - type: boolean - - type: 'null' - stream_options: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseStreamOptions' - - type: 'null' - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationParam' - - type: 'null' - OpenAI.ImageDetail: - type: string - enum: - - low - - high - - auto - OpenAI.IncludeEnum: - anyOf: - - type: string - - type: string - enum: - - file_search_call.results - - web_search_call.results - - web_search_call.action.sources - - message.input_image.image_url - - computer_call_output.output.image_url - - code_interpreter_call.outputs - - reasoning.encrypted_content - - message.output_text.logprobs - description: |- - Specify additional output data to include in the model response. Currently supported values are: - - `web_search_call.action.sources`: Include the sources of the web search tool call. - - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. - - `computer_call_output.output.image_url`: Include image urls from the computer call output. - - `file_search_call.results`: Include the search results of the file search tool call. - - `message.input_image.image_url`: Include image urls from the input message. - - `message.output_text.logprobs`: Include logprobs with assistant messages. - - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). - OpenAI.InputFileContent: - type: object - required: - - type - properties: - type: - type: string - enum: - - input_file - description: The type of the input item. Always `input_file`. - x-stainless-const: true - default: input_file - file_id: - anyOf: - - type: string - - type: 'null' - filename: - type: string - description: The name of the file to be sent to the model. - file_url: - type: string - format: uri - description: The URL of the file to be sent to the model. - file_data: - type: string - description: The content of the file to be sent to the model. - description: A file input to the model. - title: Input file - OpenAI.InputImageContent: - type: object - required: - - type - - detail - properties: - type: - type: string - enum: - - input_image - description: The type of the input item. Always `input_image`. - x-stainless-const: true - default: input_image - image_url: - anyOf: - - type: string - format: uri - - type: 'null' - file_id: - anyOf: - - type: string - - type: 'null' - detail: - allOf: - - $ref: '#/components/schemas/OpenAI.ImageDetail' - description: 'The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`.' - description: 'An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision).' - title: Input image - OpenAI.InputItem: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.InputItemType' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAI.EasyInputMessage' - item_reference: '#/components/schemas/OpenAI.ItemReferenceParam' - OpenAI.InputItemType: - anyOf: - - type: string - - type: string - enum: - - message - - item_reference - OpenAI.InputParam: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - description: |- - Text, image, or file inputs to the model, used to generate a response. - Learn more: - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Image inputs](https://platform.openai.com/docs/guides/images) - - [File inputs](https://platform.openai.com/docs/guides/pdf-files) - - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) - - [Function calling](https://platform.openai.com/docs/guides/function-calling) - OpenAI.InputTextContent: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - input_text - description: The type of the input item. Always `input_text`. - x-stainless-const: true - default: input_text - text: - type: string - description: The text input to the model. - description: A text input to the model. - title: Input text - OpenAI.ItemResource: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ItemResourceType' - discriminator: - propertyName: type - mapping: - message: '#/components/schemas/OpenAI.InputMessageResource' - output_message: '#/components/schemas/OpenAI.ItemResourceOutputMessage' - file_search_call: '#/components/schemas/OpenAI.ItemResourceFileSearchToolCall' - computer_call: '#/components/schemas/OpenAI.ItemResourceComputerToolCall' - computer_call_output: '#/components/schemas/OpenAI.ItemResourceComputerToolCallOutputResource' - web_search_call: '#/components/schemas/OpenAI.ItemResourceWebSearchToolCall' - function_call: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallResource' - function_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionToolCallOutputResource' - image_generation_call: '#/components/schemas/OpenAI.ItemResourceImageGenToolCall' - code_interpreter_call: '#/components/schemas/OpenAI.ItemResourceCodeInterpreterToolCall' - local_shell_call: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCall' - local_shell_call_output: '#/components/schemas/OpenAI.ItemResourceLocalShellToolCallOutput' - shell_call: '#/components/schemas/OpenAI.ItemResourceFunctionShellCall' - shell_call_output: '#/components/schemas/OpenAI.ItemResourceFunctionShellCallOutput' - apply_patch_call: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCall' - apply_patch_call_output: '#/components/schemas/OpenAI.ItemResourceApplyPatchToolCallOutput' - mcp_list_tools: '#/components/schemas/OpenAI.ItemResourceMcpListTools' - mcp_approval_request: '#/components/schemas/OpenAI.ItemResourceMcpApprovalRequest' - mcp_approval_response: '#/components/schemas/OpenAI.ItemResourceMcpApprovalResponseResource' - mcp_call: '#/components/schemas/OpenAI.ItemResourceMcpToolCall' - description: Content item used to generate a response. - OpenAI.ItemResourceType: - anyOf: - - type: string - - type: string - enum: - - message - - output_message - - file_search_call - - computer_call - - computer_call_output - - web_search_call - - function_call - - function_call_output - - image_generation_call - - code_interpreter_call - - local_shell_call - - local_shell_call_output - - shell_call - - shell_call_output - - apply_patch_call - - apply_patch_call_output - - mcp_list_tools - - mcp_approval_request - - mcp_approval_response - - mcp_call - OpenAI.Metadata: - type: object - unevaluatedProperties: - type: string - description: |- - Set of 16 key-value pairs that can be attached to an object. This can be - useful for storing additional information about the object in a structured - format, and querying for objects via API or the dashboard. - Keys are strings with a maximum length of 64 characters. Values are strings - with a maximum length of 512 characters. - x-oaiTypeLabel: map - OpenAI.OutputContent: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.OutputContentType' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAI.OutputContentOutputTextContent' - refusal: '#/components/schemas/OpenAI.OutputContentRefusalContent' - OpenAI.OutputContentType: - anyOf: - - type: string - - type: string - enum: - - output_text - - refusal - - reasoning_text - OpenAI.OutputItem: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.OutputItemType' - discriminator: - propertyName: type - mapping: - output_message: '#/components/schemas/OpenAI.OutputItemOutputMessage' - file_search_call: '#/components/schemas/OpenAI.OutputItemFileSearchToolCall' - function_call: '#/components/schemas/OpenAI.OutputItemFunctionToolCall' - web_search_call: '#/components/schemas/OpenAI.OutputItemWebSearchToolCall' - computer_call: '#/components/schemas/OpenAI.OutputItemComputerToolCall' - reasoning: '#/components/schemas/OpenAI.OutputItemReasoningItem' - compaction: '#/components/schemas/OpenAI.OutputItemCompactionBody' - image_generation_call: '#/components/schemas/OpenAI.OutputItemImageGenToolCall' - code_interpreter_call: '#/components/schemas/OpenAI.OutputItemCodeInterpreterToolCall' - local_shell_call: '#/components/schemas/OpenAI.OutputItemLocalShellToolCall' - shell_call: '#/components/schemas/OpenAI.OutputItemFunctionShellCall' - shell_call_output: '#/components/schemas/OpenAI.OutputItemFunctionShellCallOutput' - apply_patch_call: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCall' - apply_patch_call_output: '#/components/schemas/OpenAI.OutputItemApplyPatchToolCallOutput' - mcp_call: '#/components/schemas/OpenAI.OutputItemMcpToolCall' - mcp_list_tools: '#/components/schemas/OpenAI.OutputItemMcpListTools' - mcp_approval_request: '#/components/schemas/OpenAI.OutputItemMcpApprovalRequest' - custom_tool_call: '#/components/schemas/OpenAI.OutputItemCustomToolCall' - OpenAI.OutputItemType: - anyOf: - - type: string - - type: string - enum: - - output_message - - file_search_call - - function_call - - web_search_call - - computer_call - - reasoning - - compaction - - image_generation_call - - code_interpreter_call - - local_shell_call - - shell_call - - shell_call_output - - apply_patch_call - - apply_patch_call_output - - mcp_call - - mcp_list_tools - - mcp_approval_request - - custom_tool_call - OpenAI.Prompt: - type: object - required: - - id - properties: - id: - type: string - description: The unique identifier of the prompt template to use. - version: - anyOf: - - type: string - - type: 'null' - variables: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponsePromptVariables' - - type: 'null' - description: |- - Reference to a prompt template and its variables. - [Learn more](https://platform.openai.com/docs/guides/text?api-mode=responses#reusable-prompts). - OpenAI.Reasoning: - type: object - properties: - effort: - $ref: '#/components/schemas/OpenAI.ReasoningEffort' - summary: - anyOf: - - type: string - enum: - - auto - - concise - - detailed - - type: 'null' - generate_summary: - anyOf: - - type: string - enum: - - auto - - concise - - detailed - - type: 'null' - description: |- - **gpt-5 and o-series models only** - Configuration options for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - title: Reasoning - OpenAI.ReasoningEffort: - anyOf: - - type: string - enum: - - none - - minimal - - low - - medium - - high - - xhigh - - type: 'null' - description: |- - Constrains effort on reasoning for - [reasoning models](https://platform.openai.com/docs/guides/reasoning). - Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing - reasoning effort can result in faster responses and fewer tokens used - on reasoning in a response. - - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1. - - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`. - - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort. - - `xhigh` is supported for all models after `gpt-5.1-codex-max`. - OpenAI.Response: - type: object - required: - - id - - object - - created_at - - error - - incomplete_details - - output - - instructions - - parallel_tool_calls - - content_filters - properties: - metadata: - anyOf: - - $ref: '#/components/schemas/OpenAI.Metadata' - - type: 'null' - top_logprobs: - anyOf: - - type: integer - - type: 'null' - temperature: - anyOf: - - type: number - - type: 'null' - default: 1 - top_p: - anyOf: - - type: number - - type: 'null' - default: 1 - user: - type: string - description: |- - This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - A stable identifier for your end-users. - Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - deprecated: true - safety_identifier: - type: string - description: |- - A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - prompt_cache_key: - type: string - description: 'Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching).' - prompt_cache_retention: - anyOf: - - type: string - enum: - - in-memory - - 24h - - type: 'null' - previous_response_id: - anyOf: - - type: string - - type: 'null' - model: - type: string - description: |- - Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - offers a wide range of models with different capabilities, performance - characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - to browse and compare available models. - reasoning: - anyOf: - - $ref: '#/components/schemas/OpenAI.Reasoning' - - type: 'null' - background: - anyOf: - - type: boolean - - type: 'null' - max_output_tokens: - anyOf: - - type: integer - - type: 'null' - max_tool_calls: - anyOf: - - type: integer - - type: 'null' - text: - $ref: '#/components/schemas/OpenAI.ResponseTextParam' - tools: - $ref: '#/components/schemas/OpenAI.ToolsArray' - tool_choice: - $ref: '#/components/schemas/OpenAI.ToolChoiceParam' - prompt: - $ref: '#/components/schemas/OpenAI.Prompt' - truncation: - anyOf: - - type: string - enum: - - auto - - disabled - - type: 'null' - default: disabled - id: - type: string - description: Unique identifier for this Response. - object: - type: string - enum: - - response - description: The object type of this resource - always set to `response`. - x-stainless-const: true - status: - type: string - enum: - - completed - - failed - - in_progress - - cancelled - - queued - - incomplete - description: |- - The status of the response generation. One of `completed`, `failed`, - `in_progress`, `cancelled`, `queued`, or `incomplete`. - created_at: - type: integer - format: unixtime - description: Unix timestamp (in seconds) of when this Response was created. - completed_at: - anyOf: - - type: string - format: date-time - - type: 'null' - type: integer - format: unixTimestamp - error: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseError' - - type: 'null' - incomplete_details: - anyOf: - - $ref: '#/components/schemas/OpenAI.ResponseIncompleteDetails' - - type: 'null' - output: - type: array - items: - $ref: '#/components/schemas/OpenAI.OutputItem' - description: |- - An array of content items generated by the model. - - The length and order of items in the `output` array is dependent - on the model's response. - - Rather than accessing the first item in the `output` array and - assuming it's an `assistant` message with the content generated by - the model, you might consider using the `output_text` property where - supported in SDKs. - instructions: - anyOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAI.InputItem' - - type: 'null' - output_text: - anyOf: - - type: string - - type: 'null' - x-stainless-skip: true - usage: - $ref: '#/components/schemas/OpenAI.ResponseUsage' - parallel_tool_calls: - type: boolean - description: Whether to allow the model to run tool calls in parallel. - default: true - conversation: - anyOf: - - $ref: '#/components/schemas/OpenAI.ConversationReference' - - type: 'null' - content_filters: - type: array - items: - $ref: '#/components/schemas/AzureContentFilterForResponsesAPI' - description: The content filter results from RAI. - title: The response object - OpenAI.ResponseAudioDeltaEvent: - type: object - required: - - type - - sequence_number - - delta - properties: - type: - type: string - enum: - - response.audio.delta - description: The type of the event. Always `response.audio.delta`. - x-stainless-const: true - sequence_number: - type: integer - description: A sequence number for this chunk of the stream response. - delta: - type: string - contentEncoding: base64 - description: A chunk of Base64 encoded response audio bytes. - description: Emitted when there is a partial audio response. - x-oaiMeta: - name: response.audio.delta - group: responses - example: | - { - "type": "response.audio.delta", - "response_id": "resp_123", - "delta": "base64encoded...", - "sequence_number": 1 - } - OpenAI.ResponseAudioTranscriptDeltaEvent: - type: object - required: - - type - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.audio.transcript.delta - description: The type of the event. Always `response.audio.transcript.delta`. - x-stainless-const: true - delta: - type: string - description: The partial transcript of the audio response. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when there is a partial transcript of audio. - x-oaiMeta: - name: response.audio.transcript.delta - group: responses - example: | - { - "type": "response.audio.transcript.delta", - "response_id": "resp_123", - "delta": " ... partial transcript ... ", - "sequence_number": 1 - } - OpenAI.ResponseCodeInterpreterCallCodeDeltaEvent: - type: object - required: - - type - - output_index - - item_id - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.code_interpreter_call_code.delta - description: The type of the event. Always `response.code_interpreter_call_code.delta`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response for which the code is being streamed. - item_id: - type: string - description: The unique identifier of the code interpreter tool call item. - delta: - type: string - description: The partial code snippet being streamed by the code interpreter. - sequence_number: - type: integer - description: 'The sequence number of this event, used to order streaming events.' - description: Emitted when a partial code snippet is streamed by the code interpreter. - x-oaiMeta: - name: response.code_interpreter_call_code.delta - group: responses - example: | - { - "type": "response.code_interpreter_call_code.delta", - "output_index": 0, - "item_id": "ci_12345", - "delta": "print('Hello, world')", - "sequence_number": 1 - } - OpenAI.ResponseCodeInterpreterCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.code_interpreter_call.in_progress - description: The type of the event. Always `response.code_interpreter_call.in_progress`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response for which the code interpreter call is in progress. - item_id: - type: string - description: The unique identifier of the code interpreter tool call item. - sequence_number: - type: integer - description: 'The sequence number of this event, used to order streaming events.' - description: Emitted when a code interpreter call is in progress. - x-oaiMeta: - name: response.code_interpreter_call.in_progress - group: responses - example: | - { - "type": "response.code_interpreter_call.in_progress", - "output_index": 0, - "item_id": "ci_12345", - "sequence_number": 1 - } - OpenAI.ResponseCodeInterpreterCallInterpretingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.code_interpreter_call.interpreting - description: The type of the event. Always `response.code_interpreter_call.interpreting`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response for which the code interpreter is interpreting code. - item_id: - type: string - description: The unique identifier of the code interpreter tool call item. - sequence_number: - type: integer - description: 'The sequence number of this event, used to order streaming events.' - description: Emitted when the code interpreter is actively interpreting the code snippet. - x-oaiMeta: - name: response.code_interpreter_call.interpreting - group: responses - example: | - { - "type": "response.code_interpreter_call.interpreting", - "output_index": 4, - "item_id": "ci_12345", - "sequence_number": 1 - } - OpenAI.ResponseContentPartAddedEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - part - - sequence_number - properties: - type: - type: string - enum: - - response.content_part.added - description: The type of the event. Always `response.content_part.added`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the content part was added to. - output_index: - type: integer - description: The index of the output item that the content part was added to. - content_index: - type: integer - description: The index of the content part that was added. - part: - allOf: - - $ref: '#/components/schemas/OpenAI.OutputContent' - description: The content part that was added. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a new content part is added. - x-oaiMeta: - name: response.content_part.added - group: responses - example: | - { - "type": "response.content_part.added", - "item_id": "msg_123", - "output_index": 0, - "content_index": 0, - "part": { - "type": "output_text", - "text": "", - "annotations": [] - }, - "sequence_number": 1 - } - OpenAI.ResponseCreatedEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.created - description: The type of the event. Always `response.created`. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that was created. - sequence_number: - type: integer - description: The sequence number for this event. - description: An event that is emitted when a response is created. - x-oaiMeta: - name: response.created - group: responses - example: | - { - "type": "response.created", - "response": { - "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", - "object": "response", - "created_at": 1741487325, - "status": "in_progress", - "completed_at": null, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-2024-08-06", - "output": [], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - }, - "sequence_number": 1 - } - OpenAI.ResponseCustomToolCallInputDeltaEvent: - type: object - required: - - type - - sequence_number - - output_index - - item_id - - delta - properties: - type: - type: string - enum: - - response.custom_tool_call_input.delta - description: The event type identifier. - x-stainless-const: true - sequence_number: - type: integer - description: The sequence number of this event. - output_index: - type: integer - description: The index of the output this delta applies to. - item_id: - type: string - description: Unique identifier for the API item associated with this event. - delta: - type: string - description: The incremental input data (delta) for the custom tool call. - description: Event representing a delta (partial update) to the input of a custom tool call. - title: ResponseCustomToolCallInputDelta - x-oaiMeta: - name: response.custom_tool_call_input.delta - group: responses - example: | - { - "type": "response.custom_tool_call_input.delta", - "output_index": 0, - "item_id": "ctc_1234567890abcdef", - "delta": "partial input text" - } - OpenAI.ResponseError: - type: object - required: - - code - - message - properties: - code: - $ref: '#/components/schemas/OpenAI.ResponseErrorCode' - message: - type: string - description: A human-readable description of the error. - description: An error object returned when the model fails to generate a Response. - OpenAI.ResponseErrorCode: - type: string - enum: - - server_error - - rate_limit_exceeded - - invalid_prompt - - vector_store_timeout - - invalid_image - - invalid_image_format - - invalid_base64_image - - invalid_image_url - - image_too_large - - image_too_small - - image_parse_error - - image_content_policy_violation - - invalid_image_mode - - image_file_too_large - - unsupported_image_media_type - - empty_image_file - - failed_to_download_image - - image_file_not_found - description: The error code for the response. - OpenAI.ResponseErrorEvent: - type: object - required: - - type - - code - - message - - param - - sequence_number - properties: - type: - type: string - enum: - - error - description: The type of the event. Always `error`. - x-stainless-const: true - code: - anyOf: - - type: string - - type: 'null' - message: - type: string - description: The error message. - param: - anyOf: - - type: string - - type: 'null' - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when an error occurs. - x-oaiMeta: - name: error - group: responses - example: | - { - "type": "error", - "code": "ERR_SOMETHING", - "message": "Something went wrong", - "param": null, - "sequence_number": 1 - } - OpenAI.ResponseFailedEvent: - type: object - required: - - type - - sequence_number - - response - properties: - type: - type: string - enum: - - response.failed - description: The type of the event. Always `response.failed`. - x-stainless-const: true - sequence_number: - type: integer - description: The sequence number of this event. - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that failed. - description: An event that is emitted when a response fails. - x-oaiMeta: - name: response.failed - group: responses - example: | - { - "type": "response.failed", - "response": { - "id": "resp_123", - "object": "response", - "created_at": 1740855869, - "status": "failed", - "completed_at": null, - "error": { - "code": "server_error", - "message": "The model failed to generate a response." - }, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-mini-2024-07-18", - "output": [], - "previous_response_id": null, - "reasoning_effort": null, - "store": false, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - } - } - OpenAI.ResponseFileSearchCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.file_search_call.in_progress - description: The type of the event. Always `response.file_search_call.in_progress`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the file search call is initiated. - item_id: - type: string - description: The ID of the output item that the file search call is initiated. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a file search call is initiated. - x-oaiMeta: - name: response.file_search_call.in_progress - group: responses - example: | - { - "type": "response.file_search_call.in_progress", - "output_index": 0, - "item_id": "fs_123", - "sequence_number": 1 - } - OpenAI.ResponseFileSearchCallSearchingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.file_search_call.searching - description: The type of the event. Always `response.file_search_call.searching`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the file search call is searching. - item_id: - type: string - description: The ID of the output item that the file search call is initiated. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a file search is currently searching. - x-oaiMeta: - name: response.file_search_call.searching - group: responses - example: | - { - "type": "response.file_search_call.searching", - "output_index": 0, - "item_id": "fs_123", - "sequence_number": 1 - } - OpenAI.ResponseFunctionCallArgumentsDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - - delta - properties: - type: - type: string - enum: - - response.function_call_arguments.delta - description: The type of the event. Always `response.function_call_arguments.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the function-call arguments delta is added to. - output_index: - type: integer - description: The index of the output item that the function-call arguments delta is added to. - sequence_number: - type: integer - description: The sequence number of this event. - delta: - type: string - description: The function-call arguments delta that is added. - description: Emitted when there is a partial function-call arguments delta. - x-oaiMeta: - name: response.function_call_arguments.delta - group: responses - example: | - { - "type": "response.function_call_arguments.delta", - "item_id": "item-abc", - "output_index": 0, - "delta": "{ "arg":" - "sequence_number": 1 - } - OpenAI.ResponseImageGenCallGeneratingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.image_generation_call.generating - description: The type of the event. Always 'response.image_generation_call.generating'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the image generation item being processed. - sequence_number: - type: integer - description: The sequence number of the image generation item being processed. - description: Emitted when an image generation tool call is actively generating an image (intermediate state). - title: ResponseImageGenCallGeneratingEvent - x-oaiMeta: - name: response.image_generation_call.generating - group: responses - example: | - { - "type": "response.image_generation_call.generating", - "output_index": 0, - "item_id": "item-123", - "sequence_number": 0 - } - OpenAI.ResponseImageGenCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.image_generation_call.in_progress - description: The type of the event. Always 'response.image_generation_call.in_progress'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the image generation item being processed. - sequence_number: - type: integer - description: The sequence number of the image generation item being processed. - description: Emitted when an image generation tool call is in progress. - title: ResponseImageGenCallInProgressEvent - x-oaiMeta: - name: response.image_generation_call.in_progress - group: responses - example: | - { - "type": "response.image_generation_call.in_progress", - "output_index": 0, - "item_id": "item-123", - "sequence_number": 0 - } - OpenAI.ResponseImageGenCallPartialImageEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - - partial_image_index - - partial_image_b64 - properties: - type: - type: string - enum: - - response.image_generation_call.partial_image - description: The type of the event. Always 'response.image_generation_call.partial_image'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the image generation item being processed. - sequence_number: - type: integer - description: The sequence number of the image generation item being processed. - partial_image_index: - type: integer - description: '0-based index for the partial image (backend is 1-based, but this is 0-based for the user).' - partial_image_b64: - type: string - description: 'Base64-encoded partial image data, suitable for rendering as an image.' - description: Emitted when a partial image is available during image generation streaming. - title: ResponseImageGenCallPartialImageEvent - x-oaiMeta: - name: response.image_generation_call.partial_image - group: responses - example: | - { - "type": "response.image_generation_call.partial_image", - "output_index": 0, - "item_id": "item-123", - "sequence_number": 0, - "partial_image_index": 0, - "partial_image_b64": "..." - } - OpenAI.ResponseInProgressEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.in_progress - description: The type of the event. Always `response.in_progress`. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that is in progress. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when the response is in progress. - x-oaiMeta: - name: response.in_progress - group: responses - example: | - { - "type": "response.in_progress", - "response": { - "id": "resp_67ccfcdd16748190a91872c75d38539e09e4d4aac714747c", - "object": "response", - "created_at": 1741487325, - "status": "in_progress", - "completed_at": null, - "error": null, - "incomplete_details": null, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-2024-08-06", - "output": [], - "parallel_tool_calls": true, - "previous_response_id": null, - "reasoning": { - "effort": null, - "summary": null - }, - "store": true, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - }, - "sequence_number": 1 - } - OpenAI.ResponseIncompleteDetails: - type: object - properties: - reason: - type: string - enum: - - max_output_tokens - - content_filter - OpenAI.ResponseIncompleteEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.incomplete - description: The type of the event. Always `response.incomplete`. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The response that was incomplete. - sequence_number: - type: integer - description: The sequence number of this event. - description: An event that is emitted when a response finishes as incomplete. - x-oaiMeta: - name: response.incomplete - group: responses - example: | - { - "type": "response.incomplete", - "response": { - "id": "resp_123", - "object": "response", - "created_at": 1740855869, - "status": "incomplete", - "completed_at": null, - "error": null, - "incomplete_details": { - "reason": "max_tokens" - }, - "instructions": null, - "max_output_tokens": null, - "model": "gpt-4o-mini-2024-07-18", - "output": [], - "previous_response_id": null, - "reasoning_effort": null, - "store": false, - "temperature": 1, - "text": { - "format": { - "type": "text" - } - }, - "tool_choice": "auto", - "tools": [], - "top_p": 1, - "truncation": "disabled", - "usage": null, - "user": null, - "metadata": {} - }, - "sequence_number": 1 - } - OpenAI.ResponseItemList: - type: object - required: - - object - - data - - has_more - - first_id - - last_id - properties: - object: - type: string - enum: - - list - description: 'The type of object returned, must be `list`.' - x-stainless-const: true - data: - type: array - items: - $ref: '#/components/schemas/OpenAI.ItemResource' - description: A list of items used to generate this response. - has_more: - type: boolean - description: Whether there are more items available. - first_id: - type: string - description: The ID of the first item in the list. - last_id: - type: string - description: The ID of the last item in the list. - description: A list of Response items. - x-oaiMeta: - name: The input item list - group: responses - example: | - { - "object": "list", - "data": [ - { - "id": "msg_abc123", - "type": "message", - "role": "user", - "content": [ - { - "type": "input_text", - "text": "Tell me a three sentence bedtime story about a unicorn." - } - ] - } - ], - "first_id": "msg_abc123", - "last_id": "msg_abc123", - "has_more": false - } - OpenAI.ResponseLogProb: - type: object - required: - - token - - logprob - properties: - token: - type: string - description: A possible text token. - logprob: - type: number - description: The log probability of this token. - top_logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.ResponseLogProbTopLogprobs' - description: The log probability of the top 20 most likely tokens. - description: |- - A logprob is the logarithmic probability that the model assigns to producing - a particular token at a given position in the sequence. Less-negative (higher) - logprob values indicate greater model confidence in that token choice. - OpenAI.ResponseLogProbTopLogprobs: - type: object - properties: - token: - type: string - logprob: - type: number - OpenAI.ResponseMCPCallArgumentsDeltaEvent: - type: object - required: - - type - - output_index - - item_id - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_call_arguments.delta - description: The type of the event. Always 'response.mcp_call_arguments.delta'. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the MCP tool call item being processed. - delta: - type: string - description: A JSON string containing the partial update to the arguments for the MCP tool call. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when there is a delta (partial update) to the arguments of an MCP tool call. - title: ResponseMCPCallArgumentsDeltaEvent - x-oaiMeta: - name: response.mcp_call_arguments.delta - group: responses - example: | - { - "type": "response.mcp_call_arguments.delta", - "output_index": 0, - "item_id": "item-abc", - "delta": "{", - "sequence_number": 1 - } - OpenAI.ResponseMCPCallFailedEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_call.failed - description: The type of the event. Always 'response.mcp_call.failed'. - x-stainless-const: true - item_id: - type: string - description: The ID of the MCP tool call item that failed. - output_index: - type: integer - description: The index of the output item that failed. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when an MCP tool call has failed. - title: ResponseMCPCallFailedEvent - x-oaiMeta: - name: response.mcp_call.failed - group: responses - example: | - { - "type": "response.mcp_call.failed", - "sequence_number": 1, - "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90", - "output_index": 0 - } - OpenAI.ResponseMCPCallInProgressEvent: - type: object - required: - - type - - sequence_number - - output_index - - item_id - properties: - type: - type: string - enum: - - response.mcp_call.in_progress - description: The type of the event. Always 'response.mcp_call.in_progress'. - x-stainless-const: true - sequence_number: - type: integer - description: The sequence number of this event. - output_index: - type: integer - description: The index of the output item in the response's output array. - item_id: - type: string - description: The unique identifier of the MCP tool call item being processed. - description: Emitted when an MCP tool call is in progress. - title: ResponseMCPCallInProgressEvent - x-oaiMeta: - name: response.mcp_call.in_progress - group: responses - example: | - { - "type": "response.mcp_call.in_progress", - "sequence_number": 1, - "output_index": 0, - "item_id": "mcp_682d437d90a88191bf88cd03aae0c3e503937d5f622d7a90" - } - OpenAI.ResponseMCPListToolsFailedEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_list_tools.failed - description: The type of the event. Always 'response.mcp_list_tools.failed'. - x-stainless-const: true - item_id: - type: string - description: The ID of the MCP tool call item that failed. - output_index: - type: integer - description: The index of the output item that failed. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when the attempt to list available MCP tools has failed. - title: ResponseMCPListToolsFailedEvent - x-oaiMeta: - name: response.mcp_list_tools.failed - group: responses - example: | - { - "type": "response.mcp_list_tools.failed", - "sequence_number": 1, - "output_index": 0, - "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" - } - OpenAI.ResponseMCPListToolsInProgressEvent: - type: object - required: - - type - - item_id - - output_index - - sequence_number - properties: - type: - type: string - enum: - - response.mcp_list_tools.in_progress - description: The type of the event. Always 'response.mcp_list_tools.in_progress'. - x-stainless-const: true - item_id: - type: string - description: The ID of the MCP tool call item that is being processed. - output_index: - type: integer - description: The index of the output item that is being processed. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when the system is in the process of retrieving the list of available MCP tools. - title: ResponseMCPListToolsInProgressEvent - x-oaiMeta: - name: response.mcp_list_tools.in_progress - group: responses - example: | - { - "type": "response.mcp_list_tools.in_progress", - "sequence_number": 1, - "output_index": 0, - "item_id": "mcpl_682d4379df088191886b70f4ec39f90403937d5f622d7a90" - } - OpenAI.ResponseOutputItemAddedEvent: - type: object - required: - - type - - output_index - - sequence_number - - item - properties: - type: - type: string - enum: - - response.output_item.added - description: The type of the event. Always `response.output_item.added`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that was added. - sequence_number: - type: integer - description: The sequence number of this event. - item: - allOf: - - $ref: '#/components/schemas/OpenAI.OutputItem' - description: The output item that was added. - description: Emitted when a new output item is added. - x-oaiMeta: - name: response.output_item.added - group: responses - example: | - { - "type": "response.output_item.added", - "output_index": 0, - "item": { - "id": "msg_123", - "status": "in_progress", - "type": "message", - "role": "assistant", - "content": [] - }, - "sequence_number": 1 - } - OpenAI.ResponseOutputTextAnnotationAddedEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - annotation_index - - sequence_number - - annotation - properties: - type: - type: string - enum: - - response.output_text.annotation.added - description: The type of the event. Always 'response.output_text.annotation.added'. - x-stainless-const: true - item_id: - type: string - description: The unique identifier of the item to which the annotation is being added. - output_index: - type: integer - description: The index of the output item in the response's output array. - content_index: - type: integer - description: The index of the content part within the output item. - annotation_index: - type: integer - description: The index of the annotation within the content part. - sequence_number: - type: integer - description: The sequence number of this event. - annotation: - allOf: - - $ref: '#/components/schemas/OpenAI.Annotation' - description: The annotation object being added. (See annotation schema for details.) - description: Emitted when an annotation is added to output text content. - title: ResponseOutputTextAnnotationAddedEvent - x-oaiMeta: - name: response.output_text.annotation.added - group: responses - example: | - { - "type": "response.output_text.annotation.added", - "item_id": "item-abc", - "output_index": 0, - "content_index": 0, - "annotation_index": 0, - "annotation": { - "type": "text_annotation", - "text": "This is a test annotation", - "start": 0, - "end": 10 - }, - "sequence_number": 1 - } - OpenAI.ResponsePromptVariables: - type: object - unevaluatedProperties: - anyOf: - - type: string - - $ref: '#/components/schemas/OpenAI.InputTextContent' - - $ref: '#/components/schemas/OpenAI.InputImageContent' - - $ref: '#/components/schemas/OpenAI.InputFileContent' - description: |- - Optional map of values to substitute in for variables in your - prompt. The substitution values can either be strings, or other - Response input types like images or files. - title: Prompt Variables - x-oaiExpandable: true - x-oaiTypeLabel: map - OpenAI.ResponseQueuedEvent: - type: object - required: - - type - - response - - sequence_number - properties: - type: - type: string - enum: - - response.queued - description: The type of the event. Always 'response.queued'. - x-stainless-const: true - response: - allOf: - - $ref: '#/components/schemas/OpenAI.Response' - description: The full response object that is queued. - sequence_number: - type: integer - description: The sequence number for this event. - description: Emitted when a response is queued and waiting to be processed. - title: ResponseQueuedEvent - x-oaiMeta: - name: response.queued - group: responses - example: | - { - "type": "response.queued", - "response": { - "id": "res_123", - "status": "queued", - "created_at": "2021-01-01T00:00:00Z", - "updated_at": "2021-01-01T00:00:00Z" - }, - "sequence_number": 1 - } - OpenAI.ResponseReasoningSummaryPartAddedEvent: - type: object - required: - - type - - item_id - - output_index - - summary_index - - sequence_number - - part - properties: - type: - type: string - enum: - - response.reasoning_summary_part.added - description: The type of the event. Always `response.reasoning_summary_part.added`. - x-stainless-const: true - item_id: - type: string - description: The ID of the item this summary part is associated with. - output_index: - type: integer - description: The index of the output item this summary part is associated with. - summary_index: - type: integer - description: The index of the summary part within the reasoning summary. - sequence_number: - type: integer - description: The sequence number of this event. - part: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseReasoningSummaryPartAddedEventPart' - description: The summary part that was added. - description: Emitted when a new reasoning summary part is added. - x-oaiMeta: - name: response.reasoning_summary_part.added - group: responses - example: | - { - "type": "response.reasoning_summary_part.added", - "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", - "output_index": 0, - "summary_index": 0, - "part": { - "type": "summary_text", - "text": "" - }, - "sequence_number": 1 - } - OpenAI.ResponseReasoningSummaryPartAddedEventPart: - type: object - required: - - type - - text - properties: - type: - type: string - enum: - - summary_text - x-stainless-const: true - text: - type: string - OpenAI.ResponseReasoningSummaryTextDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - summary_index - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.reasoning_summary_text.delta - description: The type of the event. Always `response.reasoning_summary_text.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the item this summary text delta is associated with. - output_index: - type: integer - description: The index of the output item this summary text delta is associated with. - summary_index: - type: integer - description: The index of the summary part within the reasoning summary. - delta: - type: string - description: The text delta that was added to the summary. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a delta is added to a reasoning summary text. - x-oaiMeta: - name: response.reasoning_summary_text.delta - group: responses - example: | - { - "type": "response.reasoning_summary_text.delta", - "item_id": "rs_6806bfca0b2481918a5748308061a2600d3ce51bdffd5476", - "output_index": 0, - "summary_index": 0, - "delta": "**Responding to a greeting** - - The user just said, "Hello!" So, it seems I need to engage. I'll greet them back and offer help since they're looking to chat. I could say something like, "Hello! How can I assist you today?" That feels friendly and open. They didn't ask a specific question, so this approach will work well for starting a conversation. Let's see where it goes from there!", - "sequence_number": 1 - } - OpenAI.ResponseReasoningTextDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.reasoning_text.delta - description: The type of the event. Always `response.reasoning_text.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the item this reasoning text delta is associated with. - output_index: - type: integer - description: The index of the output item this reasoning text delta is associated with. - content_index: - type: integer - description: The index of the reasoning content part this delta is associated with. - delta: - type: string - description: The text delta that was added to the reasoning content. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when a delta is added to a reasoning text. - x-oaiMeta: - name: response.reasoning_text.delta - group: responses - example: | - { - "type": "response.reasoning_text.delta", - "item_id": "rs_123", - "output_index": 0, - "content_index": 0, - "delta": "The", - "sequence_number": 1 - } - OpenAI.ResponseRefusalDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - delta - - sequence_number - properties: - type: - type: string - enum: - - response.refusal.delta - description: The type of the event. Always `response.refusal.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the refusal text is added to. - output_index: - type: integer - description: The index of the output item that the refusal text is added to. - content_index: - type: integer - description: The index of the content part that the refusal text is added to. - delta: - type: string - description: The refusal text that is added. - sequence_number: - type: integer - description: The sequence number of this event. - description: Emitted when there is a partial refusal text. - x-oaiMeta: - name: response.refusal.delta - group: responses - example: | - { - "type": "response.refusal.delta", - "item_id": "msg_123", - "output_index": 0, - "content_index": 0, - "delta": "refusal text so far", - "sequence_number": 1 - } - OpenAI.ResponseStreamOptions: - type: object - properties: - include_obfuscation: - type: boolean - description: |- - When true, stream obfuscation will be enabled. Stream obfuscation adds - random characters to an `obfuscation` field on streaming delta events to - normalize payload sizes as a mitigation to certain side-channel attacks. - These obfuscation fields are included by default, but add a small amount - of overhead to the data stream. You can set `include_obfuscation` to - false to optimize for bandwidth if you trust the network links between - your application and the OpenAI API. - description: 'Options for streaming responses. Only set this when you set `stream: true`.' - OpenAI.ResponseTextDeltaEvent: - type: object - required: - - type - - item_id - - output_index - - content_index - - delta - - sequence_number - - logprobs - properties: - type: - type: string - enum: - - response.output_text.delta - description: The type of the event. Always `response.output_text.delta`. - x-stainless-const: true - item_id: - type: string - description: The ID of the output item that the text delta was added to. - output_index: - type: integer - description: The index of the output item that the text delta was added to. - content_index: - type: integer - description: The index of the content part that the text delta was added to. - delta: - type: string - description: The text delta that was added. - sequence_number: - type: integer - description: The sequence number for this event. - logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAI.ResponseLogProb' - description: The log probabilities of the tokens in the delta. - description: Emitted when there is an additional text delta. - x-oaiMeta: - name: response.output_text.delta - group: responses - example: | - { - "type": "response.output_text.delta", - "item_id": "msg_123", - "output_index": 0, - "content_index": 0, - "delta": "In", - "sequence_number": 1 - } - OpenAI.ResponseTextParam: - type: object - properties: - format: - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfiguration' - verbosity: - $ref: '#/components/schemas/OpenAI.Verbosity' - description: |- - Configuration options for a text response from the model. Can be plain - text or structured JSON data. Learn more: - - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - OpenAI.ResponseUsage: - type: object - required: - - input_tokens - - input_tokens_details - - output_tokens - - output_tokens_details - - total_tokens - properties: - input_tokens: - type: integer - description: The number of input tokens. - input_tokens_details: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseUsageInputTokensDetails' - description: A detailed breakdown of the input tokens. - output_tokens: - type: integer - description: The number of output tokens. - output_tokens_details: - allOf: - - $ref: '#/components/schemas/OpenAI.ResponseUsageOutputTokensDetails' - description: A detailed breakdown of the output tokens. - total_tokens: - type: integer - description: The total number of tokens used. - description: |- - Represents token usage details including input tokens, output tokens, - a breakdown of output tokens, and the total tokens used. - OpenAI.ResponseUsageInputTokensDetails: - type: object - required: - - cached_tokens - properties: - cached_tokens: - type: integer - OpenAI.ResponseUsageOutputTokensDetails: - type: object - required: - - reasoning_tokens - properties: - reasoning_tokens: - type: integer - OpenAI.ResponseWebSearchCallInProgressEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.web_search_call.in_progress - description: The type of the event. Always `response.web_search_call.in_progress`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the web search call is associated with. - item_id: - type: string - description: Unique ID for the output item associated with the web search call. - sequence_number: - type: integer - description: The sequence number of the web search call being processed. - description: 'Note: web_search is not yet available via Azure OpenAI.' - x-oaiMeta: - name: response.web_search_call.in_progress - group: responses - example: | - { - "type": "response.web_search_call.in_progress", - "output_index": 0, - "item_id": "ws_123", - "sequence_number": 0 - } - OpenAI.ResponseWebSearchCallSearchingEvent: - type: object - required: - - type - - output_index - - item_id - - sequence_number - properties: - type: - type: string - enum: - - response.web_search_call.searching - description: The type of the event. Always `response.web_search_call.searching`. - x-stainless-const: true - output_index: - type: integer - description: The index of the output item that the web search call is associated with. - item_id: - type: string - description: Unique ID for the output item associated with the web search call. - sequence_number: - type: integer - description: The sequence number of the web search call being processed. - description: 'Note: web_search is not yet available via Azure OpenAI.' - x-oaiMeta: - name: response.web_search_call.searching - group: responses - example: | - { - "type": "response.web_search_call.searching", - "output_index": 0, - "item_id": "ws_123", - "sequence_number": 0 - } - OpenAI.TextResponseFormatConfiguration: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.TextResponseFormatConfigurationType' - discriminator: - propertyName: type - mapping: - json_schema: '#/components/schemas/OpenAI.TextResponseFormatJsonSchema' - text: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatText' - json_object: '#/components/schemas/OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject' - description: |- - An object specifying the format that the model must output. - Configuring `{ "type": "json_schema" }` enables Structured Outputs, - which ensures the model will match your supplied JSON schema. Learn more in the - [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - The default format is `{ "type": "text" }` with no additional options. - *Not recommended for gpt-4o and newer models:** - Setting to `{ "type": "json_object" }` enables the older JSON mode, which - ensures the message the model generates is valid JSON. Using `json_schema` - is preferred for models that support it. - OpenAI.TextResponseFormatConfigurationType: - anyOf: - - type: string - - type: string - enum: - - text - - json_schema - - json_object - OpenAI.Tool: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ToolType' - discriminator: - propertyName: type - mapping: - code_interpreter: '#/components/schemas/OpenAI.CodeInterpreterTool' - function: '#/components/schemas/OpenAI.FunctionTool' - file_search: '#/components/schemas/OpenAI.FileSearchTool' - computer_use_preview: '#/components/schemas/OpenAI.ComputerUsePreviewTool' - web_search: '#/components/schemas/OpenAI.WebSearchTool' - mcp: '#/components/schemas/OpenAI.MCPTool' - image_generation: '#/components/schemas/OpenAI.ImageGenTool' - local_shell: '#/components/schemas/OpenAI.LocalShellToolParam' - shell: '#/components/schemas/OpenAI.FunctionShellToolParam' - custom: '#/components/schemas/OpenAI.CustomToolParam' - web_search_preview: '#/components/schemas/OpenAI.WebSearchPreviewTool' - apply_patch: '#/components/schemas/OpenAI.ApplyPatchToolParam' - description: A tool that can be used to generate a response. - OpenAI.ToolChoiceParam: - type: object - required: - - type - properties: - type: - $ref: '#/components/schemas/OpenAI.ToolChoiceParamType' - discriminator: - propertyName: type - mapping: - allowed_tools: '#/components/schemas/OpenAI.ToolChoiceAllowed' - mcp: '#/components/schemas/OpenAI.ToolChoiceMCP' - custom: '#/components/schemas/OpenAI.ToolChoiceCustom' - apply_patch: '#/components/schemas/OpenAI.SpecificApplyPatchParam' - shell: '#/components/schemas/OpenAI.SpecificFunctionShellParam' - file_search: '#/components/schemas/OpenAI.ToolChoiceFileSearch' - web_search_preview: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview' - computer_use_preview: '#/components/schemas/OpenAI.ToolChoiceComputerUsePreview' - web_search_preview_2025_03_11: '#/components/schemas/OpenAI.ToolChoiceWebSearchPreview20250311' - image_generation: '#/components/schemas/OpenAI.ToolChoiceImageGeneration' - code_interpreter: '#/components/schemas/OpenAI.ToolChoiceCodeInterpreter' - description: |- - How the model should select which tool (or tools) to use when generating - a response. See the `tools` parameter to see how to specify which tools - the model can call. - OpenAI.ToolChoiceParamType: - anyOf: - - type: string - - type: string - enum: - - allowed_tools - - function - - mcp - - custom - - apply_patch - - shell - - file_search - - web_search_preview - - computer_use_preview - - web_search_preview_2025_03_11 - - image_generation - - code_interpreter - OpenAI.ToolType: - anyOf: - - type: string - - type: string - enum: - - function - - file_search - - computer_use_preview - - web_search - - mcp - - code_interpreter - - image_generation - - local_shell - - shell - - custom - - web_search_preview - - apply_patch - OpenAI.ToolsArray: - type: array - items: - $ref: '#/components/schemas/OpenAI.Tool' - description: |- - An array of tools the model may call while generating a response. You - can specify which tool to use by setting the `tool_choice` parameter. - We support the following categories of tools: - - **Built-in tools**: Tools that are provided by OpenAI that extend the - model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - [built-in tools](https://platform.openai.com/docs/guides/tools). - - **MCP Tools**: Integrations with third-party systems via custom MCP servers - or predefined connectors such as Google Drive and SharePoint. Learn more about - [MCP Tools](https://platform.openai.com/docs/guides/tools-connectors-mcp). - - **Function calls (custom tools)**: Functions that are defined by you, - enabling the model to call your own code with strongly typed arguments - and outputs. Learn more about - [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - custom tools to call your own code. - OpenAI.Verbosity: - anyOf: - - type: string - enum: - - low - - medium - - high - - type: 'null' - description: |- - Constrains the verbosity of the model's response. Lower values will result in - more concise responses, while higher values will result in more verbose responses. - Currently supported values are `low`, `medium`, and `high`. - securitySchemes: - ApiKeyAuth: - type: apiKey - in: header - name: api-key - ApiKeyAuth_: - type: apiKey - in: header - name: authorization - OAuth2Auth: - type: oauth2 - flows: - implicit: - authorizationUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize' - scopes: - 'https://cognitiveservices.azure.com/.default': '' -servers: - - url: '{endpoint}/openai/v1' - description: Azure AI Foundry Models APIs - variables: - endpoint: - default: '' - description: |- - A supported Azure AI Foundry Models APIs endpoint, including protocol and hostname. - For example: - https://westus.api.cognitive.microsoft.com). diff --git a/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml b/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml deleted file mode 100644 index b9ed1665b..000000000 --- a/foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# Filter to keep only /responses/** paths -inverseOperationIds: - - createResponse - - getResponse - - cancelResponse - - listInputItems -unusedComponents: - - schemas - -# npx openapi-format foundation-models/openai-responses/src/main/resources/spec/azure-v1-v1-generated.yaml --no-sort \ -# -o foundation-models/openai-responses/src/main/resources/spec/azure-responses-only.yaml \ -# --filterFile foundation-models/openai-responses/src/main/resources/spec/filter-config.yaml \ No newline at end of file diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java b/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java deleted file mode 100644 index bc1bb3e13..000000000 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreHttpClientImplTest.java +++ /dev/null @@ -1,268 +0,0 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.assertj.core.api.Assertions.assertThatThrownBy; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.isNull; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.mockStatic; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -import com.openai.core.RequestOptions; -import com.openai.core.http.Headers; -import com.openai.core.http.HttpMethod; -import com.openai.core.http.HttpRequest; -import com.openai.core.http.HttpRequestBody; -import com.openai.errors.OpenAIIoException; -import com.sap.ai.sdk.foundationmodels.openai.responses.AiCoreOpenAiClient.AiCoreHttpClientImpl; -import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; -import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import org.apache.hc.client5.http.classic.HttpClient; -import org.apache.hc.core5.http.ClassicHttpResponse; -import org.apache.hc.core5.http.Header; -import org.apache.hc.core5.http.HttpEntity; -import org.apache.hc.core5.http.io.HttpClientResponseHandler; -import org.apache.hc.core5.http.message.BasicClassicHttpRequest; -import org.apache.hc.core5.http.message.BasicHeader; -import org.junit.jupiter.api.Test; -import org.mockito.MockedStatic; - -class AiCoreHttpClientImplTest { - - private static final String TEST_URL = "https://test.api.com/v1/chat/completions"; - private static final DefaultHttpDestination TEST_DESTINATION = - DefaultHttpDestination.builder("https://test.api.com").build(); - - @Test - void testNonStreamingRequest() throws IOException { - // Setup: Create a non-streaming request (no "stream":true in body) - final String requestBodyContent = - "{\"model\":\"gpt-4\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello\"}]}"; - final String responseBodyContent = "{\"id\":\"resp_123\",\"output\":\"Hi there!\"}"; - - final HttpRequest request = mockHttpRequest(requestBodyContent, false); - final HttpClient mockApacheClient = mock(HttpClient.class); - final ClassicHttpResponse mockResponse = mockClassicHttpResponse(200, responseBodyContent); - - // Mock the execute method to call the response handler - when(mockApacheClient.execute( - any(BasicClassicHttpRequest.class), any(HttpClientResponseHandler.class))) - .thenAnswer( - invocation -> { - HttpClientResponseHandler handler = - invocation.getArgument(1); - return handler.handleResponse(mockResponse); - }); - - try (MockedStatic mockedAccessor = - mockStatic(ApacheHttpClient5Accessor.class)) { - mockedAccessor - .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) - .thenReturn(mockApacheClient); - - // Execute: Make a non-streaming request - final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); - final com.openai.core.http.HttpResponse response = - client.execute(request, RequestOptions.none()); - - // Verify: Response is buffered and can be read - assertThat(response.statusCode()).isEqualTo(200); - final String body = new String(response.body().readAllBytes(), StandardCharsets.UTF_8); - assertThat(body).isEqualTo(responseBodyContent); - - // Verify: Request body was closed - verify(request.body()).close(); - } - } - - @Test - void testStreamingRequest() throws IOException { - // Setup: Create a streaming request (with Accept: text/event-stream header) - final String requestBodyContent = "{\"model\":\"gpt-4\",\"messages\":[],\"stream\":true}"; - - final HttpRequest request = mockHttpRequest(requestBodyContent, true); - final HttpClient mockApacheClient = mock(HttpClient.class); - final ClassicHttpResponse mockResponse = mockStreamingResponse(); - - // Mock executeOpen for streaming - when(mockApacheClient.executeOpen(isNull(), any(BasicClassicHttpRequest.class), isNull())) - .thenReturn(mockResponse); - - try (MockedStatic mockedAccessor = - mockStatic(ApacheHttpClient5Accessor.class)) { - mockedAccessor - .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) - .thenReturn(mockApacheClient); - - // Execute: Make a streaming request - final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); - final com.openai.core.http.HttpResponse response = - client.execute(request, RequestOptions.none()); - - // Verify: Response is streaming (connection kept open) - assertThat(response.statusCode()).isEqualTo(200); - assertThat(response.body()).isNotNull(); - - // Verify: Can read from stream - final byte[] chunk = new byte[10]; - final int read = response.body().read(chunk); - assertThat(read).isGreaterThan(0); - - // Cleanup: Close the response - response.close(); - - // Verify: Request body was closed - verify(request.body()).close(); - } - } - - @Test - void testStreamingRequestViaQueryParam() throws IOException { - // Setup: Create a streaming request (with Accept: text/event-stream header) - final String requestBodyContent = "{\"model\":\"gpt-4\",\"messages\":[]}"; - - final HttpRequest request = mockHttpRequest(requestBodyContent, true); - final HttpClient mockApacheClient = mock(HttpClient.class); - final ClassicHttpResponse mockResponse = mockStreamingResponse(); - - // Mock executeOpen for streaming - when(mockApacheClient.executeOpen(isNull(), any(BasicClassicHttpRequest.class), isNull())) - .thenReturn(mockResponse); - - try (MockedStatic mockedAccessor = - mockStatic(ApacheHttpClient5Accessor.class)) { - mockedAccessor - .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) - .thenReturn(mockApacheClient); - - // Execute: Make a streaming request via query param - final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); - final com.openai.core.http.HttpResponse response = - client.execute(request, RequestOptions.none()); - - // Verify: Response is streaming - assertThat(response.statusCode()).isEqualTo(200); - assertThat(response.body()).isNotNull(); - - // Cleanup - response.close(); - - // Verify: Request body was closed - verify(request.body()).close(); - } - } - - @Test - void testRequestBodyClosedOnException() throws IOException { - // Setup: Create a request that will fail - final String requestBodyContent = "{\"model\":\"gpt-4\"}"; - - final HttpRequest request = mockHttpRequest(requestBodyContent, false); - final HttpClient mockApacheClient = mock(HttpClient.class); - - // Mock execute to throw IOException - when(mockApacheClient.execute( - any(BasicClassicHttpRequest.class), any(HttpClientResponseHandler.class))) - .thenThrow(new IOException("Network error")); - - try (MockedStatic mockedAccessor = - mockStatic(ApacheHttpClient5Accessor.class)) { - mockedAccessor - .when(() -> ApacheHttpClient5Accessor.getHttpClient(TEST_DESTINATION)) - .thenReturn(mockApacheClient); - - // Execute: Request fails with exception - final AiCoreHttpClientImpl client = new AiCoreHttpClientImpl(TEST_DESTINATION); - - assertThatThrownBy(() -> client.execute(request, RequestOptions.none())) - .isInstanceOf(OpenAIIoException.class) - .hasMessageContaining("HTTP request execution failed"); - - // Verify: Request body was still closed despite exception - verify(request.body()).close(); - } - } - - // Helper methods - - private HttpRequest mockHttpRequest(String bodyContent, boolean isStreaming) { - final HttpRequest request = mock(HttpRequest.class); - final HttpRequestBody requestBody = mock(HttpRequestBody.class); - - when(request.url()).thenReturn(TEST_URL); - when(request.method()).thenReturn(HttpMethod.POST); - - // Build headers based on streaming flag - final Headers.Builder headersBuilder = - Headers.builder().put("Content-Type", "application/json"); - - if (isStreaming) { - headersBuilder.put("Accept", "text/event-stream"); - } - - when(request.headers()).thenReturn(headersBuilder.build()); - when(request.body()).thenReturn(requestBody); - when(requestBody.contentType()).thenReturn("application/json"); - - // Mock queryParams - final com.openai.core.http.QueryParams queryParams = - mock(com.openai.core.http.QueryParams.class); - when(request.queryParams()).thenReturn(queryParams); - when(queryParams.keys()).thenReturn(java.util.Collections.emptySet()); - - // Mock the writeTo method to write body content - doAnswer( - invocation -> { - ByteArrayOutputStream out = invocation.getArgument(0); - out.write(bodyContent.getBytes(StandardCharsets.UTF_8)); - return null; - }) - .when(requestBody) - .writeTo(any(ByteArrayOutputStream.class)); - - return request; - } - - private ClassicHttpResponse mockClassicHttpResponse(int statusCode, String bodyContent) - throws IOException { - final ClassicHttpResponse response = mock(ClassicHttpResponse.class); - final HttpEntity entity = mock(HttpEntity.class); - final InputStream bodyStream = - new ByteArrayInputStream(bodyContent.getBytes(StandardCharsets.UTF_8)); - - when(response.getCode()).thenReturn(statusCode); - when(response.getHeaders()) - .thenReturn(new Header[] {new BasicHeader("Content-Type", "application/json")}); - when(response.getEntity()).thenReturn(entity); - when(entity.getContent()).thenReturn(bodyStream); - - return response; - } - - private ClassicHttpResponse mockStreamingResponse() throws IOException { - final ClassicHttpResponse response = mock(ClassicHttpResponse.class); - final HttpEntity entity = mock(HttpEntity.class); - // Create a stream that simulates continuous data - final InputStream liveStream = - new ByteArrayInputStream("data: chunk1\ndata: chunk2\n".getBytes(StandardCharsets.UTF_8)); - - when(response.getCode()).thenReturn(200); - when(response.getHeaders()) - .thenReturn( - new Header[] { - new BasicHeader("Content-Type", "text/event-stream"), - new BasicHeader("Transfer-Encoding", "chunked") - }); - when(response.getEntity()).thenReturn(entity); - when(entity.getContent()).thenReturn(liveStream); - - return response; - } -} diff --git a/foundation-models/openai-responses/pom.xml b/foundation-models/openai-v1/pom.xml similarity index 85% rename from foundation-models/openai-responses/pom.xml rename to foundation-models/openai-v1/pom.xml index ab3c8ad37..4608ec1df 100644 --- a/foundation-models/openai-responses/pom.xml +++ b/foundation-models/openai-v1/pom.xml @@ -8,11 +8,9 @@ ../../pom.xml com.sap.ai.sdk.foundationmodels - openai-responses - OpenAI Responses API Client - - - + openai-v1 + OpenAI V1 API Client + SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for consuming Azure OpenAI models without Orchestration Service. https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation SAP SE @@ -39,12 +37,12 @@ ${project.basedir}/../../ - 55% - 74% - 74% + 48% + 60% + 59% 50% - 75% - 100% + 56% + 0.75% @@ -102,10 +100,5 @@ wiremock test - - org.mockito - mockito-core - test - diff --git a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java similarity index 95% rename from foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java rename to foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java index 6b2563279..ea18c5af3 100644 --- a/foundation-models/openai-responses/src/main/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClient.java +++ b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java @@ -1,4 +1,4 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; +package com.sap.ai.sdk.foundationmodels.openai.v1; import com.openai.client.OpenAIClient; import com.openai.client.OpenAIClientImpl; @@ -265,22 +265,23 @@ private HttpResponse createStreamingResponse(@Nonnull final ClassicHttpResponse ? apacheResponse.getEntity().getContent() : InputStream.nullInputStream(); - // Return response that keeps connection open until stream is closed return new StreamingHttpResponse(statusCode, headers, liveStream, apacheResponse); } @Nonnull private HttpResponse createBufferedResponse(@Nonnull final ClassicHttpResponse apacheResponse) throws IOException { - final int statusCode = apacheResponse.getCode(); - final Headers headers = extractResponseHeaders(apacheResponse); + try (apacheResponse) { + final int statusCode = apacheResponse.getCode(); + final Headers headers = extractResponseHeaders(apacheResponse); - final byte[] body = - apacheResponse.getEntity() != null - ? EntityUtils.toByteArray(apacheResponse.getEntity()) - : new byte[0]; + final byte[] body = + apacheResponse.getEntity() != null + ? EntityUtils.toByteArray(apacheResponse.getEntity()) + : new byte[0]; - return new BufferedHttpResponse(statusCode, headers, body); + return new BufferedHttpResponse(statusCode, headers, body); + } } /** diff --git a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java b/foundation-models/openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClientTest.java similarity index 94% rename from foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java rename to foundation-models/openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClientTest.java index 63a6257f4..9e50ca2f1 100644 --- a/foundation-models/openai-responses/src/test/java/com/sap/ai/sdk/foundationmodels/openai/responses/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClientTest.java @@ -1,6 +1,5 @@ -package com.sap.ai.sdk.foundationmodels.openai.responses; +package com.sap.ai.sdk.foundationmodels.openai.v1; -import static com.github.tomakehurst.wiremock.client.WireMock.*; import static org.assertj.core.api.Assertions.assertThat; import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; diff --git a/foundation-models/openai-responses/src/test/resources/mappings/createResponse.json b/foundation-models/openai-v1/src/test/resources/mappings/createResponse.json similarity index 100% rename from foundation-models/openai-responses/src/test/resources/mappings/createResponse.json rename to foundation-models/openai-v1/src/test/resources/mappings/createResponse.json diff --git a/logback.xml b/logback.xml index 5fe30b5bf..2bbaaa365 100644 --- a/logback.xml +++ b/logback.xml @@ -12,8 +12,8 @@ - - + + diff --git a/pom.xml b/pom.xml index 87f6e542e..a695f1ab4 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ core-services/prompt-registry foundation-models/openai foundation-models/sap-rpt - foundation-models/openai-responses + foundation-models/openai-v1 scm:git:git://github.com/SAP/ai-sdk-java.git @@ -256,7 +256,7 @@ com.sap.ai.sdk.foundationmodels - openai-responses + openai-v1 ${project.version} @@ -468,8 +468,7 @@ Do not use JUnit 4.X, instead exclusively use Junit Jupiter. JUnit 4 tests will (silently) - simply not be executed. - + simply not be executed. junit:junit @@ -559,8 +558,7 @@ Apache Software License - Version 2.0|Apache License Version 2.0|Apache 2.0| The Apache License, Version 2.0|Apache License, Version 2.0|Apache-2.0| - The Apache Software License, Version 2.0|Apache License 2.0 - + The Apache Software License, Version 2.0|Apache License 2.0 The MIT License|MIT License|The MIT License (MIT)|MIT|MIT-0 The BSD 3-Clause License|BSD License 3|The BSD License|BSD-3-Clause|BSD-2-Clause|BSD licence Eclipse Distribution License - v 1.0|EDL 1.0 @@ -698,7 +696,6 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/client/* com/sap/ai/sdk/core/model/* com/sap/ai/sdk/foundationmodels/openai/generated/model/* - com/sap/ai/sdk/foundationmodels/openai-responses/generated/** com/sap/ai/sdk/foundationmodels/rpt/generated/** com/sap/ai/sdk/orchestration/model/* com/sap/ai/sdk/grounding/client/* @@ -727,7 +724,6 @@ https://gitbox.apache.org/repos/asf?p=maven-pmd-plugin.git;a=blob_plain;f=src/ma com/sap/ai/sdk/core/model/* com/sap/ai/sdk/orchestration/model/* com/sap/ai/sdk/foundationmodels/openai/generated/model/* - com/sap/ai/sdk/foundationmodels/openai-responses/generated/** com/sap/ai/sdk/foundationmodels/rpt/generated/** com/sap/ai/sdk/grounding/client/* com/sap/ai/sdk/grounding/model/* diff --git a/sample-code/spring-app/pom.xml b/sample-code/spring-app/pom.xml index 25a50fc8d..cb3793a8e 100644 --- a/sample-code/spring-app/pom.xml +++ b/sample-code/spring-app/pom.xml @@ -79,7 +79,7 @@ com.sap.ai.sdk.foundationmodels - openai-responses + openai-v1 com.openai diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java index 5d2973572..d8688fb98 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java @@ -6,13 +6,12 @@ import com.openai.core.http.QueryParams; import com.openai.core.http.StreamResponse; import com.openai.models.ChatModel; -import com.openai.models.chat.completions.ChatCompletion; import com.openai.models.chat.completions.ChatCompletionChunk; import com.openai.models.chat.completions.ChatCompletionCreateParams; import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; import com.openai.models.responses.ResponseStreamEvent; -import com.sap.ai.sdk.foundationmodels.openai.responses.AiCoreOpenAiClient; +import com.sap.ai.sdk.foundationmodels.openai.v1.AiCoreOpenAiClient; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -51,23 +50,6 @@ public StreamResponse createStreamingResponse(@Nonnull fina return client.responses().createStreaming(params); } - /** - * Create a chat completion using the Chat Completions API - * - * @param input the input text to send to the model - * @return the chat completion response from the Chat Completions API - */ - @Nonnull - public ChatCompletion createChatCompletion(@Nonnull final String input) { - val params = - ChatCompletionCreateParams.builder() - .addUserMessage(input) - .model(ChatModel.GPT_5) - .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) - .build(); - return client.chat().completions().create(params); - } - /** * Create a streaming chat completion using the Chat Completions API * diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java index f05007b3d..d5afc7a2e 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java @@ -6,6 +6,7 @@ import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @Slf4j @@ -26,6 +27,7 @@ void testCreateResponse() { } @Test + @Disabled("Assumes not yet enables and leads to Internal Server Error (500)") void testCreateStreamingResponse() { try (final var streamResponse = service.createStreamingResponse("What is the capital of France?")) { @@ -41,15 +43,6 @@ void testCreateStreamingResponse() { } } - @Test - void testCreateChatCompletion() { - final var response = service.createChatCompletion("What is the capital of France?"); - assertThat(response).isNotNull(); - assertThat(response.choices()).isNotEmpty(); - assertThat(response.choices().get(0).message().content()).isPresent(); - assertThat(response.choices().get(0).message().content().get()).isNotEmpty(); - } - @Test void testCreateStreamingChatCompletion() { try (final var streamResponse = From 2a55080dc31a2ea887453ce9ca8b12be7c034c6c Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 24 Mar 2026 18:05:12 +0100 Subject: [PATCH 20/31] Reduce Javadoc verbosity --- .../openai/v1/AiCoreOpenAiClient.java | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java index ea18c5af3..dfe137cc9 100644 --- a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java +++ b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java @@ -43,24 +43,6 @@ * *

This class provides factory methods that return fully configured OpenAI SDK clients using SAP * Cloud SDK's Apache HttpClient with automatic OAuth token refresh. - * - *

The returned clients are long-lived and thread-safe. OAuth tokens are automatically refreshed - * on each request via the Cloud SDK's {@link ApacheHttpClient5Accessor}. - * - *

Example usage: - * - *

{@code
- * OpenAIClient client = AiCoreOpenAiClient.forModel(OpenAiModel.GPT_4);
- *
- * ChatCompletionCreateParams params = ChatCompletionCreateParams.builder()
- *     .addMessage(ChatCompletionUserMessageParam.builder()
- *         .content(ChatCompletionUserMessageParam.Content.ofTextContent("Hello!"))
- *         .build())
- *     .model("gpt-4")
- *     .build();
- *
- * ChatCompletion response = client.chat().completions().create(params);
- * }
*/ @Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) @@ -102,9 +84,6 @@ public static OpenAIClient forModel( /** * Create an OpenAI client from a pre-resolved destination. * - *

The destination should point to an OpenAI-compatible deployment. This method is useful for - * advanced scenarios where you need custom destination configuration. - * * @param destination The destination to use. * @return A configured OpenAI client instance. */ @@ -115,7 +94,6 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) final var httpClient = new AiCoreHttpClientImpl(destination); // Build ClientOptions with our custom HttpClient - // Note: apiKey is required by SDK but unused since we handle auth via destination headers final ClientOptions clientOptions = ClientOptions.builder().baseUrl(baseUrl).httpClient(httpClient).apiKey("unused").build(); @@ -125,13 +103,6 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) /** * Internal implementation of OpenAI SDK's HttpClient interface using Apache HttpClient from SAP * Cloud SDK. - * - *

This client leverages Cloud SDK's {@link ApacheHttpClient5Accessor} which provides: - - * Automatic OAuth token refresh via {@code ApacheHttpClient5Wrapper} - Connection pooling and - * lifecycle management - Custom headers from destination (including AI-Resource-Group) - - * Thread-safe request execution - * - *

Package-private for testing purposes. */ @Slf4j @RequiredArgsConstructor(access = AccessLevel.PACKAGE) From 4ca8af151ab5854882251e58b49a88574e40e96b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 24 Mar 2026 18:24:07 +0100 Subject: [PATCH 21/31] Restrict to `/responses` api --- foundation-models/openai-v1/pom.xml | 2 +- .../openai/v1/AiCoreOpenAiClient.java | 11 +++++++++++ .../com/sap/ai/sdk/app/controllers/OpenAiV1Test.java | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/foundation-models/openai-v1/pom.xml b/foundation-models/openai-v1/pom.xml index 4608ec1df..9754f47a2 100644 --- a/foundation-models/openai-v1/pom.xml +++ b/foundation-models/openai-v1/pom.xml @@ -39,7 +39,7 @@ ${project.basedir}/../../ 48% 60% - 59% + 58% 50% 56% 0.75% diff --git a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java index dfe137cc9..1a7dbe5a1 100644 --- a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java +++ b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java @@ -24,6 +24,7 @@ import java.util.Locale; import java.util.Objects; import java.util.Optional; +import java.util.Set; import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; import lombok.AccessLevel; @@ -110,12 +111,14 @@ static final class AiCoreHttpClientImpl implements HttpClient { private final HttpDestination destination; private static final String SSE_MEDIA_TYPE = "text/event-stream"; + private static final Set ALLOWED_PATHS = Set.of("/responses"); @Override @Nonnull @SuppressWarnings("PMD.CloseResource") public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { + validateAllowedEndpoint(request); final var apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); final var apacheRequest = toApacheRequest(request); @@ -149,6 +152,14 @@ public void close() { // Apache HttpClient lifecycle is managed by Cloud SDK's ApacheHttpClient5Cache } + private static void validateAllowedEndpoint(@Nonnull final HttpRequest request) { + if (ALLOWED_PATHS.stream().noneMatch(request.url()::endsWith)) { + throw new UnsupportedOperationException( + String.format( + "Only requests to the following endpoints are allowed: %s.", ALLOWED_PATHS)); + } + } + @Nonnull @SuppressWarnings("PMD.CloseResource") private ClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java index d5afc7a2e..20231ce81 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java @@ -27,7 +27,7 @@ void testCreateResponse() { } @Test - @Disabled("Assumes not yet enables and leads to Internal Server Error (500)") + @Disabled("Not yet enables and leads to Internal Server Error (500)") void testCreateStreamingResponse() { try (final var streamResponse = service.createStreamingResponse("What is the capital of France?")) { @@ -44,6 +44,7 @@ void testCreateStreamingResponse() { } @Test + @Disabled("/chat/completions endpoint is not in allowed path") void testCreateStreamingChatCompletion() { try (final var streamResponse = service.createStreamingChatCompletion("What is the capital of France?")) { From 7061cbc3f807d78d9dc65ce2fd407dd1215b9231 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 24 Mar 2026 18:25:05 +0100 Subject: [PATCH 22/31] Cleanup comments --- .../ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java index 1a7dbe5a1..6ff149b98 100644 --- a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java +++ b/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java @@ -94,7 +94,6 @@ static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) final var baseUrl = destination.getUri().toString(); final var httpClient = new AiCoreHttpClientImpl(destination); - // Build ClientOptions with our custom HttpClient final ClientOptions clientOptions = ClientOptions.builder().baseUrl(baseUrl).httpClient(httpClient).apiKey("unused").build(); From 6eb57fc65ac4508fbc007e0c444a9cc09b38954b Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 26 Mar 2026 10:24:34 +0100 Subject: [PATCH 23/31] Charles review suggestions --- foundation-models/openai-v1/pom.xml | 104 ------------------ foundation-models/openai/pom.xml | 16 ++- .../openai}/AiCoreOpenAiClient.java | 2 +- .../openai}/AiCoreOpenAiClientTest.java | 2 +- .../resources/mappings/createResponse.json | 0 pom.xml | 6 - sample-code/spring-app/pom.xml | 4 - ...1Service.java => AiCoreOpenAiService.java} | 4 +- ...penAiV1Test.java => AiCoreOpenAiTest.java} | 13 +-- 9 files changed, 20 insertions(+), 131 deletions(-) delete mode 100644 foundation-models/openai-v1/pom.xml rename foundation-models/{openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1 => openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai}/AiCoreOpenAiClient.java (99%) rename foundation-models/{openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1 => openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai}/AiCoreOpenAiClientTest.java (97%) rename foundation-models/{openai-v1 => openai}/src/test/resources/mappings/createResponse.json (100%) rename sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/{OpenAiV1Service.java => AiCoreOpenAiService.java} (96%) rename sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/{OpenAiV1Test.java => AiCoreOpenAiTest.java} (86%) diff --git a/foundation-models/openai-v1/pom.xml b/foundation-models/openai-v1/pom.xml deleted file mode 100644 index 9754f47a2..000000000 --- a/foundation-models/openai-v1/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - 4.0.0 - - com.sap.ai.sdk - sdk-parent - 1.17.0-SNAPSHOT - ../../pom.xml - - com.sap.ai.sdk.foundationmodels - openai-v1 - OpenAI V1 API Client - SAP Cloud SDK for AI is the official Software Development Kit (SDK) for SAP AI Core, SAP Generative AI Hub, and Orchestration Service. This is the client for consuming Azure OpenAI models without Orchestration Service. - https://github.com/SAP/ai-sdk-java?tab=readme-ov-file#documentation - - SAP SE - https://www.sap.com - - - - The Apache Software License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0.txt - - - - - SAP - cloudsdk@sap.com - SAP SE - https://www.sap.com - - - - scm:git:git://github.com/SAP/ai-sdk-java.git - scm:git:ssh://github.com:SAP/ai-sdk-java.git - https://github.com/SAP/ai-sdk-java/tree/main - - - ${project.basedir}/../../ - 48% - 60% - 58% - 50% - 56% - 0.75% - - - - - com.sap.ai.sdk - core - - - com.sap.cloud.sdk.cloudplatform - cloudplatform-connectivity - - - com.sap.cloud.sdk.cloudplatform - connectivity-apache-httpclient5 - - - com.openai - openai-java-core - - - org.apache.httpcomponents.client5 - httpclient5 - - - org.apache.httpcomponents.core5 - httpcore5 - - - org.slf4j - slf4j-api - - - com.google.code.findbugs - jsr305 - - - - org.projectlombok - lombok - provided - - - - org.junit.jupiter - junit-jupiter-api - test - - - org.assertj - assertj-core - test - - - org.wiremock - wiremock - test - - - diff --git a/foundation-models/openai/pom.xml b/foundation-models/openai/pom.xml index 340832839..e98b3317e 100644 --- a/foundation-models/openai/pom.xml +++ b/foundation-models/openai/pom.xml @@ -38,12 +38,12 @@ ${project.basedir}/../../ - 81% - 91% - 88% - 78% - 90% - 92% + 77% + 87% + 85% + 75% + 87% + 91% @@ -117,6 +117,10 @@ reactor-core true + + com.openai + openai-java-core + org.projectlombok diff --git a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java similarity index 99% rename from foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java rename to foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index 6ff149b98..474db0484 100644 --- a/foundation-models/openai-v1/src/main/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -1,4 +1,4 @@ -package com.sap.ai.sdk.foundationmodels.openai.v1; +package com.sap.ai.sdk.foundationmodels.openai; import com.openai.client.OpenAIClient; import com.openai.client.OpenAIClientImpl; diff --git a/foundation-models/openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClientTest.java b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java similarity index 97% rename from foundation-models/openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClientTest.java rename to foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java index 9e50ca2f1..26687df52 100644 --- a/foundation-models/openai-v1/src/test/java/com/sap/ai/sdk/foundationmodels/openai/v1/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java @@ -1,4 +1,4 @@ -package com.sap.ai.sdk.foundationmodels.openai.v1; +package com.sap.ai.sdk.foundationmodels.openai; import static org.assertj.core.api.Assertions.assertThat; diff --git a/foundation-models/openai-v1/src/test/resources/mappings/createResponse.json b/foundation-models/openai/src/test/resources/mappings/createResponse.json similarity index 100% rename from foundation-models/openai-v1/src/test/resources/mappings/createResponse.json rename to foundation-models/openai/src/test/resources/mappings/createResponse.json diff --git a/pom.xml b/pom.xml index a695f1ab4..36a2ceac1 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,6 @@ core-services/prompt-registry foundation-models/openai foundation-models/sap-rpt - foundation-models/openai-v1 scm:git:git://github.com/SAP/ai-sdk-java.git @@ -254,11 +253,6 @@ openai ${project.version} - - com.sap.ai.sdk.foundationmodels - openai-v1 - ${project.version} - com.sap.ai.sdk.foundationmodels sap-rpt diff --git a/sample-code/spring-app/pom.xml b/sample-code/spring-app/pom.xml index cb3793a8e..a5a8d21b6 100644 --- a/sample-code/spring-app/pom.xml +++ b/sample-code/spring-app/pom.xml @@ -77,10 +77,6 @@ com.sap.ai.sdk.foundationmodels openai - - com.sap.ai.sdk.foundationmodels - openai-v1 - com.openai openai-java-core diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java similarity index 96% rename from sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java rename to sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java index d8688fb98..7642dbb87 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OpenAiV1Service.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java @@ -11,7 +11,7 @@ import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; import com.openai.models.responses.ResponseStreamEvent; -import com.sap.ai.sdk.foundationmodels.openai.v1.AiCoreOpenAiClient; +import com.sap.ai.sdk.foundationmodels.openai.AiCoreOpenAiClient; import javax.annotation.Nonnull; import lombok.extern.slf4j.Slf4j; import lombok.val; @@ -20,7 +20,7 @@ /** Service class for the OpenAI Responses API */ @Service @Slf4j -public class OpenAiV1Service { +public class AiCoreOpenAiService { private static final OpenAIClient client = AiCoreOpenAiClient.forModel(GPT_5, "ai-sdk-java-e2e"); diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java similarity index 86% rename from sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java rename to sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java index 20231ce81..21470fe58 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OpenAiV1Test.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java @@ -2,7 +2,7 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.sap.ai.sdk.app.services.OpenAiV1Service; +import com.sap.ai.sdk.app.services.AiCoreOpenAiService; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; @@ -10,12 +10,12 @@ import org.junit.jupiter.api.Test; @Slf4j -class OpenAiV1Test { - OpenAiV1Service service; +class AiCoreOpenAiTest { + AiCoreOpenAiService service; @BeforeEach void setUp() { - service = new OpenAiV1Service(); + service = new AiCoreOpenAiService(); } @Test @@ -23,7 +23,8 @@ void testCreateResponse() { final var response = service.createResponse("What is the capital of France?"); assertThat(response).isNotNull(); assertThat(response.output()).isNotNull(); - assertThat(response.output()).isNotEmpty(); + assertThat(response.output().get(1).message().get().content().get(0).asOutputText().text()) + .contains("Paris"); } @Test @@ -33,7 +34,6 @@ void testCreateStreamingResponse() { service.createStreamingResponse("What is the capital of France?")) { final var events = streamResponse.stream().collect(Collectors.toList()); - assertThat(events).isNotNull(); assertThat(events).isNotEmpty(); // Verify we got text deltas @@ -50,7 +50,6 @@ void testCreateStreamingChatCompletion() { service.createStreamingChatCompletion("What is the capital of France?")) { final var events = streamResponse.stream().collect(Collectors.toList()); - assertThat(events).isNotNull(); assertThat(events).isNotEmpty(); // Verify we got content deltas From 38ced8644f595387e9ba1975eb9163743ef17887 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 26 Mar 2026 13:22:28 +0100 Subject: [PATCH 24/31] Charles review - round 2 suggestions --- .../openai/AiCoreOpenAiClient.java | 51 ++++++++++--------- .../sdk/app/services/AiCoreOpenAiService.java | 43 ++++++++++++++-- .../sdk/app/controllers/AiCoreOpenAiTest.java | 19 +++++-- 3 files changed, 82 insertions(+), 31 deletions(-) diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index 474db0484..8cfe29618 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -7,7 +7,6 @@ import com.openai.core.http.Headers; import com.openai.core.http.HttpClient; import com.openai.core.http.HttpRequest; -import com.openai.core.http.HttpRequestBody; import com.openai.core.http.HttpResponse; import com.openai.errors.OpenAIIoException; import com.sap.ai.sdk.core.AiCoreService; @@ -15,6 +14,7 @@ import com.sap.ai.sdk.core.DeploymentResolutionException; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; +import com.sap.cloud.sdk.cloudplatform.thread.ThreadContextExecutors; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -110,11 +110,16 @@ static final class AiCoreHttpClientImpl implements HttpClient { private final HttpDestination destination; private static final String SSE_MEDIA_TYPE = "text/event-stream"; - private static final Set ALLOWED_PATHS = Set.of("/responses"); + private static final Set ALLOWED_PATHS = + Set.of( + "/chat/completions", + "/responses", + "/responses/[^/]+", + "/responses/[^/]+/input_items", + "/responses/[^/]+/cancel"); @Override @Nonnull - @SuppressWarnings("PMD.CloseResource") public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { validateAllowedEndpoint(request); @@ -134,8 +139,6 @@ public HttpResponse execute( } } catch (final IOException e) { throw new OpenAIIoException("HTTP request execution failed", e); - } finally { - Optional.ofNullable(request.body()).ifPresent(HttpRequestBody::close); } } @@ -143,7 +146,8 @@ public HttpResponse execute( @Nonnull public CompletableFuture executeAsync( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { - return CompletableFuture.supplyAsync(() -> execute(request, requestOptions)); + return CompletableFuture.supplyAsync( + () -> execute(request, requestOptions), ThreadContextExecutors.getExecutor()); } @Override @@ -152,7 +156,8 @@ public void close() { } private static void validateAllowedEndpoint(@Nonnull final HttpRequest request) { - if (ALLOWED_PATHS.stream().noneMatch(request.url()::endsWith)) { + final var endpoint = "/" + String.join("/", request.pathSegments()); + if (ALLOWED_PATHS.stream().noneMatch(endpoint::matches)) { throw new UnsupportedOperationException( String.format( "Only requests to the following endpoints are allowed: %s.", ALLOWED_PATHS)); @@ -160,28 +165,28 @@ private static void validateAllowedEndpoint(@Nonnull final HttpRequest request) } @Nonnull - @SuppressWarnings("PMD.CloseResource") private ClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { final var fullUri = buildUrlWithQueryParams(request); final var method = request.method(); final var apacheRequest = new BasicClassicHttpRequest(method.name(), fullUri.toString()); applyRequestHeaders(request, apacheRequest); - final var requestBody = request.body(); - if (requestBody != null) { - try (var outputStream = new ByteArrayOutputStream()) { - requestBody.writeTo(outputStream); - final var bodyBytes = outputStream.toByteArray(); - - final var apacheContentType = - Optional.ofNullable(requestBody.contentType()) - .map(ContentType::parse) - .orElse(ContentType.APPLICATION_JSON); - - apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, apacheContentType)); - return apacheRequest; - } catch (final IOException e) { - throw new OpenAIIoException("Failed to read request body", e); + try (var requestBody = request.body()) { + if (requestBody != null) { + try (var outputStream = new ByteArrayOutputStream()) { + requestBody.writeTo(outputStream); + final var bodyBytes = outputStream.toByteArray(); + + final var apacheContentType = + Optional.ofNullable(requestBody.contentType()) + .map(ContentType::parse) + .orElse(ContentType.APPLICATION_JSON); + + apacheRequest.setEntity(new ByteArrayEntity(bodyBytes, apacheContentType)); + return apacheRequest; + } catch (final IOException e) { + throw new OpenAIIoException("Failed to read request body", e); + } } } diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java index 7642dbb87..38e6cd391 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java @@ -6,6 +6,7 @@ import com.openai.core.http.QueryParams; import com.openai.core.http.StreamResponse; import com.openai.models.ChatModel; +import com.openai.models.chat.completions.ChatCompletion; import com.openai.models.chat.completions.ChatCompletionChunk; import com.openai.models.chat.completions.ChatCompletionCreateParams; import com.openai.models.responses.Response; @@ -22,7 +23,7 @@ @Slf4j public class AiCoreOpenAiService { - private static final OpenAIClient client = AiCoreOpenAiClient.forModel(GPT_5, "ai-sdk-java-e2e"); + private static final OpenAIClient CLIENT = AiCoreOpenAiClient.forModel(GPT_5, "ai-sdk-java-e2e"); /** * Create a simple response using the Responses API @@ -34,7 +35,21 @@ public class AiCoreOpenAiService { public Response createResponse(@Nonnull final String input) { val params = ResponseCreateParams.builder().input(input).model(ChatModel.GPT_5).store(false).build(); - return client.responses().create(params); + return CLIENT.responses().create(params); + } + + /** + * Create a response and immediately retrieve it using the Responses API. This demonstrates the + * two-step process of creating and then fetching a response. + * + * @param input the input text to send to the model + * @return the retrieved response object from the Responses API + */ + @Nonnull + public Response retrieveResponse(@Nonnull final String input) { + val params = ResponseCreateParams.builder().input(input).model(ChatModel.GPT_5).build(); + val createResponse = CLIENT.responses().create(params); + return CLIENT.responses().retrieve(createResponse.id()); } /** @@ -47,7 +62,25 @@ public Response createResponse(@Nonnull final String input) { public StreamResponse createStreamingResponse(@Nonnull final String input) { val params = ResponseCreateParams.builder().input(input).model(ChatModel.GPT_5).store(false).build(); - return client.responses().createStreaming(params); + return CLIENT.responses().createStreaming(params); + } + + /** + * Create a chat completion using the Chat Completions API. Note: This uses the legacy API version + * format via query parameters. + * + * @param input the input text to send to the model + * @return the chat completion response from the Chat Completions API + */ + @Nonnull + public ChatCompletion createChatCompletion(@Nonnull final String input) { + val params = + ChatCompletionCreateParams.builder() + .addUserMessage(input) + .model(ChatModel.GPT_5) + .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) + .build(); + return CLIENT.chat().completions().create(params); } /** @@ -61,10 +94,10 @@ public StreamResponse createStreamingChatCompletion( @Nonnull final String input) { val params = ChatCompletionCreateParams.builder() - .addUserMessage("Say this is a test") + .addUserMessage(input) .model(ChatModel.GPT_5) .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) .build(); - return client.chat().completions().createStreaming(params); + return CLIENT.chat().completions().createStreaming(params); } } diff --git a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java index 21470fe58..99548e00f 100644 --- a/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java +++ b/sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/AiCoreOpenAiTest.java @@ -27,6 +27,16 @@ void testCreateResponse() { .contains("Paris"); } + @Test + @Disabled("Flaky test") + void testGetResponse() { + final var response = service.retrieveResponse("What is the capital of France?"); + assertThat(response).isNotNull(); + assertThat(response.output()).isNotNull(); + assertThat(response.output().get(1).message().get().content().get(0).asOutputText().text()) + .contains("Paris"); + } + @Test @Disabled("Not yet enables and leads to Internal Server Error (500)") void testCreateStreamingResponse() { @@ -36,7 +46,6 @@ void testCreateStreamingResponse() { assertThat(events).isNotEmpty(); - // Verify we got text deltas final var hasTextDeltas = events.stream().anyMatch(event -> event.outputTextDelta().isPresent()); assertThat(hasTextDeltas).isTrue(); @@ -44,7 +53,12 @@ void testCreateStreamingResponse() { } @Test - @Disabled("/chat/completions endpoint is not in allowed path") + void testCreateChatCompletion() { + final var response = service.createChatCompletion("What is the capital of France?"); + assertThat(response).isNotNull(); + } + + @Test void testCreateStreamingChatCompletion() { try (final var streamResponse = service.createStreamingChatCompletion("What is the capital of France?")) { @@ -52,7 +66,6 @@ void testCreateStreamingChatCompletion() { assertThat(events).isNotEmpty(); - // Verify we got content deltas final var hasContentDeltas = events.stream() .anyMatch( From d8e19025d306f61c1d81d9c2686701839b4173e7 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 26 Mar 2026 14:31:18 +0100 Subject: [PATCH 25/31] Add dependency --- foundation-models/openai/pom.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/foundation-models/openai/pom.xml b/foundation-models/openai/pom.xml index e98b3317e..27ebd9af5 100644 --- a/foundation-models/openai/pom.xml +++ b/foundation-models/openai/pom.xml @@ -50,6 +50,10 @@ com.sap.cloud.sdk.cloudplatform cloudplatform-connectivity + + com.sap.cloud.sdk.cloudplatform + cloudplatform-core + com.sap.cloud.sdk.cloudplatform connectivity-apache-httpclient5 @@ -206,13 +210,13 @@ /deployments/{deployment-id}/completions - /deployments/{deployment-id}/audio/transcriptions - /deployments/{deployment-id}/audio/translations - /deployments/{deployment-id}/images/generations + /deployments/{deployment-id}/audio/transcriptions + /deployments/{deployment-id}/audio/translations + /deployments/{deployment-id}/images/generations chatCompletionResponseMessage.context - createChatCompletionRequest.data_sources + createChatCompletionRequest.data_sources true From dae1906b4a21906e9c6f7b4337bb17dea35b302c Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Thu, 26 Mar 2026 17:34:45 +0100 Subject: [PATCH 26/31] Mark openai dependency optional and new client `@Beta` --- foundation-models/openai/pom.xml | 1 + .../ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java | 4 ++++ .../java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/foundation-models/openai/pom.xml b/foundation-models/openai/pom.xml index 27ebd9af5..9bc1bde85 100644 --- a/foundation-models/openai/pom.xml +++ b/foundation-models/openai/pom.xml @@ -124,6 +124,7 @@ com.openai openai-java-core + true diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index 8cfe29618..9bf5ff4d3 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -1,5 +1,6 @@ package com.sap.ai.sdk.foundationmodels.openai; +import com.google.common.annotations.Beta; import com.openai.client.OpenAIClient; import com.openai.client.OpenAIClientImpl; import com.openai.core.ClientOptions; @@ -44,9 +45,12 @@ * *

This class provides factory methods that return fully configured OpenAI SDK clients using SAP * Cloud SDK's Apache HttpClient with automatic OAuth token refresh. + * + * @since 1.18.0 */ @Slf4j @NoArgsConstructor(access = AccessLevel.PRIVATE) +@Beta public final class AiCoreOpenAiClient { private static final String DEFAULT_RESOURCE_GROUP = "default"; diff --git a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java index 38e6cd391..7b59d8bda 100644 --- a/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java +++ b/sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/AiCoreOpenAiService.java @@ -78,7 +78,7 @@ public ChatCompletion createChatCompletion(@Nonnull final String input) { ChatCompletionCreateParams.builder() .addUserMessage(input) .model(ChatModel.GPT_5) - .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) + .additionalQueryParams(QueryParams.builder().put("api-version", "2024-02-01").build()) .build(); return CLIENT.chat().completions().create(params); } @@ -96,7 +96,7 @@ public StreamResponse createStreamingChatCompletion( ChatCompletionCreateParams.builder() .addUserMessage(input) .model(ChatModel.GPT_5) - .additionalQueryParams(QueryParams.builder().put("api-version", "2023-05-15").build()) + .additionalQueryParams(QueryParams.builder().put("api-version", "2024-02-01").build()) .build(); return CLIENT.chat().completions().createStreaming(params); } From 88ae43cf0e2c2563fb7bd6a70be6905fb434a02d Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 30 Mar 2026 17:10:04 +0200 Subject: [PATCH 27/31] Cleanup and no throw on missing model --- .../openai/AiCoreOpenAiClient.java | 18 ++- .../openai/AiCoreResponsesService.java | 135 ++++++++++++++++++ .../openai/OpenAIClientImplWrapper.java | 29 ++++ .../openai/AiCoreOpenAiClientTest.java | 50 +++++-- 4 files changed, 217 insertions(+), 15 deletions(-) create mode 100644 foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java create mode 100644 foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index 9bf5ff4d3..c4206f621 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -10,6 +10,7 @@ import com.openai.core.http.HttpRequest; import com.openai.core.http.HttpResponse; import com.openai.errors.OpenAIIoException; +import com.openai.models.ChatModel; import com.sap.ai.sdk.core.AiCoreService; import com.sap.ai.sdk.core.AiModel; import com.sap.ai.sdk.core.DeploymentResolutionException; @@ -82,26 +83,31 @@ public static OpenAIClient forModel( @Nonnull final AiModel model, @Nonnull final String resourceGroup) { final HttpDestination destination = new AiCoreService().getInferenceDestination(resourceGroup).forModel(model); - - return fromDestination(destination); + return fromDestination(destination, model); } /** * Create an OpenAI client from a pre-resolved destination. * * @param destination The destination to use. + * @param model The model name for validation. * @return A configured OpenAI client instance. */ @Nonnull @SuppressWarnings("PMD.CloseResource") - static OpenAIClient fromDestination(@Nonnull final HttpDestination destination) { + static OpenAIClient fromDestination( + @Nonnull final HttpDestination destination, @Nonnull final AiModel model) { final var baseUrl = destination.getUri().toString(); final var httpClient = new AiCoreHttpClientImpl(destination); - final ClientOptions clientOptions = + final var clientOptions = ClientOptions.builder().baseUrl(baseUrl).httpClient(httpClient).apiKey("unused").build(); - - return new OpenAIClientImpl(clientOptions); + final var chatModel = + Optional.ofNullable(model.version()) + .map(version -> model.name() + "-" + version) + .orElse(model.name()); + return new OpenAIClientImplWrapper( + new OpenAIClientImpl(clientOptions), ChatModel.of(chatModel)); } /** diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java new file mode 100644 index 000000000..f732179ed --- /dev/null +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java @@ -0,0 +1,135 @@ +package com.sap.ai.sdk.foundationmodels.openai; + +import com.openai.core.RequestOptions; +import com.openai.core.http.StreamResponse; +import com.openai.models.ChatModel; +import com.openai.models.ResponsesModel; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseStreamEvent; +import com.openai.models.responses.StructuredResponse; +import com.openai.models.responses.StructuredResponseCreateParams; +import com.openai.services.blocking.ResponseService; +import javax.annotation.Nonnull; +import lombok.experimental.Delegate; + +class AiCoreResponsesService implements ResponseService { + + @Delegate(excludes = Excludes.class) + private final ResponseService delegate; + + private final ChatModel expectedModel; + + AiCoreResponsesService( + @Nonnull final ResponseService delegate, @Nonnull final ChatModel expectedModel) { + this.delegate = delegate; + this.expectedModel = expectedModel; + } + + @Override + @Nonnull + public Response create(@Nonnull final ResponseCreateParams params) { + return create(params, RequestOptions.none()); + } + + @Override + @Nonnull + public Response create( + @Nonnull final ResponseCreateParams params, @Nonnull final RequestOptions requestOptions) { + return delegate.create(withValidatedModel(params), requestOptions); + } + + @Override + @Nonnull + public StructuredResponse create(@Nonnull final StructuredResponseCreateParams params) { + return create(params, RequestOptions.none()); + } + + @Override + @Nonnull + public StructuredResponse create( + @Nonnull final StructuredResponseCreateParams params, + @Nonnull final RequestOptions requestOptions) { + return delegate.create(withValidatedModel(params), requestOptions); + } + + @Override + @Nonnull + public StreamResponse createStreaming( + @Nonnull final ResponseCreateParams params) { + return createStreaming(params, RequestOptions.none()); + } + + @Override + @Nonnull + public StreamResponse createStreaming( + @Nonnull final ResponseCreateParams params, @Nonnull final RequestOptions requestOptions) { + return delegate.createStreaming(withValidatedModel(params), requestOptions); + } + + @Override + @Nonnull + public StreamResponse createStreaming( + @Nonnull final StructuredResponseCreateParams params) { + return createStreaming(params, RequestOptions.none()); + } + + @Override + @Nonnull + public StreamResponse createStreaming( + @Nonnull final StructuredResponseCreateParams params, + @Nonnull final RequestOptions requestOptions) { + return delegate.createStreaming(withValidatedModel(params), requestOptions); + } + + @Nonnull + private ResponseCreateParams withValidatedModel(@Nonnull final ResponseCreateParams params) { + final ChatModel givenModel = params.model().map(ResponsesModel::asChat).orElse(null); + + if (givenModel == null) { + return params.toBuilder().model(expectedModel).build(); + } + + if (!expectedModel.equals(givenModel)) { + throw new IllegalArgumentException( + """ + Model mismatch: + Expected : '%s' (configured via forModel()) + Actual : '%s' (set in request parameters) + Fix: Either remove the model from the request parameters, \ + or use forModel("%s") when creating the client.\ + """ + .formatted(expectedModel, givenModel, givenModel)); + } + + return params; + } + + @Nonnull + private StructuredResponseCreateParams withValidatedModel( + @Nonnull final StructuredResponseCreateParams params) { + final ResponseCreateParams validated = withValidatedModel(params.rawParams()); + return new StructuredResponseCreateParams<>(params.responseType(), validated); + } + + private interface Excludes { + Response create(ResponseCreateParams params); + + Response create(ResponseCreateParams params, RequestOptions requestOptions); + + StructuredResponse create(StructuredResponseCreateParams params); + + StructuredResponse create( + StructuredResponseCreateParams params, RequestOptions requestOptions); + + StreamResponse createStreaming(ResponseCreateParams params); + + StreamResponse createStreaming( + ResponseCreateParams params, RequestOptions requestOptions); + + StreamResponse createStreaming(StructuredResponseCreateParams params); + + StreamResponse createStreaming( + StructuredResponseCreateParams params, RequestOptions requestOptions); + } +} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java new file mode 100644 index 000000000..2c0691a46 --- /dev/null +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java @@ -0,0 +1,29 @@ +package com.sap.ai.sdk.foundationmodels.openai; + +import com.openai.client.OpenAIClient; +import com.openai.client.OpenAIClientImpl; +import com.openai.models.ChatModel; +import com.openai.services.blocking.ResponseService; +import javax.annotation.Nonnull; +import lombok.RequiredArgsConstructor; +import lombok.experimental.Delegate; + +@RequiredArgsConstructor +class OpenAIClientImplWrapper implements OpenAIClient { + @Nonnull + @Delegate(excludes = Excludes.class) + private final OpenAIClientImpl delegate; + + @Nonnull private final ChatModel expectedModel; + + /** Returns an instance of AiCoreResponsesService */ + @Override + @Nonnull + public ResponseService responses() { + return new AiCoreResponsesService(delegate.responses(), expectedModel); + } + + private interface Excludes { + ResponseService responses(); + } +} diff --git a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java index 26687df52..9c266d161 100644 --- a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java @@ -1,10 +1,12 @@ package com.sap.ai.sdk.foundationmodels.openai; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo; import com.github.tomakehurst.wiremock.junit5.WireMockTest; import com.openai.client.OpenAIClient; +import com.openai.models.ChatModel; import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; import com.openai.models.responses.ResponseStatus; @@ -23,13 +25,9 @@ class AiCoreOpenAiClientTest { @BeforeEach void setup(@Nonnull final WireMockRuntimeInfo server) { - // Create destination pointing to WireMock server final var destination = DefaultHttpDestination.builder(server.getHttpBaseUrl()).build(); + client = AiCoreOpenAiClient.fromDestination(destination, OpenAiModel.GPT_5); - // Create OpenAI client using our custom implementation - client = AiCoreOpenAiClient.fromDestination(destination); - - // Disable HTTP client caching for tests to ensure fresh clients ApacheHttpClient5Accessor.setHttpClientCache(ApacheHttpClient5Cache.DISABLED); } @@ -40,18 +38,52 @@ void reset() { } @Test - void testResponseSuccess() { + void testResponseSuccessWithMatchingModel() { + final var params = + ResponseCreateParams.builder() + .input("What is the capital of France?") + .model(ChatModel.GPT_5) + .build(); + + final Response response = client.responses().create(params); + + assertThat(response).isNotNull(); + assertThat(response.status().orElseThrow()).isEqualTo(ResponseStatus.COMPLETED); + } + + @Test + void testResponseFailsWithModelMismatch() { final var params = ResponseCreateParams.builder() .input("What is the capital of France?") - .model("gpt-5") + .model(ChatModel.GPT_4) // Different from client's expected model "gpt-5" .build(); + assertThatThrownBy(() -> client.responses().create(params)) + .isInstanceOf(IllegalArgumentException.class) + .hasMessageContaining("Model mismatch") + .hasMessageContaining("gpt-5") + .hasMessageContaining("gpt-4"); + } + + @Test + void testResponseSuccessWithoutModel() { + final var params = + ResponseCreateParams.builder().input("What is the capital of France?").build(); final Response response = client.responses().create(params); assertThat(response).isNotNull(); - assertThat(response.id()).isEqualTo("resp_01a38d2783b385be0069bd43d260108193aef990678aa8a0af"); assertThat(response.status().orElseThrow()).isEqualTo(ResponseStatus.COMPLETED); - assertThat(response.output()).isNotEmpty(); + } + + @Test + void testOtherServicesStillWork() { + // Verify that other OpenAI services are still accessible + assertThat(client.chat()).isNotNull(); + assertThat(client.completions()).isNotNull(); + assertThat(client.embeddings()).isNotNull(); + assertThat(client.files()).isNotNull(); + assertThat(client.images()).isNotNull(); + assertThat(client.audio()).isNotNull(); } } From c995beec91906fc9b09438bb2f18366f996338bf Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Mon, 30 Mar 2026 17:14:34 +0200 Subject: [PATCH 28/31] pmd --- .../sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index c4206f621..72b53f131 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -105,7 +105,7 @@ static OpenAIClient fromDestination( final var chatModel = Optional.ofNullable(model.version()) .map(version -> model.name() + "-" + version) - .orElse(model.name()); + .orElseGet(model::name); return new OpenAIClientImplWrapper( new OpenAIClientImpl(clientOptions), ChatModel.of(chatModel)); } From 145f1620cc5298eb610a17e1c4c0fb9d585190c5 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Tue, 31 Mar 2026 11:16:36 +0200 Subject: [PATCH 29/31] Responses API complete --- foundation-models/openai/pom.xml | 10 +-- ...ervice.java => AiCoreResponseService.java} | 88 +++++++++++++++---- .../openai/OpenAIClientImplWrapper.java | 2 +- .../openai/AiCoreOpenAiClientTest.java | 30 +++++-- 4 files changed, 101 insertions(+), 29 deletions(-) rename foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/{AiCoreResponsesService.java => AiCoreResponseService.java} (56%) diff --git a/foundation-models/openai/pom.xml b/foundation-models/openai/pom.xml index 9bc1bde85..703940ab7 100644 --- a/foundation-models/openai/pom.xml +++ b/foundation-models/openai/pom.xml @@ -38,11 +38,11 @@ ${project.basedir}/../../ - 77% - 87% - 85% - 75% - 87% + 75% + 86% + 83% + 74% + 83% 91% diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java similarity index 56% rename from foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java rename to foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java index f732179ed..b66874eb3 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponsesService.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java @@ -1,26 +1,41 @@ package com.sap.ai.sdk.foundationmodels.openai; +import com.openai.core.ClientOptions; import com.openai.core.RequestOptions; import com.openai.core.http.StreamResponse; import com.openai.models.ChatModel; import com.openai.models.ResponsesModel; +import com.openai.models.responses.CompactedResponse; import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCancelParams; +import com.openai.models.responses.ResponseCompactParams; import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseDeleteParams; +import com.openai.models.responses.ResponseRetrieveParams; import com.openai.models.responses.ResponseStreamEvent; import com.openai.models.responses.StructuredResponse; import com.openai.models.responses.StructuredResponseCreateParams; import com.openai.services.blocking.ResponseService; +import com.openai.services.blocking.responses.InputItemService; +import com.openai.services.blocking.responses.InputTokenService; +import java.util.function.Consumer; import javax.annotation.Nonnull; import lombok.experimental.Delegate; -class AiCoreResponsesService implements ResponseService { +class AiCoreResponseService implements ResponseService { - @Delegate(excludes = Excludes.class) + @Delegate(types = SafeMethods.class) private final ResponseService delegate; private final ChatModel expectedModel; - AiCoreResponsesService( + @Override + @Nonnull + public ResponseService withOptions(@Nonnull final Consumer modifier) { + return new AiCoreResponseService(delegate.withOptions(modifier), expectedModel); + } + + AiCoreResponseService( @Nonnull final ResponseService delegate, @Nonnull final ChatModel expectedModel) { this.delegate = delegate; this.expectedModel = expectedModel; @@ -82,6 +97,19 @@ public StreamResponse createStreaming( return delegate.createStreaming(withValidatedModel(params), requestOptions); } + @Override + @Nonnull + public CompactedResponse compact(@Nonnull final ResponseCompactParams params) { + return compact(params, RequestOptions.none()); + } + + @Override + @Nonnull + public CompactedResponse compact( + @Nonnull final ResponseCompactParams params, @Nonnull final RequestOptions requestOptions) { + return delegate.compact(withValidatedModel(params), requestOptions); + } + @Nonnull private ResponseCreateParams withValidatedModel(@Nonnull final ResponseCreateParams params) { final ChatModel givenModel = params.model().map(ResponsesModel::asChat).orElse(null); @@ -112,24 +140,54 @@ private StructuredResponseCreateParams withValidatedModel( return new StructuredResponseCreateParams<>(params.responseType(), validated); } - private interface Excludes { - Response create(ResponseCreateParams params); + @Nonnull + private ResponseCompactParams withValidatedModel(@Nonnull final ResponseCompactParams params) { + final String givenModel = + params.model().map(ResponseCompactParams.Model::asString).orElse(null); + + if (givenModel == null) { + return params.toBuilder().model(expectedModel.asString()).build(); + } + + if (!expectedModel.asString().equals(givenModel)) { + throw new IllegalArgumentException( + """ + Model mismatch: + Expected : '%s' (configured via forModel()) + Actual : '%s' (set in request parameters) + Fix: Either remove the model from the request parameters, \ + or use forModel("%s") when creating the client.\ + """ + .formatted(expectedModel, givenModel, givenModel)); + } + + return params; + } + + private interface SafeMethods { + InputItemService inputItems(); + + InputTokenService inputTokens(); + + ResponseService.WithRawResponse withRawResponse(); + + Response retrieve(ResponseRetrieveParams params, RequestOptions requestOptions); - Response create(ResponseCreateParams params, RequestOptions requestOptions); + Response retrieve(ResponseRetrieveParams params); - StructuredResponse create(StructuredResponseCreateParams params); + StreamResponse retrieveStreaming( + ResponseRetrieveParams params, RequestOptions requestOptions); - StructuredResponse create( - StructuredResponseCreateParams params, RequestOptions requestOptions); + StreamResponse retrieveStreaming(ResponseRetrieveParams params); - StreamResponse createStreaming(ResponseCreateParams params); + // Delete operation - DELETE by ID, no model parameter + void delete(ResponseDeleteParams params, RequestOptions requestOptions); - StreamResponse createStreaming( - ResponseCreateParams params, RequestOptions requestOptions); + void delete(ResponseDeleteParams params); - StreamResponse createStreaming(StructuredResponseCreateParams params); + // Cancel operation - no model parameter + Response cancel(ResponseCancelParams params, RequestOptions requestOptions); - StreamResponse createStreaming( - StructuredResponseCreateParams params, RequestOptions requestOptions); + Response cancel(ResponseCancelParams params); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java index 2c0691a46..db530c773 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java @@ -20,7 +20,7 @@ class OpenAIClientImplWrapper implements OpenAIClient { @Override @Nonnull public ResponseService responses() { - return new AiCoreResponsesService(delegate.responses(), expectedModel); + return new AiCoreResponseService(delegate.responses(), expectedModel); } private interface Excludes { diff --git a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java index 9c266d161..7e464a7ed 100644 --- a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java @@ -38,7 +38,7 @@ void reset() { } @Test - void testResponseSuccessWithMatchingModel() { + void testResponseServiceSuccessWithMatchingModel() { final var params = ResponseCreateParams.builder() .input("What is the capital of France?") @@ -52,7 +52,17 @@ void testResponseSuccessWithMatchingModel() { } @Test - void testResponseFailsWithModelMismatch() { + void testResponseServiceSuccessWithoutModel() { + final var params = + ResponseCreateParams.builder().input("What is the capital of France?").build(); + final Response response = client.responses().create(params); + + assertThat(response).isNotNull(); + assertThat(response.status().orElseThrow()).isEqualTo(ResponseStatus.COMPLETED); + } + + @Test + void testResponseServiceFailsWithModelMismatch() { final var params = ResponseCreateParams.builder() .input("What is the capital of France?") @@ -67,13 +77,17 @@ void testResponseFailsWithModelMismatch() { } @Test - void testResponseSuccessWithoutModel() { - final var params = - ResponseCreateParams.builder().input("What is the capital of France?").build(); - final Response response = client.responses().create(params); + void testResponseServiceWithOptions() { + final var originalService = client.responses(); - assertThat(response).isNotNull(); - assertThat(response.status().orElseThrow()).isEqualTo(ResponseStatus.COMPLETED); + final var modifiedService = + originalService.withOptions( + builder -> { + // Modify some option + builder.putHeader("X-Custom-Header", "test-value"); + }); + + assertThat(modifiedService).isInstanceOf(AiCoreResponseService.class); } @Test From bf29f137c190bc6ff54ff6eda403965364ab3be6 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Wed, 1 Apr 2026 14:57:00 +0200 Subject: [PATCH 30/31] ChatCompletionCreateParams throws without model. Needs rethink client API creation forModel --- .../openai/AiCoreChatCompletionService.java | 189 ++++++++++++++++++ .../openai/AiCoreChatService.java | 33 +++ .../openai/AiCoreOpenAiClient.java | 45 +++-- .../openai/AiCoreResponseService.java | 95 ++++----- .../openai/OpenAIClientImplWrapper.java | 105 +++++++++- .../openai/AiCoreOpenAiClientTest.java | 19 +- 6 files changed, 408 insertions(+), 78 deletions(-) create mode 100644 foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java create mode 100644 foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java new file mode 100644 index 000000000..322522f21 --- /dev/null +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java @@ -0,0 +1,189 @@ +package com.sap.ai.sdk.foundationmodels.openai; + +import com.openai.core.ClientOptions; +import com.openai.core.RequestOptions; +import com.openai.core.http.QueryParams; +import com.openai.core.http.StreamResponse; +import com.openai.models.chat.completions.ChatCompletion; +import com.openai.models.chat.completions.ChatCompletionChunk; +import com.openai.models.chat.completions.ChatCompletionCreateParams; +import com.openai.models.chat.completions.ChatCompletionDeleteParams; +import com.openai.models.chat.completions.ChatCompletionDeleted; +import com.openai.models.chat.completions.ChatCompletionListPage; +import com.openai.models.chat.completions.ChatCompletionListParams; +import com.openai.models.chat.completions.ChatCompletionRetrieveParams; +import com.openai.models.chat.completions.ChatCompletionUpdateParams; +import com.openai.models.chat.completions.StructuredChatCompletion; +import com.openai.models.chat.completions.StructuredChatCompletionCreateParams; +import com.openai.services.blocking.chat.ChatCompletionService; +import com.openai.services.blocking.chat.completions.MessageService; +import java.util.function.Consumer; +import javax.annotation.Nonnull; +import lombok.experimental.Delegate; +import org.jspecify.annotations.NonNull; + +class AiCoreChatCompletionService implements ChatCompletionService { + + @Delegate(types = PassThroughMethods.class) + private final ChatCompletionService delegate; + + private final String deploymentModel; + + AiCoreChatCompletionService( + @Nonnull final ChatCompletionService delegate, @Nonnull final String expectedModel) { + final var apiVersionQuery = QueryParams.builder().put("api-version", "2024-02-01").build(); + this.delegate = delegate.withOptions(builder -> builder.queryParams(apiVersionQuery)); + this.deploymentModel = expectedModel; + } + + @Override + @NonNull + public ChatCompletionService withOptions( + @NonNull final Consumer consumer) { + return new AiCoreChatCompletionService(delegate.withOptions(consumer), deploymentModel); + } + + @Override + @Nonnull + public ChatCompletionService.WithRawResponse withRawResponse() { + throw new UnsupportedOperationException( + "withRawResponse() is not supported by AiCoreResponseService."); + } + + @Override + @Nonnull + public @NonNull ChatCompletion create(@NonNull final ChatCompletionCreateParams params) { + return create(params, RequestOptions.none()); + } + + @Override + @NonNull + public ChatCompletion create( + @NonNull final ChatCompletionCreateParams params, + @NonNull final RequestOptions requestOptions) { + return delegate.create(params, requestOptions); + } + + @Override + @NonNull + public StructuredChatCompletion create( + @NonNull final StructuredChatCompletionCreateParams params) { + return create(params, RequestOptions.none()); + } + + @Override + @NonNull + public StructuredChatCompletion create( + @NonNull final StructuredChatCompletionCreateParams params, + @NonNull final RequestOptions requestOptions) { + return delegate.create(params, requestOptions); + } + + @Override + @NonNull + public StreamResponse createStreaming( + @NonNull final ChatCompletionCreateParams params) { + return createStreaming(params, RequestOptions.none()); + } + + @Override + @NonNull + public StreamResponse createStreaming( + @NonNull final ChatCompletionCreateParams params, + @NonNull final RequestOptions requestOptions) { + return delegate.createStreaming(params, requestOptions); + } + + @Override + @NonNull + public StreamResponse createStreaming( + @NonNull final StructuredChatCompletionCreateParams params) { + return createStreaming(params, RequestOptions.none()); + } + + @Override + @NonNull + public StreamResponse createStreaming( + @NonNull final StructuredChatCompletionCreateParams params, + @NonNull final RequestOptions requestOptions) { + return delegate.createStreaming(params, requestOptions); + } + + @Nonnull + private ChatCompletionCreateParams useDeploymentModel( + @Nonnull final ChatCompletionCreateParams params) { + final var givenModel = params.model().asString(); + + if (givenModel == null) { + return params.toBuilder().model(deploymentModel).build(); + } + + throwOnModelMismatch(givenModel); + return params; + } + + private void throwOnModelMismatch(@Nonnull final String givenModel) { + if (!deploymentModel.equals(givenModel)) { + throw new IllegalArgumentException( + """ + Model mismatch: + Expected : '%s' (configured via forModel()) + Actual : '%s' (set in request parameters) + Fix: Either remove the model from the request parameters, \ + or use forModel("%s") when creating the client.\ + """ + .formatted(deploymentModel, givenModel, givenModel)); + } + } + + private interface PassThroughMethods { + ChatCompletionDeleted delete( + ChatCompletionDeleteParams chatCompletionDeleteParams, RequestOptions requestOptions); + + ChatCompletionDeleted delete(String completionId); + + ChatCompletionDeleted delete(String completionId, ChatCompletionDeleteParams params); + + ChatCompletionDeleted delete( + String completionId, ChatCompletionDeleteParams params, RequestOptions requestOptions); + + ChatCompletionDeleted delete(String completionId, RequestOptions requestOptions); + + ChatCompletionDeleted delete(ChatCompletionDeleteParams params); + + ChatCompletionListPage list(); + + ChatCompletionListPage list( + ChatCompletionListParams chatCompletionListParams, RequestOptions requestOptions); + + ChatCompletionListPage list(ChatCompletionListParams params); + + ChatCompletionListPage list(RequestOptions requestOptions); + + MessageService messages(); + + ChatCompletion retrieve( + ChatCompletionRetrieveParams chatCompletionRetrieveParams, RequestOptions requestOptions); + + ChatCompletion retrieve(String completionId); + + ChatCompletion retrieve(String completionId, ChatCompletionRetrieveParams params); + + ChatCompletion retrieve( + String completionId, ChatCompletionRetrieveParams params, RequestOptions requestOptions); + + ChatCompletion retrieve(String completionId, RequestOptions requestOptions); + + ChatCompletion retrieve(ChatCompletionRetrieveParams params); + + ChatCompletion update( + ChatCompletionUpdateParams chatCompletionUpdateParams, RequestOptions requestOptions); + + ChatCompletion update(String completionId, ChatCompletionUpdateParams params); + + ChatCompletion update( + String completionId, ChatCompletionUpdateParams params, RequestOptions requestOptions); + + ChatCompletion update(ChatCompletionUpdateParams params); + } +} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java new file mode 100644 index 000000000..a5816a383 --- /dev/null +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java @@ -0,0 +1,33 @@ +package com.sap.ai.sdk.foundationmodels.openai; + +import com.openai.core.ClientOptions; +import com.openai.services.blocking.ChatService; +import com.openai.services.blocking.chat.ChatCompletionService; +import java.util.function.Consumer; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; +import lombok.experimental.Delegate; +import org.jspecify.annotations.NonNull; + +@RequiredArgsConstructor(access = AccessLevel.PACKAGE) +class AiCoreChatService implements ChatService { + + @Delegate private final ChatService delegate; + private final String deploymentModel; + + @Override + public @NonNull ChatService withOptions(@NonNull final Consumer consumer) { + return new AiCoreChatService(delegate.withOptions(consumer), deploymentModel); + } + + @Override + public @NonNull WithRawResponse withRawResponse() { + throw new UnsupportedOperationException( + "withRawResponse() is not supported for AiCoreChatService"); + } + + @Override + public @NonNull ChatCompletionService completions() { + return new AiCoreChatCompletionService(delegate.completions(), deploymentModel); + } +} diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index 72b53f131..a9b5cd3e5 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -12,7 +12,6 @@ import com.openai.errors.OpenAIIoException; import com.openai.models.ChatModel; import com.sap.ai.sdk.core.AiCoreService; -import com.sap.ai.sdk.core.AiModel; import com.sap.ai.sdk.core.DeploymentResolutionException; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination; @@ -24,6 +23,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.Locale; +import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; @@ -65,7 +65,7 @@ public final class AiCoreOpenAiClient { * @throws DeploymentResolutionException If no running deployment is found for the model. */ @Nonnull - public static OpenAIClient forModel(@Nonnull final AiModel model) { + public static OpenAIClient forModel(@Nonnull final OpenAiModel model) { return forModel(model, DEFAULT_RESOURCE_GROUP); } @@ -80,7 +80,7 @@ public static OpenAIClient forModel(@Nonnull final AiModel model) { */ @Nonnull public static OpenAIClient forModel( - @Nonnull final AiModel model, @Nonnull final String resourceGroup) { + @Nonnull final OpenAiModel model, @Nonnull final String resourceGroup) { final HttpDestination destination = new AiCoreService().getInferenceDestination(resourceGroup).forModel(model); return fromDestination(destination, model); @@ -96,7 +96,7 @@ public static OpenAIClient forModel( @Nonnull @SuppressWarnings("PMD.CloseResource") static OpenAIClient fromDestination( - @Nonnull final HttpDestination destination, @Nonnull final AiModel model) { + @Nonnull final HttpDestination destination, @Nonnull final OpenAiModel model) { final var baseUrl = destination.getUri().toString(); final var httpClient = new AiCoreHttpClientImpl(destination); @@ -107,7 +107,7 @@ static OpenAIClient fromDestination( .map(version -> model.name() + "-" + version) .orElseGet(model::name); return new OpenAIClientImplWrapper( - new OpenAIClientImpl(clientOptions), ChatModel.of(chatModel)); + new OpenAIClientImpl(clientOptions), ChatModel.of(chatModel).asString()); } /** @@ -120,19 +120,19 @@ static final class AiCoreHttpClientImpl implements HttpClient { private final HttpDestination destination; private static final String SSE_MEDIA_TYPE = "text/event-stream"; - private static final Set ALLOWED_PATHS = - Set.of( - "/chat/completions", - "/responses", - "/responses/[^/]+", - "/responses/[^/]+/input_items", - "/responses/[^/]+/cancel"); + private static final Map> ALLOWED_OPERATIONS = + Map.of( + "/chat/completions", Set.of("POST"), + "/responses", Set.of("GET", "POST"), + "/responses/[^/]+", Set.of("GET", "DELETE"), + "/responses/[^/]+/compact", Set.of("POST"), + "/responses/[^/]+/cancel", Set.of("POST")); @Override @Nonnull public HttpResponse execute( @Nonnull final HttpRequest request, @Nonnull final RequestOptions requestOptions) { - validateAllowedEndpoint(request); + validateAllowedOperation(request); final var apacheClient = ApacheHttpClient5Accessor.getHttpClient(destination); final var apacheRequest = toApacheRequest(request); @@ -165,12 +165,25 @@ public void close() { // Apache HttpClient lifecycle is managed by Cloud SDK's ApacheHttpClient5Cache } - private static void validateAllowedEndpoint(@Nonnull final HttpRequest request) { + private static void validateAllowedOperation(@Nonnull final HttpRequest request) { final var endpoint = "/" + String.join("/", request.pathSegments()); - if (ALLOWED_PATHS.stream().noneMatch(endpoint::matches)) { + final var method = request.method().name(); + + // Find matching path pattern + final var matchingEntry = + ALLOWED_OPERATIONS.entrySet().stream() + .filter(entry -> endpoint.matches(entry.getKey())) + .findFirst() + .orElseThrow( + () -> + new UnsupportedOperationException( + String.format("Endpoint %s is not supported in AI Core", endpoint))); + + // Validate method + if (!matchingEntry.getValue().contains(method)) { throw new UnsupportedOperationException( String.format( - "Only requests to the following endpoints are allowed: %s.", ALLOWED_PATHS)); + "HTTP %s method is not supported on endpoint %s in AI Core", method, endpoint)); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java index b66874eb3..090aa639a 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreResponseService.java @@ -20,25 +20,29 @@ import com.openai.services.blocking.responses.InputTokenService; import java.util.function.Consumer; import javax.annotation.Nonnull; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; +@RequiredArgsConstructor(access = AccessLevel.PACKAGE) class AiCoreResponseService implements ResponseService { - @Delegate(types = SafeMethods.class) + @Delegate(types = PassThroughMethods.class) private final ResponseService delegate; - private final ChatModel expectedModel; + private final String deploymentModel; @Override @Nonnull public ResponseService withOptions(@Nonnull final Consumer modifier) { - return new AiCoreResponseService(delegate.withOptions(modifier), expectedModel); + return new AiCoreResponseService(delegate.withOptions(modifier), deploymentModel); } - AiCoreResponseService( - @Nonnull final ResponseService delegate, @Nonnull final ChatModel expectedModel) { - this.delegate = delegate; - this.expectedModel = expectedModel; + @Override + @Nonnull + public ResponseService.WithRawResponse withRawResponse() { + throw new UnsupportedOperationException( + "withRawResponse() is not supported by AiCoreResponseService."); } @Override @@ -51,7 +55,7 @@ public Response create(@Nonnull final ResponseCreateParams params) { @Nonnull public Response create( @Nonnull final ResponseCreateParams params, @Nonnull final RequestOptions requestOptions) { - return delegate.create(withValidatedModel(params), requestOptions); + return delegate.create(useDeploymentModel(params), requestOptions); } @Override @@ -65,7 +69,7 @@ public StructuredResponse create(@Nonnull final StructuredResponseCreateP public StructuredResponse create( @Nonnull final StructuredResponseCreateParams params, @Nonnull final RequestOptions requestOptions) { - return delegate.create(withValidatedModel(params), requestOptions); + return delegate.create(useDeploymentModel(params), requestOptions); } @Override @@ -79,7 +83,7 @@ public StreamResponse createStreaming( @Nonnull public StreamResponse createStreaming( @Nonnull final ResponseCreateParams params, @Nonnull final RequestOptions requestOptions) { - return delegate.createStreaming(withValidatedModel(params), requestOptions); + return delegate.createStreaming(useDeploymentModel(params), requestOptions); } @Override @@ -94,7 +98,7 @@ public StreamResponse createStreaming( public StreamResponse createStreaming( @Nonnull final StructuredResponseCreateParams params, @Nonnull final RequestOptions requestOptions) { - return delegate.createStreaming(withValidatedModel(params), requestOptions); + return delegate.createStreaming(useDeploymentModel(params), requestOptions); } @Override @@ -107,70 +111,61 @@ public CompactedResponse compact(@Nonnull final ResponseCompactParams params) { @Nonnull public CompactedResponse compact( @Nonnull final ResponseCompactParams params, @Nonnull final RequestOptions requestOptions) { - return delegate.compact(withValidatedModel(params), requestOptions); + return delegate.compact(useDeploymentModel(params), requestOptions); } @Nonnull - private ResponseCreateParams withValidatedModel(@Nonnull final ResponseCreateParams params) { - final ChatModel givenModel = params.model().map(ResponsesModel::asChat).orElse(null); + private StructuredResponseCreateParams useDeploymentModel( + @Nonnull final StructuredResponseCreateParams params) { + final ResponseCreateParams validated = useDeploymentModel(params.rawParams()); + return new StructuredResponseCreateParams<>(params.responseType(), validated); + } - if (givenModel == null) { - return params.toBuilder().model(expectedModel).build(); - } + @Nonnull + private ResponseCreateParams useDeploymentModel(@Nonnull final ResponseCreateParams params) { + final var givenModel = + params.model().map(ResponsesModel::asChat).map(ChatModel::asString).orElse(null); - if (!expectedModel.equals(givenModel)) { - throw new IllegalArgumentException( - """ - Model mismatch: - Expected : '%s' (configured via forModel()) - Actual : '%s' (set in request parameters) - Fix: Either remove the model from the request parameters, \ - or use forModel("%s") when creating the client.\ - """ - .formatted(expectedModel, givenModel, givenModel)); + if (givenModel == null) { + return params.toBuilder().model(deploymentModel).build(); } + throwOnModelMismatch(givenModel); return params; } @Nonnull - private StructuredResponseCreateParams withValidatedModel( - @Nonnull final StructuredResponseCreateParams params) { - final ResponseCreateParams validated = withValidatedModel(params.rawParams()); - return new StructuredResponseCreateParams<>(params.responseType(), validated); - } - - @Nonnull - private ResponseCompactParams withValidatedModel(@Nonnull final ResponseCompactParams params) { + private ResponseCompactParams useDeploymentModel(@Nonnull final ResponseCompactParams params) { final String givenModel = params.model().map(ResponseCompactParams.Model::asString).orElse(null); if (givenModel == null) { - return params.toBuilder().model(expectedModel.asString()).build(); + return params.toBuilder().model(deploymentModel).build(); } - if (!expectedModel.asString().equals(givenModel)) { + throwOnModelMismatch(givenModel); + return params; + } + + private void throwOnModelMismatch(@Nonnull final String givenModel) { + if (!deploymentModel.equals(givenModel)) { throw new IllegalArgumentException( """ - Model mismatch: - Expected : '%s' (configured via forModel()) - Actual : '%s' (set in request parameters) - Fix: Either remove the model from the request parameters, \ - or use forModel("%s") when creating the client.\ - """ - .formatted(expectedModel, givenModel, givenModel)); + Model mismatch: + Expected : '%s' (configured via forModel()) + Actual : '%s' (set in request parameters) + Fix: Either remove the model from the request parameters, \ + or use forModel("%s") when creating the client.\ + """ + .formatted(deploymentModel, givenModel, givenModel)); } - - return params; } - private interface SafeMethods { + private interface PassThroughMethods { InputItemService inputItems(); InputTokenService inputTokens(); - ResponseService.WithRawResponse withRawResponse(); - Response retrieve(ResponseRetrieveParams params, RequestOptions requestOptions); Response retrieve(ResponseRetrieveParams params); @@ -180,12 +175,10 @@ StreamResponse retrieveStreaming( StreamResponse retrieveStreaming(ResponseRetrieveParams params); - // Delete operation - DELETE by ID, no model parameter void delete(ResponseDeleteParams params, RequestOptions requestOptions); void delete(ResponseDeleteParams params); - // Cancel operation - no model parameter Response cancel(ResponseCancelParams params, RequestOptions requestOptions); Response cancel(ResponseCancelParams params); diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java index db530c773..9308f19f6 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/OpenAIClientImplWrapper.java @@ -1,29 +1,120 @@ package com.sap.ai.sdk.foundationmodels.openai; import com.openai.client.OpenAIClient; +import com.openai.client.OpenAIClientAsync; import com.openai.client.OpenAIClientImpl; -import com.openai.models.ChatModel; +import com.openai.core.ClientOptions; +import com.openai.services.blocking.AudioService; +import com.openai.services.blocking.BatchService; +import com.openai.services.blocking.BetaService; +import com.openai.services.blocking.ChatService; +import com.openai.services.blocking.CompletionService; +import com.openai.services.blocking.ContainerService; +import com.openai.services.blocking.ConversationService; +import com.openai.services.blocking.EmbeddingService; +import com.openai.services.blocking.EvalService; +import com.openai.services.blocking.FileService; +import com.openai.services.blocking.FineTuningService; +import com.openai.services.blocking.GraderService; +import com.openai.services.blocking.ImageService; +import com.openai.services.blocking.ModelService; +import com.openai.services.blocking.ModerationService; +import com.openai.services.blocking.RealtimeService; import com.openai.services.blocking.ResponseService; +import com.openai.services.blocking.SkillService; +import com.openai.services.blocking.UploadService; +import com.openai.services.blocking.VectorStoreService; +import com.openai.services.blocking.VideoService; +import com.openai.services.blocking.WebhookService; +import com.sap.ai.sdk.foundationmodels.openai.AiCoreOpenAiClient.AiCoreHttpClientImpl; +import java.util.function.Consumer; import javax.annotation.Nonnull; import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; @RequiredArgsConstructor class OpenAIClientImplWrapper implements OpenAIClient { + + @Delegate(types = OtherMethods.class) @Nonnull - @Delegate(excludes = Excludes.class) private final OpenAIClientImpl delegate; - @Nonnull private final ChatModel expectedModel; + @Nonnull private final String deploymentModel; + + @Nonnull + @Override + public OpenAIClient withOptions(@Nonnull final Consumer consumer) { + return new OpenAIClientImplWrapper( + (OpenAIClientImpl) delegate.withOptions(consumer), deploymentModel); + } + + @Nonnull + @Override + public ChatService chat() { + return new AiCoreChatService(delegate.chat(), deploymentModel); + } - /** Returns an instance of AiCoreResponsesService */ @Override @Nonnull public ResponseService responses() { - return new AiCoreResponseService(delegate.responses(), expectedModel); + return new AiCoreResponseService(delegate.responses(), deploymentModel); } - private interface Excludes { - ResponseService responses(); + /** + * Methods that are delegated to the underlying OpenAI client. + * + *

Note: Most of these methods will throw {@link UnsupportedOperationException} at runtime due + * to endpoint constraints enforced in {@code AiCoreHttpClientImpl}. + * + * @see AiCoreHttpClientImpl#validateAllowedEndpoint + */ + private interface OtherMethods { + OpenAIClientAsync async(); + + OpenAIClient.WithRawResponse withRawResponse(); + + OpenAIClient withOptions(Consumer modifier); + + CompletionService completions(); + + EmbeddingService embeddings(); + + FileService files(); + + ImageService images(); + + AudioService audio(); + + ModerationService moderations(); + + ModelService models(); + + FineTuningService fineTuning(); + + GraderService graders(); + + VectorStoreService vectorStores(); + + WebhookService webhooks(); + + BetaService beta(); + + BatchService batches(); + + UploadService uploads(); + + RealtimeService realtime(); + + ConversationService conversations(); + + EvalService evals(); + + ContainerService containers(); + + SkillService skills(); + + VideoService videos(); + + void close(); } } diff --git a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java index 7e464a7ed..29fb84a22 100644 --- a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java @@ -7,6 +7,8 @@ import com.github.tomakehurst.wiremock.junit5.WireMockTest; import com.openai.client.OpenAIClient; import com.openai.models.ChatModel; +import com.openai.models.chat.completions.ChatCompletion; +import com.openai.models.chat.completions.ChatCompletionCreateParams; import com.openai.models.responses.Response; import com.openai.models.responses.ResponseCreateParams; import com.openai.models.responses.ResponseStatus; @@ -78,10 +80,10 @@ void testResponseServiceFailsWithModelMismatch() { @Test void testResponseServiceWithOptions() { - final var originalService = client.responses(); + final var service = client.responses(); final var modifiedService = - originalService.withOptions( + service.withOptions( builder -> { // Modify some option builder.putHeader("X-Custom-Header", "test-value"); @@ -90,10 +92,19 @@ void testResponseServiceWithOptions() { assertThat(modifiedService).isInstanceOf(AiCoreResponseService.class); } + @Test + void testChatCompletionService() { + final var params = + ChatCompletionCreateParams.builder().addUserMessage("Say this is a test").build(); + final ChatCompletion response = + AiCoreOpenAiClient.forModel(OpenAiModel.GPT_5).chat().completions().create(params); + + assertThat(response).isNotNull(); + } + @Test void testOtherServicesStillWork() { - // Verify that other OpenAI services are still accessible - assertThat(client.chat()).isNotNull(); + assertThat(client.chat().completions()).isNotNull(); assertThat(client.completions()).isNotNull(); assertThat(client.embeddings()).isNotNull(); assertThat(client.files()).isNotNull(); From 96feb250a1b7fd822c098adaec6e53cfe3742db1 Mon Sep 17 00:00:00 2001 From: Roshin Rajan Panackal Date: Wed, 1 Apr 2026 17:51:25 +0200 Subject: [PATCH 31/31] Cleanup and close with test documenting limitation --- foundation-models/openai/pom.xml | 8 +- .../openai/AiCoreChatCompletionService.java | 71 +++++------- .../openai/AiCoreChatService.java | 17 ++- .../openai/AiCoreOpenAiClient.java | 24 +--- .../openai/AiCoreOpenAiClientTest.java | 34 ++++-- .../resources/mappings/chatCompletion.json | 104 ++++++++++++++++++ 6 files changed, 173 insertions(+), 85 deletions(-) create mode 100644 foundation-models/openai/src/test/resources/mappings/chatCompletion.json diff --git a/foundation-models/openai/pom.xml b/foundation-models/openai/pom.xml index 703940ab7..eecd1b41c 100644 --- a/foundation-models/openai/pom.xml +++ b/foundation-models/openai/pom.xml @@ -38,11 +38,11 @@ ${project.basedir}/../../ - 75% - 86% - 83% + 73% + 85% + 82% 74% - 83% + 79% 91% diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java index 322522f21..afd307be1 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatCompletionService.java @@ -2,7 +2,6 @@ import com.openai.core.ClientOptions; import com.openai.core.RequestOptions; -import com.openai.core.http.QueryParams; import com.openai.core.http.StreamResponse; import com.openai.models.chat.completions.ChatCompletion; import com.openai.models.chat.completions.ChatCompletionChunk; @@ -19,9 +18,11 @@ import com.openai.services.blocking.chat.completions.MessageService; import java.util.function.Consumer; import javax.annotation.Nonnull; +import lombok.AccessLevel; +import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; -import org.jspecify.annotations.NonNull; +@RequiredArgsConstructor(access = AccessLevel.PACKAGE) class AiCoreChatCompletionService implements ChatCompletionService { @Delegate(types = PassThroughMethods.class) @@ -29,17 +30,10 @@ class AiCoreChatCompletionService implements ChatCompletionService { private final String deploymentModel; - AiCoreChatCompletionService( - @Nonnull final ChatCompletionService delegate, @Nonnull final String expectedModel) { - final var apiVersionQuery = QueryParams.builder().put("api-version", "2024-02-01").build(); - this.delegate = delegate.withOptions(builder -> builder.queryParams(apiVersionQuery)); - this.deploymentModel = expectedModel; - } - @Override - @NonNull + @Nonnull public ChatCompletionService withOptions( - @NonNull final Consumer consumer) { + @Nonnull final Consumer consumer) { return new AiCoreChatCompletionService(delegate.withOptions(consumer), deploymentModel); } @@ -52,76 +46,67 @@ public ChatCompletionService.WithRawResponse withRawResponse() { @Override @Nonnull - public @NonNull ChatCompletion create(@NonNull final ChatCompletionCreateParams params) { + public ChatCompletion create(@Nonnull final ChatCompletionCreateParams params) { return create(params, RequestOptions.none()); } @Override - @NonNull + @Nonnull public ChatCompletion create( - @NonNull final ChatCompletionCreateParams params, - @NonNull final RequestOptions requestOptions) { + @Nonnull final ChatCompletionCreateParams params, + @Nonnull final RequestOptions requestOptions) { + throwOnModelMismatch(params.model().asString()); return delegate.create(params, requestOptions); } @Override - @NonNull + @Nonnull public StructuredChatCompletion create( - @NonNull final StructuredChatCompletionCreateParams params) { + @Nonnull final StructuredChatCompletionCreateParams params) { return create(params, RequestOptions.none()); } @Override - @NonNull + @Nonnull public StructuredChatCompletion create( - @NonNull final StructuredChatCompletionCreateParams params, - @NonNull final RequestOptions requestOptions) { + @Nonnull final StructuredChatCompletionCreateParams params, + @Nonnull final RequestOptions requestOptions) { + throwOnModelMismatch(params.rawParams().model().asString()); return delegate.create(params, requestOptions); } @Override - @NonNull + @Nonnull public StreamResponse createStreaming( - @NonNull final ChatCompletionCreateParams params) { + @Nonnull final ChatCompletionCreateParams params) { return createStreaming(params, RequestOptions.none()); } @Override - @NonNull + @Nonnull public StreamResponse createStreaming( - @NonNull final ChatCompletionCreateParams params, - @NonNull final RequestOptions requestOptions) { + @Nonnull final ChatCompletionCreateParams params, + @Nonnull final RequestOptions requestOptions) { + throwOnModelMismatch(params.model().asString()); return delegate.createStreaming(params, requestOptions); } @Override - @NonNull + @Nonnull public StreamResponse createStreaming( - @NonNull final StructuredChatCompletionCreateParams params) { + @Nonnull final StructuredChatCompletionCreateParams params) { return createStreaming(params, RequestOptions.none()); } @Override - @NonNull + @Nonnull public StreamResponse createStreaming( - @NonNull final StructuredChatCompletionCreateParams params, - @NonNull final RequestOptions requestOptions) { + @Nonnull final StructuredChatCompletionCreateParams params, + @Nonnull final RequestOptions requestOptions) { + throwOnModelMismatch(params.rawParams().model().asString()); return delegate.createStreaming(params, requestOptions); } - @Nonnull - private ChatCompletionCreateParams useDeploymentModel( - @Nonnull final ChatCompletionCreateParams params) { - final var givenModel = params.model().asString(); - - if (givenModel == null) { - return params.toBuilder().model(deploymentModel).build(); - } - - throwOnModelMismatch(givenModel); - return params; - } - private void throwOnModelMismatch(@Nonnull final String givenModel) { if (!deploymentModel.equals(givenModel)) { throw new IllegalArgumentException( diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java index a5816a383..641255c47 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreChatService.java @@ -1,13 +1,14 @@ package com.sap.ai.sdk.foundationmodels.openai; import com.openai.core.ClientOptions; +import com.openai.core.http.QueryParams; import com.openai.services.blocking.ChatService; import com.openai.services.blocking.chat.ChatCompletionService; import java.util.function.Consumer; +import javax.annotation.Nonnull; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.experimental.Delegate; -import org.jspecify.annotations.NonNull; @RequiredArgsConstructor(access = AccessLevel.PACKAGE) class AiCoreChatService implements ChatService { @@ -16,18 +17,24 @@ class AiCoreChatService implements ChatService { private final String deploymentModel; @Override - public @NonNull ChatService withOptions(@NonNull final Consumer consumer) { + @Nonnull + public ChatService withOptions(@Nonnull final Consumer consumer) { return new AiCoreChatService(delegate.withOptions(consumer), deploymentModel); } @Override - public @NonNull WithRawResponse withRawResponse() { + @Nonnull + public WithRawResponse withRawResponse() { throw new UnsupportedOperationException( "withRawResponse() is not supported for AiCoreChatService"); } @Override - public @NonNull ChatCompletionService completions() { - return new AiCoreChatCompletionService(delegate.completions(), deploymentModel); + @Nonnull + public ChatCompletionService completions() { + final var apiVersionQuery = QueryParams.builder().put("api-version", "2024-02-01").build(); + final var completions = + delegate.completions().withOptions(builder -> builder.queryParams(apiVersionQuery)); + return new AiCoreChatCompletionService(completions, deploymentModel); } } diff --git a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java index a9b5cd3e5..5d1d97459 100644 --- a/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java +++ b/foundation-models/openai/src/main/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClient.java @@ -20,8 +20,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; import java.util.Locale; import java.util.Map; import java.util.Objects; @@ -39,7 +37,6 @@ import org.apache.hc.core5.http.io.entity.ByteArrayEntity; import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.message.BasicClassicHttpRequest; -import org.apache.hc.core5.net.URIBuilder; /** * Factory for creating OpenAI SDK clients configured for SAP AI Core deployments. @@ -189,9 +186,9 @@ private static void validateAllowedOperation(@Nonnull final HttpRequest request) @Nonnull private ClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { - final var fullUri = buildUrlWithQueryParams(request); + final var fullUri = request.url(); final var method = request.method(); - final var apacheRequest = new BasicClassicHttpRequest(method.name(), fullUri.toString()); + final var apacheRequest = new BasicClassicHttpRequest(method.name(), fullUri); applyRequestHeaders(request, apacheRequest); try (var requestBody = request.body()) { @@ -216,23 +213,6 @@ private ClassicHttpRequest toApacheRequest(@Nonnull final HttpRequest request) { return apacheRequest; } - private static URI buildUrlWithQueryParams(@Nonnull final HttpRequest request) { - try { - final var uriBuilder = new URIBuilder(request.url()); - final var queryParams = request.queryParams(); - - for (final var key : queryParams.keys()) { - for (final var value : queryParams.values(key)) { - uriBuilder.addParameter(key, value); - } - } - - return uriBuilder.build(); - } catch (URISyntaxException e) { - throw new OpenAIIoException("Failed to build URI with query parameters", e); - } - } - private static void applyRequestHeaders( @Nonnull final HttpRequest request, @Nonnull final BasicClassicHttpRequest apacheRequest) { final var headers = request.headers(); diff --git a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java index 29fb84a22..9a3e8667e 100644 --- a/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java +++ b/foundation-models/openai/src/test/java/com/sap/ai/sdk/foundationmodels/openai/AiCoreOpenAiClientTest.java @@ -15,9 +15,11 @@ import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor; import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Cache; import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination; +import java.util.concurrent.CompletableFuture; import javax.annotation.Nonnull; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @WireMockTest @@ -93,22 +95,32 @@ void testResponseServiceWithOptions() { } @Test - void testChatCompletionService() { + void testChatCompletionServiceSuccessWithMatchingModel() { final var params = - ChatCompletionCreateParams.builder().addUserMessage("Say this is a test").build(); - final ChatCompletion response = - AiCoreOpenAiClient.forModel(OpenAiModel.GPT_5).chat().completions().create(params); + ChatCompletionCreateParams.builder() + .model(ChatModel.GPT_5) + .addUserMessage("Say this is a test") + .build(); + final ChatCompletion response = client.chat().completions().create(params); assertThat(response).isNotNull(); } @Test - void testOtherServicesStillWork() { - assertThat(client.chat().completions()).isNotNull(); - assertThat(client.completions()).isNotNull(); - assertThat(client.embeddings()).isNotNull(); - assertThat(client.files()).isNotNull(); - assertThat(client.images()).isNotNull(); - assertThat(client.audio()).isNotNull(); + @Disabled("Fails as Async client needs additional wrappers. Maintenance wall.") + void testAsyncChatCompletion() { + final var params = + ChatCompletionCreateParams.builder() + .model(ChatModel.GPT_5) + .addUserMessage("Say this is a test") + .build(); + + final CompletableFuture future = + client.async().chat().completions().create(params); + + final ChatCompletion response = future.join(); + + assertThat(response).isNotNull(); + assertThat(response.choices()).isNotEmpty(); } } diff --git a/foundation-models/openai/src/test/resources/mappings/chatCompletion.json b/foundation-models/openai/src/test/resources/mappings/chatCompletion.json new file mode 100644 index 000000000..bb5358a84 --- /dev/null +++ b/foundation-models/openai/src/test/resources/mappings/chatCompletion.json @@ -0,0 +1,104 @@ +{ + "request": { + "method": "POST", + "urlPattern": "/chat/completions\\?api-version=2024-02-01", + "bodyPatterns": [ + { + "equalToJson": { + "messages": [ + { + "content": "Say this is a test", + "role": "user" + } + ], + "model": "gpt-5" + } + } + ] + }, + "response": { + "status": 200, + "headers": { + "Content-Type": "application/json", + "x-request-id": "f181d24e-f41e-9396-a195-6d1334bfe952", + "ai-inference-id": "f181d24e-f41e-9396-a195-6d1334bfe952", + "x-upstream-service-time": "3177" + }, + "jsonBody": { + "choices": [ + { + "content_filter_results": { + "hate": { + "filtered": false, + "severity": "safe" + }, + "self_harm": { + "filtered": false, + "severity": "safe" + }, + "sexual": { + "filtered": false, + "severity": "safe" + }, + "violence": { + "filtered": false, + "severity": "safe" + } + }, + "finish_reason": "stop", + "index": 0, + "logprobs": null, + "message": { + "annotations": [], + "content": "This is a test.", + "refusal": null, + "role": "assistant" + } + } + ], + "created": 1775053782, + "id": "chatcmpl-DPqreavBOHfKfV0orguq4jK5Gbmmh", + "model": "gpt-5-2025-08-07", + "object": "chat.completion", + "prompt_filter_results": [ + { + "content_filter_results": { + "hate": { + "filtered": false, + "severity": "safe" + }, + "self_harm": { + "filtered": false, + "severity": "safe" + }, + "sexual": { + "filtered": false, + "severity": "safe" + }, + "violence": { + "filtered": false, + "severity": "safe" + } + }, + "prompt_index": 0 + } + ], + "system_fingerprint": null, + "usage": { + "completion_tokens": 271, + "completion_tokens_details": { + "accepted_prediction_tokens": 0, + "audio_tokens": 0, + "reasoning_tokens": 256, + "rejected_prediction_tokens": 0 + }, + "prompt_tokens": 11, + "prompt_tokens_details": { + "audio_tokens": 0, + "cached_tokens": 0 + }, + "total_tokens": 282 + } + } + } +} \ No newline at end of file