From e50d53d8f4b940b6d994cd1ed1213425c269cc07 Mon Sep 17 00:00:00 2001 From: Gerardo Lecaros <10088504+glecaros@users.noreply.github.com> Date: Thu, 20 Feb 2025 11:03:30 -0800 Subject: [PATCH] [openai] Updates for Azure OpenAI Assistants (2025-01-01-preview) (#32256) * [openai] Updates for Azure OpenAI Asisstants (2024-12-01-preview) * Adding suppression * examples * removing suppression * format * changed directive for file_searcxh * rename * moved to 2025-01-01-preview * updating readme * optional * Added option for java emitter to prevent sample emission --------- Co-authored-by: Jose Alvarez Co-authored-by: Travis Wilson <35748617+trrwilson@users.noreply.github.com> --- .../ai/OpenAI.Assistants/common/models.tsp | 64 +- .../2025-01-01-preview/cancel_run.json | 49 + .../cancel_vector_store_file_batch.json | 28 + .../2025-01-01-preview/create_assistant.json | 41 + .../2025-01-01-preview/create_message.json | 41 + .../2025-01-01-preview/create_run.json | 51 + .../2025-01-01-preview/create_thread.json | 20 + .../create_thread_and_run.json | 55 + .../create_vector_store.json | 32 + .../create_vector_store_file.json | 28 + .../create_vector_store_file_batch.json | 33 + .../2025-01-01-preview/delete_assistant.json | 18 + .../2025-01-01-preview/delete_file.json | 18 + .../2025-01-01-preview/delete_thread.json | 18 + .../delete_vector_store.json | 18 + .../delete_vector_store_file.json | 19 + .../2025-01-01-preview/get_assistant.json | 32 + .../examples/2025-01-01-preview/get_file.json | 23 + .../2025-01-01-preview/get_file_content.json | 14 + .../2025-01-01-preview/get_message.json | 38 + .../examples/2025-01-01-preview/get_run.json | 43 + .../2025-01-01-preview/get_run_step.json | 42 + .../2025-01-01-preview/get_thread.json | 24 + .../2025-01-01-preview/get_vector_store.json | 30 + .../get_vector_store_file.json | 26 + .../get_vector_store_file_batch.json | 28 + .../2025-01-01-preview/list_assistants.json | 71 + .../2025-01-01-preview/list_file.json | 38 + .../2025-01-01-preview/list_messages.json | 69 + .../2025-01-01-preview/list_run_steps.json | 49 + .../2025-01-01-preview/list_runs.json | 99 + .../list_vector_store_file_batch_files.json | 46 + .../list_vector_store_files.json | 45 + .../list_vector_stores.json | 54 + .../modify_vector_store.json | 33 + .../submit_tool_outputs_to_run.json | 80 + .../2025-01-01-preview/update_assistant.json | 45 + .../2025-01-01-preview/update_message.json | 47 + .../2025-01-01-preview/update_run.json | 60 + .../2025-01-01-preview/update_thread.json | 29 + .../2025-01-01-preview/upload_file.json | 30 + specification/ai/OpenAI.Assistants/main.tsp | 4 + .../ai/OpenAI.Assistants/run_steps/routes.tsp | 11 + .../ai/OpenAI.Assistants/runs/models.tsp | 11 + .../ai/OpenAI.Assistants/runs/routes.tsp | 5 + .../ai/OpenAI.Assistants/tools/models.tsp | 35 +- .../ai/OpenAI.Assistants/tspconfig.yaml | 1 + .../vector_stores/files/models.tsp | 16 + .../assistants_generated.json | 8 +- .../assistants_generated.json | 16 +- .../assistants_generated.json | 16 +- .../assistants_generated.json | 16 +- .../assistants_generated.json | 16 +- .../assistants_generated.json | 5735 +++++++++++++++++ .../examples/cancel_run.json | 49 + .../cancel_vector_store_file_batch.json | 28 + .../examples/create_assistant.json | 41 + .../examples/create_message.json | 41 + .../examples/create_run.json | 51 + .../examples/create_thread.json | 20 + .../examples/create_thread_and_run.json | 55 + .../examples/create_vector_store.json | 32 + .../examples/create_vector_store_file.json | 28 + .../create_vector_store_file_batch.json | 33 + .../examples/delete_assistant.json | 18 + .../examples/delete_file.json | 18 + .../examples/delete_thread.json | 18 + .../examples/delete_vector_store.json | 18 + .../examples/delete_vector_store_file.json | 19 + .../examples/get_assistant.json | 32 + .../2025-01-01-preview/examples/get_file.json | 23 + .../examples/get_file_content.json | 14 + .../examples/get_message.json | 38 + .../2025-01-01-preview/examples/get_run.json | 43 + .../examples/get_run_step.json | 42 + .../examples/get_thread.json | 24 + .../examples/get_vector_store.json | 30 + .../examples/get_vector_store_file.json | 26 + .../examples/get_vector_store_file_batch.json | 28 + .../examples/list_assistants.json | 71 + .../examples/list_file.json | 38 + .../examples/list_messages.json | 69 + .../examples/list_run_steps.json | 49 + .../examples/list_runs.json | 99 + .../list_vector_store_file_batch_files.json | 46 + .../examples/list_vector_store_files.json | 45 + .../examples/list_vector_stores.json | 54 + .../examples/modify_vector_store.json | 33 + .../examples/submit_tool_outputs_to_run.json | 80 + .../examples/update_assistant.json | 45 + .../examples/update_message.json | 47 + .../examples/update_run.json | 60 + .../examples/update_thread.json | 29 + .../examples/upload_file.json | 30 + .../assistants_generated.yaml | 9 +- .../assistants_generated.yaml | 60 +- .../assistants_generated.yaml | 60 +- .../assistants_generated.yaml | 60 +- .../assistants_generated.yaml | 60 +- .../assistants_generated.yaml | 4595 +++++++++++++ .../ai/data-plane/OpenAI.Assistants/readme.md | 7 + 101 files changed, 13843 insertions(+), 90 deletions(-) create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_run.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_vector_store_file_batch.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_assistant.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_message.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_run.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread_and_run.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file_batch.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_assistant.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_file.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_thread.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store_file.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_assistant.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file_content.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_message.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run_step.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_thread.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file_batch.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_assistants.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_file.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_messages.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_run_steps.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_runs.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_file_batch_files.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_files.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_stores.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/modify_vector_store.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/submit_tool_outputs_to_run.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_assistant.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_message.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_run.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_thread.json create mode 100644 specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/upload_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/assistants_generated.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_run.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_vector_store_file_batch.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_assistant.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_message.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_run.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread_and_run.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file_batch.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_assistant.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_thread.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_assistant.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file_content.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_message.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run_step.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_thread.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file_batch.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_assistants.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_messages.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_run_steps.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_runs.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_file_batch_files.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_files.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_stores.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/modify_vector_store.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/submit_tool_outputs_to_run.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_assistant.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_message.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_run.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_thread.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/upload_file.json create mode 100644 specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2025-01-01-preview/assistants_generated.yaml diff --git a/specification/ai/OpenAI.Assistants/common/models.tsp b/specification/ai/OpenAI.Assistants/common/models.tsp index 5c446a1d1d42..d547192f0c62 100644 --- a/specification/ai/OpenAI.Assistants/common/models.tsp +++ b/specification/ai/OpenAI.Assistants/common/models.tsp @@ -42,7 +42,7 @@ alias OpenAIListRequestOptions = { @query after?: string; - @doc("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.") + @doc("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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.") @query before?: string; }; @@ -94,9 +94,12 @@ alias OptionalNullableMetadata = { }; /** - * Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + * Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. * - * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + * 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. + * + * 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, @@ -124,6 +127,7 @@ union AssistantsApiResponseFormatMode { "auto", /** Setting the value to `none`, will result in a 400 Bad request. */ + @removed(ServiceApiVersions.v2025_01_01_preview) "none", } @@ -132,11 +136,60 @@ union AssistantsApiResponseFormatMode { * If `text` the model can return text or any value needed. */ @added(ServiceApiVersions.v2024_05_01_preview) +@discriminator("type") model AssistantsApiResponseFormat { - /** Must be one of `text` or `json_object`. */ + /** Must be one of `text`, `json_object` or `json_schema` . */ type?: ApiResponseFormat = ApiResponseFormat.text; } +/** + * An object describing expected output of the model as text. + */ +@added(ServiceApiVersions.v2024_05_01_preview) +model AssistantsApiResponseFormatText extends AssistantsApiResponseFormat { + /** The type of response format being defined: `text` */ + type: ApiResponseFormat.text; +} + +/** + * An object describing expected output of the model as a JSON object. + */ +@added(ServiceApiVersions.v2024_05_01_preview) +model AssistantsApiResponseFormatJsonObject + extends AssistantsApiResponseFormat { + /** The type of response format being defined: `json_object` */ + type: ApiResponseFormat.jsonObject; +} + +/** + * An object describing expected output of the model to match a JSON schema. + */ +@added(ServiceApiVersions.v2025_01_01_preview) +model AssistantsApiResponseFormatJsonSchema + extends AssistantsApiResponseFormat { + /** The type of response format being defined: `json_schema` */ + type: ApiResponseFormat.jsonSchema; + + /** The JSON schema that the model must output. */ + @encodedName("application/json", "json_schema") + jsonSchema: { + /** A description of what the response format is for, used by the model to determine how to respond in the format. */ + description?: string; + + /** 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. */ + name: string; + + /** The schema for the response format, described as a JSON Schema object. */ + #suppress "@azure-tools/typespec-azure-core/no-unknown" "External API shape takes an arbitrary json" + schema: unknown; + + /** + * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the Structured Outputs guide. + */ + strict?: boolean; + }; +} + /** Possible API response formats. */ @added(ServiceApiVersions.v2024_05_01_preview) union ApiResponseFormat { @@ -147,4 +200,7 @@ union ApiResponseFormat { /** Using `json_object` format will limit the usage of ToolCall to only functions. */ jsonObject: "json_object", + + /** Using `json_schema` format will ensure the model matches the supplied JSON schema. */ + jsonSchema: "json_schema", } diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_run.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_run.json new file mode 100644 index 000000000000..e1afe8ae1b65 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_run.json @@ -0,0 +1,49 @@ +{ + "title": "Cancels a run that is `in_progress`.\n", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "runId": "run_abc123" + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699076126, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "cancelling", + "started_at": 1699076126, + "expires_at": 1699076726, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "You summarize books.", + "tools": [ + { + "type": "file_search" + } + ], + "tool_choice": "auto", + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "max_completion_tokens": 1000, + "max_prompt_tokens": 1000, + "incomplete_details": null, + "metadata": {}, + "usage": null, + "temperature": 1.0, + "top_p": 1.0, + "response_format": "auto" + } + } + }, + "operationId": "CancelRun" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_vector_store_file_batch.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_vector_store_file_batch.json new file mode 100644 index 000000000000..44e5e2e9b172 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/cancel_vector_store_file_batch.json @@ -0,0 +1,28 @@ +{ + "title": "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "batchId": "vsfb_abc123" + }, + "responses": { + "200": { + "body": { + "id": "vsfb_abc123", + "object": "vector_store.files_batch", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "status": "cancelling", + "file_counts": { + "in_progress": 12, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 15 + } + } + } + }, + "operationId": "CancelVectorStoreFileBatch" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_assistant.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_assistant.json new file mode 100644 index 000000000000..681c91a3127a --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_assistant.json @@ -0,0 +1,41 @@ +{ + "title": "Create an assistant with a model and instructions.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": { + "name": "Math Tutor", + "instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "model": "gpt-4-1106-preview" + } + }, + "responses": { + "200": { + "body": { + "id": "asst_4nsG2qgNzimRPE7MazXTXbU7", + "object": "assistant", + "created_at": 1707295707, + "name": "Math Tutor", + "description": null, + "model": "gpt-4-1106-preview", + "instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + } + } + }, + "operationId": "CreateAssistant" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_message.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_message.json new file mode 100644 index 000000000000..4a07c2d596ed --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_message.json @@ -0,0 +1,41 @@ +{ + "title": "Create a message.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", + "body": { + "role": "user", + "content": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces." + } + }, + "responses": { + "200": { + "body": { + "id": "msg_as3XIk1tpVP3hdHjWBGg3uG4", + "object": "thread.message", + "created_at": 1707298421, + "assistant_id": null, + "thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces.", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "attachments": [], + "metadata": {} + } + } + }, + "operationId": "CreateMessage" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_run.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_run.json new file mode 100644 index 000000000000..0468305bf829 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_run.json @@ -0,0 +1,51 @@ +{ + "title": "Create a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "body": { + "assistant_id": "asst_abc123" + } + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699063290, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": 1699063290, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699063291, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": {}, + "usage": null, + "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" + } + } + }, + "operationId": "CreateRun" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread.json new file mode 100644 index 000000000000..56e487effa24 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread.json @@ -0,0 +1,20 @@ +{ + "title": "Creates a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": {} + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread", + "created_at": 1707297136, + "tool_resources": {}, + "metadata": {} + } + } + }, + "operationId": "CreateThread" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread_and_run.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread_and_run.json new file mode 100644 index 000000000000..b82b725da44e --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_thread_and_run.json @@ -0,0 +1,55 @@ +{ + "title": "Create a thread and run it in one request.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": { + "assistant_id": "asst_abc123", + "thread": { + "messages": [ + { + "role": "user", + "content": "Explain deep learning to a 5 year old." + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699076792, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": null, + "expires_at": 1699077392, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "parallel_tool_calls": true, + "required_action": null, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "You are a helpful assistant.", + "tools": [], + "metadata": {}, + "temperature": 1.0, + "top_p": 1.0, + "max_completion_tokens": null, + "max_prompt_tokens": null, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "incomplete_details": null, + "usage": null, + "response_format": "auto", + "tool_choice": "auto" + } + } + }, + "operationId": "CreateThreadAndRun" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store.json new file mode 100644 index 000000000000..50d24262052d --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store.json @@ -0,0 +1,32 @@ +{ + "title": "Creates a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": { + "name": "Support FAQ" + } + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "completed", + "last_active_at": 1699061776, + "metadata": {}, + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + } + } + } + }, + "operationId": "CreateVectorStore" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file.json new file mode 100644 index 000000000000..4cfdaa21daed --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file.json @@ -0,0 +1,28 @@ +{ + "title": "Create a vector store file by attaching a File to a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "body": { + "file_id": "file-abc123" + } + }, + "responses": { + "200": { + "body": { + "id": "file-abc123", + "object": "vector_store.file", + "created_at": 1699061776, + "usage_bytes": 1234, + "vector_store_id": "vs_abcd", + "status": "completed", + "last_error": null, + "chunking_strategy": { + "type": "other" + } + } + } + }, + "operationId": "CreateVectorStoreFile" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file_batch.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file_batch.json new file mode 100644 index 000000000000..4516f263fa41 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/create_vector_store_file_batch.json @@ -0,0 +1,33 @@ +{ + "title": "Create a vector store file batch.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "body": { + "file_ids": [ + "file-abc123", + "file-abc456" + ] + } + }, + "responses": { + "200": { + "body": { + "id": "vsfb_abc123", + "object": "vector_store.files_batch", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "status": "in_progress", + "file_counts": { + "in_progress": 1, + "completed": 1, + "failed": 0, + "cancelled": 0, + "total": 0 + } + } + } + }, + "operationId": "CreateVectorStoreFileBatch" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_assistant.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_assistant.json new file mode 100644 index 000000000000..d9cd4484c672 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_assistant.json @@ -0,0 +1,18 @@ +{ + "title": "Deletes an assistant.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "assistantId": "asst_4nsG2qgNzimRPE7MazXTXbU7" + }, + "responses": { + "200": { + "body": { + "id": "asst_4nsG2qgNzimRPE7MazXTXbU7", + "object": "assistant.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteAssistant" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_file.json new file mode 100644 index 000000000000..c8c2ba38bb1f --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_file.json @@ -0,0 +1,18 @@ +{ + "title": "Delete a previously uploaded file.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + }, + "responses": { + "200": { + "body": { + "object": "file", + "deleted": true, + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + } + } + }, + "operationId": "DeleteFile" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_thread.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_thread.json new file mode 100644 index 000000000000..e9803e0f0a3e --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_thread.json @@ -0,0 +1,18 @@ +{ + "title": "Deletes a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx" + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteThread" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store.json new file mode 100644 index 000000000000..ad052d4e06d5 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store.json @@ -0,0 +1,18 @@ +{ + "title": "Deletes a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123 " + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteVectorStore" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store_file.json new file mode 100644 index 000000000000..b41982f004fd --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/delete_vector_store_file.json @@ -0,0 +1,19 @@ +{ + "title": "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 endpoint.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "fileId": "file_abc123" + }, + "responses": { + "200": { + "body": { + "id": "file_abc123", + "object": "vector_store.file.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteVectorStoreFile" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_assistant.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_assistant.json new file mode 100644 index 000000000000..49995ab2fb36 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_assistant.json @@ -0,0 +1,32 @@ +{ + "title": "Retrieves an assistant.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "assistantId": "asst_abc123" + }, + "responses": { + "200": { + "body": { + "id": "asst_4lMdCUN4lS2SQcHEy9CM1QIt", + "object": "assistant", + "created_at": 1718875084, + "name": "Math Tutor", + "description": null, + "model": "gpt-4-1106-preview", + "instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "top_p": 1.0, + "temperature": 1.0, + "tool_resources": {}, + "metadata": {}, + "response_format": "auto" + } + } + }, + "operationId": "GetAssistant" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file.json new file mode 100644 index 000000000000..af3ab4586d76 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file.json @@ -0,0 +1,23 @@ +{ + "title": "Returns a file", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2024-02-15-preview", + "fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + }, + "responses": { + "200": { + "body": { + "object": "file", + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", + "purpose": "assistants", + "filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", + "bytes": 4, + "created_at": 1718886199, + "status": "processed", + "status_details": null + } + } + }, + "operationId": "GetFile" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file_content.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file_content.json new file mode 100644 index 000000000000..834a00473cf4 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_file_content.json @@ -0,0 +1,14 @@ +{ + "title": "Returns the content of a file", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + }, + "responses": { + "200": { + "body": "file content" + } + }, + "operationId": "GetFileContent" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_message.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_message.json new file mode 100644 index 000000000000..75d37873ad10 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_message.json @@ -0,0 +1,38 @@ +{ + "title": "Retrieve a message.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", + "messageId": "msg_as3XIk1tpVP3hdHjWBGg3uG4" + }, + "responses": { + "200": { + "body": { + "id": "msg_as3XIk1tpVP3hdHjWBGg3uG4", + "object": "thread.message", + "created_at": 1707298421, + "thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces.", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "assistant_id": null, + "run_id": null, + "attachments": [], + "metadata": {} + } + } + }, + "operationId": "GetMessage" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run.json new file mode 100644 index 000000000000..f38321072cd4 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run.json @@ -0,0 +1,43 @@ +{ + "title": "Gets a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_eRNwflE3ncDYak1np6MdMHJh", + "runId": "run_HsO8tYM4K5AAMAHgK0J3om8Q" + }, + "responses": { + "200": { + "body": { + "id": "run_HsO8tYM4K5AAMAHgK0J3om8Q", + "object": "thread.run", + "created_at": 1707303196, + "assistant_id": "asst_JtTwHk28cIocgFXZPCBxhOzl", + "thread_id": "thread_eRNwflE3ncDYak1np6MdMHJh", + "status": "completed", + "incomplete_details": null, + "usage": null, + "started_at": 1707303197, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1707303201, + "parallel_tool_calls": true, + "max_prompt_tokens": 1000, + "max_completion_tokens": 1000, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "response_format": "auto", + "tool_choice": "auto", + "last_error": null, + "model": "gpt-4-1106-preview", + "instructions": "You are an AI model that empowers every person and every organization on the planet to achieve more.", + "tools": [], + "metadata": {} + } + } + }, + "operationId": "GetRun" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run_step.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run_step.json new file mode 100644 index 000000000000..5c7d221d7b14 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_run_step.json @@ -0,0 +1,42 @@ +{ + "title": "Retrieves a run step.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_eRNwflE3ncDYak1np6MdMHJh", + "runId": "run_HsO8tYM4K5AAMAHgK0J3om8Q", + "stepId": "step_abc123" + }, + "responses": { + "200": { + "body": { + "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 + }, + "metadata": {} + } + } + }, + "operationId": "GetRunStep" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_thread.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_thread.json new file mode 100644 index 000000000000..061c9f5a8a18 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_thread.json @@ -0,0 +1,24 @@ +{ + "title": "Retrieves a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx" + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread", + "created_at": 1707297136, + "metadata": {}, + "tool_resources": { + "code_interpreter": { + "file_ids": [] + } + } + } + } + }, + "operationId": "GetThread" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store.json new file mode 100644 index 000000000000..c09ca2bc9497 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store.json @@ -0,0 +1,30 @@ +{ + "title": "Retrieves a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123" + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "completed", + "last_active_at": 1699061776, + "metadata": {}, + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + } + } + } + }, + "operationId": "GetVectorStore" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file.json new file mode 100644 index 000000000000..16d3209f828a --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file.json @@ -0,0 +1,26 @@ +{ + "title": "Retrieves a vector store file.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "fileId": "file-abc123" + }, + "responses": { + "200": { + "body": { + "id": "file-abc123", + "object": "vector_store.file", + "created_at": 1699061776, + "usage_bytes": 123456, + "vector_store_id": "vs_abcd", + "status": "completed", + "last_error": null, + "chunking_strategy": { + "type": "other" + } + } + } + }, + "operationId": "GetVectorStoreFile" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file_batch.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file_batch.json new file mode 100644 index 000000000000..955fe8e8c59b --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/get_vector_store_file_batch.json @@ -0,0 +1,28 @@ +{ + "title": "Retrieves a vector store file batch.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "batchId": "vsfb_abc123" + }, + "responses": { + "200": { + "body": { + "id": "vsfb_abc123", + "object": "vector_store.files_batch", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "status": "in_progress", + "file_counts": { + "in_progress": 1, + "completed": 1, + "failed": 0, + "cancelled": 0, + "total": 0 + } + } + } + }, + "operationId": "GetVectorStoreFileBatch" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_assistants.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_assistants.json new file mode 100644 index 000000000000..905ae4662725 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_assistants.json @@ -0,0 +1,71 @@ +{ + "title": "Returns a list of assistants.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "order": "desc", + "limit": 20 + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1707257477, + "name": "Stock Analyst", + "description": null, + "model": "gpt-4-1106-preview", + "instructions": "You are a financial analyst that analyzes stock market prices and other financial data present on user uploaded files or by calling external APIs.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + }, + { + "id": "asst_abc456", + "object": "assistant", + "created_at": 1698982718, + "name": "My Assistant", + "description": null, + "model": "gpt-4-turbo", + "instructions": "You are a helpful assistant designed to make me better at coding!", + "tools": [], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + }, + { + "id": "asst_abc789", + "object": "assistant", + "created_at": 1698982643, + "name": null, + "description": null, + "model": "gpt-4-turbo", + "instructions": "", + "tools": [], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + } + ], + "first_id": "asst_abc123", + "last_id": "asst_abc789", + "has_more": false + } + } + }, + "operationId": "ListAssistants" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_file.json new file mode 100644 index 000000000000..0c8cf76d18d9 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_file.json @@ -0,0 +1,38 @@ +{ + "title": "Returns a list of files filtered by purpose", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "purpose": "assistants" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "file", + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", + "purpose": "assistants", + "filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", + "bytes": 4, + "created_at": 1718886199, + "status": "processed", + "status_details": null + }, + { + "object": "file", + "id": "assistant-D6AmXzgJ6gyGcgT48OmJ8kYc", + "purpose": "assistants", + "filename": "test07a45e38-9b88-449a-9580-94fdb986eb75.txt", + "bytes": 4, + "created_at": 1718886043, + "status": "processed", + "status_details": null + } + ] + } + } + }, + "operationId": "ListFiles" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_messages.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_messages.json new file mode 100644 index 000000000000..994f4efd0390 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_messages.json @@ -0,0 +1,69 @@ +{ + "title": "List Messages", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699016383, + "assistant_id": null, + "thread_id": "thread_abc123", + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "attachments": [], + "metadata": {} + }, + { + "id": "msg_abc456", + "object": "thread.message", + "created_at": 1699016383, + "assistant_id": null, + "thread_id": "thread_abc123", + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "Hello, what is AI?", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "attachments": [], + "metadata": {} + } + ], + "first_id": "msg_abc123", + "last_id": "msg_abc456", + "has_more": false + } + } + }, + "operationId": "ListMessages" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_run_steps.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_run_steps.json new file mode 100644 index 000000000000..a42ac3449ae0 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_run_steps.json @@ -0,0 +1,49 @@ +{ + "title": "Returns a list of run steps belonging to a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "runId": "run_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "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 + }, + "metadata": {} + } + ], + "first_id": "step_abc123", + "last_id": "step_abc456", + "has_more": false + } + } + }, + "operationId": "ListRunSteps" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_runs.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_runs.json new file mode 100644 index 000000000000..b03a500622cd --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_runs.json @@ -0,0 +1,99 @@ +{ + "title": "Returns a list of runs belonging to a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": {}, + "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" + }, + { + "id": "run_abc456", + "object": "thread.run", + "created_at": 1699063290, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699063290, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699063291, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": {}, + "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" + } + ], + "first_id": "run_abc123", + "last_id": "run_abc456", + "has_more": false + } + } + }, + "operationId": "ListRuns" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_file_batch_files.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_file_batch_files.json new file mode 100644 index 000000000000..a69f4f89ae29 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_file_batch_files.json @@ -0,0 +1,46 @@ +{ + "title": "Returns a list of vector store files of a given batch.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "batchId": "batch-abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "file-abc123", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + }, + { + "id": "file-abc456", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + } + ], + "first_id": "file-abc123", + "last_id": "file-abc456", + "has_more": false + } + } + }, + "operationId": "ListVectorStoreFileBatchFiles" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_files.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_files.json new file mode 100644 index 000000000000..5d8062cf8589 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_store_files.json @@ -0,0 +1,45 @@ +{ + "title": "Returns a list of vector store files.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "file-abc123", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + }, + { + "id": "file-abc456", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + } + ], + "first_id": "file-abc123", + "last_id": "file-abc456", + "has_more": false + } + } + }, + "operationId": "ListVectorStoreFiles" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_stores.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_stores.json new file mode 100644 index 000000000000..f30be4521569 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/list_vector_stores.json @@ -0,0 +1,54 @@ +{ + "title": "Returns a list of vector stores.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "in_progress", + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + }, + "last_active_at": 1699061776, + "metadata": {} + }, + { + "id": "vs_abc456", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ v2", + "usage_bytes": 139920, + "status": "in_progress", + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + }, + "last_active_at": 1699061776, + "metadata": {} + } + ], + "first_id": "vs_abc123", + "last_id": "vs_abc456", + "has_more": false + } + } + }, + "operationId": "ListVectorStores" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/modify_vector_store.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/modify_vector_store.json new file mode 100644 index 000000000000..27ad3552de68 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/modify_vector_store.json @@ -0,0 +1,33 @@ +{ + "title": "Modifies a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "body": { + "name": "Support FAQ" + } + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "completed", + "last_active_at": 1699061776, + "metadata": {}, + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + } + } + } + }, + "operationId": "ModifyVectorStore" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/submit_tool_outputs_to_run.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/submit_tool_outputs_to_run.json new file mode 100644 index 000000000000..ce162f9badb8 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/submit_tool_outputs_to_run.json @@ -0,0 +1,80 @@ +{ + "title": "When a run has the `status: \"requires_action\"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.\n", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_123", + "runId": "run_123", + "body": { + "tool_outputs": [ + { + "tool_call_id": "call_001", + "output": "70 degrees and sunny." + } + ] + } + }, + "responses": { + "200": { + "body": { + "id": "run_123", + "object": "thread.run", + "created_at": 1699075592, + "assistant_id": "asst_123", + "thread_id": "thread_123", + "status": "queued", + "started_at": 1699075592, + "expires_at": 1699076192, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "tools": [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": [ + "celsius", + "fahrenheit" + ] + } + }, + "required": [ + "location" + ] + } + } + } + ], + "metadata": {}, + "usage": null, + "temperature": 1.0, + "top_p": 1.0, + "incomplete_details": null, + "max_prompt_tokens": 1000, + "max_completion_tokens": 1000, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "response_format": "auto", + "tool_choice": "auto" + } + } + }, + "operationId": "SubmitToolOutputsToRun" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_assistant.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_assistant.json new file mode 100644 index 000000000000..f73ce276994b --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_assistant.json @@ -0,0 +1,45 @@ +{ + "title": "Modifies an assistant.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "assistantId": "asst_abc123", + "body": { + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + "tools": [ + { + "type": "file_search" + } + ], + "model": "gpt-4-turbo" + } + }, + "responses": { + "200": { + "body": { + "id": "asst_123", + "object": "assistant", + "created_at": 1699009709, + "name": "HR Helper", + "description": null, + "model": "gpt-4-turbo", + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + "tools": [ + { + "type": "file_search" + } + ], + "tool_resources": { + "file_search": { + "vector_store_ids": [] + } + }, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + } + } + }, + "operationId": "UpdateAssistant" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_message.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_message.json new file mode 100644 index 000000000000..cbf06632e75b --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_message.json @@ -0,0 +1,47 @@ +{ + "title": "Modify a message.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "messageId": "msg_abc123 ", + "body": { + "metadata": { + "modified": "true", + "user": "abc123" + } + } + }, + "responses": { + "200": { + "body": { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699017614, + "assistant_id": null, + "thread_id": "thread_abc123", + "status": "complete", + "incomplete_details": null, + "completed_at": 1699017614, + "incomplete_at": null, + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "attachments": [], + "metadata": { + "modified": "true", + "user": "abc123" + } + } + } + }, + "operationId": "UpdateMessage" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_run.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_run.json new file mode 100644 index 000000000000..0169fcc9e0c4 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_run.json @@ -0,0 +1,60 @@ +{ + "title": "Modifies a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "runId": "run_abc123", + "body": { + "metadata": { + "user_id": "user_abc123" + } + } + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": { + "user_id": "user_abc123" + }, + "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" + } + } + }, + "operationId": "UpdateRun" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_thread.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_thread.json new file mode 100644 index 000000000000..92819d554035 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/update_thread.json @@ -0,0 +1,29 @@ +{ + "title": "Modifies a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", + "body": { + "metadata": { + "modified": "true", + "user": "abc123" + } + } + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread", + "created_at": 1707297136, + "metadata": { + "modified": "true", + "user": "abc123" + }, + "tool_resources": {} + } + } + }, + "operationId": "UpdateThread" +} diff --git a/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/upload_file.json b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/upload_file.json new file mode 100644 index 000000000000..a2de8664f909 --- /dev/null +++ b/specification/ai/OpenAI.Assistants/examples/2025-01-01-preview/upload_file.json @@ -0,0 +1,30 @@ +{ + "title": "Uploads a file", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "purpose": "assistants", + "file": [ + 0, + 1, + 0, + 1, + 0 + ] + }, + "responses": { + "200": { + "body": { + "object": "file", + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", + "purpose": "assistants", + "filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", + "bytes": 4, + "created_at": 1718886199, + "status": "processed", + "status_details": null + } + } + }, + "operationId": "UploadFile" +} diff --git a/specification/ai/OpenAI.Assistants/main.tsp b/specification/ai/OpenAI.Assistants/main.tsp index be4fe1e1ab7a..13e94f3e49b4 100644 --- a/specification/ai/OpenAI.Assistants/main.tsp +++ b/specification/ai/OpenAI.Assistants/main.tsp @@ -70,5 +70,9 @@ namespace Azure.AI.OpenAI.Assistants { @useDependency(Azure.Core.Versions.v1_0_Preview_2) @doc("The October 2024 preview release for Azure OpenAI.") v2024_10_01_Preview: "2024-10-01-preview", + + @useDependency(Azure.Core.Versions.v1_0_Preview_2) + @doc("The December 2024 preview release for Azure OpenAI.") + v2025_01_01_preview: "2025-01-01-preview", } } diff --git a/specification/ai/OpenAI.Assistants/run_steps/routes.tsp b/specification/ai/OpenAI.Assistants/run_steps/routes.tsp index f038461dc5c1..759819752c2c 100644 --- a/specification/ai/OpenAI.Assistants/run_steps/routes.tsp +++ b/specification/ai/OpenAI.Assistants/run_steps/routes.tsp @@ -28,6 +28,11 @@ op getRunStep( @path threadId: string, @path runId: string, @path stepId: string, + + /** A list of additional fields to include in the response. */ + @added(ServiceApiVersions.v2025_01_01_preview) + @query("include[]") + runInclude?: RunIncludes[], ): RunStep; /** @@ -47,5 +52,11 @@ op getRunStep( op listRunSteps( @path threadId: string, @path runId: string, + + /** A list of additional fields to include in the response. */ + @added(ServiceApiVersions.v2025_01_01_preview) + @query("include[]") + runInclude?: RunIncludes[], + ...OpenAIListRequestOptions, ): OpenAIPageableListOf; diff --git a/specification/ai/OpenAI.Assistants/runs/models.tsp b/specification/ai/OpenAI.Assistants/runs/models.tsp index fa75790192e5..ea86711532c9 100644 --- a/specification/ai/OpenAI.Assistants/runs/models.tsp +++ b/specification/ai/OpenAI.Assistants/runs/models.tsp @@ -184,6 +184,17 @@ model RunCompletionUsage { totalTokens: int64; } +/** + * Values to for the includes parameter in the create run operation. + */ +@added(ServiceApiVersions.v2025_01_01_preview) +union RunIncludes { + string, + + /** Fetch the file search result content. */ + fileSearchContent: "step_details.tool_calls[*].file_search.results[*].content", +} + @doc("The details used when creating a new run of an assistant thread.") @added(ServiceApiVersions.v2024_02_15_preview) model CreateRunOptions { diff --git a/specification/ai/OpenAI.Assistants/runs/routes.tsp b/specification/ai/OpenAI.Assistants/runs/routes.tsp index 44748b3f8799..38b144a25c5d 100644 --- a/specification/ai/OpenAI.Assistants/runs/routes.tsp +++ b/specification/ai/OpenAI.Assistants/runs/routes.tsp @@ -31,6 +31,11 @@ namespace Azure.AI.OpenAI.Assistants; op createRun( @path threadId: string, + /** A list of additional fields to include in the response. */ + @added(ServiceApiVersions.v2025_01_01_preview) + @query("include[]") + runInclude?: RunIncludes[], + /** * The details used when creating a new run of an assistant thread. */ diff --git a/specification/ai/OpenAI.Assistants/tools/models.tsp b/specification/ai/OpenAI.Assistants/tools/models.tsp index b5dbc36a2ef6..fe0846691261 100644 --- a/specification/ai/OpenAI.Assistants/tools/models.tsp +++ b/specification/ai/OpenAI.Assistants/tools/models.tsp @@ -161,9 +161,40 @@ model RunStepFileSearchToolCall extends RunStepToolCall { @doc("The object type, which is always 'file_search'.") type: "file_search"; - @doc("Reserved for future use.") + /** The results of the file search. */ + @typeChangedFrom(ServiceApiVersions.v2025_01_01_preview, Record) @encodedName("application/json", "file_search") - fileSearch: Record; + fileSearch: FileSearchToolCallResult[]; +} + +/** File search tool call result */ +@added(ServiceApiVersions.v2025_01_01_preview) +model FileSearchToolCallResult { + /** The ID of the file that result was found in. */ + @encodedName("application/json", "file_id") + fileId: string; + + /** The name of the file that result was found in. */ + @encodedName("application/json", "file_name") + fileName: string; + + /** The score of the result. All values must be a floating point number between 0 and 1. */ + @minValue(0) + @maxValue(1) + score: float64; + + /** The content of the result that was found. The content is only included if requested via the include query parameter. */ + content?: FileSearchToolCallResultContentItem[]; +} + +/** Content item in a file search result */ +@added(ServiceApiVersions.v2025_01_01_preview) +model FileSearchToolCallResultContentItem { + /** The type of the content. */ + type?: "text"; + + /** The text content of the file. */ + text?: string; } @doc(""" diff --git a/specification/ai/OpenAI.Assistants/tspconfig.yaml b/specification/ai/OpenAI.Assistants/tspconfig.yaml index 7484a8f6027e..5354f1c9db9b 100644 --- a/specification/ai/OpenAI.Assistants/tspconfig.yaml +++ b/specification/ai/OpenAI.Assistants/tspconfig.yaml @@ -34,6 +34,7 @@ options: partial-update: true enable-sync-stack: true generate-tests: false + generate-samples: false custom-types-subpackage: "implementation.models" custom-types: "FileListResponse,OpenAIPageableListOfAssistant,OpenAIPageableListOfRunStep,OpenAIPageableListOfThreadMessage,OpenAIPageableListOfThreadRun,OpenAIPageableListOfVectorStore,OpenAIPageableListOfVectorStoreFile" flavor: azure diff --git a/specification/ai/OpenAI.Assistants/vector_stores/files/models.tsp b/specification/ai/OpenAI.Assistants/vector_stores/files/models.tsp index 17edc28f6d21..fc7cd63a817a 100644 --- a/specification/ai/OpenAI.Assistants/vector_stores/files/models.tsp +++ b/specification/ai/OpenAI.Assistants/vector_stores/files/models.tsp @@ -44,16 +44,32 @@ union VectorStoreFileErrorCode { string, /** An internal error occurred. */ + @removed(ServiceApiVersions.v2025_01_01_preview) internalError: "internal_error", /** The file was not found. */ + @removed(ServiceApiVersions.v2025_01_01_preview) fileNotFound: "file_not_found", /** The file could not be parsed. */ + @removed(ServiceApiVersions.v2025_01_01_preview) parsingError: "parsing_error", /** The file has an unhandled mime type. */ + @removed(ServiceApiVersions.v2025_01_01_preview) unhandledMimeType: "unhandled_mime_type", + + /** The server encountered an error. */ + @added(ServiceApiVersions.v2025_01_01_preview) + serverError: "server_error", + + /** The file format is not supported. */ + @added(ServiceApiVersions.v2025_01_01_preview) + unsupportedFile: "unsupported_file", + + /** The file is invalid. */ + @added(ServiceApiVersions.v2025_01_01_preview) + invalidFile: "invalid_file", } /** Details on the error that may have ocurred while processing a file for this vector store */ diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-02-15-preview/assistants_generated.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-02-15-preview/assistants_generated.json index e0e6a4265818..42858e79a2be 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-02-15-preview/assistants_generated.json +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-02-15-preview/assistants_generated.json @@ -111,7 +111,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -686,7 +686,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -928,7 +928,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1212,7 +1212,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-05-01-preview/assistants_generated.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-05-01-preview/assistants_generated.json index b4ab33219b56..b2e2502ccb3b 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-05-01-preview/assistants_generated.json +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-05-01-preview/assistants_generated.json @@ -111,7 +111,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -729,7 +729,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -971,7 +971,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1255,7 +1255,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1503,7 +1503,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1908,7 +1908,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -2068,7 +2068,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -3983,7 +3983,7 @@ "properties": { "file_search": { "type": "object", - "description": "Reserved for future use.", + "description": "The results of the file search.", "additionalProperties": { "type": "string" }, diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-07-01-preview/assistants_generated.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-07-01-preview/assistants_generated.json index 968bda0d9e3b..f3700608a010 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-07-01-preview/assistants_generated.json +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-07-01-preview/assistants_generated.json @@ -111,7 +111,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -729,7 +729,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -971,7 +971,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1255,7 +1255,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1503,7 +1503,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1913,7 +1913,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -2073,7 +2073,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -4014,7 +4014,7 @@ "properties": { "file_search": { "type": "object", - "description": "Reserved for future use.", + "description": "The results of the file search.", "additionalProperties": { "type": "string" }, diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-09-01-preview/assistants_generated.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-09-01-preview/assistants_generated.json index a86fd19d1613..2b1020b3be36 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-09-01-preview/assistants_generated.json +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-09-01-preview/assistants_generated.json @@ -111,7 +111,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -729,7 +729,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -971,7 +971,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1255,7 +1255,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1503,7 +1503,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1913,7 +1913,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -2073,7 +2073,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -4026,7 +4026,7 @@ "properties": { "file_search": { "type": "object", - "description": "Reserved for future use.", + "description": "The results of the file search.", "additionalProperties": { "type": "string" }, diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-10-01-preview/assistants_generated.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-10-01-preview/assistants_generated.json index 54bf316790fe..601f3ea9d65d 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-10-01-preview/assistants_generated.json +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2024-10-01-preview/assistants_generated.json @@ -111,7 +111,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -729,7 +729,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -971,7 +971,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1255,7 +1255,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1503,7 +1503,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -1913,7 +1913,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -2073,7 +2073,7 @@ { "name": "before", "in": "query", - "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.", + "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, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", "required": false, "type": "string" } @@ -4026,7 +4026,7 @@ "properties": { "file_search": { "type": "object", - "description": "Reserved for future use.", + "description": "The results of the file search.", "additionalProperties": { "type": "string" }, diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/assistants_generated.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/assistants_generated.json new file mode 100644 index 000000000000..50e2093fe658 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/assistants_generated.json @@ -0,0 +1,5735 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure OpenAI", + "version": "2025-01-01-preview", + "description": "Azure OpenAI APIs for Assistants.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "An OpenAI endpoint supporting assistants functionality.", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "ApiKeyAuth": [] + }, + { + "OAuth2Auth": [ + "https://cognitiveservices.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "ApiKeyAuth": { + "type": "apiKey", + "name": "api-key", + "in": "header" + }, + "OAuth2Auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + "scopes": { + "https://cognitiveservices.azure.com/.default": "" + } + } + }, + "tags": [], + "paths": { + "/assistants": { + "get": { + "operationId": "ListAssistants", + "description": "Gets a list of assistants that were previously created.", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested list of assistants.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/Assistant" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "Returns a list of assistants.": { + "$ref": "./examples/list_assistants.json" + } + } + }, + "post": { + "operationId": "CreateAssistant", + "description": "Creates a new assistant.", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "The request details to use when creating a new assistant.", + "required": true, + "schema": { + "$ref": "#/definitions/AssistantCreationOptions" + } + } + ], + "responses": { + "200": { + "description": "The new assistant instance.", + "schema": { + "$ref": "#/definitions/Assistant" + } + } + }, + "x-ms-examples": { + "Create an assistant with a model and instructions.": { + "$ref": "./examples/create_assistant.json" + } + } + } + }, + "/assistants/{assistantId}": { + "get": { + "operationId": "GetAssistant", + "description": "Retrieves an existing assistant.", + "parameters": [ + { + "name": "assistantId", + "in": "path", + "description": "The ID of the assistant to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested assistant instance.", + "schema": { + "$ref": "#/definitions/Assistant" + } + } + }, + "x-ms-examples": { + "Retrieves an assistant.": { + "$ref": "./examples/get_assistant.json" + } + } + }, + "post": { + "operationId": "UpdateAssistant", + "description": "Modifies an existing assistant.", + "parameters": [ + { + "name": "assistantId", + "in": "path", + "description": "The ID of the assistant to modify.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "The request details to use when modifying an existing assistant.", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAssistantOptions" + } + } + ], + "responses": { + "200": { + "description": "The updated assistant instance.", + "schema": { + "$ref": "#/definitions/Assistant" + } + } + }, + "x-ms-examples": { + "Modifies an assistant.": { + "$ref": "./examples/update_assistant.json" + } + } + }, + "delete": { + "operationId": "DeleteAssistant", + "description": "Deletes an assistant.", + "parameters": [ + { + "name": "assistantId", + "in": "path", + "description": "The ID of the assistant to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Status information about the requested deletion operation.", + "schema": { + "$ref": "#/definitions/AssistantDeletionStatus" + } + } + }, + "x-ms-examples": { + "Deletes an assistant.": { + "$ref": "./examples/delete_assistant.json" + } + } + } + }, + "/files": { + "get": { + "operationId": "ListFiles", + "description": "Gets a list of previously uploaded files.", + "parameters": [ + { + "name": "purpose", + "in": "query", + "description": "A value that, when provided, limits list results to files matching the corresponding purpose.", + "required": false, + "type": "string", + "enum": [ + "fine-tune", + "fine-tune-results", + "assistants", + "assistants_output", + "batch", + "batch_output", + "vision" + ], + "x-ms-enum": { + "name": "FilePurpose", + "modelAsString": true, + "values": [ + { + "name": "fineTune", + "value": "fine-tune", + "description": "Indicates a file is used for fine tuning input." + }, + { + "name": "fineTuneResults", + "value": "fine-tune-results", + "description": "Indicates a file is used for fine tuning results." + }, + { + "name": "assistants", + "value": "assistants", + "description": "Indicates a file is used as input to assistants." + }, + { + "name": "assistantsOutput", + "value": "assistants_output", + "description": "Indicates a file is used as output by assistants." + }, + { + "name": "batch", + "value": "batch", + "description": "Indicates a file is used as input to ." + }, + { + "name": "batchOutput", + "value": "batch_output", + "description": "Indicates a file is used as output by a vector store batch operation." + }, + { + "name": "vision", + "value": "vision", + "description": "Indicates a file is used as input to a vision operation." + } + ] + } + } + ], + "responses": { + "200": { + "description": "The requested list of files.", + "schema": { + "$ref": "#/definitions/FileListResponse" + } + } + }, + "x-ms-examples": { + "Returns a list of files filtered by purpose": { + "$ref": "./examples/list_file.json" + } + } + }, + "post": { + "operationId": "UploadFile", + "description": "Uploads a file for use by other operations.", + "consumes": [ + "multipart/form-data" + ], + "parameters": [ + { + "name": "file", + "in": "formData", + "description": "The file data (not filename) to upload.", + "required": true, + "type": "file" + }, + { + "name": "purpose", + "in": "formData", + "description": "The intended purpose of the file.", + "required": true, + "type": "string", + "enum": [ + "fine-tune", + "fine-tune-results", + "assistants", + "assistants_output", + "batch", + "batch_output", + "vision" + ], + "x-ms-enum": { + "name": "FilePurpose", + "modelAsString": true, + "values": [ + { + "name": "fineTune", + "value": "fine-tune", + "description": "Indicates a file is used for fine tuning input." + }, + { + "name": "fineTuneResults", + "value": "fine-tune-results", + "description": "Indicates a file is used for fine tuning results." + }, + { + "name": "assistants", + "value": "assistants", + "description": "Indicates a file is used as input to assistants." + }, + { + "name": "assistantsOutput", + "value": "assistants_output", + "description": "Indicates a file is used as output by assistants." + }, + { + "name": "batch", + "value": "batch", + "description": "Indicates a file is used as input to ." + }, + { + "name": "batchOutput", + "value": "batch_output", + "description": "Indicates a file is used as output by a vector store batch operation." + }, + { + "name": "vision", + "value": "vision", + "description": "Indicates a file is used as input to a vision operation." + } + ] + } + }, + { + "name": "filename", + "in": "formData", + "description": "A filename to associate with the uploaded data.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "A representation of the uploaded file.", + "schema": { + "$ref": "#/definitions/OpenAIFile" + } + } + }, + "x-ms-examples": { + "Uploads a file": { + "$ref": "./examples/upload_file.json" + } + } + } + }, + "/files/{fileId}": { + "get": { + "operationId": "GetFile", + "description": "Returns information about a specific file. Does not retrieve file content.", + "parameters": [ + { + "name": "fileId", + "in": "path", + "description": "The ID of the file to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/OpenAIFile" + } + } + }, + "x-ms-examples": { + "Returns a file": { + "$ref": "./examples/get_file.json" + } + } + }, + "delete": { + "operationId": "DeleteFile", + "description": "Delete a previously uploaded file.", + "parameters": [ + { + "name": "fileId", + "in": "path", + "description": "The ID of the file to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/FileDeletionStatus" + } + } + }, + "x-ms-examples": { + "Delete a previously uploaded file.": { + "$ref": "./examples/delete_file.json" + } + } + } + }, + "/files/{fileId}/content": { + "get": { + "operationId": "GetFileContent", + "description": "Returns information about a specific file. Does not retrieve file content.", + "parameters": [ + { + "name": "fileId", + "in": "path", + "description": "The ID of the file to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "string", + "format": "byte" + } + } + }, + "x-ms-examples": { + "Returns the content of a file": { + "$ref": "./examples/get_file_content.json" + } + } + } + }, + "/threads": { + "post": { + "operationId": "CreateThread", + "description": "Creates a new thread. Threads contain messages and can be run by assistants.", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "The details used to create a new assistant thread.", + "required": true, + "schema": { + "$ref": "#/definitions/AssistantThreadCreationOptions" + } + } + ], + "responses": { + "200": { + "description": "Information about the newly created thread.", + "schema": { + "$ref": "#/definitions/AssistantThread" + } + } + }, + "x-ms-examples": { + "Creates a thread.": { + "$ref": "./examples/create_thread.json" + } + } + } + }, + "/threads/{threadId}": { + "get": { + "operationId": "GetThread", + "description": "Gets information about an existing thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to retrieve information about.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Information about the requested thread.", + "schema": { + "$ref": "#/definitions/AssistantThread" + } + } + }, + "x-ms-examples": { + "Retrieves a thread.": { + "$ref": "./examples/get_thread.json" + } + } + }, + "post": { + "operationId": "UpdateThread", + "description": "Modifies an existing thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to modify.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "The details used to update an existing assistant thread.", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAssistantThreadOptions" + } + } + ], + "responses": { + "200": { + "description": "Information about the modified thread.", + "schema": { + "$ref": "#/definitions/AssistantThread" + } + } + }, + "x-ms-examples": { + "Modifies a thread.": { + "$ref": "./examples/update_thread.json" + } + } + }, + "delete": { + "operationId": "DeleteThread", + "description": "Deletes an existing thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Status information about the requested thread deletion operation.", + "schema": { + "$ref": "#/definitions/ThreadDeletionStatus" + } + } + }, + "x-ms-examples": { + "Deletes a thread.": { + "$ref": "./examples/delete_thread.json" + } + } + } + }, + "/threads/{threadId}/messages": { + "get": { + "operationId": "ListMessages", + "description": "Gets a list of messages that exist on a thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to list messages from.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "query", + "description": "Filter messages by the run ID that generated them.", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested list of messages.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/ThreadMessage" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "List Messages": { + "$ref": "./examples/list_messages.json" + } + } + }, + "post": { + "operationId": "CreateMessage", + "description": "Creates a new message on a specified thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to create the new message on.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "A single message within an assistant thread, as provided during that thread's creation for its initial state.", + "required": true, + "schema": { + "$ref": "#/definitions/ThreadMessageOptions" + } + } + ], + "responses": { + "200": { + "description": "A representation of the new message.", + "schema": { + "$ref": "#/definitions/ThreadMessage" + } + } + }, + "x-ms-examples": { + "Create a message.": { + "$ref": "./examples/create_message.json" + } + } + } + }, + "/threads/{threadId}/messages/{messageId}": { + "get": { + "operationId": "GetMessage", + "description": "Gets an existing message from an existing thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to retrieve the specified message from.", + "required": true, + "type": "string" + }, + { + "name": "messageId", + "in": "path", + "description": "The ID of the message to retrieve from the specified thread.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "A representation of the requested message.", + "schema": { + "$ref": "#/definitions/ThreadMessage" + } + } + }, + "x-ms-examples": { + "Retrieve a message.": { + "$ref": "./examples/get_message.json" + } + } + }, + "post": { + "operationId": "UpdateMessage", + "description": "Modifies an existing message on an existing thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread containing the specified message to modify.", + "required": true, + "type": "string" + }, + { + "name": "messageId", + "in": "path", + "description": "The ID of the message to modify on the specified thread.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "A representation of the modified message.", + "schema": { + "$ref": "#/definitions/ThreadMessage" + } + } + }, + "x-ms-examples": { + "Modify a message.": { + "$ref": "./examples/update_message.json" + } + } + } + }, + "/threads/{threadId}/runs": { + "get": { + "operationId": "ListRuns", + "description": "Gets a list of runs for a specified thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to list runs from.", + "required": true, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested list of thread runs.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/ThreadRun" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "Returns a list of runs belonging to a thread.": { + "$ref": "./examples/list_runs.json" + } + } + }, + "post": { + "operationId": "CreateRun", + "description": "Creates a new run for an assistant thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to run.", + "required": true, + "type": "string" + }, + { + "name": "include[]", + "in": "query", + "description": "A list of additional fields to include in the response.", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "step_details.tool_calls[*].file_search.results[*].content" + ], + "x-ms-enum": { + "name": "RunIncludes", + "modelAsString": true, + "values": [ + { + "name": "fileSearchContent", + "value": "step_details.tool_calls[*].file_search.results[*].content", + "description": "Fetch the file search result content." + } + ] + } + }, + "collectionFormat": "csv", + "x-ms-client-name": "runInclude" + }, + { + "name": "body", + "in": "body", + "description": "The details used when creating a new run of an assistant thread.", + "required": true, + "schema": { + "$ref": "#/definitions/CreateRunOptions" + } + } + ], + "responses": { + "200": { + "description": "Information about the new thread run.", + "schema": { + "$ref": "#/definitions/ThreadRun" + } + } + }, + "x-ms-examples": { + "Create a run.": { + "$ref": "./examples/create_run.json" + } + } + } + }, + "/threads/{threadId}/runs/{runId}": { + "get": { + "operationId": "GetRun", + "description": "Gets an existing run from an existing thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread to retrieve run information from.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "path", + "description": "The ID of the thread to retrieve information about.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested information about the specified thread run.", + "schema": { + "$ref": "#/definitions/ThreadRun" + } + } + }, + "x-ms-examples": { + "Gets a run.": { + "$ref": "./examples/get_run.json" + } + } + }, + "post": { + "operationId": "UpdateRun", + "description": "Modifies an existing thread run.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread associated with the specified run.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "path", + "description": "The ID of the run to modify.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "Information about the modified run.", + "schema": { + "$ref": "#/definitions/ThreadRun" + } + } + }, + "x-ms-examples": { + "Modifies a run.": { + "$ref": "./examples/update_run.json" + } + } + } + }, + "/threads/{threadId}/runs/{runId}/cancel": { + "post": { + "operationId": "CancelRun", + "description": "Cancels a run of an in progress thread.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread being run.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "path", + "description": "The ID of the run to cancel.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "Updated information about the cancelled run.", + "schema": { + "$ref": "#/definitions/ThreadRun" + } + } + }, + "x-ms-examples": { + "Cancels a run that is `in_progress`.\n": { + "$ref": "./examples/cancel_run.json" + } + } + } + }, + "/threads/{threadId}/runs/{runId}/steps": { + "get": { + "operationId": "ListRunSteps", + "description": "Gets a list of run steps from a thread run.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread that was run.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "path", + "description": "The ID of the run to list steps from.", + "required": true, + "type": "string" + }, + { + "name": "include[]", + "in": "query", + "description": "A list of additional fields to include in the response.", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "step_details.tool_calls[*].file_search.results[*].content" + ], + "x-ms-enum": { + "name": "RunIncludes", + "modelAsString": true, + "values": [ + { + "name": "fileSearchContent", + "value": "step_details.tool_calls[*].file_search.results[*].content", + "description": "Fetch the file search result content." + } + ] + } + }, + "collectionFormat": "csv", + "x-ms-client-name": "runInclude" + }, + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The requested list of run steps.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/RunStep" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "Returns a list of run steps belonging to a run.": { + "$ref": "./examples/list_run_steps.json" + } + } + } + }, + "/threads/{threadId}/runs/{runId}/steps/{stepId}": { + "get": { + "operationId": "GetRunStep", + "description": "Gets a single run step from a thread run.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread that was run.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "path", + "description": "The ID of the specific run to retrieve the step from.", + "required": true, + "type": "string" + }, + { + "name": "stepId", + "in": "path", + "description": "The ID of the step to retrieve information about.", + "required": true, + "type": "string" + }, + { + "name": "include[]", + "in": "query", + "description": "A list of additional fields to include in the response.", + "required": false, + "type": "array", + "items": { + "type": "string", + "enum": [ + "step_details.tool_calls[*].file_search.results[*].content" + ], + "x-ms-enum": { + "name": "RunIncludes", + "modelAsString": true, + "values": [ + { + "name": "fileSearchContent", + "value": "step_details.tool_calls[*].file_search.results[*].content", + "description": "Fetch the file search result content." + } + ] + } + }, + "collectionFormat": "csv", + "x-ms-client-name": "runInclude" + } + ], + "responses": { + "200": { + "description": "Information about the requested run step.", + "schema": { + "$ref": "#/definitions/RunStep" + } + } + }, + "x-ms-examples": { + "Retrieves a run step.": { + "$ref": "./examples/get_run_step.json" + } + } + } + }, + "/threads/{threadId}/runs/{runId}/submit_tool_outputs": { + "post": { + "operationId": "SubmitToolOutputsToRun", + "description": "Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a status of 'requires_action' with a required_action.type of 'submit_tool_outputs'.", + "parameters": [ + { + "name": "threadId", + "in": "path", + "description": "The ID of the thread that was run.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "path", + "description": "The ID of the run that requires tool outputs.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "tool_outputs": { + "type": "array", + "description": "A list of tools for which the outputs are being submitted.", + "items": { + "$ref": "#/definitions/ToolOutput" + }, + "x-ms-client-name": "toolOutputs", + "x-ms-identifiers": [] + }, + "stream": { + "type": "boolean", + "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.", + "x-nullable": true + } + }, + "required": [ + "tool_outputs" + ] + } + } + ], + "responses": { + "200": { + "description": "Updated information about the run.", + "schema": { + "$ref": "#/definitions/ThreadRun" + } + } + }, + "x-ms-examples": { + "When a run has the `status: \"requires_action\"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.\n": { + "$ref": "./examples/submit_tool_outputs_to_run.json" + } + } + } + }, + "/threads/runs": { + "post": { + "operationId": "CreateThreadAndRun", + "description": "Creates a new assistant thread and immediately starts a run using that new thread.", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "The details used when creating and immediately running a new assistant thread.", + "required": true, + "schema": { + "$ref": "#/definitions/CreateAndRunThreadOptions" + } + } + ], + "responses": { + "200": { + "description": "Information about the newly created thread.", + "schema": { + "$ref": "#/definitions/ThreadRun" + } + } + }, + "x-ms-examples": { + "Create a thread and run it in one request.": { + "$ref": "./examples/create_thread_and_run.json" + } + } + } + }, + "/vector_stores": { + "get": { + "operationId": "ListVectorStores", + "description": "Returns a list of vector stores.", + "parameters": [ + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/VectorStore" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "Returns a list of vector stores.": { + "$ref": "./examples/list_vector_stores.json" + } + } + }, + "post": { + "operationId": "CreateVectorStore", + "description": "Creates a vector store.", + "parameters": [ + { + "name": "body", + "in": "body", + "description": "Request object for creating a vector store.", + "required": true, + "schema": { + "$ref": "#/definitions/VectorStoreOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStore" + } + } + }, + "x-ms-examples": { + "Creates a vector store.": { + "$ref": "./examples/create_vector_store.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}": { + "get": { + "operationId": "GetVectorStore", + "description": "Returns the vector store object matching the specified ID.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStore" + } + } + }, + "x-ms-examples": { + "Retrieves a vector store.": { + "$ref": "./examples/get_vector_store.json" + } + } + }, + "post": { + "operationId": "ModifyVectorStore", + "description": "The ID of the vector store to modify.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store to modify.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Request object for updating a vector store.", + "required": true, + "schema": { + "$ref": "#/definitions/VectorStoreUpdateOptions" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStore" + } + } + }, + "x-ms-examples": { + "Modifies a vector store.": { + "$ref": "./examples/modify_vector_store.json" + } + } + }, + "delete": { + "operationId": "DeleteVectorStore", + "description": "Deletes the vector store object matching the specified ID.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store to delete.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreDeletionStatus" + } + } + }, + "x-ms-examples": { + "Deletes a vector store.": { + "$ref": "./examples/delete_vector_store.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}/file_batches": { + "post": { + "operationId": "CreateVectorStoreFileBatch", + "description": "Create a vector store file batch.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store for which to create a File Batch.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "description": "A list of File IDs that the vector store should use. Useful for tools like `file_search` that can access files.", + "minItems": 1, + "maxItems": 500, + "items": { + "type": "string" + }, + "x-ms-client-name": "fileIds" + }, + "chunking_strategy": { + "$ref": "#/definitions/VectorStoreChunkingStrategyRequest", + "description": "The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.", + "x-ms-client-name": "chunkingStrategy" + } + }, + "required": [ + "file_ids" + ] + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreFileBatch" + } + } + }, + "x-ms-examples": { + "Create a vector store file batch.": { + "$ref": "./examples/create_vector_store_file_batch.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}/file_batches/{batchId}": { + "get": { + "operationId": "GetVectorStoreFileBatch", + "description": "Retrieve a vector store file batch.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store that the file batch belongs to.", + "required": true, + "type": "string" + }, + { + "name": "batchId", + "in": "path", + "description": "The ID of the file batch being retrieved.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreFileBatch" + } + } + }, + "x-ms-examples": { + "Retrieves a vector store file batch.": { + "$ref": "./examples/get_vector_store_file_batch.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel": { + "post": { + "operationId": "CancelVectorStoreFileBatch", + "description": "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store that the file batch belongs to.", + "required": true, + "type": "string" + }, + { + "name": "batchId", + "in": "path", + "description": "The ID of the file batch to cancel.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreFileBatch" + } + } + }, + "x-ms-examples": { + "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.": { + "$ref": "./examples/cancel_vector_store_file_batch.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}/file_batches/{batchId}/files": { + "get": { + "operationId": "ListVectorStoreFileBatchFiles", + "description": "Returns a list of vector store files in a batch.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store that the file batch belongs to.", + "required": true, + "type": "string" + }, + { + "name": "batchId", + "in": "path", + "description": "The ID of the file batch that the files belong to.", + "required": true, + "type": "string" + }, + { + "name": "filter", + "in": "query", + "description": "Filter by file status.", + "required": false, + "type": "string", + "enum": [ + "in_progress", + "completed", + "failed", + "cancelled" + ], + "x-ms-enum": { + "name": "VectorStoreFileStatusFilter", + "modelAsString": true, + "values": [ + { + "name": "inProgress", + "value": "in_progress", + "description": "Retrieve only files that are currently being processed" + }, + { + "name": "completed", + "value": "completed", + "description": "Retrieve only files that have been successfully processed" + }, + { + "name": "failed", + "value": "failed", + "description": "Retrieve only files that have failed to process" + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Retrieve only files that were cancelled" + } + ] + } + }, + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/VectorStoreFile" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "Returns a list of vector store files of a given batch.": { + "$ref": "./examples/list_vector_store_file_batch_files.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}/files": { + "get": { + "operationId": "ListVectorStoreFiles", + "description": "Returns a list of vector store files.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store that the files belong to.", + "required": true, + "type": "string" + }, + { + "name": "filter", + "in": "query", + "description": "Filter by file status.", + "required": false, + "type": "string", + "enum": [ + "in_progress", + "completed", + "failed", + "cancelled" + ], + "x-ms-enum": { + "name": "VectorStoreFileStatusFilter", + "modelAsString": true, + "values": [ + { + "name": "inProgress", + "value": "in_progress", + "description": "Retrieve only files that are currently being processed" + }, + { + "name": "completed", + "value": "completed", + "description": "Retrieve only files that have been successfully processed" + }, + { + "name": "failed", + "value": "failed", + "description": "Retrieve only files that have failed to process" + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Retrieve only files that were cancelled" + } + ] + } + }, + { + "name": "limit", + "in": "query", + "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.", + "required": false, + "type": "integer", + "format": "int32", + "default": 20 + }, + { + "name": "order", + "in": "query", + "description": "Sort order by the created_at timestamp of the objects. asc for ascending order and desc for descending order.", + "required": false, + "type": "string", + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "x-ms-enum": { + "name": "ListSortOrder", + "modelAsString": true, + "values": [ + { + "name": "ascending", + "value": "asc", + "description": "Specifies an ascending sort order." + }, + { + "name": "descending", + "value": "desc", + "description": "Specifies a descending sort order." + } + ] + } + }, + { + "name": "after", + "in": "query", + "description": "A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.", + "required": false, + "type": "string" + }, + { + "name": "before", + "in": "query", + "description": "A cursor for use in pagination. before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "type": "object", + "description": "The response data for a requested list of items.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always list.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The requested list of items.", + "items": { + "$ref": "#/definitions/VectorStoreFile" + } + }, + "first_id": { + "type": "string", + "description": "The first ID represented in this list.", + "x-ms-client-name": "firstId" + }, + "last_id": { + "type": "string", + "description": "The last ID represented in this list.", + "x-ms-client-name": "lastId" + }, + "has_more": { + "type": "boolean", + "description": "A value indicating whether there are additional values available not captured in this list.", + "x-ms-client-name": "hasMore" + } + }, + "required": [ + "object", + "data", + "first_id", + "last_id", + "has_more" + ] + } + } + }, + "x-ms-examples": { + "Returns a list of vector store files.": { + "$ref": "./examples/list_vector_store_files.json" + } + } + }, + "post": { + "operationId": "CreateVectorStoreFile", + "description": "Create a vector store file by attaching a file to a vector store.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store for which to create a File.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "file_id": { + "type": "string", + "description": "A File ID that the vector store should use. Useful for tools like `file_search` that can access files.", + "x-ms-client-name": "fileId" + }, + "chunking_strategy": { + "$ref": "#/definitions/VectorStoreChunkingStrategyRequest", + "description": "The chunking strategy used to chunk the file(s). If not set, will use the auto strategy.", + "x-ms-client-name": "chunkingStrategy" + } + }, + "required": [ + "file_id" + ] + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreFile" + } + } + }, + "x-ms-examples": { + "Create a vector store file by attaching a File to a vector store.": { + "$ref": "./examples/create_vector_store_file.json" + } + } + } + }, + "/vector_stores/{vectorStoreId}/files/{fileId}": { + "get": { + "operationId": "GetVectorStoreFile", + "description": "Retrieves a vector store file.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store that the file belongs to.", + "required": true, + "type": "string" + }, + { + "name": "fileId", + "in": "path", + "description": "The ID of the file being retrieved.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreFile" + } + } + }, + "x-ms-examples": { + "Retrieves a vector store file.": { + "$ref": "./examples/get_vector_store_file.json" + } + } + }, + "delete": { + "operationId": "DeleteVectorStoreFile", + "description": "Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted.\nTo delete the file, use the delete file endpoint.", + "parameters": [ + { + "name": "vectorStoreId", + "in": "path", + "description": "The ID of the vector store that the file belongs to.", + "required": true, + "type": "string" + }, + { + "name": "fileId", + "in": "path", + "description": "The ID of the file to delete its relationship to the vector store.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VectorStoreFileDeletionStatus" + } + } + }, + "x-ms-examples": { + "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 endpoint.": { + "$ref": "./examples/delete_vector_store_file.json" + } + } + } + } + }, + "definitions": { + "Assistant": { + "type": "object", + "description": "Represents an assistant that can call the model and use tools.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always assistant.", + "enum": [ + "assistant" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this object was created.", + "x-ms-client-name": "createdAt" + }, + "name": { + "type": "string", + "description": "The name of the assistant.", + "x-nullable": true + }, + "description": { + "type": "string", + "description": "The description of the assistant.", + "x-nullable": true + }, + "model": { + "type": "string", + "description": "The ID of the model to use." + }, + "instructions": { + "type": "string", + "description": "The system instructions for the assistant to use.", + "x-nullable": true + }, + "tools": { + "type": "array", + "description": "The collection of tools enabled for the assistant.", + "default": [], + "items": { + "$ref": "#/definitions/ToolDefinition" + }, + "x-ms-identifiers": [] + }, + "tool_resources": { + "type": "object", + "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`\ntool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/ToolResources" + } + ], + "x-ms-client-name": "toolResources" + }, + "temperature": { + "type": "number", + "format": "float", + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,\nwhile lower values like 0.2 will make it more focused and deterministic.", + "default": 1, + "x-nullable": true + }, + "top_p": { + "type": "number", + "format": "float", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.\nSo 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or temperature but not both.", + "default": 1, + "x-nullable": true, + "x-ms-client-name": "topP" + }, + "response_format": { + "$ref": "#/definitions/AssistantsApiResponseFormatOption", + "description": "The response format of the tool calls used by this assistant.", + "x-nullable": true, + "x-ms-client-name": "responseFormat" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id", + "object", + "created_at", + "name", + "description", + "model", + "instructions", + "tools", + "tool_resources", + "temperature", + "top_p", + "metadata" + ] + }, + "AssistantCreationOptions": { + "type": "object", + "description": "The request details to use when creating a new assistant.", + "properties": { + "model": { + "type": "string", + "description": "The ID of the model to use." + }, + "name": { + "type": "string", + "description": "The name of the new assistant.", + "x-nullable": true + }, + "description": { + "type": "string", + "description": "The description of the new assistant.", + "x-nullable": true + }, + "instructions": { + "type": "string", + "description": "The system instructions for the new assistant to use.", + "x-nullable": true + }, + "tools": { + "type": "array", + "description": "The collection of tools to enable for the new assistant.", + "default": [], + "items": { + "$ref": "#/definitions/ToolDefinition" + }, + "x-ms-identifiers": [] + }, + "tool_resources": { + "type": "object", + "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`\ntool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/CreateToolResourcesOptions" + } + ], + "x-ms-client-name": "toolResources" + }, + "temperature": { + "type": "number", + "format": "float", + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,\nwhile lower values like 0.2 will make it more focused and deterministic.", + "default": 1, + "x-nullable": true + }, + "top_p": { + "type": "number", + "format": "float", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.\nSo 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or temperature but not both.", + "default": 1, + "x-nullable": true, + "x-ms-client-name": "topP" + }, + "response_format": { + "$ref": "#/definitions/AssistantsApiResponseFormatOption", + "description": "The response format of the tool calls used by this assistant.", + "x-nullable": true, + "x-ms-client-name": "responseFormat" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "model" + ] + }, + "AssistantDeletionStatus": { + "type": "object", + "description": "The status of an assistant deletion operation.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the resource specified for deletion." + }, + "deleted": { + "type": "boolean", + "description": "A value indicating whether deletion was successful." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'assistant.deleted'.", + "enum": [ + "assistant.deleted" + ], + "x-ms-enum": { + "modelAsString": false + } + } + }, + "required": [ + "id", + "deleted", + "object" + ] + }, + "AssistantThread": { + "type": "object", + "description": "Information about a single thread associated with an assistant.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'thread'.", + "enum": [ + "thread" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this object was created.", + "x-ms-client-name": "createdAt" + }, + "tool_resources": { + "type": "object", + "description": "A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type\nof tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list\nof vector store IDs.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/ToolResources" + } + ], + "x-ms-client-name": "toolResources" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id", + "object", + "created_at", + "tool_resources", + "metadata" + ] + }, + "AssistantThreadCreationOptions": { + "type": "object", + "description": "The details used to create a new assistant thread.", + "properties": { + "messages": { + "type": "array", + "description": "The initial messages to associate with the new thread.", + "items": { + "$ref": "#/definitions/ThreadMessageOptions" + }, + "x-ms-identifiers": [] + }, + "tool_resources": { + "type": "object", + "description": "A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the\ntype of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires\na list of vector store IDs.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/CreateToolResourcesOptions" + } + ], + "x-ms-client-name": "toolResources" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + }, + "AssistantsApiResponseFormatOption": {}, + "AssistantsApiToolChoiceOption": {}, + "CodeInterpreterToolDefinition": { + "type": "object", + "description": "The input definition information for a code interpreter tool as used to configure an assistant.", + "allOf": [ + { + "$ref": "#/definitions/ToolDefinition" + } + ], + "x-ms-discriminator-value": "code_interpreter" + }, + "CodeInterpreterToolResource": { + "type": "object", + "description": "A set of resources that are used by the `code_interpreter` tool.", + "properties": { + "file_ids": { + "type": "array", + "description": "A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files\nassociated with the tool.", + "default": [], + "maxItems": 20, + "items": { + "type": "string" + }, + "x-ms-client-name": "fileIds" + } + }, + "required": [ + "file_ids" + ] + }, + "CreateAndRunThreadOptions": { + "type": "object", + "description": "The details used when creating and immediately running a new assistant thread.", + "properties": { + "assistant_id": { + "type": "string", + "description": "The ID of the assistant for which the thread should be created.", + "x-ms-client-name": "assistantId" + }, + "thread": { + "$ref": "#/definitions/AssistantThreadCreationOptions", + "description": "The details used to create the new thread. If no thread is provided, an empty one will be created." + }, + "model": { + "type": "string", + "description": "The overridden model that the assistant should use to run the thread.", + "x-nullable": true + }, + "instructions": { + "type": "string", + "description": "The overridden system instructions the assistant should use to run the thread.", + "x-nullable": true + }, + "tools": { + "type": "array", + "description": "The overridden list of enabled tools the assistant should use to run the thread.", + "x-nullable": true, + "items": { + "$ref": "#/definitions/ToolDefinition" + }, + "x-ms-identifiers": [] + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to enable parallel function calling during tool use.", + "default": true, + "x-ms-client-name": "parallelToolCalls" + }, + "tool_resources": { + "type": "object", + "description": "Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/UpdateToolResourcesOptions" + } + ], + "x-ms-client-name": "toolResources" + }, + "stream": { + "type": "boolean", + "description": "If `true`, returns a stream of events that happen during the Run as server-sent events,\nterminating when the Run enters a terminal state with a `data: [DONE]` message." + }, + "temperature": { + "type": "number", + "format": "float", + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output\nmore random, while lower values like 0.2 will make it more focused and deterministic.", + "default": 1, + "x-nullable": true + }, + "top_p": { + "type": "number", + "format": "float", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model\nconsiders the results of the tokens with top_p probability mass. So 0.1 means only the tokens\ncomprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or temperature but not both.", + "default": 1, + "x-nullable": true, + "x-ms-client-name": "topP" + }, + "max_prompt_tokens": { + "type": "integer", + "format": "int32", + "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\nthe number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified,\nthe run will end with status `incomplete`. See `incomplete_details` for more info.", + "x-nullable": true, + "x-ms-client-name": "maxPromptTokens" + }, + "max_completion_tokens": { + "type": "integer", + "format": "int32", + "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\nthe number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens\nspecified, the run will end with status `incomplete`. See `incomplete_details` for more info.", + "x-nullable": true, + "x-ms-client-name": "maxCompletionTokens" + }, + "truncation_strategy": { + "type": "object", + "description": "The strategy to use for dropping messages as the context windows moves forward.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/TruncationObject" + } + ], + "x-ms-client-name": "truncationStrategy" + }, + "tool_choice": { + "$ref": "#/definitions/AssistantsApiToolChoiceOption", + "description": "Controls whether or not and which tool is called by the model.", + "x-nullable": true, + "x-ms-client-name": "toolChoice" + }, + "response_format": { + "$ref": "#/definitions/AssistantsApiResponseFormatOption", + "description": "Specifies the format that the model must output.", + "x-nullable": true, + "x-ms-client-name": "responseFormat" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "assistant_id" + ] + }, + "CreateCodeInterpreterToolResourceOptions": { + "type": "object", + "description": "A set of resources that will be used by the `code_interpreter` tool. Request object.", + "properties": { + "file_ids": { + "type": "array", + "description": "A list of file IDs made available to the `code_interpreter` tool.", + "default": [], + "maxItems": 20, + "items": { + "type": "string" + }, + "x-ms-client-name": "fileIds" + } + } + }, + "CreateFileSearchToolResourceOptions": {}, + "CreateRunOptions": { + "type": "object", + "description": "The details used when creating a new run of an assistant thread.", + "properties": { + "assistant_id": { + "type": "string", + "description": "The ID of the assistant that should run the thread.", + "x-ms-client-name": "assistantId" + }, + "model": { + "type": "string", + "description": "The overridden model name that the assistant should use to run the thread.", + "x-nullable": true + }, + "instructions": { + "type": "string", + "description": "The overridden system instructions that the assistant should use to run the thread.", + "x-nullable": true + }, + "additional_instructions": { + "type": "string", + "description": "Additional instructions to append at the end of the instructions for the run. This is useful for modifying the behavior\non a per-run basis without overriding other instructions.", + "x-nullable": true, + "x-ms-client-name": "additionalInstructions" + }, + "additional_messages": { + "type": "array", + "description": "Adds additional messages to the thread before creating the run.", + "x-nullable": true, + "items": { + "$ref": "#/definitions/ThreadMessage" + }, + "x-ms-client-name": "additionalMessages" + }, + "tools": { + "type": "array", + "description": "The overridden list of enabled tools that the assistant should use to run the thread.", + "x-nullable": true, + "items": { + "$ref": "#/definitions/ToolDefinition" + }, + "x-ms-identifiers": [] + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to enable parallel function calling during tool use.", + "default": true, + "x-ms-client-name": "parallelToolCalls" + }, + "stream": { + "type": "boolean", + "description": "If `true`, returns a stream of events that happen during the Run as server-sent events,\nterminating when the Run enters a terminal state with a `data: [DONE]` message." + }, + "temperature": { + "type": "number", + "format": "float", + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output\nmore random, while lower values like 0.2 will make it more focused and deterministic.", + "default": 1, + "x-nullable": true + }, + "top_p": { + "type": "number", + "format": "float", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model\nconsiders the results of the tokens with top_p probability mass. So 0.1 means only the tokens\ncomprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or temperature but not both.", + "default": 1, + "x-nullable": true, + "x-ms-client-name": "topP" + }, + "max_prompt_tokens": { + "type": "integer", + "format": "int32", + "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\nthe number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified,\nthe run will end with status `incomplete`. See `incomplete_details` for more info.", + "x-nullable": true, + "x-ms-client-name": "maxPromptTokens" + }, + "max_completion_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort\nto use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of\ncompletion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info.", + "x-nullable": true, + "x-ms-client-name": "maxCompletionTokens" + }, + "truncation_strategy": { + "type": "object", + "description": "The strategy to use for dropping messages as the context windows moves forward.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/TruncationObject" + } + ], + "x-ms-client-name": "truncationStrategy" + }, + "tool_choice": { + "$ref": "#/definitions/AssistantsApiToolChoiceOption", + "description": "Controls whether or not and which tool is called by the model.", + "x-nullable": true, + "x-ms-client-name": "toolChoice" + }, + "response_format": { + "$ref": "#/definitions/AssistantsApiResponseFormatOption", + "description": "Specifies the format that the model must output.", + "x-nullable": true, + "x-ms-client-name": "responseFormat" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "assistant_id" + ] + }, + "CreateToolResourcesOptions": { + "type": "object", + "description": "Request object. A set of resources that are used by the assistant's tools. The resources are specific to the\ntype of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search`\ntool requires a list of vector store IDs.", + "properties": { + "code_interpreter": { + "$ref": "#/definitions/CreateCodeInterpreterToolResourceOptions", + "description": "A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files\nassociated with the tool.", + "x-ms-client-name": "codeInterpreter" + }, + "file_search": { + "$ref": "#/definitions/CreateFileSearchToolResourceOptions", + "description": "A list of vector stores or their IDs made available to the `file_search` tool.", + "x-ms-client-name": "fileSearch" + } + } + }, + "FileDeletionStatus": { + "type": "object", + "description": "A status response from a file deletion operation.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the resource specified for deletion." + }, + "deleted": { + "type": "boolean", + "description": "A value indicating whether deletion was successful." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'file'.", + "enum": [ + "file" + ], + "x-ms-enum": { + "modelAsString": false + } + } + }, + "required": [ + "id", + "deleted", + "object" + ] + }, + "FileListResponse": { + "type": "object", + "description": "The response data from a file list operation.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always 'list'.", + "enum": [ + "list" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "data": { + "type": "array", + "description": "The files returned for the request.", + "items": { + "$ref": "#/definitions/OpenAIFile" + } + } + }, + "required": [ + "object", + "data" + ] + }, + "FilePurpose": { + "type": "string", + "description": "The possible values denoting the intended usage of a file.", + "enum": [ + "fine-tune", + "fine-tune-results", + "assistants", + "assistants_output", + "batch", + "batch_output", + "vision" + ], + "x-ms-enum": { + "name": "FilePurpose", + "modelAsString": true, + "values": [ + { + "name": "fineTune", + "value": "fine-tune", + "description": "Indicates a file is used for fine tuning input." + }, + { + "name": "fineTuneResults", + "value": "fine-tune-results", + "description": "Indicates a file is used for fine tuning results." + }, + { + "name": "assistants", + "value": "assistants", + "description": "Indicates a file is used as input to assistants." + }, + { + "name": "assistantsOutput", + "value": "assistants_output", + "description": "Indicates a file is used as output by assistants." + }, + { + "name": "batch", + "value": "batch", + "description": "Indicates a file is used as input to ." + }, + { + "name": "batchOutput", + "value": "batch_output", + "description": "Indicates a file is used as output by a vector store batch operation." + }, + { + "name": "vision", + "value": "vision", + "description": "Indicates a file is used as input to a vision operation." + } + ] + } + }, + "FileSearchToolCallResult": { + "type": "object", + "description": "File search tool call result", + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the file that result was found in.", + "x-ms-client-name": "fileId" + }, + "file_name": { + "type": "string", + "description": "The name of the file that result was found in.", + "x-ms-client-name": "fileName" + }, + "score": { + "type": "number", + "format": "double", + "description": "The score of the result. All values must be a floating point number between 0 and 1.", + "minimum": 0, + "maximum": 1 + }, + "content": { + "type": "array", + "description": "The content of the result that was found. The content is only included if requested via the include query parameter.", + "items": { + "$ref": "#/definitions/FileSearchToolCallResultContentItem" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "file_id", + "file_name", + "score" + ] + }, + "FileSearchToolCallResultContentItem": { + "type": "object", + "description": "Content item in a file search result", + "properties": { + "type": { + "type": "string", + "description": "The type of the content.", + "enum": [ + "text" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "text": { + "type": "string", + "description": "The text content of the file." + } + } + }, + "FileSearchToolDefinition": { + "type": "object", + "description": "The input definition information for a file search tool as used to configure an assistant.", + "properties": { + "file_search": { + "$ref": "#/definitions/FileSearchToolDefinitionDetails", + "description": "Options overrides for the file search tool.", + "x-ms-client-name": "fileSearch" + } + }, + "allOf": [ + { + "$ref": "#/definitions/ToolDefinition" + } + ], + "x-ms-discriminator-value": "file_search" + }, + "FileSearchToolDefinitionDetails": { + "type": "object", + "description": "Options overrides for the file search tool.", + "properties": { + "max_num_results": { + "type": "integer", + "format": "int32", + "description": "The maximum number of results the file search tool should output. The default is 20 for gpt-4* models and 5 for gpt-3.5-turbo. This number should be between 1 and 50 inclusive.\n\nNote that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information.", + "minimum": 1, + "maximum": 50, + "x-ms-client-name": "maxNumResults" + } + } + }, + "FileSearchToolResource": { + "type": "object", + "description": "A set of resources that are used by the `file_search` tool.", + "properties": { + "vector_store_ids": { + "type": "array", + "description": "The ID of the vector store attached to this assistant. There can be a maximum of 1 vector\nstore attached to the assistant.", + "maxItems": 1, + "items": { + "type": "string" + }, + "x-ms-client-name": "vectorStoreIds" + } + } + }, + "FileState": { + "type": "string", + "description": "The state of the file.", + "enum": [ + "uploaded", + "pending", + "running", + "processed", + "error", + "deleting", + "deleted" + ], + "x-ms-enum": { + "name": "FileState", + "modelAsString": true, + "values": [ + { + "name": "uploaded", + "value": "uploaded", + "description": "The file has been uploaded but it's not yet processed. This state is not returned by Azure OpenAI and exposed only for\ncompatibility. It can be categorized as an inactive state." + }, + { + "name": "pending", + "value": "pending", + "description": "The operation was created and is not queued to be processed in the future. It can be categorized as an inactive state." + }, + { + "name": "running", + "value": "running", + "description": "The operation has started to be processed. It can be categorized as an active state." + }, + { + "name": "processed", + "value": "processed", + "description": "The operation has successfully processed and is ready for consumption. It can be categorized as a terminal state." + }, + { + "name": "error", + "value": "error", + "description": "The operation has completed processing with a failure and cannot be further consumed. It can be categorized as a terminal state." + }, + { + "name": "deleting", + "value": "deleting", + "description": "The entity is in the process to be deleted. This state is not returned by Azure OpenAI and exposed only for compatibility.\nIt can be categorized as an active state." + }, + { + "name": "deleted", + "value": "deleted", + "description": "The entity has been deleted but may still be referenced by other entities predating the deletion. It can be categorized as a\nterminal state." + } + ] + } + }, + "FunctionDefinition": { + "type": "object", + "description": "The input definition information for a function.", + "properties": { + "name": { + "type": "string", + "description": "The name of the function to be called." + }, + "description": { + "type": "string", + "description": "A description of what the function does, used by the model to choose when and how to call the function." + }, + "parameters": { + "description": "The parameters the functions accepts, described as a JSON Schema object." + } + }, + "required": [ + "name", + "parameters" + ] + }, + "FunctionToolDefinition": { + "type": "object", + "description": "The input definition information for a function tool as used to configure an assistant.", + "properties": { + "function": { + "$ref": "#/definitions/FunctionDefinition", + "description": "The definition of the concrete function that the function tool should call." + } + }, + "required": [ + "function" + ], + "allOf": [ + { + "$ref": "#/definitions/ToolDefinition" + } + ], + "x-ms-discriminator-value": "function" + }, + "IncompleteRunDetails": { + "type": "string", + "description": "The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run.", + "enum": [ + "max_completion_tokens", + "max_prompt_tokens" + ], + "x-ms-enum": { + "name": "IncompleteRunDetails", + "modelAsString": true, + "values": [ + { + "name": "maxCompletionTokens", + "value": "max_completion_tokens", + "description": "Maximum completion tokens exceeded" + }, + { + "name": "maxPromptTokens", + "value": "max_prompt_tokens", + "description": "Maximum prompt tokens exceeded" + } + ] + } + }, + "MessageAttachment": { + "type": "object", + "description": "This describes to which tools a file has been attached.", + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the file to attach to the message.", + "x-ms-client-name": "fileId" + }, + "tools": { + "type": "array", + "description": "The tools to add to this file.", + "items": { + "$ref": "#/definitions/MessageAttachmentToolDefinition" + } + } + }, + "required": [ + "file_id", + "tools" + ] + }, + "MessageAttachmentToolDefinition": { + "x-nullable": false + }, + "MessageContent": { + "type": "object", + "description": "An abstract representation of a single item of thread message content.", + "properties": { + "type": { + "type": "string", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "MessageImageFileContent": { + "type": "object", + "description": "A representation of image file content in a thread message.", + "properties": { + "image_file": { + "$ref": "#/definitions/MessageImageFileDetails", + "description": "The image file for this thread message content item.", + "x-ms-client-name": "imageFile" + } + }, + "required": [ + "image_file" + ], + "allOf": [ + { + "$ref": "#/definitions/MessageContent" + } + ], + "x-ms-discriminator-value": "image_file" + }, + "MessageImageFileDetails": { + "type": "object", + "description": "An image reference, as represented in thread message content.", + "properties": { + "file_id": { + "type": "string", + "description": "The ID for the file associated with this image.", + "x-ms-client-name": "fileId" + } + }, + "required": [ + "file_id" + ] + }, + "MessageIncompleteDetails": { + "type": "object", + "description": "Information providing additional detail about a message entering an incomplete status.", + "properties": { + "reason": { + "$ref": "#/definitions/MessageIncompleteDetailsReason", + "description": "The provided reason describing why the message was marked as incomplete." + } + }, + "required": [ + "reason" + ] + }, + "MessageIncompleteDetailsReason": { + "type": "string", + "description": "A set of reasons describing why a message is marked as incomplete.", + "enum": [ + "content_filter", + "max_tokens", + "run_cancelled", + "run_failed", + "run_expired" + ], + "x-ms-enum": { + "name": "MessageIncompleteDetailsReason", + "modelAsString": true, + "values": [ + { + "name": "contentFilter", + "value": "content_filter", + "description": "The run generating the message was terminated due to content filter flagging." + }, + { + "name": "maxTokens", + "value": "max_tokens", + "description": "The run generating the message exhausted available tokens before completion." + }, + { + "name": "runCancelled", + "value": "run_cancelled", + "description": "The run generating the message was cancelled before completion." + }, + { + "name": "runFailed", + "value": "run_failed", + "description": "The run generating the message failed." + }, + { + "name": "runExpired", + "value": "run_expired", + "description": "The run generating the message expired." + } + ] + } + }, + "MessageRole": { + "type": "string", + "description": "The possible values for roles attributed to messages in a thread.", + "enum": [ + "user", + "assistant" + ], + "x-ms-enum": { + "name": "MessageRole", + "modelAsString": true, + "values": [ + { + "name": "user", + "value": "user", + "description": "The role representing the end-user." + }, + { + "name": "assistant", + "value": "assistant", + "description": "The role representing the assistant." + } + ] + } + }, + "MessageStatus": { + "type": "string", + "description": "The possible execution status values for a thread message.", + "enum": [ + "in_progress", + "incomplete", + "completed" + ], + "x-ms-enum": { + "name": "MessageStatus", + "modelAsString": true, + "values": [ + { + "name": "inProgress", + "value": "in_progress", + "description": "A run is currently creating this message." + }, + { + "name": "incomplete", + "value": "incomplete", + "description": "This message is incomplete. See incomplete_details for more information." + }, + { + "name": "completed", + "value": "completed", + "description": "This message was successfully completed by a run." + } + ] + } + }, + "MessageTextAnnotation": { + "type": "object", + "description": "An abstract representation of an annotation to text thread message content.", + "properties": { + "type": { + "type": "string", + "description": "The object type." + }, + "text": { + "type": "string", + "description": "The textual content associated with this text annotation item." + } + }, + "discriminator": "type", + "required": [ + "type", + "text" + ] + }, + "MessageTextContent": { + "type": "object", + "description": "A representation of a textual item of thread message content.", + "properties": { + "text": { + "$ref": "#/definitions/MessageTextDetails", + "description": "The text and associated annotations for this thread message content item." + } + }, + "required": [ + "text" + ], + "allOf": [ + { + "$ref": "#/definitions/MessageContent" + } + ], + "x-ms-discriminator-value": "text" + }, + "MessageTextDetails": { + "type": "object", + "description": "The text and associated annotations for a single item of assistant thread message content.", + "properties": { + "value": { + "type": "string", + "description": "The text data." + }, + "annotations": { + "type": "array", + "description": "A list of annotations associated with this text.", + "items": { + "$ref": "#/definitions/MessageTextAnnotation" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "value", + "annotations" + ] + }, + "MessageTextFileCitationAnnotation": { + "type": "object", + "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.", + "properties": { + "file_citation": { + "$ref": "#/definitions/MessageTextFileCitationDetails", + "description": "A citation within the message that points to a specific quote from a specific file.\nGenerated when the assistant uses the \"file_search\" tool to search files.", + "x-ms-client-name": "fileCitation" + }, + "start_index": { + "type": "integer", + "format": "int32", + "description": "The first text index associated with this text annotation.", + "x-ms-client-name": "startIndex" + }, + "end_index": { + "type": "integer", + "format": "int32", + "description": "The last text index associated with this text annotation.", + "x-ms-client-name": "endIndex" + } + }, + "required": [ + "file_citation" + ], + "allOf": [ + { + "$ref": "#/definitions/MessageTextAnnotation" + } + ], + "x-ms-discriminator-value": "file_citation" + }, + "MessageTextFileCitationDetails": { + "type": "object", + "description": "A representation of a file-based text citation, as used in a file-based annotation of text thread message content.", + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the file associated with this citation.", + "x-ms-client-name": "fileId" + }, + "quote": { + "type": "string", + "description": "The specific quote cited in the associated file." + } + }, + "required": [ + "file_id", + "quote" + ] + }, + "MessageTextFilePathAnnotation": { + "type": "object", + "description": "A citation within the message that points to a file located at a specific path.", + "properties": { + "file_path": { + "$ref": "#/definitions/MessageTextFilePathDetails", + "description": "A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file.", + "x-ms-client-name": "filePath" + }, + "start_index": { + "type": "integer", + "format": "int32", + "description": "The first text index associated with this text annotation.", + "x-ms-client-name": "startIndex" + }, + "end_index": { + "type": "integer", + "format": "int32", + "description": "The last text index associated with this text annotation.", + "x-ms-client-name": "endIndex" + } + }, + "required": [ + "file_path" + ], + "allOf": [ + { + "$ref": "#/definitions/MessageTextAnnotation" + } + ], + "x-ms-discriminator-value": "file_path" + }, + "MessageTextFilePathDetails": { + "type": "object", + "description": "An encapsulation of an image file ID, as used by message image content.", + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the specific file that the citation is from.", + "x-ms-client-name": "fileId" + } + }, + "required": [ + "file_id" + ] + }, + "OpenAIFile": { + "type": "object", + "description": "Represents an assistant that can call the model and use tools.", + "properties": { + "object": { + "type": "string", + "description": "The object type, which is always 'file'.", + "enum": [ + "file" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "bytes": { + "type": "integer", + "format": "int32", + "description": "The size of the file, in bytes." + }, + "filename": { + "type": "string", + "description": "The name of the file." + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this object was created.", + "x-ms-client-name": "createdAt" + }, + "purpose": { + "$ref": "#/definitions/FilePurpose", + "description": "The intended purpose of a file." + }, + "status": { + "$ref": "#/definitions/FileState", + "description": "The state of the file. This field is available in Azure OpenAI only." + }, + "status_details": { + "type": "string", + "description": "The error message with details in case processing of this file failed. This field is available in Azure OpenAI only.", + "x-ms-client-name": "statusDetails" + } + }, + "required": [ + "object", + "id", + "bytes", + "filename", + "created_at", + "purpose" + ] + }, + "RequiredAction": { + "type": "object", + "description": "An abstract representation of a required action for an assistant thread run to continue.", + "properties": { + "type": { + "type": "string", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "RequiredFunctionToolCall": { + "type": "object", + "description": "A representation of a requested call to a function tool, needed by the model to continue evaluation of a run.", + "properties": { + "function": { + "$ref": "#/definitions/RequiredFunctionToolCallDetails", + "description": "Detailed information about the function to be executed by the tool that includes name and arguments." + } + }, + "required": [ + "function" + ], + "allOf": [ + { + "$ref": "#/definitions/RequiredToolCall" + } + ], + "x-ms-discriminator-value": "function" + }, + "RequiredFunctionToolCallDetails": { + "type": "object", + "description": "The detailed information for a function invocation, as provided by a required action invoking a function tool, that includes the name of and arguments to the function.", + "properties": { + "name": { + "type": "string", + "description": "The name of the function." + }, + "arguments": { + "type": "string", + "description": "The arguments to use when invoking the named function, as provided by the model. Arguments are presented as a JSON document that should be validated and parsed for evaluation." + } + }, + "required": [ + "name", + "arguments" + ] + }, + "RequiredToolCall": { + "type": "object", + "description": "An abstract representation a a tool invocation needed by the model to continue a run.", + "properties": { + "type": { + "type": "string", + "description": "The object type for the required tool call." + }, + "id": { + "type": "string", + "description": "The ID of the tool call. This ID must be referenced when submitting tool outputs." + } + }, + "discriminator": "type", + "required": [ + "type", + "id" + ] + }, + "RunCompletionUsage": { + "type": "object", + "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.).", + "properties": { + "completion_tokens": { + "type": "integer", + "format": "int64", + "description": "Number of completion tokens used over the course of the run.", + "x-ms-client-name": "completionTokens" + }, + "prompt_tokens": { + "type": "integer", + "format": "int64", + "description": "Number of prompt tokens used over the course of the run.", + "x-ms-client-name": "promptTokens" + }, + "total_tokens": { + "type": "integer", + "format": "int64", + "description": "Total number of tokens used (prompt + completion).", + "x-ms-client-name": "totalTokens" + } + }, + "required": [ + "completion_tokens", + "prompt_tokens", + "total_tokens" + ] + }, + "RunError": { + "type": "object", + "description": "The details of an error as encountered by an assistant thread run.", + "properties": { + "code": { + "type": "string", + "description": "The status for the error." + }, + "message": { + "type": "string", + "description": "The human-readable text associated with the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "RunStatus": { + "type": "string", + "description": "Possible values for the status of an assistant thread run.", + "enum": [ + "queued", + "in_progress", + "requires_action", + "cancelling", + "cancelled", + "failed", + "completed", + "expired" + ], + "x-ms-enum": { + "name": "RunStatus", + "modelAsString": true, + "values": [ + { + "name": "queued", + "value": "queued", + "description": "Represents a run that is queued to start." + }, + { + "name": "inProgress", + "value": "in_progress", + "description": "Represents a run that is in progress." + }, + { + "name": "requiresAction", + "value": "requires_action", + "description": "Represents a run that needs another operation, such as tool output submission, to continue." + }, + { + "name": "cancelling", + "value": "cancelling", + "description": "Represents a run that is in the process of cancellation." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Represents a run that has been cancelled." + }, + { + "name": "failed", + "value": "failed", + "description": "Represents a run that failed." + }, + { + "name": "completed", + "value": "completed", + "description": "Represents a run that successfully completed." + }, + { + "name": "expired", + "value": "expired", + "description": "Represents a run that expired before it could otherwise finish." + } + ] + } + }, + "RunStep": { + "type": "object", + "description": "Detailed information about a single step of an assistant thread run.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'thread.run.step'.", + "enum": [ + "thread.run.step" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "type": { + "$ref": "#/definitions/RunStepType", + "description": "The type of run step, which can be either message_creation or tool_calls." + }, + "assistant_id": { + "type": "string", + "description": "The ID of the assistant associated with the run step.", + "x-ms-client-name": "assistantId" + }, + "thread_id": { + "type": "string", + "description": "The ID of the thread that was run.", + "x-ms-client-name": "threadId" + }, + "run_id": { + "type": "string", + "description": "The ID of the run that this run step is a part of.", + "x-ms-client-name": "runId" + }, + "status": { + "$ref": "#/definitions/RunStepStatus", + "description": "The status of this run step." + }, + "step_details": { + "$ref": "#/definitions/RunStepDetails", + "description": "The details for this run step.", + "x-ms-client-name": "stepDetails" + }, + "last_error": { + "type": "object", + "description": "If applicable, information about the last error encountered by this run step.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/RunStepError" + } + ], + "x-ms-client-name": "lastError" + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this object was created.", + "x-ms-client-name": "createdAt" + }, + "expired_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this item expired.", + "x-nullable": true, + "x-ms-client-name": "expiredAt" + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this completed.", + "x-nullable": true, + "x-ms-client-name": "completedAt" + }, + "cancelled_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this was cancelled.", + "x-nullable": true, + "x-ms-client-name": "cancelledAt" + }, + "failed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this failed.", + "x-nullable": true, + "x-ms-client-name": "failedAt" + }, + "usage": { + "type": "object", + "description": "Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/RunStepCompletionUsage" + } + ] + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id", + "object", + "type", + "assistant_id", + "thread_id", + "run_id", + "status", + "step_details", + "last_error", + "created_at", + "expired_at", + "completed_at", + "cancelled_at", + "failed_at", + "metadata" + ] + }, + "RunStepCodeInterpreterImageOutput": { + "type": "object", + "description": "A representation of an image output emitted by a code interpreter tool in response to a tool call by the model.", + "properties": { + "image": { + "$ref": "#/definitions/RunStepCodeInterpreterImageReference", + "description": "Referential information for the image associated with this output." + } + }, + "required": [ + "image" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepCodeInterpreterToolCallOutput" + } + ], + "x-ms-discriminator-value": "image" + }, + "RunStepCodeInterpreterImageReference": { + "type": "object", + "description": "An image reference emitted by a code interpreter tool in response to a tool call by the model.", + "properties": { + "file_id": { + "type": "string", + "description": "The ID of the file associated with this image.", + "x-ms-client-name": "fileId" + } + }, + "required": [ + "file_id" + ] + }, + "RunStepCodeInterpreterLogOutput": { + "type": "object", + "description": "A representation of a log output emitted by a code interpreter tool in response to a tool call by the model.", + "properties": { + "logs": { + "type": "string", + "description": "The serialized log output emitted by the code interpreter." + } + }, + "required": [ + "logs" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepCodeInterpreterToolCallOutput" + } + ], + "x-ms-discriminator-value": "logs" + }, + "RunStepCodeInterpreterToolCall": { + "type": "object", + "description": "A record of a call to a code interpreter tool, issued by the model in evaluation of a defined tool, that\nrepresents inputs and outputs consumed and emitted by the code interpreter.", + "properties": { + "code_interpreter": { + "$ref": "#/definitions/RunStepCodeInterpreterToolCallDetails", + "description": "The details of the tool call to the code interpreter tool.", + "x-ms-client-name": "codeInterpreter" + } + }, + "required": [ + "code_interpreter" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepToolCall" + } + ], + "x-ms-discriminator-value": "code_interpreter" + }, + "RunStepCodeInterpreterToolCallDetails": { + "type": "object", + "description": "The detailed information about a code interpreter invocation by the model.", + "properties": { + "input": { + "type": "string", + "description": "The input provided by the model to the code interpreter tool." + }, + "outputs": { + "type": "array", + "description": "The outputs produced by the code interpreter tool back to the model in response to the tool call.", + "items": { + "$ref": "#/definitions/RunStepCodeInterpreterToolCallOutput" + }, + "x-ms-identifiers": [] + } + }, + "required": [ + "input", + "outputs" + ] + }, + "RunStepCodeInterpreterToolCallOutput": { + "type": "object", + "description": "An abstract representation of an emitted output from a code interpreter tool.", + "properties": { + "type": { + "type": "string", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "RunStepCompletionUsage": { + "type": "object", + "description": "Usage statistics related to the run step.", + "properties": { + "completion_tokens": { + "type": "integer", + "format": "int64", + "description": "Number of completion tokens used over the course of the run step.", + "x-ms-client-name": "completionTokens" + }, + "prompt_tokens": { + "type": "integer", + "format": "int64", + "description": "Number of prompt tokens used over the course of the run step.", + "x-ms-client-name": "promptTokens" + }, + "total_tokens": { + "type": "integer", + "format": "int64", + "description": "Total number of tokens used (prompt + completion).", + "x-ms-client-name": "totalTokens" + } + }, + "required": [ + "completion_tokens", + "prompt_tokens", + "total_tokens" + ] + }, + "RunStepDetails": { + "type": "object", + "description": "An abstract representation of the details for a run step.", + "properties": { + "type": { + "$ref": "#/definitions/RunStepType", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "RunStepError": { + "type": "object", + "description": "The error information associated with a failed run step.", + "properties": { + "code": { + "$ref": "#/definitions/RunStepErrorCode", + "description": "The error code for this error." + }, + "message": { + "type": "string", + "description": "The human-readable text associated with this error." + } + }, + "required": [ + "code", + "message" + ] + }, + "RunStepErrorCode": { + "type": "string", + "description": "Possible error code values attributable to a failed run step.", + "enum": [ + "server_error", + "rate_limit_exceeded" + ], + "x-ms-enum": { + "name": "RunStepErrorCode", + "modelAsString": true, + "values": [ + { + "name": "serverError", + "value": "server_error", + "description": "Represents a server error." + }, + { + "name": "rateLimitExceeded", + "value": "rate_limit_exceeded", + "description": "Represents an error indicating configured rate limits were exceeded." + } + ] + } + }, + "RunStepFileSearchToolCall": { + "type": "object", + "description": "A record of a call to a file search tool, issued by the model in evaluation of a defined tool, that represents\nexecuted file search.", + "properties": { + "file_search": { + "type": "array", + "description": "The results of the file search.", + "items": { + "$ref": "#/definitions/FileSearchToolCallResult" + }, + "x-ms-client-name": "fileSearch", + "x-ms-identifiers": [] + } + }, + "required": [ + "file_search" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepToolCall" + } + ], + "x-ms-discriminator-value": "file_search" + }, + "RunStepFunctionToolCall": { + "type": "object", + "description": "A record of a call to a function tool, issued by the model in evaluation of a defined tool, that represents the inputs\nand output consumed and emitted by the specified function.", + "properties": { + "function": { + "$ref": "#/definitions/RunStepFunctionToolCallDetails", + "description": "The detailed information about the function called by the model." + } + }, + "required": [ + "function" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepToolCall" + } + ], + "x-ms-discriminator-value": "function" + }, + "RunStepFunctionToolCallDetails": { + "type": "object", + "description": "The detailed information about the function called by the model.", + "properties": { + "name": { + "type": "string", + "description": "The name of the function." + }, + "arguments": { + "type": "string", + "description": "The arguments that the model requires are provided to the named function." + }, + "output": { + "type": "string", + "description": "The output of the function, only populated for function calls that have already have had their outputs submitted.", + "x-nullable": true + } + }, + "required": [ + "name", + "arguments", + "output" + ] + }, + "RunStepMessageCreationDetails": { + "type": "object", + "description": "The detailed information associated with a message creation run step.", + "properties": { + "message_creation": { + "$ref": "#/definitions/RunStepMessageCreationReference", + "description": "Information about the message creation associated with this run step.", + "x-ms-client-name": "messageCreation" + } + }, + "required": [ + "message_creation" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepDetails" + } + ], + "x-ms-discriminator-value": "message_creation" + }, + "RunStepMessageCreationReference": { + "type": "object", + "description": "The details of a message created as a part of a run step.", + "properties": { + "message_id": { + "type": "string", + "description": "The ID of the message created by this run step.", + "x-ms-client-name": "messageId" + } + }, + "required": [ + "message_id" + ] + }, + "RunStepStatus": { + "type": "string", + "description": "Possible values for the status of a run step.", + "enum": [ + "in_progress", + "cancelled", + "failed", + "completed", + "expired" + ], + "x-ms-enum": { + "name": "RunStepStatus", + "modelAsString": true, + "values": [ + { + "name": "inProgress", + "value": "in_progress", + "description": "Represents a run step still in progress." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "Represents a run step that was cancelled." + }, + { + "name": "failed", + "value": "failed", + "description": "Represents a run step that failed." + }, + { + "name": "completed", + "value": "completed", + "description": "Represents a run step that successfully completed." + }, + { + "name": "expired", + "value": "expired", + "description": "Represents a run step that expired before otherwise finishing." + } + ] + } + }, + "RunStepToolCall": { + "type": "object", + "description": "An abstract representation of a detailed tool call as recorded within a run step for an existing run.", + "properties": { + "type": { + "type": "string", + "description": "The object type." + }, + "id": { + "type": "string", + "description": "The ID of the tool call. This ID must be referenced when you submit tool outputs." + } + }, + "discriminator": "type", + "required": [ + "type", + "id" + ] + }, + "RunStepToolCallDetails": { + "type": "object", + "description": "The detailed information associated with a run step calling tools.", + "properties": { + "tool_calls": { + "type": "array", + "description": "A list of tool call details for this run step.", + "items": { + "$ref": "#/definitions/RunStepToolCall" + }, + "x-ms-client-name": "toolCalls" + } + }, + "required": [ + "tool_calls" + ], + "allOf": [ + { + "$ref": "#/definitions/RunStepDetails" + } + ], + "x-ms-discriminator-value": "tool_calls" + }, + "RunStepType": { + "type": "string", + "description": "The possible types of run steps.", + "enum": [ + "message_creation", + "tool_calls" + ], + "x-ms-enum": { + "name": "RunStepType", + "modelAsString": true, + "values": [ + { + "name": "messageCreation", + "value": "message_creation", + "description": "Represents a run step to create a message." + }, + { + "name": "toolCalls", + "value": "tool_calls", + "description": "Represents a run step that calls tools." + } + ] + } + }, + "SubmitToolOutputsAction": { + "type": "object", + "description": "The details for required tool calls that must be submitted for an assistant thread run to continue.", + "properties": { + "submit_tool_outputs": { + "$ref": "#/definitions/SubmitToolOutputsDetails", + "description": "The details describing tools that should be called to submit tool outputs.", + "x-ms-client-name": "submitToolOutputs" + } + }, + "required": [ + "submit_tool_outputs" + ], + "allOf": [ + { + "$ref": "#/definitions/RequiredAction" + } + ], + "x-ms-discriminator-value": "submit_tool_outputs" + }, + "SubmitToolOutputsDetails": { + "type": "object", + "description": "The details describing tools that should be called to submit tool outputs.", + "properties": { + "tool_calls": { + "type": "array", + "description": "The list of tool calls that must be resolved for the assistant thread run to continue.", + "items": { + "$ref": "#/definitions/RequiredToolCall" + }, + "x-ms-client-name": "toolCalls" + } + }, + "required": [ + "tool_calls" + ] + }, + "ThreadDeletionStatus": { + "type": "object", + "description": "The status of a thread deletion operation.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the resource specified for deletion." + }, + "deleted": { + "type": "boolean", + "description": "A value indicating whether deletion was successful." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'thread.deleted'.", + "enum": [ + "thread.deleted" + ], + "x-ms-enum": { + "modelAsString": false + } + } + }, + "required": [ + "id", + "deleted", + "object" + ] + }, + "ThreadMessage": { + "type": "object", + "description": "A single, existing message within an assistant thread.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'thread.message'.", + "enum": [ + "thread.message" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this object was created.", + "x-ms-client-name": "createdAt" + }, + "thread_id": { + "type": "string", + "description": "The ID of the thread that this message belongs to.", + "x-ms-client-name": "threadId" + }, + "status": { + "$ref": "#/definitions/MessageStatus", + "description": "The status of the message." + }, + "incomplete_details": { + "type": "object", + "description": "On an incomplete message, details about why the message is incomplete.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/MessageIncompleteDetails" + } + ], + "x-ms-client-name": "incompleteDetails" + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the message was completed.", + "x-nullable": true, + "x-ms-client-name": "completedAt" + }, + "incomplete_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the message was marked as incomplete.", + "x-nullable": true, + "x-ms-client-name": "incompleteAt" + }, + "role": { + "$ref": "#/definitions/MessageRole", + "description": "The role associated with the assistant thread message." + }, + "content": { + "type": "array", + "description": "The list of content items associated with the assistant thread message.", + "items": { + "$ref": "#/definitions/MessageContent" + }, + "x-ms-identifiers": [] + }, + "assistant_id": { + "type": "string", + "description": "If applicable, the ID of the assistant that authored this message.", + "x-nullable": true, + "x-ms-client-name": "assistantId" + }, + "run_id": { + "type": "string", + "description": "If applicable, the ID of the run associated with the authoring of this message.", + "x-nullable": true, + "x-ms-client-name": "runId" + }, + "attachments": { + "type": "array", + "description": "A list of files attached to the message, and the tools they were added to.", + "x-nullable": true, + "items": { + "$ref": "#/definitions/MessageAttachment" + }, + "x-ms-identifiers": [] + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id", + "object", + "created_at", + "thread_id", + "status", + "incomplete_details", + "completed_at", + "incomplete_at", + "role", + "content", + "assistant_id", + "run_id", + "attachments", + "metadata" + ] + }, + "ThreadMessageOptions": { + "type": "object", + "description": "A single message within an assistant thread, as provided during that thread's creation for its initial state.", + "properties": { + "role": { + "$ref": "#/definitions/MessageRole", + "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\nthe conversation." + }, + "content": { + "type": "string", + "description": "The textual content of the initial message. Currently, robust input including images and annotated text may only be provided via\na separate call to the create message API." + }, + "attachments": { + "type": "array", + "description": "A list of files attached to the message, and the tools they should be added to.", + "x-nullable": true, + "items": { + "$ref": "#/definitions/MessageAttachment" + }, + "x-ms-identifiers": [] + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "role", + "content" + ] + }, + "ThreadRun": { + "type": "object", + "description": "Data representing a single evaluation run of an assistant thread.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'thread.run'.", + "enum": [ + "thread.run" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "thread_id": { + "type": "string", + "description": "The ID of the thread associated with this run.", + "x-ms-client-name": "threadId" + }, + "assistant_id": { + "type": "string", + "description": "The ID of the assistant associated with the thread this run was performed against.", + "x-ms-client-name": "assistantId" + }, + "status": { + "$ref": "#/definitions/RunStatus", + "description": "The status of the assistant thread run." + }, + "required_action": { + "type": "object", + "description": "The details of the action required for the assistant thread run to continue.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/RequiredAction" + } + ], + "x-ms-client-name": "requiredAction" + }, + "last_error": { + "type": "object", + "description": "The last error, if any, encountered by this assistant thread run.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/RunError" + } + ], + "x-ms-client-name": "lastError" + }, + "model": { + "type": "string", + "description": "The ID of the model to use." + }, + "instructions": { + "type": "string", + "description": "The overridden system instructions used for this assistant thread run." + }, + "tools": { + "type": "array", + "description": "The overridden enabled tools used for this assistant thread run.", + "default": [], + "items": { + "$ref": "#/definitions/ToolDefinition" + }, + "x-ms-identifiers": [] + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this object was created.", + "x-ms-client-name": "createdAt" + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this item expires.", + "x-nullable": true, + "x-ms-client-name": "expiresAt" + }, + "started_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this item was started.", + "x-nullable": true, + "x-ms-client-name": "startedAt" + }, + "completed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this completed.", + "x-nullable": true, + "x-ms-client-name": "completedAt" + }, + "cancelled_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this was cancelled.", + "x-nullable": true, + "x-ms-client-name": "cancelledAt" + }, + "failed_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp, in seconds, representing when this failed.", + "x-nullable": true, + "x-ms-client-name": "failedAt" + }, + "incomplete_details": { + "$ref": "#/definitions/IncompleteRunDetails", + "description": "Details on why the run is incomplete. Will be `null` if the run is not incomplete.", + "x-nullable": true, + "x-ms-client-name": "incompleteDetails" + }, + "usage": { + "type": "object", + "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.).", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/RunCompletionUsage" + } + ] + }, + "temperature": { + "type": "number", + "format": "float", + "description": "The sampling temperature used for this run. If not set, defaults to 1.", + "x-nullable": true + }, + "top_p": { + "type": "number", + "format": "float", + "description": "The nucleus sampling value used for this run. If not set, defaults to 1.", + "x-nullable": true, + "x-ms-client-name": "topP" + }, + "max_prompt_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of prompt tokens specified to have been used over the course of the run.", + "x-nullable": true, + "x-ms-client-name": "maxPromptTokens" + }, + "max_completion_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of completion tokens specified to have been used over the course of the run.", + "x-nullable": true, + "x-ms-client-name": "maxCompletionTokens" + }, + "truncation_strategy": { + "type": "object", + "description": "The strategy to use for dropping messages as the context windows moves forward.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/TruncationObject" + } + ], + "x-ms-client-name": "truncationStrategy" + }, + "tool_choice": { + "$ref": "#/definitions/AssistantsApiToolChoiceOption", + "description": "Controls whether or not and which tool is called by the model.", + "x-nullable": true, + "x-ms-client-name": "toolChoice" + }, + "parallel_tool_calls": { + "type": "boolean", + "description": "Whether to enable parallel function calling during tool use.", + "x-ms-client-name": "parallelToolCalls" + }, + "response_format": { + "$ref": "#/definitions/AssistantsApiResponseFormatOption", + "description": "The response format of the tool calls used in this run.", + "x-nullable": true, + "x-ms-client-name": "responseFormat" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id", + "object", + "thread_id", + "assistant_id", + "status", + "last_error", + "model", + "instructions", + "tools", + "created_at", + "expires_at", + "started_at", + "completed_at", + "cancelled_at", + "failed_at", + "incomplete_details", + "usage", + "max_prompt_tokens", + "max_completion_tokens", + "truncation_strategy", + "tool_choice", + "parallel_tool_calls", + "response_format", + "metadata" + ] + }, + "ToolDefinition": { + "type": "object", + "description": "An abstract representation of an input tool definition that an assistant can use.", + "properties": { + "type": { + "type": "string", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "ToolOutput": { + "type": "object", + "description": "The data provided during a tool outputs submission to resolve pending tool calls and allow the model to continue.", + "properties": { + "tool_call_id": { + "type": "string", + "description": "The ID of the tool call being resolved, as provided in the tool calls of a required action from a run.", + "x-ms-client-name": "toolCallId" + }, + "output": { + "type": "string", + "description": "The output from the tool to be submitted." + } + } + }, + "ToolResources": { + "type": "object", + "description": "A set of resources that are used by the assistant's tools. The resources are specific to the type of\ntool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search`\ntool requires a list of vector store IDs.", + "properties": { + "code_interpreter": { + "$ref": "#/definitions/CodeInterpreterToolResource", + "description": "Resources to be used by the `code_interpreter tool` consisting of file IDs.", + "x-ms-client-name": "codeInterpreter" + }, + "file_search": { + "$ref": "#/definitions/FileSearchToolResource", + "description": "Resources to be used by the `file_search` tool consisting of vector store IDs.", + "x-ms-client-name": "fileSearch" + } + } + }, + "TruncationObject": { + "type": "object", + "description": "Controls for how a thread will be truncated prior to the run. Use this to control the initial\ncontext window of the run.", + "properties": { + "type": { + "type": "string", + "description": "The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will\nbe truncated to the `lastMessages` count most recent messages in the thread. When set to `auto`, messages in the middle of the thread\nwill be dropped to fit the context length of the model, `max_prompt_tokens`.", + "default": "auto", + "enum": [ + "auto", + "last_messages" + ], + "x-ms-enum": { + "name": "TruncationStrategy", + "modelAsString": true, + "values": [ + { + "name": "auto", + "value": "auto", + "description": "Default value. Messages in the middle of the thread will be dropped to fit the context length of the model." + }, + { + "name": "lastMessages", + "value": "last_messages", + "description": "The thread will truncate to the `lastMessages` count of recent messages." + } + ] + } + }, + "last_messages": { + "type": "integer", + "format": "int32", + "description": "The number of most recent messages from the thread when constructing the context for the run.", + "x-nullable": true, + "x-ms-client-name": "lastMessages" + } + }, + "required": [ + "type" + ] + }, + "UpdateAssistantOptions": { + "type": "object", + "description": "The request details to use when modifying an existing assistant.", + "properties": { + "model": { + "type": "string", + "description": "The ID of the model to use." + }, + "name": { + "type": "string", + "description": "The modified name for the assistant to use.", + "x-nullable": true + }, + "description": { + "type": "string", + "description": "The modified description for the assistant to use.", + "x-nullable": true + }, + "instructions": { + "type": "string", + "description": "The modified system instructions for the new assistant to use.", + "x-nullable": true + }, + "tools": { + "type": "array", + "description": "The modified collection of tools to enable for the assistant.", + "default": [], + "items": { + "$ref": "#/definitions/ToolDefinition" + }, + "x-ms-identifiers": [] + }, + "tool_resources": { + "$ref": "#/definitions/UpdateToolResourcesOptions", + "description": "A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example,\nthe `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.", + "x-ms-client-name": "toolResources" + }, + "temperature": { + "type": "number", + "format": "float", + "description": "What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,\nwhile lower values like 0.2 will make it more focused and deterministic.", + "default": 1, + "x-nullable": true + }, + "top_p": { + "type": "number", + "format": "float", + "description": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.\nSo 0.1 means only the tokens comprising the top 10% probability mass are considered.\n\nWe generally recommend altering this or temperature but not both.", + "default": 1, + "x-nullable": true, + "x-ms-client-name": "topP" + }, + "response_format": { + "$ref": "#/definitions/AssistantsApiResponseFormatOption", + "description": "The response format of the tool calls used by this assistant.", + "x-nullable": true, + "x-ms-client-name": "responseFormat" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + }, + "UpdateAssistantThreadOptions": { + "type": "object", + "description": "The details used to update an existing assistant thread", + "properties": { + "tool_resources": { + "type": "object", + "description": "A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the\ntype of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires\na list of vector store IDs", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/UpdateToolResourcesOptions" + } + ], + "x-ms-client-name": "toolResources" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + }, + "UpdateCodeInterpreterToolResourceOptions": { + "type": "object", + "description": "Request object to update `code_interpreted` tool resources.", + "properties": { + "file_ids": { + "type": "array", + "description": "A list of file IDs to override the current list of the assistant.", + "maxItems": 20, + "items": { + "type": "string" + }, + "x-ms-client-name": "fileIds" + } + } + }, + "UpdateFileSearchToolResourceOptions": { + "type": "object", + "description": "Request object to update `file_search` tool resources.", + "properties": { + "vector_store_ids": { + "type": "array", + "description": "A list of vector store IDs to override the current list of the assistant.", + "maxItems": 1, + "items": { + "type": "string" + }, + "x-ms-client-name": "vectorStoreIds" + } + } + }, + "UpdateToolResourcesOptions": { + "type": "object", + "description": "Request object. A set of resources that are used by the assistant's tools. The resources are specific to the type of tool.\nFor example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of\nvector store IDs.", + "properties": { + "code_interpreter": { + "$ref": "#/definitions/UpdateCodeInterpreterToolResourceOptions", + "description": "Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files\nassociated with the tool.", + "x-ms-client-name": "codeInterpreter" + }, + "file_search": { + "$ref": "#/definitions/UpdateFileSearchToolResourceOptions", + "description": "Overrides the vector store attached to this assistant. There can be a maximum of 1 vector store attached to the assistant.", + "x-ms-client-name": "fileSearch" + } + } + }, + "VectorStore": { + "type": "object", + "description": "A vector store is a collection of processed files can be used by the `file_search` tool.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always `vector_store`", + "enum": [ + "vector_store" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store was created.", + "x-ms-client-name": "createdAt" + }, + "name": { + "type": "string", + "description": "The name of the vector store." + }, + "usage_bytes": { + "type": "integer", + "format": "int32", + "description": "The total number of bytes used by the files in the vector store.", + "x-ms-client-name": "usageBytes" + }, + "file_counts": { + "$ref": "#/definitions/VectorStoreFileCount", + "description": "Files count grouped by status processed or being processed by this vector store.", + "x-ms-client-name": "fileCounts" + }, + "status": { + "$ref": "#/definitions/VectorStoreStatus", + "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": "#/definitions/VectorStoreExpirationPolicy", + "description": "Details on when this vector store expires", + "x-ms-client-name": "expiresAfter" + }, + "expires_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store will expire.", + "x-nullable": true, + "x-ms-client-name": "expiresAt" + }, + "last_active_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store was last active.", + "x-nullable": true, + "x-ms-client-name": "lastActiveAt" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id", + "object", + "created_at", + "name", + "usage_bytes", + "file_counts", + "status", + "last_active_at", + "metadata" + ] + }, + "VectorStoreAutoChunkingStrategyRequest": { + "type": "object", + "description": "The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400.", + "allOf": [ + { + "$ref": "#/definitions/VectorStoreChunkingStrategyRequest" + } + ], + "x-ms-discriminator-value": "auto" + }, + "VectorStoreAutoChunkingStrategyResponse": { + "type": "object", + "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.", + "allOf": [ + { + "$ref": "#/definitions/VectorStoreChunkingStrategyResponse" + } + ], + "x-ms-discriminator-value": "other" + }, + "VectorStoreChunkingStrategyRequest": { + "type": "object", + "description": "An abstract representation of a vector store chunking strategy configuration.", + "properties": { + "type": { + "$ref": "#/definitions/VectorStoreChunkingStrategyRequestType", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "VectorStoreChunkingStrategyRequestType": { + "type": "string", + "description": "Type of chunking strategy", + "enum": [ + "auto", + "static" + ], + "x-ms-enum": { + "name": "VectorStoreChunkingStrategyRequestType", + "modelAsString": true, + "values": [ + { + "name": "auto", + "value": "auto" + }, + { + "name": "static", + "value": "static" + } + ] + } + }, + "VectorStoreChunkingStrategyResponse": { + "type": "object", + "description": "An abstract representation of a vector store chunking strategy configuration.", + "properties": { + "type": { + "$ref": "#/definitions/VectorStoreChunkingStrategyResponseType", + "description": "The object type." + } + }, + "discriminator": "type", + "required": [ + "type" + ] + }, + "VectorStoreChunkingStrategyResponseType": { + "type": "string", + "description": "Type of chunking strategy", + "enum": [ + "other", + "static" + ], + "x-ms-enum": { + "name": "VectorStoreChunkingStrategyResponseType", + "modelAsString": true, + "values": [ + { + "name": "other", + "value": "other" + }, + { + "name": "static", + "value": "static" + } + ] + } + }, + "VectorStoreDeletionStatus": { + "type": "object", + "description": "Response object for deleting a vector store.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the resource specified for deletion." + }, + "deleted": { + "type": "boolean", + "description": "A value indicating whether deletion was successful." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'vector_store.deleted'.", + "enum": [ + "vector_store.deleted" + ], + "x-ms-enum": { + "modelAsString": false + } + } + }, + "required": [ + "id", + "deleted", + "object" + ] + }, + "VectorStoreExpirationPolicy": { + "type": "object", + "description": "The expiration policy for a vector store.", + "properties": { + "anchor": { + "$ref": "#/definitions/VectorStoreExpirationPolicyAnchor", + "description": "Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`." + }, + "days": { + "type": "integer", + "format": "int32", + "description": "The anchor timestamp after which the expiration policy applies.", + "minimum": 1, + "maximum": 365 + } + }, + "required": [ + "anchor", + "days" + ] + }, + "VectorStoreExpirationPolicyAnchor": { + "type": "string", + "description": "Describes the relationship between the days and the expiration of this vector store", + "enum": [ + "last_active_at" + ], + "x-ms-enum": { + "name": "VectorStoreExpirationPolicyAnchor", + "modelAsString": true, + "values": [ + { + "name": "lastActiveAt", + "value": "last_active_at", + "description": "The expiration policy is based on the last time the vector store was active." + } + ] + } + }, + "VectorStoreFile": { + "type": "object", + "description": "Description of a file attached to a vector store.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always `vector_store.file`.", + "enum": [ + "vector_store.file" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "usage_bytes": { + "type": "integer", + "format": "int32", + "description": "The total vector store usage in bytes. Note that this may be different from the original file\nsize.", + "x-ms-client-name": "usageBytes" + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store file was created.", + "x-ms-client-name": "createdAt" + }, + "vector_store_id": { + "type": "string", + "description": "The ID of the vector store that the file is attached to.", + "x-ms-client-name": "vectorStoreId" + }, + "status": { + "$ref": "#/definitions/VectorStoreFileStatus", + "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": { + "type": "object", + "description": "The last error associated with this vector store file. Will be `null` if there are no errors.", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/VectorStoreFileError" + } + ], + "x-ms-client-name": "lastError" + }, + "chunking_strategy": { + "$ref": "#/definitions/VectorStoreChunkingStrategyResponse", + "description": "The strategy used to chunk the file.", + "x-ms-client-name": "chunkingStrategy" + } + }, + "required": [ + "id", + "object", + "usage_bytes", + "created_at", + "vector_store_id", + "status", + "last_error", + "chunking_strategy" + ] + }, + "VectorStoreFileBatch": { + "type": "object", + "description": "A batch of files attached to a vector store.", + "properties": { + "id": { + "type": "string", + "description": "The identifier, which can be referenced in API endpoints." + }, + "object": { + "type": "string", + "description": "The object type, which is always `vector_store.file_batch`.", + "enum": [ + "vector_store.files_batch" + ], + "x-ms-enum": { + "modelAsString": false + } + }, + "created_at": { + "type": "integer", + "format": "unixtime", + "description": "The Unix timestamp (in seconds) for when the vector store files batch was created.", + "x-ms-client-name": "createdAt" + }, + "vector_store_id": { + "type": "string", + "description": "The ID of the vector store that the file is attached to.", + "x-ms-client-name": "vectorStoreId" + }, + "status": { + "$ref": "#/definitions/VectorStoreFileBatchStatus", + "description": "The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`." + }, + "file_counts": { + "$ref": "#/definitions/VectorStoreFileCount", + "description": "Files count grouped by status processed or being processed by this vector store.", + "x-ms-client-name": "fileCounts" + } + }, + "required": [ + "id", + "object", + "created_at", + "vector_store_id", + "status", + "file_counts" + ] + }, + "VectorStoreFileBatchStatus": { + "type": "string", + "description": "The status of the vector store file batch.", + "enum": [ + "in_progress", + "completed", + "cancelled", + "failed" + ], + "x-ms-enum": { + "name": "VectorStoreFileBatchStatus", + "modelAsString": true, + "values": [ + { + "name": "inProgress", + "value": "in_progress", + "description": "The vector store is still processing this file batch." + }, + { + "name": "completed", + "value": "completed", + "description": "the vector store file batch is ready for use." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "The vector store file batch was cancelled." + }, + { + "name": "failed", + "value": "failed", + "description": "The vector store file batch failed to process." + } + ] + } + }, + "VectorStoreFileCount": { + "type": "object", + "description": "Counts of files processed or being processed by this vector store grouped by status.", + "properties": { + "in_progress": { + "type": "integer", + "format": "int32", + "description": "The number of files that are currently being processed.", + "x-ms-client-name": "inProgress" + }, + "completed": { + "type": "integer", + "format": "int32", + "description": "The number of files that have been successfully processed." + }, + "failed": { + "type": "integer", + "format": "int32", + "description": "The number of files that have failed to process." + }, + "cancelled": { + "type": "integer", + "format": "int32", + "description": "The number of files that were cancelled." + }, + "total": { + "type": "integer", + "format": "int32", + "description": "The total number of files." + } + }, + "required": [ + "in_progress", + "completed", + "failed", + "cancelled", + "total" + ] + }, + "VectorStoreFileDeletionStatus": { + "type": "object", + "description": "Response object for deleting a vector store file relationship.", + "properties": { + "id": { + "type": "string", + "description": "The ID of the resource specified for deletion." + }, + "deleted": { + "type": "boolean", + "description": "A value indicating whether deletion was successful." + }, + "object": { + "type": "string", + "description": "The object type, which is always 'vector_store.deleted'.", + "enum": [ + "vector_store.file.deleted" + ], + "x-ms-enum": { + "modelAsString": false + } + } + }, + "required": [ + "id", + "deleted", + "object" + ] + }, + "VectorStoreFileError": { + "type": "object", + "description": "Details on the error that may have ocurred while processing a file for this vector store", + "properties": { + "code": { + "$ref": "#/definitions/VectorStoreFileErrorCode", + "description": "One of `server_error` or `rate_limit_exceeded`." + }, + "message": { + "type": "string", + "description": "A human-readable description of the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "VectorStoreFileErrorCode": { + "type": "string", + "description": "Error code variants for vector store file processing", + "enum": [ + "server_error", + "unsupported_file", + "invalid_file" + ], + "x-ms-enum": { + "name": "VectorStoreFileErrorCode", + "modelAsString": true, + "values": [ + { + "name": "serverError", + "value": "server_error", + "description": "The server encountered an error." + }, + { + "name": "unsupportedFile", + "value": "unsupported_file", + "description": "The file format is not supported." + }, + { + "name": "invalidFile", + "value": "invalid_file", + "description": "The file is invalid." + } + ] + } + }, + "VectorStoreFileStatus": { + "type": "string", + "description": "Vector store file status", + "enum": [ + "in_progress", + "completed", + "failed", + "cancelled" + ], + "x-ms-enum": { + "name": "VectorStoreFileStatus", + "modelAsString": true, + "values": [ + { + "name": "inProgress", + "value": "in_progress", + "description": "The file is currently being processed." + }, + { + "name": "completed", + "value": "completed", + "description": "The file has been successfully processed." + }, + { + "name": "failed", + "value": "failed", + "description": "The file has failed to process." + }, + { + "name": "cancelled", + "value": "cancelled", + "description": "The file was cancelled." + } + ] + } + }, + "VectorStoreOptions": { + "type": "object", + "description": "Request object for creating a vector store.", + "properties": { + "file_ids": { + "type": "array", + "description": "A list of file IDs that the vector store should use. Useful for tools like `file_search` that can access files.", + "maxItems": 500, + "items": { + "type": "string" + }, + "x-ms-client-name": "fileIds" + }, + "name": { + "type": "string", + "description": "The name of the vector store." + }, + "expires_after": { + "$ref": "#/definitions/VectorStoreExpirationPolicy", + "description": "Details on when this vector store expires", + "x-ms-client-name": "expiresAfter" + }, + "chunking_strategy": { + "$ref": "#/definitions/VectorStoreChunkingStrategyRequest", + "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.", + "x-ms-client-name": "chunkingStrategy" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + }, + "VectorStoreStaticChunkingStrategyOptions": { + "type": "object", + "description": "Options to configure a vector store static chunking strategy.", + "properties": { + "max_chunk_size_tokens": { + "type": "integer", + "format": "int32", + "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.", + "minimum": 100, + "maximum": 4096, + "x-ms-client-name": "maxChunkSizeTokens" + }, + "chunk_overlap_tokens": { + "type": "integer", + "format": "int32", + "description": "The number of tokens that overlap between chunks. The default value is 400.\nNote that the overlap must not exceed half of max_chunk_size_tokens. *", + "x-ms-client-name": "chunkOverlapTokens" + } + }, + "required": [ + "max_chunk_size_tokens", + "chunk_overlap_tokens" + ] + }, + "VectorStoreStaticChunkingStrategyRequest": { + "type": "object", + "description": "A statically configured chunking strategy.", + "properties": { + "static": { + "$ref": "#/definitions/VectorStoreStaticChunkingStrategyOptions", + "description": "The options for the static chunking strategy." + } + }, + "required": [ + "static" + ], + "allOf": [ + { + "$ref": "#/definitions/VectorStoreChunkingStrategyRequest" + } + ], + "x-ms-discriminator-value": "static" + }, + "VectorStoreStaticChunkingStrategyResponse": { + "type": "object", + "description": "A statically configured chunking strategy.", + "properties": { + "static": { + "$ref": "#/definitions/VectorStoreStaticChunkingStrategyOptions", + "description": "The options for the static chunking strategy." + } + }, + "required": [ + "static" + ], + "allOf": [ + { + "$ref": "#/definitions/VectorStoreChunkingStrategyResponse" + } + ], + "x-ms-discriminator-value": "static" + }, + "VectorStoreStatus": { + "type": "string", + "description": "Vector store possible status", + "enum": [ + "expired", + "in_progress", + "completed" + ], + "x-ms-enum": { + "name": "VectorStoreStatus", + "modelAsString": true, + "values": [ + { + "name": "expired", + "value": "expired", + "description": "expired status indicates that this vector store has expired and is no longer available for use." + }, + { + "name": "inProgress", + "value": "in_progress", + "description": "in_progress status indicates that this vector store is still processing files." + }, + { + "name": "completed", + "value": "completed", + "description": "completed status indicates that this vector store is ready for use." + } + ] + } + }, + "VectorStoreUpdateOptions": { + "type": "object", + "description": "Request object for updating a vector store.", + "properties": { + "name": { + "type": "string", + "description": "The name of the vector store.", + "x-nullable": true + }, + "expires_after": { + "type": "object", + "description": "Details on when this vector store expires", + "x-nullable": true, + "allOf": [ + { + "$ref": "#/definitions/VectorStoreExpirationPolicy" + } + ], + "x-ms-client-name": "expiresAfter" + }, + "metadata": { + "type": "object", + "description": "A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.", + "x-nullable": true, + "additionalProperties": { + "type": "string" + } + } + } + } + }, + "parameters": {} +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_run.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_run.json new file mode 100644 index 000000000000..e1afe8ae1b65 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_run.json @@ -0,0 +1,49 @@ +{ + "title": "Cancels a run that is `in_progress`.\n", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "runId": "run_abc123" + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699076126, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "cancelling", + "started_at": 1699076126, + "expires_at": 1699076726, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "You summarize books.", + "tools": [ + { + "type": "file_search" + } + ], + "tool_choice": "auto", + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "max_completion_tokens": 1000, + "max_prompt_tokens": 1000, + "incomplete_details": null, + "metadata": {}, + "usage": null, + "temperature": 1.0, + "top_p": 1.0, + "response_format": "auto" + } + } + }, + "operationId": "CancelRun" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_vector_store_file_batch.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_vector_store_file_batch.json new file mode 100644 index 000000000000..44e5e2e9b172 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/cancel_vector_store_file_batch.json @@ -0,0 +1,28 @@ +{ + "title": "Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "batchId": "vsfb_abc123" + }, + "responses": { + "200": { + "body": { + "id": "vsfb_abc123", + "object": "vector_store.files_batch", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "status": "cancelling", + "file_counts": { + "in_progress": 12, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 15 + } + } + } + }, + "operationId": "CancelVectorStoreFileBatch" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_assistant.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_assistant.json new file mode 100644 index 000000000000..681c91a3127a --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_assistant.json @@ -0,0 +1,41 @@ +{ + "title": "Create an assistant with a model and instructions.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": { + "name": "Math Tutor", + "instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "model": "gpt-4-1106-preview" + } + }, + "responses": { + "200": { + "body": { + "id": "asst_4nsG2qgNzimRPE7MazXTXbU7", + "object": "assistant", + "created_at": 1707295707, + "name": "Math Tutor", + "description": null, + "model": "gpt-4-1106-preview", + "instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + } + } + }, + "operationId": "CreateAssistant" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_message.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_message.json new file mode 100644 index 000000000000..4a07c2d596ed --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_message.json @@ -0,0 +1,41 @@ +{ + "title": "Create a message.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", + "body": { + "role": "user", + "content": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces." + } + }, + "responses": { + "200": { + "body": { + "id": "msg_as3XIk1tpVP3hdHjWBGg3uG4", + "object": "thread.message", + "created_at": 1707298421, + "assistant_id": null, + "thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces.", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "attachments": [], + "metadata": {} + } + } + }, + "operationId": "CreateMessage" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_run.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_run.json new file mode 100644 index 000000000000..0468305bf829 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_run.json @@ -0,0 +1,51 @@ +{ + "title": "Create a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "body": { + "assistant_id": "asst_abc123" + } + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699063290, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": 1699063290, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699063291, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": {}, + "usage": null, + "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" + } + } + }, + "operationId": "CreateRun" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread.json new file mode 100644 index 000000000000..56e487effa24 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread.json @@ -0,0 +1,20 @@ +{ + "title": "Creates a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": {} + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread", + "created_at": 1707297136, + "tool_resources": {}, + "metadata": {} + } + } + }, + "operationId": "CreateThread" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread_and_run.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread_and_run.json new file mode 100644 index 000000000000..b82b725da44e --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_thread_and_run.json @@ -0,0 +1,55 @@ +{ + "title": "Create a thread and run it in one request.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": { + "assistant_id": "asst_abc123", + "thread": { + "messages": [ + { + "role": "user", + "content": "Explain deep learning to a 5 year old." + } + ] + } + } + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699076792, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "queued", + "started_at": null, + "expires_at": 1699077392, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "parallel_tool_calls": true, + "required_action": null, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "You are a helpful assistant.", + "tools": [], + "metadata": {}, + "temperature": 1.0, + "top_p": 1.0, + "max_completion_tokens": null, + "max_prompt_tokens": null, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "incomplete_details": null, + "usage": null, + "response_format": "auto", + "tool_choice": "auto" + } + } + }, + "operationId": "CreateThreadAndRun" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store.json new file mode 100644 index 000000000000..50d24262052d --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store.json @@ -0,0 +1,32 @@ +{ + "title": "Creates a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "body": { + "name": "Support FAQ" + } + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "completed", + "last_active_at": 1699061776, + "metadata": {}, + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + } + } + } + }, + "operationId": "CreateVectorStore" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file.json new file mode 100644 index 000000000000..4cfdaa21daed --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file.json @@ -0,0 +1,28 @@ +{ + "title": "Create a vector store file by attaching a File to a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "body": { + "file_id": "file-abc123" + } + }, + "responses": { + "200": { + "body": { + "id": "file-abc123", + "object": "vector_store.file", + "created_at": 1699061776, + "usage_bytes": 1234, + "vector_store_id": "vs_abcd", + "status": "completed", + "last_error": null, + "chunking_strategy": { + "type": "other" + } + } + } + }, + "operationId": "CreateVectorStoreFile" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file_batch.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file_batch.json new file mode 100644 index 000000000000..4516f263fa41 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/create_vector_store_file_batch.json @@ -0,0 +1,33 @@ +{ + "title": "Create a vector store file batch.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "body": { + "file_ids": [ + "file-abc123", + "file-abc456" + ] + } + }, + "responses": { + "200": { + "body": { + "id": "vsfb_abc123", + "object": "vector_store.files_batch", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "status": "in_progress", + "file_counts": { + "in_progress": 1, + "completed": 1, + "failed": 0, + "cancelled": 0, + "total": 0 + } + } + } + }, + "operationId": "CreateVectorStoreFileBatch" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_assistant.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_assistant.json new file mode 100644 index 000000000000..d9cd4484c672 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_assistant.json @@ -0,0 +1,18 @@ +{ + "title": "Deletes an assistant.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "assistantId": "asst_4nsG2qgNzimRPE7MazXTXbU7" + }, + "responses": { + "200": { + "body": { + "id": "asst_4nsG2qgNzimRPE7MazXTXbU7", + "object": "assistant.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteAssistant" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_file.json new file mode 100644 index 000000000000..c8c2ba38bb1f --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_file.json @@ -0,0 +1,18 @@ +{ + "title": "Delete a previously uploaded file.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + }, + "responses": { + "200": { + "body": { + "object": "file", + "deleted": true, + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + } + } + }, + "operationId": "DeleteFile" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_thread.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_thread.json new file mode 100644 index 000000000000..e9803e0f0a3e --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_thread.json @@ -0,0 +1,18 @@ +{ + "title": "Deletes a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx" + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteThread" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store.json new file mode 100644 index 000000000000..ad052d4e06d5 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store.json @@ -0,0 +1,18 @@ +{ + "title": "Deletes a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123 " + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteVectorStore" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store_file.json new file mode 100644 index 000000000000..b41982f004fd --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/delete_vector_store_file.json @@ -0,0 +1,19 @@ +{ + "title": "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 endpoint.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "fileId": "file_abc123" + }, + "responses": { + "200": { + "body": { + "id": "file_abc123", + "object": "vector_store.file.deleted", + "deleted": true + } + } + }, + "operationId": "DeleteVectorStoreFile" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_assistant.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_assistant.json new file mode 100644 index 000000000000..49995ab2fb36 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_assistant.json @@ -0,0 +1,32 @@ +{ + "title": "Retrieves an assistant.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "assistantId": "asst_abc123" + }, + "responses": { + "200": { + "body": { + "id": "asst_4lMdCUN4lS2SQcHEy9CM1QIt", + "object": "assistant", + "created_at": 1718875084, + "name": "Math Tutor", + "description": null, + "model": "gpt-4-1106-preview", + "instructions": "When a customer asks about a specific math problem, use Python to evaluate their query.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "top_p": 1.0, + "temperature": 1.0, + "tool_resources": {}, + "metadata": {}, + "response_format": "auto" + } + } + }, + "operationId": "GetAssistant" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file.json new file mode 100644 index 000000000000..af3ab4586d76 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file.json @@ -0,0 +1,23 @@ +{ + "title": "Returns a file", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2024-02-15-preview", + "fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + }, + "responses": { + "200": { + "body": { + "object": "file", + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", + "purpose": "assistants", + "filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", + "bytes": 4, + "created_at": 1718886199, + "status": "processed", + "status_details": null + } + } + }, + "operationId": "GetFile" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file_content.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file_content.json new file mode 100644 index 000000000000..834a00473cf4 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_file_content.json @@ -0,0 +1,14 @@ +{ + "title": "Returns the content of a file", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "fileId": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3" + }, + "responses": { + "200": { + "body": "file content" + } + }, + "operationId": "GetFileContent" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_message.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_message.json new file mode 100644 index 000000000000..75d37873ad10 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_message.json @@ -0,0 +1,38 @@ +{ + "title": "Retrieve a message.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", + "messageId": "msg_as3XIk1tpVP3hdHjWBGg3uG4" + }, + "responses": { + "200": { + "body": { + "id": "msg_as3XIk1tpVP3hdHjWBGg3uG4", + "object": "thread.message", + "created_at": 1707298421, + "thread_id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "What is the cube root of the sum of 12, 14, 1234, 4321, 90000, 123213541223, 443123123124, 5423324234, 234324324234, 653434534545, 200000000, 98237432984, 99999999, 99999999999, 220000000000, 3309587702? Give me the answer rounded to the nearest integer without commas or spaces.", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "assistant_id": null, + "run_id": null, + "attachments": [], + "metadata": {} + } + } + }, + "operationId": "GetMessage" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run.json new file mode 100644 index 000000000000..f38321072cd4 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run.json @@ -0,0 +1,43 @@ +{ + "title": "Gets a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_eRNwflE3ncDYak1np6MdMHJh", + "runId": "run_HsO8tYM4K5AAMAHgK0J3om8Q" + }, + "responses": { + "200": { + "body": { + "id": "run_HsO8tYM4K5AAMAHgK0J3om8Q", + "object": "thread.run", + "created_at": 1707303196, + "assistant_id": "asst_JtTwHk28cIocgFXZPCBxhOzl", + "thread_id": "thread_eRNwflE3ncDYak1np6MdMHJh", + "status": "completed", + "incomplete_details": null, + "usage": null, + "started_at": 1707303197, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1707303201, + "parallel_tool_calls": true, + "max_prompt_tokens": 1000, + "max_completion_tokens": 1000, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "response_format": "auto", + "tool_choice": "auto", + "last_error": null, + "model": "gpt-4-1106-preview", + "instructions": "You are an AI model that empowers every person and every organization on the planet to achieve more.", + "tools": [], + "metadata": {} + } + } + }, + "operationId": "GetRun" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run_step.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run_step.json new file mode 100644 index 000000000000..5c7d221d7b14 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_run_step.json @@ -0,0 +1,42 @@ +{ + "title": "Retrieves a run step.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_eRNwflE3ncDYak1np6MdMHJh", + "runId": "run_HsO8tYM4K5AAMAHgK0J3om8Q", + "stepId": "step_abc123" + }, + "responses": { + "200": { + "body": { + "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 + }, + "metadata": {} + } + } + }, + "operationId": "GetRunStep" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_thread.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_thread.json new file mode 100644 index 000000000000..061c9f5a8a18 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_thread.json @@ -0,0 +1,24 @@ +{ + "title": "Retrieves a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx" + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread", + "created_at": 1707297136, + "metadata": {}, + "tool_resources": { + "code_interpreter": { + "file_ids": [] + } + } + } + } + }, + "operationId": "GetThread" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store.json new file mode 100644 index 000000000000..c09ca2bc9497 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store.json @@ -0,0 +1,30 @@ +{ + "title": "Retrieves a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123" + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "completed", + "last_active_at": 1699061776, + "metadata": {}, + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + } + } + } + }, + "operationId": "GetVectorStore" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file.json new file mode 100644 index 000000000000..16d3209f828a --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file.json @@ -0,0 +1,26 @@ +{ + "title": "Retrieves a vector store file.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "fileId": "file-abc123" + }, + "responses": { + "200": { + "body": { + "id": "file-abc123", + "object": "vector_store.file", + "created_at": 1699061776, + "usage_bytes": 123456, + "vector_store_id": "vs_abcd", + "status": "completed", + "last_error": null, + "chunking_strategy": { + "type": "other" + } + } + } + }, + "operationId": "GetVectorStoreFile" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file_batch.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file_batch.json new file mode 100644 index 000000000000..955fe8e8c59b --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/get_vector_store_file_batch.json @@ -0,0 +1,28 @@ +{ + "title": "Retrieves a vector store file batch.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "batchId": "vsfb_abc123" + }, + "responses": { + "200": { + "body": { + "id": "vsfb_abc123", + "object": "vector_store.files_batch", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "status": "in_progress", + "file_counts": { + "in_progress": 1, + "completed": 1, + "failed": 0, + "cancelled": 0, + "total": 0 + } + } + } + }, + "operationId": "GetVectorStoreFileBatch" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_assistants.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_assistants.json new file mode 100644 index 000000000000..905ae4662725 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_assistants.json @@ -0,0 +1,71 @@ +{ + "title": "Returns a list of assistants.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "order": "desc", + "limit": 20 + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "asst_abc123", + "object": "assistant", + "created_at": 1707257477, + "name": "Stock Analyst", + "description": null, + "model": "gpt-4-1106-preview", + "instructions": "You are a financial analyst that analyzes stock market prices and other financial data present on user uploaded files or by calling external APIs.", + "tools": [ + { + "type": "code_interpreter" + } + ], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + }, + { + "id": "asst_abc456", + "object": "assistant", + "created_at": 1698982718, + "name": "My Assistant", + "description": null, + "model": "gpt-4-turbo", + "instructions": "You are a helpful assistant designed to make me better at coding!", + "tools": [], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + }, + { + "id": "asst_abc789", + "object": "assistant", + "created_at": 1698982643, + "name": null, + "description": null, + "model": "gpt-4-turbo", + "instructions": "", + "tools": [], + "tool_resources": {}, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + } + ], + "first_id": "asst_abc123", + "last_id": "asst_abc789", + "has_more": false + } + } + }, + "operationId": "ListAssistants" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_file.json new file mode 100644 index 000000000000..0c8cf76d18d9 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_file.json @@ -0,0 +1,38 @@ +{ + "title": "Returns a list of files filtered by purpose", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "purpose": "assistants" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "object": "file", + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", + "purpose": "assistants", + "filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", + "bytes": 4, + "created_at": 1718886199, + "status": "processed", + "status_details": null + }, + { + "object": "file", + "id": "assistant-D6AmXzgJ6gyGcgT48OmJ8kYc", + "purpose": "assistants", + "filename": "test07a45e38-9b88-449a-9580-94fdb986eb75.txt", + "bytes": 4, + "created_at": 1718886043, + "status": "processed", + "status_details": null + } + ] + } + } + }, + "operationId": "ListFiles" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_messages.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_messages.json new file mode 100644 index 000000000000..994f4efd0390 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_messages.json @@ -0,0 +1,69 @@ +{ + "title": "List Messages", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699016383, + "assistant_id": null, + "thread_id": "thread_abc123", + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "attachments": [], + "metadata": {} + }, + { + "id": "msg_abc456", + "object": "thread.message", + "created_at": 1699016383, + "assistant_id": null, + "thread_id": "thread_abc123", + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "Hello, what is AI?", + "annotations": [] + } + } + ], + "status": "completed", + "incomplete_details": null, + "incomplete_at": null, + "completed_at": 1707298439, + "attachments": [], + "metadata": {} + } + ], + "first_id": "msg_abc123", + "last_id": "msg_abc456", + "has_more": false + } + } + }, + "operationId": "ListMessages" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_run_steps.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_run_steps.json new file mode 100644 index 000000000000..a42ac3449ae0 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_run_steps.json @@ -0,0 +1,49 @@ +{ + "title": "Returns a list of run steps belonging to a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "runId": "run_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "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 + }, + "metadata": {} + } + ], + "first_id": "step_abc123", + "last_id": "step_abc456", + "has_more": false + } + } + }, + "operationId": "ListRunSteps" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_runs.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_runs.json new file mode 100644 index 000000000000..b03a500622cd --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_runs.json @@ -0,0 +1,99 @@ +{ + "title": "Returns a list of runs belonging to a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": {}, + "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" + }, + { + "id": "run_abc456", + "object": "thread.run", + "created_at": 1699063290, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699063290, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699063291, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": {}, + "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" + } + ], + "first_id": "run_abc123", + "last_id": "run_abc456", + "has_more": false + } + } + }, + "operationId": "ListRuns" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_file_batch_files.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_file_batch_files.json new file mode 100644 index 000000000000..a69f4f89ae29 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_file_batch_files.json @@ -0,0 +1,46 @@ +{ + "title": "Returns a list of vector store files of a given batch.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "batchId": "batch-abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "file-abc123", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + }, + { + "id": "file-abc456", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + } + ], + "first_id": "file-abc123", + "last_id": "file-abc456", + "has_more": false + } + } + }, + "operationId": "ListVectorStoreFileBatchFiles" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_files.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_files.json new file mode 100644 index 000000000000..5d8062cf8589 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_store_files.json @@ -0,0 +1,45 @@ +{ + "title": "Returns a list of vector store files.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "file-abc123", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + }, + { + "id": "file-abc456", + "usage_bytes": 1234, + "status": "completed", + "last_error": null, + "object": "vector_store.file", + "created_at": 1699061776, + "vector_store_id": "vs_abc123", + "chunking_strategy": { + "type": "other" + } + } + ], + "first_id": "file-abc123", + "last_id": "file-abc456", + "has_more": false + } + } + }, + "operationId": "ListVectorStoreFiles" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_stores.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_stores.json new file mode 100644 index 000000000000..f30be4521569 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/list_vector_stores.json @@ -0,0 +1,54 @@ +{ + "title": "Returns a list of vector stores.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview" + }, + "responses": { + "200": { + "body": { + "object": "list", + "data": [ + { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "in_progress", + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + }, + "last_active_at": 1699061776, + "metadata": {} + }, + { + "id": "vs_abc456", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ v2", + "usage_bytes": 139920, + "status": "in_progress", + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + }, + "last_active_at": 1699061776, + "metadata": {} + } + ], + "first_id": "vs_abc123", + "last_id": "vs_abc456", + "has_more": false + } + } + }, + "operationId": "ListVectorStores" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/modify_vector_store.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/modify_vector_store.json new file mode 100644 index 000000000000..27ad3552de68 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/modify_vector_store.json @@ -0,0 +1,33 @@ +{ + "title": "Modifies a vector store.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "vectorStoreId": "vs_abc123", + "body": { + "name": "Support FAQ" + } + }, + "responses": { + "200": { + "body": { + "id": "vs_abc123", + "object": "vector_store", + "created_at": 1699061776, + "name": "Support FAQ", + "usage_bytes": 139920, + "status": "completed", + "last_active_at": 1699061776, + "metadata": {}, + "file_counts": { + "in_progress": 0, + "completed": 3, + "failed": 0, + "cancelled": 0, + "total": 3 + } + } + } + }, + "operationId": "ModifyVectorStore" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/submit_tool_outputs_to_run.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/submit_tool_outputs_to_run.json new file mode 100644 index 000000000000..ce162f9badb8 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/submit_tool_outputs_to_run.json @@ -0,0 +1,80 @@ +{ + "title": "When a run has the `status: \"requires_action\"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request.\n", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_123", + "runId": "run_123", + "body": { + "tool_outputs": [ + { + "tool_call_id": "call_001", + "output": "70 degrees and sunny." + } + ] + } + }, + "responses": { + "200": { + "body": { + "id": "run_123", + "object": "thread.run", + "created_at": 1699075592, + "assistant_id": "asst_123", + "thread_id": "thread_123", + "status": "queued", + "started_at": 1699075592, + "expires_at": 1699076192, + "cancelled_at": null, + "failed_at": null, + "completed_at": null, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "tools": [ + { + "type": "function", + "function": { + "name": "get_current_weather", + "description": "Get the current weather in a given location", + "parameters": { + "type": "object", + "properties": { + "location": { + "type": "string", + "description": "The city and state, e.g. San Francisco, CA" + }, + "unit": { + "type": "string", + "enum": [ + "celsius", + "fahrenheit" + ] + } + }, + "required": [ + "location" + ] + } + } + } + ], + "metadata": {}, + "usage": null, + "temperature": 1.0, + "top_p": 1.0, + "incomplete_details": null, + "max_prompt_tokens": 1000, + "max_completion_tokens": 1000, + "truncation_strategy": { + "type": "auto", + "last_messages": null + }, + "response_format": "auto", + "tool_choice": "auto" + } + } + }, + "operationId": "SubmitToolOutputsToRun" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_assistant.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_assistant.json new file mode 100644 index 000000000000..f73ce276994b --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_assistant.json @@ -0,0 +1,45 @@ +{ + "title": "Modifies an assistant.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "assistantId": "asst_abc123", + "body": { + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + "tools": [ + { + "type": "file_search" + } + ], + "model": "gpt-4-turbo" + } + }, + "responses": { + "200": { + "body": { + "id": "asst_123", + "object": "assistant", + "created_at": 1699009709, + "name": "HR Helper", + "description": null, + "model": "gpt-4-turbo", + "instructions": "You are an HR bot, and you have access to files to answer employee questions about company policies. Always response with info from either of the files.", + "tools": [ + { + "type": "file_search" + } + ], + "tool_resources": { + "file_search": { + "vector_store_ids": [] + } + }, + "metadata": {}, + "top_p": 1.0, + "temperature": 1.0, + "response_format": "auto" + } + } + }, + "operationId": "UpdateAssistant" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_message.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_message.json new file mode 100644 index 000000000000..cbf06632e75b --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_message.json @@ -0,0 +1,47 @@ +{ + "title": "Modify a message.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "messageId": "msg_abc123 ", + "body": { + "metadata": { + "modified": "true", + "user": "abc123" + } + } + }, + "responses": { + "200": { + "body": { + "id": "msg_abc123", + "object": "thread.message", + "created_at": 1699017614, + "assistant_id": null, + "thread_id": "thread_abc123", + "status": "complete", + "incomplete_details": null, + "completed_at": 1699017614, + "incomplete_at": null, + "run_id": null, + "role": "user", + "content": [ + { + "type": "text", + "text": { + "value": "How does AI work? Explain it in simple terms.", + "annotations": [] + } + } + ], + "attachments": [], + "metadata": { + "modified": "true", + "user": "abc123" + } + } + } + }, + "operationId": "UpdateMessage" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_run.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_run.json new file mode 100644 index 000000000000..0169fcc9e0c4 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_run.json @@ -0,0 +1,60 @@ +{ + "title": "Modifies a run.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_abc123", + "runId": "run_abc123", + "body": { + "metadata": { + "user_id": "user_abc123" + } + } + }, + "responses": { + "200": { + "body": { + "id": "run_abc123", + "object": "thread.run", + "created_at": 1699075072, + "assistant_id": "asst_abc123", + "thread_id": "thread_abc123", + "status": "completed", + "started_at": 1699075072, + "expires_at": null, + "cancelled_at": null, + "failed_at": null, + "completed_at": 1699075073, + "parallel_tool_calls": true, + "last_error": null, + "model": "gpt-4-turbo", + "instructions": "", + "incomplete_details": null, + "tools": [ + { + "type": "code_interpreter" + } + ], + "metadata": { + "user_id": "user_abc123" + }, + "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" + } + } + }, + "operationId": "UpdateRun" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_thread.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_thread.json new file mode 100644 index 000000000000..92819d554035 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/update_thread.json @@ -0,0 +1,29 @@ +{ + "title": "Modifies a thread.", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "threadId": "thread_v7V4csrNOxtNmgcwGg496Smx", + "body": { + "metadata": { + "modified": "true", + "user": "abc123" + } + } + }, + "responses": { + "200": { + "body": { + "id": "thread_v7V4csrNOxtNmgcwGg496Smx", + "object": "thread", + "created_at": 1707297136, + "metadata": { + "modified": "true", + "user": "abc123" + }, + "tool_resources": {} + } + } + }, + "operationId": "UpdateThread" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/upload_file.json b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/upload_file.json new file mode 100644 index 000000000000..a2de8664f909 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV2/preview/2025-01-01-preview/examples/upload_file.json @@ -0,0 +1,30 @@ +{ + "title": "Uploads a file", + "parameters": { + "endpoint": "{endpoint}", + "api-version": "2025-01-01-preview", + "purpose": "assistants", + "file": [ + 0, + 1, + 0, + 1, + 0 + ] + }, + "responses": { + "200": { + "body": { + "object": "file", + "id": "assistant-uzdgnx4i8PPe96zgXQ1vJ9W3", + "purpose": "assistants", + "filename": "test78686269-a3d7-4c96-be67-fecdf3f39de8.txt", + "bytes": 4, + "created_at": 1718886199, + "status": "processed", + "status_details": null + } + } + }, + "operationId": "UploadFile" +} diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-02-15-preview/assistants_generated.yaml b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-02-15-preview/assistants_generated.yaml index 6ba18d22bdc6..2f201d3f6cfd 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-02-15-preview/assistants_generated.yaml +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-02-15-preview/assistants_generated.yaml @@ -55,7 +55,7 @@ paths: - 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. + 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, starting 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 @@ -415,7 +415,7 @@ paths: - 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. + 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, starting 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 @@ -575,7 +575,7 @@ paths: - 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. + 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, starting 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 @@ -741,7 +741,7 @@ paths: - 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. + 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, starting 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 @@ -2412,6 +2412,7 @@ components: - 2024-07-01-preview - 2024-09-01-preview - 2024-10-01-preview + - 2025-01-01-preview description: The known set of supported API versions. SubmitToolOutputsAction: type: object diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-05-01-preview/assistants_generated.yaml b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-05-01-preview/assistants_generated.yaml index f4bc587645df..1d2df3ad8a2a 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-05-01-preview/assistants_generated.yaml +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-05-01-preview/assistants_generated.yaml @@ -55,7 +55,7 @@ paths: - 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. + 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, starting 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 @@ -422,7 +422,7 @@ paths: - 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. + 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, starting 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 @@ -582,7 +582,7 @@ paths: - 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. + 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, starting 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 @@ -748,7 +748,7 @@ paths: - 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. + 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, starting 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 @@ -890,7 +890,7 @@ paths: - 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. + 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, starting 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 @@ -1138,7 +1138,7 @@ paths: - 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. + 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, starting 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 @@ -1221,7 +1221,7 @@ paths: - 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. + 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, starting 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 @@ -1350,6 +1350,7 @@ components: enum: - text - json_object + - json_schema description: Possible API response formats. Assistant: type: object @@ -1619,15 +1620,35 @@ components: description: The details used to create a new assistant thread. AssistantsApiResponseFormat: type: object + required: + - type properties: type: allOf: - $ref: '#/components/schemas/ApiResponseFormat' - description: Must be one of `text` or `json_object`. + description: Must be one of `text`, `json_object` or `json_schema` . default: text + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/AssistantsApiResponseFormatText' + json_object: '#/components/schemas/AssistantsApiResponseFormatJsonObject' description: |- An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed. + AssistantsApiResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: 'The type of response format being defined: `json_object`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as a JSON object. AssistantsApiResponseFormatMode: anyOf: - type: string @@ -1642,14 +1663,30 @@ components: - $ref: '#/components/schemas/AssistantsApiResponseFormatMode' - $ref: '#/components/schemas/AssistantsApiResponseFormat' description: |- - Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, 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. - Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + 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. + AssistantsApiResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: 'The type of response format being defined: `text`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as text. AssistantsApiToolChoiceOption: anyOf: - type: string @@ -3231,7 +3268,7 @@ components: type: object additionalProperties: type: string - description: Reserved for future use. + description: The results of the file search. allOf: - $ref: '#/components/schemas/RunStepToolCall' description: |- @@ -3395,6 +3432,7 @@ components: - 2024-07-01-preview - 2024-09-01-preview - 2024-10-01-preview + - 2025-01-01-preview description: The known set of supported API versions. SubmitToolOutputsAction: type: object diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-07-01-preview/assistants_generated.yaml b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-07-01-preview/assistants_generated.yaml index c6f5bcc31b9f..e6381ddcd0b0 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-07-01-preview/assistants_generated.yaml +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-07-01-preview/assistants_generated.yaml @@ -55,7 +55,7 @@ paths: - 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. + 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, starting 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 @@ -422,7 +422,7 @@ paths: - 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. + 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, starting 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 @@ -582,7 +582,7 @@ paths: - 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. + 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, starting 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 @@ -748,7 +748,7 @@ paths: - 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. + 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, starting 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 @@ -890,7 +890,7 @@ paths: - 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. + 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, starting 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 @@ -1142,7 +1142,7 @@ paths: - 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. + 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, starting 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 @@ -1225,7 +1225,7 @@ paths: - 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. + 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, starting 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 @@ -1358,6 +1358,7 @@ components: enum: - text - json_object + - json_schema description: Possible API response formats. Assistant: type: object @@ -1627,15 +1628,35 @@ components: description: The details used to create a new assistant thread. AssistantsApiResponseFormat: type: object + required: + - type properties: type: allOf: - $ref: '#/components/schemas/ApiResponseFormat' - description: Must be one of `text` or `json_object`. + description: Must be one of `text`, `json_object` or `json_schema` . default: text + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/AssistantsApiResponseFormatText' + json_object: '#/components/schemas/AssistantsApiResponseFormatJsonObject' description: |- An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed. + AssistantsApiResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: 'The type of response format being defined: `json_object`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as a JSON object. AssistantsApiResponseFormatMode: anyOf: - type: string @@ -1650,14 +1671,30 @@ components: - $ref: '#/components/schemas/AssistantsApiResponseFormatMode' - $ref: '#/components/schemas/AssistantsApiResponseFormat' description: |- - Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, 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. - Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + 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. + AssistantsApiResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: 'The type of response format being defined: `text`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as text. AssistantsApiToolChoiceOption: anyOf: - type: string @@ -3271,7 +3308,7 @@ components: type: object additionalProperties: type: string - description: Reserved for future use. + description: The results of the file search. allOf: - $ref: '#/components/schemas/RunStepToolCall' description: |- @@ -3435,6 +3472,7 @@ components: - 2024-07-01-preview - 2024-09-01-preview - 2024-10-01-preview + - 2025-01-01-preview description: The known set of supported API versions. SubmitToolOutputsAction: type: object diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-09-01-preview/assistants_generated.yaml b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-09-01-preview/assistants_generated.yaml index 7e20294a7b5a..d1f518c5040f 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-09-01-preview/assistants_generated.yaml +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-09-01-preview/assistants_generated.yaml @@ -55,7 +55,7 @@ paths: - 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. + 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, starting 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 @@ -422,7 +422,7 @@ paths: - 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. + 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, starting 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 @@ -582,7 +582,7 @@ paths: - 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. + 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, starting 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 @@ -748,7 +748,7 @@ paths: - 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. + 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, starting 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 @@ -890,7 +890,7 @@ paths: - 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. + 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, starting 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 @@ -1142,7 +1142,7 @@ paths: - 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. + 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, starting 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 @@ -1225,7 +1225,7 @@ paths: - 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. + 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, starting 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 @@ -1358,6 +1358,7 @@ components: enum: - text - json_object + - json_schema description: Possible API response formats. Assistant: type: object @@ -1627,15 +1628,35 @@ components: description: The details used to create a new assistant thread. AssistantsApiResponseFormat: type: object + required: + - type properties: type: allOf: - $ref: '#/components/schemas/ApiResponseFormat' - description: Must be one of `text` or `json_object`. + description: Must be one of `text`, `json_object` or `json_schema` . default: text + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/AssistantsApiResponseFormatText' + json_object: '#/components/schemas/AssistantsApiResponseFormatJsonObject' description: |- An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed. + AssistantsApiResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: 'The type of response format being defined: `json_object`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as a JSON object. AssistantsApiResponseFormatMode: anyOf: - type: string @@ -1650,14 +1671,30 @@ components: - $ref: '#/components/schemas/AssistantsApiResponseFormatMode' - $ref: '#/components/schemas/AssistantsApiResponseFormat' description: |- - Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, 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. - Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + 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. + AssistantsApiResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: 'The type of response format being defined: `text`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as text. AssistantsApiToolChoiceOption: anyOf: - type: string @@ -3279,7 +3316,7 @@ components: type: object additionalProperties: type: string - description: Reserved for future use. + description: The results of the file search. allOf: - $ref: '#/components/schemas/RunStepToolCall' description: |- @@ -3443,6 +3480,7 @@ components: - 2024-07-01-preview - 2024-09-01-preview - 2024-10-01-preview + - 2025-01-01-preview description: The known set of supported API versions. SubmitToolOutputsAction: type: object diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-10-01-preview/assistants_generated.yaml b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-10-01-preview/assistants_generated.yaml index c6248d03fad7..dfee4fe75f33 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-10-01-preview/assistants_generated.yaml +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2024-10-01-preview/assistants_generated.yaml @@ -55,7 +55,7 @@ paths: - 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. + 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, starting 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 @@ -422,7 +422,7 @@ paths: - 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. + 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, starting 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 @@ -582,7 +582,7 @@ paths: - 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. + 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, starting 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 @@ -748,7 +748,7 @@ paths: - 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. + 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, starting 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 @@ -890,7 +890,7 @@ paths: - 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. + 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, starting 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 @@ -1142,7 +1142,7 @@ paths: - 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. + 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, starting 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 @@ -1225,7 +1225,7 @@ paths: - 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. + 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, starting 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 @@ -1358,6 +1358,7 @@ components: enum: - text - json_object + - json_schema description: Possible API response formats. Assistant: type: object @@ -1627,15 +1628,35 @@ components: description: The details used to create a new assistant thread. AssistantsApiResponseFormat: type: object + required: + - type properties: type: allOf: - $ref: '#/components/schemas/ApiResponseFormat' - description: Must be one of `text` or `json_object`. + description: Must be one of `text`, `json_object` or `json_schema` . default: text + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/AssistantsApiResponseFormatText' + json_object: '#/components/schemas/AssistantsApiResponseFormatJsonObject' description: |- An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. If `text` the model can return text or any value needed. + AssistantsApiResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: 'The type of response format being defined: `json_object`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as a JSON object. AssistantsApiResponseFormatMode: anyOf: - type: string @@ -1650,14 +1671,30 @@ components: - $ref: '#/components/schemas/AssistantsApiResponseFormatMode' - $ref: '#/components/schemas/AssistantsApiResponseFormat' description: |- - Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, 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. - Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. + 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. + AssistantsApiResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: 'The type of response format being defined: `text`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as text. AssistantsApiToolChoiceOption: anyOf: - type: string @@ -3279,7 +3316,7 @@ components: type: object additionalProperties: type: string - description: Reserved for future use. + description: The results of the file search. allOf: - $ref: '#/components/schemas/RunStepToolCall' description: |- @@ -3443,6 +3480,7 @@ components: - 2024-07-01-preview - 2024-09-01-preview - 2024-10-01-preview + - 2025-01-01-preview description: The known set of supported API versions. SubmitToolOutputsAction: type: object diff --git a/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2025-01-01-preview/assistants_generated.yaml b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2025-01-01-preview/assistants_generated.yaml new file mode 100644 index 000000000000..b18b81f23e28 --- /dev/null +++ b/specification/ai/data-plane/OpenAI.Assistants/OpenApiV3/2025-01-01-preview/assistants_generated.yaml @@ -0,0 +1,4595 @@ +openapi: 3.0.0 +info: + title: Azure OpenAI + description: Azure OpenAI APIs for Assistants. + version: 2025-01-01-preview +tags: [] +paths: + /assistants: + post: + operationId: createAssistant + description: Creates a new assistant. + parameters: [] + responses: + '200': + description: The new assistant instance. + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AssistantCreationOptions' + description: The request details to use when creating a new assistant. + get: + operationId: listAssistants + description: Gets a list of assistants that were previously created. + parameters: + - 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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 requested list of assistants. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/Assistant' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + /assistants/{assistantId}: + get: + operationId: getAssistant + description: Retrieves an existing assistant. + parameters: + - name: assistantId + in: path + required: true + description: The ID of the assistant to retrieve. + schema: + type: string + responses: + '200': + description: The requested assistant instance. + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + post: + operationId: updateAssistant + description: Modifies an existing assistant. + parameters: + - name: assistantId + in: path + required: true + description: The ID of the assistant to modify. + schema: + type: string + responses: + '200': + description: The updated assistant instance. + content: + application/json: + schema: + $ref: '#/components/schemas/Assistant' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAssistantOptions' + description: The request details to use when modifying an existing assistant. + delete: + operationId: deleteAssistant + description: Deletes an assistant. + parameters: + - name: assistantId + in: path + required: true + description: The ID of the assistant to delete. + schema: + type: string + responses: + '200': + description: Status information about the requested deletion operation. + content: + application/json: + schema: + $ref: '#/components/schemas/AssistantDeletionStatus' + /files: + get: + operationId: listFiles + description: Gets a list of previously uploaded files. + parameters: + - name: purpose + in: query + required: false + description: A value that, when provided, limits list results to files matching the corresponding purpose. + schema: + $ref: '#/components/schemas/FilePurpose' + explode: false + responses: + '200': + description: The requested list of files. + content: + application/json: + schema: + $ref: '#/components/schemas/FileListResponse' + post: + operationId: uploadFile + description: Uploads a file for use by other operations. + parameters: [] + responses: + '200': + description: A representation of the uploaded file. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFile' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + purpose: + allOf: + - $ref: '#/components/schemas/FilePurpose' + description: The intended purpose of the file. + filename: + type: string + description: A filename to associate with the uploaded data. + required: + - file + - purpose + /files/{fileId}: + delete: + operationId: deleteFile + description: Delete a previously uploaded file. + parameters: + - name: fileId + in: path + required: true + description: The ID of the file to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/FileDeletionStatus' + get: + operationId: getFile + description: Returns information about a specific file. Does not retrieve file content. + parameters: + - name: fileId + in: path + required: true + description: The ID of the file to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIFile' + /files/{fileId}/content: + get: + operationId: getFileContent + description: Returns information about a specific file. Does not retrieve file content. + parameters: + - name: fileId + in: path + required: true + description: The ID of the file to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + type: string + format: byte + /threads: + post: + operationId: createThread + description: Creates a new thread. Threads contain messages and can be run by assistants. + parameters: [] + responses: + '200': + description: Information about the newly created thread. + content: + application/json: + schema: + $ref: '#/components/schemas/AssistantThread' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AssistantThreadCreationOptions' + description: The details used to create a new assistant thread. + /threads/runs: + post: + operationId: createThreadAndRun + description: Creates a new assistant thread and immediately starts a run using that new thread. + parameters: [] + responses: + '200': + description: Information about the newly created thread. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadRun' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAndRunThreadOptions' + description: The details used when creating and immediately running a new assistant thread. + /threads/{threadId}: + get: + operationId: getThread + description: Gets information about an existing thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to retrieve information about. + schema: + type: string + responses: + '200': + description: Information about the requested thread. + content: + application/json: + schema: + $ref: '#/components/schemas/AssistantThread' + post: + operationId: updateThread + description: Modifies an existing thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to modify. + schema: + type: string + responses: + '200': + description: Information about the modified thread. + content: + application/json: + schema: + $ref: '#/components/schemas/AssistantThread' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAssistantThreadOptions' + description: The details used to update an existing assistant thread. + delete: + operationId: deleteThread + description: Deletes an existing thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to delete. + schema: + type: string + responses: + '200': + description: Status information about the requested thread deletion operation. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadDeletionStatus' + /threads/{threadId}/messages: + post: + operationId: createMessage + description: Creates a new message on a specified thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to create the new message on. + schema: + type: string + responses: + '200': + description: A representation of the new message. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadMessage' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadMessageOptions' + description: A single message within an assistant thread, as provided during that thread's creation for its initial state. + get: + operationId: listMessages + description: Gets a list of messages that exist on a thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to list messages from. + schema: + type: string + - name: runId + in: query + required: false + description: Filter messages by the run ID that generated them. + 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 + - 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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 requested list of messages. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/ThreadMessage' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + /threads/{threadId}/messages/{messageId}: + get: + operationId: getMessage + description: Gets an existing message from an existing thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to retrieve the specified message from. + schema: + type: string + - name: messageId + in: path + required: true + description: The ID of the message to retrieve from the specified thread. + schema: + type: string + responses: + '200': + description: A representation of the requested message. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadMessage' + post: + operationId: updateMessage + description: Modifies an existing message on an existing thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread containing the specified message to modify. + schema: + type: string + - name: messageId + in: path + required: true + description: The ID of the message to modify on the specified thread. + schema: + type: string + responses: + '200': + description: A representation of the modified message. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadMessage' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + /threads/{threadId}/runs: + post: + operationId: createRun + description: Creates a new run for an assistant thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to run. + schema: + type: string + - name: include[] + in: query + required: false + description: A list of additional fields to include in the response. + schema: + type: array + items: + $ref: '#/components/schemas/RunIncludes' + explode: false + responses: + '200': + description: Information about the new thread run. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadRun' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CreateRunOptions' + description: The details used when creating a new run of an assistant thread. + get: + operationId: listRuns + description: Gets a list of runs for a specified thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to list runs 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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 requested list of thread runs. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/ThreadRun' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + /threads/{threadId}/runs/{runId}: + get: + operationId: getRun + description: Gets an existing run from an existing thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread to retrieve run information from. + schema: + type: string + - name: runId + in: path + required: true + description: The ID of the thread to retrieve information about. + schema: + type: string + responses: + '200': + description: The requested information about the specified thread run. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadRun' + post: + operationId: updateRun + description: Modifies an existing thread run. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread associated with the specified run. + schema: + type: string + - name: runId + in: path + required: true + description: The ID of the run to modify. + schema: + type: string + responses: + '200': + description: Information about the modified run. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadRun' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + /threads/{threadId}/runs/{runId}/cancel: + post: + operationId: cancelRun + description: Cancels a run of an in progress thread. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread being run. + schema: + type: string + - name: runId + in: path + required: true + description: The ID of the run to cancel. + schema: + type: string + responses: + '200': + description: Updated information about the cancelled run. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadRun' + /threads/{threadId}/runs/{runId}/steps: + get: + operationId: listRunSteps + description: Gets a list of run steps from a thread run. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread that was run. + schema: + type: string + - name: runId + in: path + required: true + description: The ID of the run to list steps from. + schema: + type: string + - name: include[] + in: query + required: false + description: A list of additional fields to include in the response. + schema: + type: array + items: + $ref: '#/components/schemas/RunIncludes' + 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 + - 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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 requested list of run steps. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/RunStep' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + /threads/{threadId}/runs/{runId}/steps/{stepId}: + get: + operationId: getRunStep + description: Gets a single run step from a thread run. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread that was run. + schema: + type: string + - name: runId + in: path + required: true + description: The ID of the specific run to retrieve the step from. + schema: + type: string + - name: stepId + in: path + required: true + description: The ID of the step to retrieve information about. + schema: + type: string + - name: include[] + in: query + required: false + description: A list of additional fields to include in the response. + schema: + type: array + items: + $ref: '#/components/schemas/RunIncludes' + explode: false + responses: + '200': + description: Information about the requested run step. + content: + application/json: + schema: + $ref: '#/components/schemas/RunStep' + /threads/{threadId}/runs/{runId}/submit_tool_outputs: + post: + operationId: submitToolOutputsToRun + description: Submits outputs from tools as requested by tool calls in a run. Runs that need submitted tool outputs will have a status of 'requires_action' with a required_action.type of 'submit_tool_outputs'. + parameters: + - name: threadId + in: path + required: true + description: The ID of the thread that was run. + schema: + type: string + - name: runId + in: path + required: true + description: The ID of the run that requires tool outputs. + schema: + type: string + responses: + '200': + description: Updated information about the run. + content: + application/json: + schema: + $ref: '#/components/schemas/ThreadRun' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + tool_outputs: + type: array + items: + $ref: '#/components/schemas/ToolOutput' + description: A list of tools for which the outputs are being submitted. + stream: + type: boolean + nullable: true + 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.' + required: + - tool_outputs + /vector_stores: + get: + operationId: listVectorStores + description: Returns a list of vector stores. + parameters: + - 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/VectorStore' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + post: + operationId: createVectorStore + description: Creates a vector store. + parameters: [] + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStore' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreOptions' + description: Request object for creating a vector store. + /vector_stores/{vectorStoreId}: + get: + operationId: getVectorStore + description: Returns the vector store object matching the specified ID. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store to retrieve. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStore' + post: + operationId: modifyVectorStore + description: The ID of the vector store to modify. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store to modify. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStore' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreUpdateOptions' + description: Request object for updating a vector store. + delete: + operationId: deleteVectorStore + description: Deletes the vector store object matching the specified ID. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store to delete. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreDeletionStatus' + /vector_stores/{vectorStoreId}/file_batches: + post: + operationId: createVectorStoreFileBatch + description: Create a vector store file batch. + parameters: + - name: vectorStoreId + 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. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatch' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + file_ids: + type: array + items: + type: string + minItems: 1 + maxItems: 500 + description: A list of File IDs that the vector store should use. Useful for tools like `file_search` that can access files. + chunking_strategy: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequest' + description: The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. + required: + - file_ids + /vector_stores/{vectorStoreId}/file_batches/{batchId}: + get: + operationId: getVectorStoreFileBatch + description: Retrieve a vector store file batch. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store that the file batch belongs to. + schema: + type: string + - name: batchId + in: path + required: true + description: The ID of the file batch being retrieved. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatch' + /vector_stores/{vectorStoreId}/file_batches/{batchId}/cancel: + post: + operationId: cancelVectorStoreFileBatch + description: Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store that the file batch belongs to. + schema: + type: string + - name: batchId + in: path + required: true + description: The ID of the file batch to cancel. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileBatch' + /vector_stores/{vectorStoreId}/file_batches/{batchId}/files: + get: + operationId: listVectorStoreFileBatchFiles + description: Returns a list of vector store files in a batch. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store that the file batch belongs to. + schema: + type: string + - name: batchId + in: path + required: true + description: The ID of the file batch that the files belong to. + schema: + type: string + - name: filter + in: query + required: false + description: Filter by file status. + schema: + $ref: '#/components/schemas/VectorStoreFileStatusFilter' + 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 + - 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/VectorStoreFile' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + /vector_stores/{vectorStoreId}/files: + get: + operationId: listVectorStoreFiles + description: Returns a list of vector store files. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store that the files belong to. + schema: + type: string + - name: filter + in: query + required: false + description: Filter by file status. + schema: + $ref: '#/components/schemas/VectorStoreFileStatusFilter' + 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 + - 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: + $ref: '#/components/schemas/ListSortOrder' + default: 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, starting 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. + content: + application/json: + schema: + type: object + required: + - object + - data + - first_id + - last_id + - has_more + properties: + object: + type: string + enum: + - list + description: The object type, which is always list. + data: + type: array + items: + $ref: '#/components/schemas/VectorStoreFile' + description: The requested list of items. + first_id: + type: string + description: The first ID represented in this list. + last_id: + type: string + description: The last ID represented in this list. + has_more: + type: boolean + description: A value indicating whether there are additional values available not captured in this list. + description: The response data for a requested list of items. + post: + operationId: createVectorStoreFile + description: Create a vector store file by attaching a file to a vector store. + parameters: + - name: vectorStoreId + 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. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFile' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + file_id: + type: string + description: A File ID that the vector store should use. Useful for tools like `file_search` that can access files. + chunking_strategy: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequest' + description: The chunking strategy used to chunk the file(s). If not set, will use the auto strategy. + required: + - file_id + /vector_stores/{vectorStoreId}/files/{fileId}: + get: + operationId: getVectorStoreFile + description: Retrieves a vector store file. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store that the file belongs to. + schema: + type: string + - name: fileId + in: path + required: true + description: The ID of the file being retrieved. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFile' + delete: + operationId: deleteVectorStoreFile + description: |- + 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 endpoint. + parameters: + - name: vectorStoreId + in: path + required: true + description: The ID of the vector store that the file belongs to. + schema: + type: string + - name: fileId + in: path + required: true + description: The ID of the file to delete its relationship to the vector store. + schema: + type: string + responses: + '200': + description: The request has succeeded. + content: + application/json: + schema: + $ref: '#/components/schemas/VectorStoreFileDeletionStatus' +security: + - ApiKeyAuth: [] + - OAuth2Auth: + - https://cognitiveservices.azure.com/.default +components: + schemas: + ApiResponseFormat: + anyOf: + - type: string + - type: string + enum: + - text + - json_object + - json_schema + description: Possible API response formats. + Assistant: + type: object + required: + - id + - object + - created_at + - name + - description + - model + - instructions + - tools + - tool_resources + - temperature + - top_p + - metadata + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - assistant + description: The object type, which is always assistant. + created_at: + type: integer + format: unixtime + description: The Unix timestamp, in seconds, representing when this object was created. + name: + type: string + nullable: true + description: The name of the assistant. + description: + type: string + nullable: true + description: The description of the assistant. + model: + type: string + description: The ID of the model to use. + instructions: + type: string + nullable: true + description: The system instructions for the assistant to use. + tools: + type: array + items: + $ref: '#/components/schemas/ToolDefinition' + description: The collection of tools enabled for the assistant. + default: [] + tool_resources: + type: object + allOf: + - $ref: '#/components/schemas/ToolResources' + nullable: true + 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. + temperature: + type: number + format: float + nullable: true + 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: + type: number + format: float + nullable: true + 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 + response_format: + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormatOption' + nullable: true + description: The response format of the tool calls used by this assistant. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: Represents an assistant that can call the model and use tools. + AssistantCreationOptions: + type: object + required: + - model + properties: + model: + type: string + description: The ID of the model to use. + name: + type: string + nullable: true + description: The name of the new assistant. + description: + type: string + nullable: true + description: The description of the new assistant. + instructions: + type: string + nullable: true + description: The system instructions for the new assistant to use. + tools: + type: array + items: + $ref: '#/components/schemas/ToolDefinition' + description: The collection of tools to enable for the new assistant. + default: [] + tool_resources: + type: object + allOf: + - $ref: '#/components/schemas/CreateToolResourcesOptions' + nullable: true + 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. + temperature: + type: number + format: float + nullable: true + 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: + type: number + format: float + nullable: true + 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 + response_format: + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormatOption' + nullable: true + description: The response format of the tool calls used by this assistant. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: The request details to use when creating a new assistant. + AssistantDeletionStatus: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + description: The ID of the resource specified for deletion. + deleted: + type: boolean + description: A value indicating whether deletion was successful. + object: + type: string + enum: + - assistant.deleted + description: The object type, which is always 'assistant.deleted'. + description: The status of an assistant deletion operation. + AssistantStreamEvent: + anyOf: + - type: string + - anyOf: + - $ref: '#/components/schemas/ThreadStreamEvent' + - $ref: '#/components/schemas/RunStreamEvent' + - $ref: '#/components/schemas/RunStepStreamEvent' + - $ref: '#/components/schemas/MessageStreamEvent' + - $ref: '#/components/schemas/ErrorEvent' + - $ref: '#/components/schemas/DoneEvent' + description: |- + Each event in a server-sent events stream has an `event` and `data` property: + + ``` + event: thread.created + data: {"id": "thread_123", "object": "thread", ...} + ``` + + We emit events whenever a new object is created, transitions to a new state, or is being + streamed in parts (deltas). For example, we emit `thread.run.created` when a new run + is created, `thread.run.completed` when a run completes, and so on. When an Assistant chooses + to create a message during a run, we emit a `thread.message.created event`, a + `thread.message.in_progress` event, many `thread.message.delta` events, and finally a + `thread.message.completed` event. + + We may add additional events over time, so we recommend handling unknown events gracefully + in your code. + AssistantThread: + 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'. + created_at: + type: integer + format: unixtime + description: The Unix timestamp, in seconds, representing when this object was created. + tool_resources: + type: object + allOf: + - $ref: '#/components/schemas/ToolResources' + nullable: true + description: |- + A set of resources that are made available to the assistant's tools in this thread. 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: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: Information about a single thread associated with an assistant. + AssistantThreadCreationOptions: + type: object + properties: + messages: + type: array + items: + $ref: '#/components/schemas/ThreadMessageOptions' + description: The initial messages to associate with the new thread. + tool_resources: + type: object + allOf: + - $ref: '#/components/schemas/CreateToolResourcesOptions' + nullable: true + description: |- + A set of resources that are made available to the assistant's tools in this thread. 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: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: The details used to create a new assistant thread. + AssistantsApiResponseFormat: + type: object + required: + - type + properties: + type: + allOf: + - $ref: '#/components/schemas/ApiResponseFormat' + description: Must be one of `text`, `json_object` or `json_schema` . + default: text + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/AssistantsApiResponseFormatText' + json_object: '#/components/schemas/AssistantsApiResponseFormatJsonObject' + json_schema: '#/components/schemas/AssistantsApiResponseFormatJsonSchema' + description: |- + An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run. + If `text` the model can return text or any value needed. + AssistantsApiResponseFormatJsonObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - json_object + description: 'The type of response format being defined: `json_object`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as a JSON object. + AssistantsApiResponseFormatJsonSchema: + type: object + required: + - type + - json_schema + properties: + type: + type: string + enum: + - json_schema + description: 'The type of response format being defined: `json_schema`' + json_schema: + type: object + properties: + 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: + description: The schema for the response format, described as a JSON Schema object. + strict: + type: boolean + description: Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. To learn more, read the Structured Outputs guide. + required: + - name + - schema + description: The JSON schema that the model must output. + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model to match a JSON schema. + AssistantsApiResponseFormatMode: + anyOf: + - type: string + - type: string + enum: + - auto + description: Represents the mode in which the model will handle the return format of a tool call. + AssistantsApiResponseFormatOption: + anyOf: + - type: string + - $ref: '#/components/schemas/AssistantsApiResponseFormatMode' + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: |- + Specifies the format that the model must output. Compatible with GPT-4o, GPT-4 Turbo, 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. + + 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. + AssistantsApiResponseFormatText: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: 'The type of response format being defined: `text`' + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormat' + description: An object describing expected output of the model as text. + AssistantsApiToolChoiceOption: + anyOf: + - type: string + - $ref: '#/components/schemas/AssistantsApiToolChoiceOptionMode' + - $ref: '#/components/schemas/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 a tool. + Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` + forces the model to call that tool. + AssistantsApiToolChoiceOptionMode: + anyOf: + - type: string + - type: string + enum: + - none + - auto + description: Specifies how the tool choice will be used + AssistantsNamedToolChoice: + type: object + required: + - type + properties: + type: + allOf: + - $ref: '#/components/schemas/AssistantsNamedToolChoiceType' + description: the type of tool. If type is `function`, the function name must be set. + function: + allOf: + - $ref: '#/components/schemas/FunctionName' + description: The name of the function to call + description: Specifies a tool the model should use. Use to force the model to call a specific tool. + AssistantsNamedToolChoiceType: + anyOf: + - type: string + - type: string + enum: + - function + - code_interpreter + - file_search + description: Available tool types for assistants named tools. + CodeInterpreterToolDefinition: + type: object + required: + - type + properties: + type: + type: string + enum: + - code_interpreter + description: The object type, which is always 'code_interpreter'. + allOf: + - $ref: '#/components/schemas/ToolDefinition' + description: The input definition information for a code interpreter tool as used to configure an assistant. + CodeInterpreterToolResource: + type: object + required: + - file_ids + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + description: |- + A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + default: [] + description: A set of resources that are used by the `code_interpreter` tool. + CreateAndRunThreadOptions: + type: object + required: + - assistant_id + properties: + assistant_id: + type: string + description: The ID of the assistant for which the thread should be created. + thread: + allOf: + - $ref: '#/components/schemas/AssistantThreadCreationOptions' + description: The details used to create the new thread. If no thread is provided, an empty one will be created. + model: + type: string + nullable: true + description: The overridden model that the assistant should use to run the thread. + instructions: + type: string + nullable: true + description: The overridden system instructions the assistant should use to run the thread. + tools: + type: array + items: + $ref: '#/components/schemas/ToolDefinition' + nullable: true + description: The overridden list of enabled tools the assistant should use to run the thread. + parallel_tool_calls: + type: boolean + description: Whether to enable parallel function calling during tool use. + default: true + tool_resources: + type: object + allOf: + - $ref: '#/components/schemas/UpdateToolResourcesOptions' + nullable: true + description: Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + stream: + type: boolean + 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. + temperature: + type: number + format: float + nullable: true + 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: + type: number + format: float + nullable: true + 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 + max_prompt_tokens: + type: integer + format: int32 + nullable: true + 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: + type: integer + format: int32 + nullable: true + 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: + type: object + allOf: + - $ref: '#/components/schemas/TruncationObject' + nullable: true + description: The strategy to use for dropping messages as the context windows moves forward. + tool_choice: + allOf: + - $ref: '#/components/schemas/AssistantsApiToolChoiceOption' + nullable: true + description: Controls whether or not and which tool is called by the model. + response_format: + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormatOption' + nullable: true + description: Specifies the format that the model must output. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: The details used when creating and immediately running a new assistant thread. + CreateCodeInterpreterToolResourceOptions: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + description: A list of file IDs made available to the `code_interpreter` tool. + default: [] + description: A set of resources that will be used by the `code_interpreter` tool. Request object. + CreateFileSearchToolResourceOptions: + anyOf: + - type: array + items: + type: string + - type: array + items: + $ref: '#/components/schemas/CreateFileSearchToolResourceVectorStoreOptions' + 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. + CreateFileSearchToolResourceVectorStoreOptions: + type: object + required: + - file_ids + - chunking_strategy + properties: + file_ids: + type: array + items: + type: string + maxItems: 10000 + description: A list of file IDs to add to the vector store. There can be a maximum of 10000 files in a vector store. + chunking_strategy: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequest' + description: The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: File IDs associated to the vector store to be passed to the helper. + CreateRunOptions: + type: object + required: + - assistant_id + properties: + assistant_id: + type: string + description: The ID of the assistant that should run the thread. + model: + type: string + nullable: true + description: The overridden model name that the assistant should use to run the thread. + instructions: + type: string + nullable: true + description: The overridden system instructions that the assistant should use to run the thread. + additional_instructions: + type: string + nullable: true + description: |- + Additional instructions to append 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: + type: array + items: + $ref: '#/components/schemas/ThreadMessage' + nullable: true + description: Adds additional messages to the thread before creating the run. + tools: + type: array + items: + $ref: '#/components/schemas/ToolDefinition' + nullable: true + description: The overridden list of enabled tools that the assistant should use to run the thread. + parallel_tool_calls: + type: boolean + description: Whether to enable parallel function calling during tool use. + default: true + stream: + type: boolean + 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. + temperature: + type: number + format: float + nullable: true + 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: + type: number + format: float + nullable: true + 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 + max_prompt_tokens: + type: integer + format: int32 + nullable: true + 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: + type: integer + format: int32 + nullable: true + 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: + type: object + allOf: + - $ref: '#/components/schemas/TruncationObject' + nullable: true + description: The strategy to use for dropping messages as the context windows moves forward. + tool_choice: + allOf: + - $ref: '#/components/schemas/AssistantsApiToolChoiceOption' + nullable: true + description: Controls whether or not and which tool is called by the model. + response_format: + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormatOption' + nullable: true + description: Specifies the format that the model must output. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: The details used when creating a new run of an assistant thread. + CreateToolResourcesOptions: + type: object + properties: + code_interpreter: + allOf: + - $ref: '#/components/schemas/CreateCodeInterpreterToolResourceOptions' + description: |- + A list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + file_search: + allOf: + - $ref: '#/components/schemas/CreateFileSearchToolResourceOptions' + description: A list of vector stores or their IDs made available to the `file_search` tool. + description: |- + Request object. 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. + DoneEvent: + anyOf: + - type: string + - type: string + enum: + - done + description: Terminal event indicating the successful end of a stream. + ErrorEvent: + anyOf: + - type: string + - type: string + enum: + - error + description: Terminal event indicating a server side error while streaming. + FileDeletionStatus: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + description: The ID of the resource specified for deletion. + deleted: + type: boolean + description: A value indicating whether deletion was successful. + object: + type: string + enum: + - file + description: The object type, which is always 'file'. + description: A status response from a file deletion operation. + FileListResponse: + type: object + required: + - object + - data + properties: + object: + type: string + enum: + - list + description: The object type, which is always 'list'. + data: + type: array + items: + $ref: '#/components/schemas/OpenAIFile' + description: The files returned for the request. + description: The response data from a file list operation. + FilePurpose: + anyOf: + - type: string + - type: string + enum: + - fine-tune + - fine-tune-results + - assistants + - assistants_output + - batch + - batch_output + - vision + description: The possible values denoting the intended usage of a file. + FileSearchToolCallResult: + 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 + format: double + 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/FileSearchToolCallResultContentItem' + description: The content of the result that was found. The content is only included if requested via the include query parameter. + description: File search tool call result + FileSearchToolCallResultContentItem: + type: object + properties: + type: + type: string + enum: + - text + description: The type of the content. + text: + type: string + description: The text content of the file. + description: Content item in a file search result + FileSearchToolDefinition: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_search + description: The object type, which is always 'file_search'. + file_search: + allOf: + - $ref: '#/components/schemas/FileSearchToolDefinitionDetails' + description: Options overrides for the file search tool. + allOf: + - $ref: '#/components/schemas/ToolDefinition' + description: The input definition information for a file search tool as used to configure an assistant. + FileSearchToolDefinitionDetails: + type: object + properties: + max_num_results: + type: integer + format: int32 + minimum: 1 + maximum: 50 + description: |- + The maximum number of results the file search tool should output. The default is 20 for gpt-4* models and 5 for gpt-3.5-turbo. This number should be between 1 and 50 inclusive. + + Note that the file search tool may output fewer than `max_num_results` results. See the file search tool documentation for more information. + description: Options overrides for the file search tool. + FileSearchToolResource: + type: object + properties: + vector_store_ids: + type: array + items: + type: string + maxItems: 1 + description: |- + The ID of the vector store attached to this assistant. There can be a maximum of 1 vector + store attached to the assistant. + description: A set of resources that are used by the `file_search` tool. + FileState: + anyOf: + - type: string + - type: string + enum: + - uploaded + - pending + - running + - processed + - error + - deleting + - deleted + description: The state of the file. + FunctionDefinition: + type: object + required: + - name + - parameters + properties: + name: + type: string + description: The name of the function to be called. + description: + type: string + description: A description of what the function does, used by the model to choose when and how to call the function. + parameters: + description: The parameters the functions accepts, described as a JSON Schema object. + description: The input definition information for a function. + FunctionName: + type: object + required: + - name + properties: + name: + type: string + description: The name of the function to call + description: The function name that will be used, if using the `function` tool + FunctionToolDefinition: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + description: The object type, which is always 'function'. + function: + allOf: + - $ref: '#/components/schemas/FunctionDefinition' + description: The definition of the concrete function that the function tool should call. + allOf: + - $ref: '#/components/schemas/ToolDefinition' + description: The input definition information for a function tool as used to configure an assistant. + IncompleteRunDetails: + anyOf: + - type: string + - type: string + enum: + - max_completion_tokens + - max_prompt_tokens + description: The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + ListSortOrder: + anyOf: + - type: string + - type: string + enum: + - asc + - desc + description: The available sorting options when requesting a list of response objects. + MessageAttachment: + type: object + required: + - file_id + - tools + properties: + file_id: + type: string + description: The ID of the file to attach to the message. + tools: + type: array + items: + $ref: '#/components/schemas/MessageAttachmentToolDefinition' + description: The tools to add to this file. + description: This describes to which tools a file has been attached. + MessageAttachmentToolDefinition: + anyOf: + - $ref: '#/components/schemas/CodeInterpreterToolDefinition' + - $ref: '#/components/schemas/FileSearchToolDefinition' + description: The possible tools to which files will be added by this message + MessageContent: + type: object + required: + - type + properties: + type: + type: string + description: The object type. + discriminator: + propertyName: type + mapping: + text: '#/components/schemas/MessageTextContent' + image_file: '#/components/schemas/MessageImageFileContent' + description: An abstract representation of a single item of thread message content. + MessageDelta: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/MessageRole' + description: The entity that produced the message. + content: + type: array + items: + $ref: '#/components/schemas/MessageDeltaContent' + description: The content of the message as an array of text and/or images. + description: Represents the typed 'delta' payload within a streaming message delta chunk. + MessageDeltaChunk: + type: object + required: + - id + - object + - delta + properties: + id: + type: string + description: The identifier of the message, which can be referenced in API endpoints. + object: + type: string + enum: + - thread.message.delta + description: The object type, which is always `thread.message.delta`. + delta: + allOf: + - $ref: '#/components/schemas/MessageDelta' + description: The delta containing the fields that have changed on the Message. + description: Represents a message delta i.e. any changed fields on a message during streaming. + MessageDeltaContent: + type: object + required: + - index + - type + properties: + index: + type: integer + format: int32 + description: The index of the content part of the message. + type: + type: string + description: The type of content for this content part. + discriminator: + propertyName: type + mapping: + image_file: '#/components/schemas/MessageDeltaImageFileContent' + text: '#/components/schemas/MessageDeltaTextContentObject' + description: The abstract base representation of a partial streamed message content payload. + MessageDeltaImageFileContent: + type: object + required: + - type + properties: + type: + type: string + enum: + - image_file + description: The type of content for this content part, which is always "image_file." + image_file: + allOf: + - $ref: '#/components/schemas/MessageDeltaImageFileContentObject' + description: The image_file data. + allOf: + - $ref: '#/components/schemas/MessageDeltaContent' + description: Represents a streamed image file content part within a streaming message delta chunk. + MessageDeltaImageFileContentObject: + type: object + properties: + file_id: + type: string + description: The file ID of the image in the message content. + description: Represents the 'image_file' payload within streaming image file content. + MessageDeltaTextAnnotation: + type: object + required: + - index + - type + properties: + index: + type: integer + format: int32 + description: The index of the annotation within a text content part. + type: + type: string + description: The type of the text content annotation. + discriminator: + propertyName: type + mapping: + file_citation: '#/components/schemas/MessageDeltaTextFileCitationAnnotationObject' + file_path: '#/components/schemas/MessageDeltaTextFilePathAnnotationObject' + description: The abstract base representation of a streamed text content part's text annotation. + MessageDeltaTextContent: + type: object + properties: + value: + type: string + description: The data that makes up the text. + annotations: + type: array + items: + $ref: '#/components/schemas/MessageDeltaTextAnnotation' + description: Annotations for the text. + description: Represents the data of a streamed text content part within a streaming message delta chunk. + MessageDeltaTextContentObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - text + description: The type of content for this content part, which is always "text." + text: + allOf: + - $ref: '#/components/schemas/MessageDeltaTextContent' + description: The text content details. + allOf: + - $ref: '#/components/schemas/MessageDeltaContent' + description: Represents a streamed text content part within a streaming message delta chunk. + MessageDeltaTextFileCitationAnnotation: + type: object + properties: + file_id: + type: string + description: The ID of the specific file the citation is from. + quote: + type: string + description: The specific quote in the cited file. + description: Represents the data of a streamed file citation as applied to a streaming text content part. + MessageDeltaTextFileCitationAnnotationObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_citation + description: The type of the text content annotation, which is always "file_citation." + file_citation: + allOf: + - $ref: '#/components/schemas/MessageDeltaTextFileCitationAnnotation' + description: The file citation information. + text: + type: string + description: The text in the message content that needs to be replaced + start_index: + type: integer + format: int32 + description: The start index of this annotation in the content text. + end_index: + type: integer + format: int32 + description: The end index of this annotation in the content text. + allOf: + - $ref: '#/components/schemas/MessageDeltaTextAnnotation' + description: Represents a streamed file citation applied to a streaming text content part. + MessageDeltaTextFilePathAnnotation: + type: object + properties: + file_id: + type: string + description: The file ID for the annotation. + description: Represents the data of a streamed file path annotation as applied to a streaming text content part. + MessageDeltaTextFilePathAnnotationObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_path + description: The type of the text content annotation, which is always "file_path." + file_path: + allOf: + - $ref: '#/components/schemas/MessageDeltaTextFilePathAnnotation' + description: The file path information. + start_index: + type: integer + format: int32 + description: The start index of this annotation in the content text. + end_index: + type: integer + format: int32 + description: The end index of this annotation in the content text. + text: + type: string + description: The text in the message content that needs to be replaced + allOf: + - $ref: '#/components/schemas/MessageDeltaTextAnnotation' + description: Represents a streamed file path annotation applied to a streaming text content part. + MessageDeltaTextUrlCitationDetails: + type: object + properties: + url: + type: string + description: The URL where the citation is from. + title: + type: string + description: The title of the URL. + description: A representation of the URL used for the text citation. + MessageImageFileContent: + type: object + required: + - type + - image_file + properties: + type: + type: string + enum: + - image_file + description: The object type, which is always 'image_file'. + image_file: + allOf: + - $ref: '#/components/schemas/MessageImageFileDetails' + description: The image file for this thread message content item. + allOf: + - $ref: '#/components/schemas/MessageContent' + description: A representation of image file content in a thread message. + MessageImageFileDetails: + type: object + required: + - file_id + properties: + file_id: + type: string + description: The ID for the file associated with this image. + description: An image reference, as represented in thread message content. + MessageIncompleteDetails: + type: object + required: + - reason + properties: + reason: + allOf: + - $ref: '#/components/schemas/MessageIncompleteDetailsReason' + description: The provided reason describing why the message was marked as incomplete. + description: Information providing additional detail about a message entering an incomplete status. + MessageIncompleteDetailsReason: + anyOf: + - type: string + - type: string + enum: + - content_filter + - max_tokens + - run_cancelled + - run_failed + - run_expired + description: A set of reasons describing why a message is marked as incomplete. + MessageRole: + anyOf: + - type: string + - type: string + enum: + - user + - assistant + description: The possible values for roles attributed to messages in a thread. + MessageStatus: + anyOf: + - type: string + - type: string + enum: + - in_progress + - incomplete + - completed + description: The possible execution status values for a thread message. + MessageStreamEvent: + anyOf: + - type: string + - type: string + enum: + - thread.message.created + - thread.message.in_progress + - thread.message.delta + - thread.message.completed + - thread.message.incomplete + description: Message operation related streaming events + MessageTextAnnotation: + type: object + required: + - type + - text + properties: + type: + type: string + description: The object type. + text: + type: string + description: The textual content associated with this text annotation item. + discriminator: + propertyName: type + mapping: + file_citation: '#/components/schemas/MessageTextFileCitationAnnotation' + file_path: '#/components/schemas/MessageTextFilePathAnnotation' + description: An abstract representation of an annotation to text thread message content. + MessageTextContent: + type: object + required: + - type + - text + properties: + type: + type: string + enum: + - text + description: The object type, which is always 'text'. + text: + allOf: + - $ref: '#/components/schemas/MessageTextDetails' + description: The text and associated annotations for this thread message content item. + allOf: + - $ref: '#/components/schemas/MessageContent' + description: A representation of a textual item of thread message content. + MessageTextDetails: + type: object + required: + - value + - annotations + properties: + value: + type: string + description: The text data. + annotations: + type: array + items: + $ref: '#/components/schemas/MessageTextAnnotation' + description: A list of annotations associated with this text. + description: The text and associated annotations for a single item of assistant thread message content. + MessageTextFileCitationAnnotation: + type: object + required: + - type + - file_citation + properties: + type: + type: string + enum: + - file_citation + description: The object type, which is always 'file_citation'. + file_citation: + allOf: + - $ref: '#/components/schemas/MessageTextFileCitationDetails' + description: |- + A citation within the message that points to a specific quote from a specific file. + Generated when the assistant uses the "file_search" tool to search files. + start_index: + type: integer + format: int32 + description: The first text index associated with this text annotation. + end_index: + type: integer + format: int32 + description: The last text index associated with this text annotation. + allOf: + - $ref: '#/components/schemas/MessageTextAnnotation' + 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. + MessageTextFileCitationDetails: + type: object + required: + - file_id + - quote + properties: + file_id: + type: string + description: The ID of the file associated with this citation. + quote: + type: string + description: The specific quote cited in the associated file. + description: A representation of a file-based text citation, as used in a file-based annotation of text thread message content. + MessageTextFilePathAnnotation: + type: object + required: + - type + - file_path + properties: + type: + type: string + enum: + - file_path + description: The object type, which is always 'file_path'. + file_path: + allOf: + - $ref: '#/components/schemas/MessageTextFilePathDetails' + description: A URL for the file that's generated when the assistant used the code_interpreter tool to generate a file. + start_index: + type: integer + format: int32 + description: The first text index associated with this text annotation. + end_index: + type: integer + format: int32 + description: The last text index associated with this text annotation. + allOf: + - $ref: '#/components/schemas/MessageTextAnnotation' + description: A citation within the message that points to a file located at a specific path. + MessageTextFilePathDetails: + type: object + required: + - file_id + properties: + file_id: + type: string + description: The ID of the specific file that the citation is from. + description: An encapsulation of an image file ID, as used by message image content. + OpenAIFile: + type: object + required: + - object + - id + - bytes + - filename + - created_at + - purpose + properties: + object: + type: string + enum: + - file + description: The object type, which is always 'file'. + id: + type: string + description: The identifier, which can be referenced in API endpoints. + bytes: + type: integer + format: int32 + description: The size of the file, in bytes. + filename: + type: string + description: The name of the file. + created_at: + type: integer + format: unixtime + description: The Unix timestamp, in seconds, representing when this object was created. + purpose: + allOf: + - $ref: '#/components/schemas/FilePurpose' + description: The intended purpose of a file. + status: + allOf: + - $ref: '#/components/schemas/FileState' + description: The state of the file. This field is available in Azure OpenAI only. + status_details: + type: string + description: The error message with details in case processing of this file failed. This field is available in Azure OpenAI only. + description: Represents an assistant that can call the model and use tools. + RequiredAction: + type: object + required: + - type + properties: + type: + type: string + description: The object type. + discriminator: + propertyName: type + mapping: + submit_tool_outputs: '#/components/schemas/SubmitToolOutputsAction' + description: An abstract representation of a required action for an assistant thread run to continue. + RequiredFunctionToolCall: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + description: The object type of the required tool call. Always 'function' for function tools. + function: + allOf: + - $ref: '#/components/schemas/RequiredFunctionToolCallDetails' + description: Detailed information about the function to be executed by the tool that includes name and arguments. + allOf: + - $ref: '#/components/schemas/RequiredToolCall' + description: A representation of a requested call to a function tool, needed by the model to continue evaluation of a run. + RequiredFunctionToolCallDetails: + type: object + required: + - name + - arguments + properties: + name: + type: string + description: The name of the function. + arguments: + type: string + description: The arguments to use when invoking the named function, as provided by the model. Arguments are presented as a JSON document that should be validated and parsed for evaluation. + description: The detailed information for a function invocation, as provided by a required action invoking a function tool, that includes the name of and arguments to the function. + RequiredToolCall: + type: object + required: + - type + - id + properties: + type: + type: string + description: The object type for the required tool call. + id: + type: string + description: The ID of the tool call. This ID must be referenced when submitting tool outputs. + discriminator: + propertyName: type + mapping: + function: '#/components/schemas/RequiredFunctionToolCall' + description: An abstract representation a a tool invocation needed by the model to continue a run. + RunCompletionUsage: + type: object + required: + - completion_tokens + - prompt_tokens + - total_tokens + properties: + completion_tokens: + type: integer + format: int64 + description: Number of completion tokens used over the course of the run. + prompt_tokens: + type: integer + format: int64 + description: Number of prompt tokens used over the course of the run. + total_tokens: + type: integer + format: int64 + 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.). + RunError: + type: object + required: + - code + - message + properties: + code: + type: string + description: The status for the error. + message: + type: string + description: The human-readable text associated with the error. + description: The details of an error as encountered by an assistant thread run. + RunIncludes: + anyOf: + - type: string + - type: string + enum: + - step_details.tool_calls[*].file_search.results[*].content + description: Values to for the includes parameter in the create run operation. + RunStatus: + anyOf: + - type: string + - type: string + enum: + - queued + - in_progress + - requires_action + - cancelling + - cancelled + - failed + - completed + - expired + description: Possible values for the status of an assistant thread run. + RunStep: + type: object + required: + - id + - object + - type + - assistant_id + - thread_id + - run_id + - status + - step_details + - last_error + - created_at + - expired_at + - completed_at + - cancelled_at + - failed_at + - metadata + properties: + id: + type: string + description: The identifier, which can be referenced in API endpoints. + object: + type: string + enum: + - thread.run.step + description: The object type, which is always 'thread.run.step'. + type: + allOf: + - $ref: '#/components/schemas/RunStepType' + description: The type of run step, which can be either message_creation or tool_calls. + assistant_id: + type: string + description: The ID of the assistant associated with the run step. + thread_id: + type: string + description: The ID of the thread that was run. + run_id: + type: string + description: The ID of the run that this run step is a part of. + status: + allOf: + - $ref: '#/components/schemas/RunStepStatus' + description: The status of this run step. + step_details: + allOf: + - $ref: '#/components/schemas/RunStepDetails' + description: The details for this run step. + last_error: + type: object + allOf: + - $ref: '#/components/schemas/RunStepError' + nullable: true + description: If applicable, information about the last error encountered by this run step. + created_at: + type: integer + format: unixtime + description: The Unix timestamp, in seconds, representing when this object was created. + expired_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this item expired. + completed_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this completed. + cancelled_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this was cancelled. + failed_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this failed. + usage: + type: object + allOf: + - $ref: '#/components/schemas/RunStepCompletionUsage' + nullable: true + description: Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: Detailed information about a single step of an assistant thread run. + RunStepCodeInterpreterImageOutput: + type: object + required: + - type + - image + properties: + type: + type: string + enum: + - image + description: The object type, which is always 'image'. + image: + allOf: + - $ref: '#/components/schemas/RunStepCodeInterpreterImageReference' + description: Referential information for the image associated with this output. + allOf: + - $ref: '#/components/schemas/RunStepCodeInterpreterToolCallOutput' + description: A representation of an image output emitted by a code interpreter tool in response to a tool call by the model. + RunStepCodeInterpreterImageReference: + type: object + required: + - file_id + properties: + file_id: + type: string + description: The ID of the file associated with this image. + description: An image reference emitted by a code interpreter tool in response to a tool call by the model. + RunStepCodeInterpreterLogOutput: + type: object + required: + - type + - logs + properties: + type: + type: string + enum: + - logs + description: The object type, which is always 'logs'. + logs: + type: string + description: The serialized log output emitted by the code interpreter. + allOf: + - $ref: '#/components/schemas/RunStepCodeInterpreterToolCallOutput' + description: A representation of a log output emitted by a code interpreter tool in response to a tool call by the model. + RunStepCodeInterpreterToolCall: + type: object + required: + - type + - code_interpreter + properties: + type: + type: string + enum: + - code_interpreter + description: The object type, which is always 'code_interpreter'. + code_interpreter: + allOf: + - $ref: '#/components/schemas/RunStepCodeInterpreterToolCallDetails' + description: The details of the tool call to the code interpreter tool. + allOf: + - $ref: '#/components/schemas/RunStepToolCall' + description: |- + A record of a call to a code interpreter tool, issued by the model in evaluation of a defined tool, that + represents inputs and outputs consumed and emitted by the code interpreter. + RunStepCodeInterpreterToolCallDetails: + type: object + required: + - input + - outputs + properties: + input: + type: string + description: The input provided by the model to the code interpreter tool. + outputs: + type: array + items: + $ref: '#/components/schemas/RunStepCodeInterpreterToolCallOutput' + description: The outputs produced by the code interpreter tool back to the model in response to the tool call. + description: The detailed information about a code interpreter invocation by the model. + RunStepCodeInterpreterToolCallOutput: + type: object + required: + - type + properties: + type: + type: string + description: The object type. + discriminator: + propertyName: type + mapping: + logs: '#/components/schemas/RunStepCodeInterpreterLogOutput' + image: '#/components/schemas/RunStepCodeInterpreterImageOutput' + description: An abstract representation of an emitted output from a code interpreter tool. + RunStepCompletionUsage: + type: object + required: + - completion_tokens + - prompt_tokens + - total_tokens + properties: + completion_tokens: + type: integer + format: int64 + description: Number of completion tokens used over the course of the run step. + prompt_tokens: + type: integer + format: int64 + description: Number of prompt tokens used over the course of the run step. + total_tokens: + type: integer + format: int64 + description: Total number of tokens used (prompt + completion). + description: Usage statistics related to the run step. + RunStepDelta: + type: object + properties: + step_details: + allOf: + - $ref: '#/components/schemas/RunStepDeltaDetail' + description: The details of the run step. + description: Represents the delta payload in a streaming run step delta chunk. + RunStepDeltaChunk: + type: object + required: + - id + - object + - delta + 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.delta + description: The object type, which is always `thread.run.step.delta`. + delta: + allOf: + - $ref: '#/components/schemas/RunStepDelta' + description: The delta containing the fields that have changed on the run step. + description: Represents a run step delta i.e. any changed fields on a run step during streaming. + RunStepDeltaCodeInterpreterDetailItemObject: + type: object + properties: + input: + type: string + description: The input into the Code Interpreter tool call. + outputs: + type: array + items: + $ref: '#/components/schemas/RunStepDeltaCodeInterpreterOutput' + description: |- + The outputs from the Code Interpreter tool call. Code Interpreter can output one or more + items, including text (`logs`) or images (`image`). Each of these are represented by a + different object type. + description: Represents the Code Interpreter tool call data in a streaming run step's tool calls. + RunStepDeltaCodeInterpreterImageOutput: + type: object + required: + - type + properties: + type: + type: string + enum: + - image + description: The object type, which is always "image." + image: + allOf: + - $ref: '#/components/schemas/RunStepDeltaCodeInterpreterImageOutputObject' + description: The image data for the Code Interpreter tool call output. + allOf: + - $ref: '#/components/schemas/RunStepDeltaCodeInterpreterOutput' + description: Represents an image output as produced the Code interpreter tool and as represented in a streaming run step's delta tool calls collection. + RunStepDeltaCodeInterpreterImageOutputObject: + type: object + properties: + file_id: + type: string + description: The file ID for the image. + description: Represents the data for a streaming run step's Code Interpreter tool call image output. + RunStepDeltaCodeInterpreterLogOutput: + type: object + required: + - type + properties: + type: + type: string + enum: + - logs + description: The type of the object, which is always "logs." + logs: + type: string + description: The text output from the Code Interpreter tool call. + allOf: + - $ref: '#/components/schemas/RunStepDeltaCodeInterpreterOutput' + description: Represents a log output as produced by the Code Interpreter tool and as represented in a streaming run step's delta tool calls collection. + RunStepDeltaCodeInterpreterOutput: + type: object + required: + - index + - type + properties: + index: + type: integer + format: int32 + description: The index of the output in the streaming run step tool call's Code Interpreter outputs array. + type: + type: string + description: The type of the streaming run step tool call's Code Interpreter output. + discriminator: + propertyName: type + mapping: + logs: '#/components/schemas/RunStepDeltaCodeInterpreterLogOutput' + image: '#/components/schemas/RunStepDeltaCodeInterpreterImageOutput' + description: The abstract base representation of a streaming run step tool call's Code Interpreter tool output. + RunStepDeltaCodeInterpreterToolCall: + type: object + required: + - type + properties: + type: + type: string + enum: + - code_interpreter + description: The object type, which is always "code_interpreter." + code_interpreter: + allOf: + - $ref: '#/components/schemas/RunStepDeltaCodeInterpreterDetailItemObject' + description: The Code Interpreter data for the tool call. + allOf: + - $ref: '#/components/schemas/RunStepDeltaToolCall' + description: Represents a Code Interpreter tool call within a streaming run step's tool call details. + RunStepDeltaDetail: + type: object + required: + - type + properties: + type: + type: string + description: The object type for the run step detail object. + discriminator: + propertyName: type + mapping: + message_creation: '#/components/schemas/RunStepDeltaMessageCreation' + tool_calls: '#/components/schemas/RunStepDeltaToolCallObject' + description: Represents a single run step detail item in a streaming run step's delta payload. + RunStepDeltaFileSearchToolCall: + type: object + required: + - type + properties: + type: + type: string + enum: + - file_search + description: The object type, which is always "file_search." + file_search: + type: object + additionalProperties: + type: string + description: Reserved for future use. + allOf: + - $ref: '#/components/schemas/RunStepDeltaToolCall' + description: Represents a file search tool call within a streaming run step's tool call details. + RunStepDeltaFunction: + type: object + properties: + name: + type: string + description: The name of the function. + arguments: + type: string + description: The arguments passed to the function as input. + output: + type: string + nullable: true + description: The output of the function, null if outputs have not yet been submitted. + description: Represents the function data in a streaming run step delta's function tool call. + RunStepDeltaFunctionToolCall: + type: object + required: + - type + properties: + type: + type: string + enum: + - function + description: The object type, which is always "function." + function: + allOf: + - $ref: '#/components/schemas/RunStepDeltaFunction' + description: The function data for the tool call. + allOf: + - $ref: '#/components/schemas/RunStepDeltaToolCall' + description: Represents a function tool call within a streaming run step's tool call details. + RunStepDeltaMessageCreation: + type: object + required: + - type + properties: + type: + type: string + enum: + - message_creation + description: The object type, which is always "message_creation." + message_creation: + allOf: + - $ref: '#/components/schemas/RunStepDeltaMessageCreationObject' + description: The message creation data. + allOf: + - $ref: '#/components/schemas/RunStepDeltaDetail' + description: Represents a message creation within a streaming run step delta. + RunStepDeltaMessageCreationObject: + type: object + properties: + message_id: + type: string + description: The ID of the newly-created message. + description: Represents the data within a streaming run step message creation response object. + RunStepDeltaToolCall: + type: object + required: + - index + - id + - type + properties: + index: + type: integer + format: int32 + description: The index of the tool call detail in the run step's tool_calls array. + id: + type: string + description: The ID of the tool call, used when submitting outputs to the run. + type: + type: string + description: The type of the tool call detail item in a streaming run step's details. + discriminator: + propertyName: type + mapping: + function: '#/components/schemas/RunStepDeltaFunctionToolCall' + file_search: '#/components/schemas/RunStepDeltaFileSearchToolCall' + code_interpreter: '#/components/schemas/RunStepDeltaCodeInterpreterToolCall' + description: The abstract base representation of a single tool call within a streaming run step's delta tool call details. + RunStepDeltaToolCallObject: + type: object + required: + - type + properties: + type: + type: string + enum: + - tool_calls + description: The object type, which is always "tool_calls." + tool_calls: + type: array + items: + $ref: '#/components/schemas/RunStepDeltaToolCall' + description: The collection of tool calls for the tool call detail item. + allOf: + - $ref: '#/components/schemas/RunStepDeltaDetail' + description: Represents an invocation of tool calls as part of a streaming run step. + RunStepDetails: + type: object + required: + - type + properties: + type: + allOf: + - $ref: '#/components/schemas/RunStepType' + description: The object type. + discriminator: + propertyName: type + mapping: + message_creation: '#/components/schemas/RunStepMessageCreationDetails' + tool_calls: '#/components/schemas/RunStepToolCallDetails' + description: An abstract representation of the details for a run step. + RunStepError: + type: object + required: + - code + - message + properties: + code: + allOf: + - $ref: '#/components/schemas/RunStepErrorCode' + description: The error code for this error. + message: + type: string + description: The human-readable text associated with this error. + description: The error information associated with a failed run step. + RunStepErrorCode: + anyOf: + - type: string + - type: string + enum: + - server_error + - rate_limit_exceeded + description: Possible error code values attributable to a failed run step. + RunStepFileSearchToolCall: + type: object + required: + - type + - file_search + properties: + type: + type: string + enum: + - file_search + description: The object type, which is always 'file_search'. + file_search: + type: array + items: + $ref: '#/components/schemas/FileSearchToolCallResult' + description: The results of the file search. + allOf: + - $ref: '#/components/schemas/RunStepToolCall' + description: |- + A record of a call to a file search tool, issued by the model in evaluation of a defined tool, that represents + executed file search. + RunStepFunctionToolCall: + type: object + required: + - type + - function + properties: + type: + type: string + enum: + - function + description: The object type, which is always 'function'. + function: + allOf: + - $ref: '#/components/schemas/RunStepFunctionToolCallDetails' + description: The detailed information about the function called by the model. + allOf: + - $ref: '#/components/schemas/RunStepToolCall' + description: |- + A record of a call to a function tool, issued by the model in evaluation of a defined tool, that represents the inputs + and output consumed and emitted by the specified function. + RunStepFunctionToolCallDetails: + type: object + required: + - name + - arguments + - output + properties: + name: + type: string + description: The name of the function. + arguments: + type: string + description: The arguments that the model requires are provided to the named function. + output: + type: string + nullable: true + description: The output of the function, only populated for function calls that have already have had their outputs submitted. + description: The detailed information about the function called by the model. + RunStepMessageCreationDetails: + type: object + required: + - type + - message_creation + properties: + type: + type: string + enum: + - message_creation + description: The object type, which is always 'message_creation'. + message_creation: + allOf: + - $ref: '#/components/schemas/RunStepMessageCreationReference' + description: Information about the message creation associated with this run step. + allOf: + - $ref: '#/components/schemas/RunStepDetails' + description: The detailed information associated with a message creation run step. + RunStepMessageCreationReference: + type: object + required: + - message_id + properties: + message_id: + type: string + description: The ID of the message created by this run step. + description: The details of a message created as a part of a run step. + RunStepStatus: + anyOf: + - type: string + - type: string + enum: + - in_progress + - cancelled + - failed + - completed + - expired + description: Possible values for the status of a run step. + RunStepStreamEvent: + anyOf: + - type: string + - type: string + enum: + - thread.run.step.created + - thread.run.step.in_progress + - thread.run.step.delta + - thread.run.step.completed + - thread.run.step.failed + - thread.run.step.cancelled + - thread.run.step.expired + description: Run step operation related streaming events + RunStepToolCall: + type: object + required: + - type + - id + properties: + type: + type: string + description: The object type. + id: + type: string + description: The ID of the tool call. This ID must be referenced when you submit tool outputs. + discriminator: + propertyName: type + mapping: + code_interpreter: '#/components/schemas/RunStepCodeInterpreterToolCall' + file_search: '#/components/schemas/RunStepFileSearchToolCall' + function: '#/components/schemas/RunStepFunctionToolCall' + description: An abstract representation of a detailed tool call as recorded within a run step for an existing run. + RunStepToolCallDetails: + type: object + required: + - type + - tool_calls + properties: + type: + type: string + enum: + - tool_calls + description: The object type, which is always 'tool_calls'. + tool_calls: + type: array + items: + $ref: '#/components/schemas/RunStepToolCall' + description: A list of tool call details for this run step. + allOf: + - $ref: '#/components/schemas/RunStepDetails' + description: The detailed information associated with a run step calling tools. + RunStepType: + anyOf: + - type: string + - type: string + enum: + - message_creation + - tool_calls + description: The possible types of run steps. + RunStreamEvent: + anyOf: + - type: string + - type: string + enum: + - thread.run.created + - thread.run.queued + - thread.run.in_progress + - thread.run.requires_action + - thread.run.completed + - thread.run.failed + - thread.run.cancelling + - thread.run.cancelled + - thread.run.expired + description: Run operation related streaming events + ServiceApiVersions: + type: string + enum: + - 2024-02-15-preview + - 2024-05-01-preview + - 2024-07-01-preview + - 2024-09-01-preview + - 2024-10-01-preview + - 2025-01-01-preview + description: The known set of supported API versions. + SubmitToolOutputsAction: + type: object + required: + - type + - submit_tool_outputs + properties: + type: + type: string + enum: + - submit_tool_outputs + description: The object type, which is always 'submit_tool_outputs'. + submit_tool_outputs: + allOf: + - $ref: '#/components/schemas/SubmitToolOutputsDetails' + description: The details describing tools that should be called to submit tool outputs. + allOf: + - $ref: '#/components/schemas/RequiredAction' + description: The details for required tool calls that must be submitted for an assistant thread run to continue. + SubmitToolOutputsDetails: + type: object + required: + - tool_calls + properties: + tool_calls: + type: array + items: + $ref: '#/components/schemas/RequiredToolCall' + description: The list of tool calls that must be resolved for the assistant thread run to continue. + description: The details describing tools that should be called to submit tool outputs. + ThreadDeletionStatus: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + description: The ID of the resource specified for deletion. + deleted: + type: boolean + description: A value indicating whether deletion was successful. + object: + type: string + enum: + - thread.deleted + description: The object type, which is always 'thread.deleted'. + description: The status of a thread deletion operation. + ThreadMessage: + 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'. + created_at: + type: integer + format: unixtime + description: The Unix timestamp, in seconds, representing when this object was created. + thread_id: + type: string + description: The ID of the thread that this message belongs to. + status: + allOf: + - $ref: '#/components/schemas/MessageStatus' + description: The status of the message. + incomplete_details: + type: object + allOf: + - $ref: '#/components/schemas/MessageIncompleteDetails' + nullable: true + description: On an incomplete message, details about why the message is incomplete. + completed_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp (in seconds) for when the message was completed. + incomplete_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp (in seconds) for when the message was marked as incomplete. + role: + allOf: + - $ref: '#/components/schemas/MessageRole' + description: The role associated with the assistant thread message. + content: + type: array + items: + $ref: '#/components/schemas/MessageContent' + description: The list of content items associated with the assistant thread message. + assistant_id: + type: string + nullable: true + description: If applicable, the ID of the assistant that authored this message. + run_id: + type: string + nullable: true + description: If applicable, the ID of the run associated with the authoring of this message. + attachments: + type: array + items: + $ref: '#/components/schemas/MessageAttachment' + nullable: true + description: A list of files attached to the message, and the tools they were added to. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: A single, existing message within an assistant thread. + ThreadMessageOptions: + type: object + required: + - role + - content + properties: + role: + allOf: + - $ref: '#/components/schemas/MessageRole' + 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: + type: string + description: |- + The textual content of the initial message. Currently, robust input including images and annotated text may only be provided via + a separate call to the create message API. + attachments: + type: array + items: + $ref: '#/components/schemas/MessageAttachment' + nullable: true + description: A list of files attached to the message, and the tools they should be added to. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: A single message within an assistant thread, as provided during that thread's creation for its initial state. + ThreadRun: + type: object + required: + - id + - object + - thread_id + - assistant_id + - status + - last_error + - model + - instructions + - tools + - created_at + - expires_at + - started_at + - completed_at + - cancelled_at + - failed_at + - incomplete_details + - usage + - max_prompt_tokens + - max_completion_tokens + - truncation_strategy + - tool_choice + - parallel_tool_calls + - response_format + - metadata + 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'. + thread_id: + type: string + description: The ID of the thread associated with this run. + assistant_id: + type: string + description: The ID of the assistant associated with the thread this run was performed against. + status: + allOf: + - $ref: '#/components/schemas/RunStatus' + description: The status of the assistant thread run. + required_action: + type: object + allOf: + - $ref: '#/components/schemas/RequiredAction' + nullable: true + description: The details of the action required for the assistant thread run to continue. + last_error: + type: object + allOf: + - $ref: '#/components/schemas/RunError' + nullable: true + description: The last error, if any, encountered by this assistant thread run. + model: + type: string + description: The ID of the model to use. + instructions: + type: string + description: The overridden system instructions used for this assistant thread run. + tools: + type: array + items: + $ref: '#/components/schemas/ToolDefinition' + description: The overridden enabled tools used for this assistant thread run. + default: [] + created_at: + type: integer + format: unixtime + description: The Unix timestamp, in seconds, representing when this object was created. + expires_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this item expires. + started_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this item was started. + completed_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this completed. + cancelled_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this was cancelled. + failed_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp, in seconds, representing when this failed. + incomplete_details: + allOf: + - $ref: '#/components/schemas/IncompleteRunDetails' + nullable: true + description: Details on why the run is incomplete. Will be `null` if the run is not incomplete. + usage: + type: object + allOf: + - $ref: '#/components/schemas/RunCompletionUsage' + nullable: true + 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.). + temperature: + type: number + format: float + nullable: true + description: The sampling temperature used for this run. If not set, defaults to 1. + top_p: + type: number + format: float + nullable: true + description: The nucleus sampling value used for this run. If not set, defaults to 1. + max_prompt_tokens: + type: integer + format: int32 + nullable: true + minimum: 256 + description: The maximum number of prompt tokens specified to have been used over the course of the run. + max_completion_tokens: + type: integer + format: int32 + nullable: true + minimum: 256 + description: The maximum number of completion tokens specified to have been used over the course of the run. + truncation_strategy: + type: object + allOf: + - $ref: '#/components/schemas/TruncationObject' + nullable: true + description: The strategy to use for dropping messages as the context windows moves forward. + tool_choice: + allOf: + - $ref: '#/components/schemas/AssistantsApiToolChoiceOption' + nullable: true + description: Controls whether or not and which tool is called by the model. + parallel_tool_calls: + type: boolean + description: Whether to enable parallel function calling during tool use. + response_format: + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormatOption' + nullable: true + description: The response format of the tool calls used in this run. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: Data representing a single evaluation run of an assistant thread. + ThreadStreamEvent: + anyOf: + - type: string + - type: string + enum: + - thread.created + description: Thread operation related streaming events + ToolDefinition: + type: object + required: + - type + properties: + type: + type: string + description: The object type. + discriminator: + propertyName: type + mapping: + code_interpreter: '#/components/schemas/CodeInterpreterToolDefinition' + file_search: '#/components/schemas/FileSearchToolDefinition' + function: '#/components/schemas/FunctionToolDefinition' + description: An abstract representation of an input tool definition that an assistant can use. + ToolOutput: + type: object + properties: + tool_call_id: + type: string + description: The ID of the tool call being resolved, as provided in the tool calls of a required action from a run. + output: + type: string + description: The output from the tool to be submitted. + description: The data provided during a tool outputs submission to resolve pending tool calls and allow the model to continue. + ToolResources: + type: object + properties: + code_interpreter: + allOf: + - $ref: '#/components/schemas/CodeInterpreterToolResource' + description: Resources to be used by the `code_interpreter tool` consisting of file IDs. + file_search: + allOf: + - $ref: '#/components/schemas/FileSearchToolResource' + description: Resources to be used by the `file_search` tool consisting of vector store IDs. + 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. + TruncationObject: + type: object + required: + - type + properties: + type: + allOf: + - $ref: '#/components/schemas/TruncationStrategy' + 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 `lastMessages` count 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`. + default: auto + last_messages: + type: integer + format: int32 + nullable: true + minimum: 1 + description: The number of most recent messages from the thread when constructing the context for the run. + description: |- + Controls for how a thread will be truncated prior to the run. Use this to control the initial + context window of the run. + TruncationStrategy: + anyOf: + - type: string + - type: string + enum: + - auto + - last_messages + description: Possible truncation strategies for the thread. + UpdateAssistantOptions: + type: object + properties: + model: + type: string + description: The ID of the model to use. + name: + type: string + nullable: true + description: The modified name for the assistant to use. + description: + type: string + nullable: true + description: The modified description for the assistant to use. + instructions: + type: string + nullable: true + description: The modified system instructions for the new assistant to use. + tools: + type: array + items: + $ref: '#/components/schemas/ToolDefinition' + description: The modified collection of tools to enable for the assistant. + default: [] + tool_resources: + allOf: + - $ref: '#/components/schemas/UpdateToolResourcesOptions' + 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. + temperature: + type: number + format: float + nullable: true + 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: + type: number + format: float + nullable: true + 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 + response_format: + allOf: + - $ref: '#/components/schemas/AssistantsApiResponseFormatOption' + nullable: true + description: The response format of the tool calls used by this assistant. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: The request details to use when modifying an existing assistant. + UpdateAssistantThreadOptions: + type: object + properties: + tool_resources: + type: object + allOf: + - $ref: '#/components/schemas/UpdateToolResourcesOptions' + nullable: true + description: |- + A set of resources that are made available to the assistant's tools in this thread. 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: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: The details used to update an existing assistant thread + UpdateCodeInterpreterToolResourceOptions: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 20 + description: A list of file IDs to override the current list of the assistant. + description: Request object to update `code_interpreted` tool resources. + UpdateFileSearchToolResourceOptions: + type: object + properties: + vector_store_ids: + type: array + items: + type: string + maxItems: 1 + description: A list of vector store IDs to override the current list of the assistant. + description: Request object to update `file_search` tool resources. + UpdateToolResourcesOptions: + type: object + properties: + code_interpreter: + allOf: + - $ref: '#/components/schemas/UpdateCodeInterpreterToolResourceOptions' + description: |- + Overrides the list of file IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files + associated with the tool. + file_search: + allOf: + - $ref: '#/components/schemas/UpdateFileSearchToolResourceOptions' + description: Overrides the vector store attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + description: |- + Request object. 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. + VectorStore: + 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` + 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 + format: int32 + description: The total number of bytes used by the files in the vector store. + file_counts: + allOf: + - $ref: '#/components/schemas/VectorStoreFileCount' + description: Files count grouped by status processed or being processed by this vector store. + status: + allOf: + - $ref: '#/components/schemas/VectorStoreStatus' + 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: + allOf: + - $ref: '#/components/schemas/VectorStoreExpirationPolicy' + description: Details on when this vector store expires + expires_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp (in seconds) for when the vector store will expire. + last_active_at: + type: integer + format: unixtime + nullable: true + description: The Unix timestamp (in seconds) for when the vector store was last active. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: A vector store is a collection of processed files can be used by the `file_search` tool. + VectorStoreAutoChunkingStrategyRequest: + type: object + required: + - type + properties: + type: + type: string + enum: + - auto + description: The object type, which is always 'auto'. + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequest' + description: The default strategy. This strategy currently uses a max_chunk_size_tokens of 800 and chunk_overlap_tokens of 400. + VectorStoreAutoChunkingStrategyResponse: + type: object + required: + - type + properties: + type: + type: string + enum: + - other + description: The object type, which is always 'other'. + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyResponse' + 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. + VectorStoreChunkingStrategyRequest: + type: object + required: + - type + properties: + type: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequestType' + description: The object type. + discriminator: + propertyName: type + mapping: + auto: '#/components/schemas/VectorStoreAutoChunkingStrategyRequest' + static: '#/components/schemas/VectorStoreStaticChunkingStrategyRequest' + description: An abstract representation of a vector store chunking strategy configuration. + VectorStoreChunkingStrategyRequestType: + anyOf: + - type: string + enum: + - auto + - static + - type: string + description: Type of chunking strategy + VectorStoreChunkingStrategyResponse: + type: object + required: + - type + properties: + type: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyResponseType' + description: The object type. + discriminator: + propertyName: type + mapping: + other: '#/components/schemas/VectorStoreAutoChunkingStrategyResponse' + static: '#/components/schemas/VectorStoreStaticChunkingStrategyResponse' + description: An abstract representation of a vector store chunking strategy configuration. + VectorStoreChunkingStrategyResponseType: + anyOf: + - type: string + enum: + - other + - static + - type: string + description: Type of chunking strategy + VectorStoreDeletionStatus: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + description: The ID of the resource specified for deletion. + deleted: + type: boolean + description: A value indicating whether deletion was successful. + object: + type: string + enum: + - vector_store.deleted + description: The object type, which is always 'vector_store.deleted'. + description: Response object for deleting a vector store. + VectorStoreExpirationPolicy: + type: object + required: + - anchor + - days + properties: + anchor: + allOf: + - $ref: '#/components/schemas/VectorStoreExpirationPolicyAnchor' + description: 'Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`.' + days: + type: integer + format: int32 + minimum: 1 + maximum: 365 + description: The anchor timestamp after which the expiration policy applies. + description: The expiration policy for a vector store. + VectorStoreExpirationPolicyAnchor: + anyOf: + - type: string + - type: string + enum: + - last_active_at + description: Describes the relationship between the days and the expiration of this vector store + VectorStoreFile: + type: object + required: + - id + - object + - usage_bytes + - created_at + - vector_store_id + - status + - last_error + - chunking_strategy + 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`. + usage_bytes: + type: integer + format: int32 + 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 that the file is attached to. + status: + allOf: + - $ref: '#/components/schemas/VectorStoreFileStatus' + 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: + type: object + allOf: + - $ref: '#/components/schemas/VectorStoreFileError' + nullable: true + description: The last error associated with this vector store file. Will be `null` if there are no errors. + chunking_strategy: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyResponse' + description: The strategy used to chunk the file. + description: Description of a file attached to a vector store. + VectorStoreFileBatch: + 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`. + 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 that the file is attached to. + status: + allOf: + - $ref: '#/components/schemas/VectorStoreFileBatchStatus' + description: The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. + file_counts: + allOf: + - $ref: '#/components/schemas/VectorStoreFileCount' + description: Files count grouped by status processed or being processed by this vector store. + description: A batch of files attached to a vector store. + VectorStoreFileBatchStatus: + anyOf: + - type: string + - type: string + enum: + - in_progress + - completed + - cancelled + - failed + description: The status of the vector store file batch. + VectorStoreFileCount: + type: object + required: + - in_progress + - completed + - failed + - cancelled + - total + properties: + in_progress: + type: integer + format: int32 + description: The number of files that are currently being processed. + completed: + type: integer + format: int32 + description: The number of files that have been successfully processed. + failed: + type: integer + format: int32 + description: The number of files that have failed to process. + cancelled: + type: integer + format: int32 + description: The number of files that were cancelled. + total: + type: integer + format: int32 + description: The total number of files. + description: Counts of files processed or being processed by this vector store grouped by status. + VectorStoreFileDeletionStatus: + type: object + required: + - id + - deleted + - object + properties: + id: + type: string + description: The ID of the resource specified for deletion. + deleted: + type: boolean + description: A value indicating whether deletion was successful. + object: + type: string + enum: + - vector_store.file.deleted + description: The object type, which is always 'vector_store.deleted'. + description: Response object for deleting a vector store file relationship. + VectorStoreFileError: + type: object + required: + - code + - message + properties: + code: + allOf: + - $ref: '#/components/schemas/VectorStoreFileErrorCode' + description: One of `server_error` or `rate_limit_exceeded`. + message: + type: string + description: A human-readable description of the error. + description: Details on the error that may have ocurred while processing a file for this vector store + VectorStoreFileErrorCode: + anyOf: + - type: string + - type: string + enum: + - server_error + - unsupported_file + - invalid_file + description: Error code variants for vector store file processing + VectorStoreFileStatus: + anyOf: + - type: string + - type: string + enum: + - in_progress + - completed + - failed + - cancelled + description: Vector store file status + VectorStoreFileStatusFilter: + anyOf: + - type: string + - type: string + enum: + - in_progress + - completed + - failed + - cancelled + description: Query parameter filter for vector store file retrieval endpoint + VectorStoreOptions: + type: object + properties: + file_ids: + type: array + items: + type: string + maxItems: 500 + description: A list of file 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. + expires_after: + allOf: + - $ref: '#/components/schemas/VectorStoreExpirationPolicy' + description: Details on when this vector store expires + chunking_strategy: + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequest' + 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. + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: Request object for creating a vector store. + VectorStoreStaticChunkingStrategyOptions: + type: object + required: + - max_chunk_size_tokens + - chunk_overlap_tokens + properties: + max_chunk_size_tokens: + type: integer + format: int32 + 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 + format: int32 + 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. * + description: Options to configure a vector store static chunking strategy. + VectorStoreStaticChunkingStrategyRequest: + type: object + required: + - type + - static + properties: + type: + type: string + enum: + - static + description: The object type, which is always 'static'. + static: + allOf: + - $ref: '#/components/schemas/VectorStoreStaticChunkingStrategyOptions' + description: The options for the static chunking strategy. + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyRequest' + description: A statically configured chunking strategy. + VectorStoreStaticChunkingStrategyResponse: + type: object + required: + - type + - static + properties: + type: + type: string + enum: + - static + description: The object type, which is always 'static'. + static: + allOf: + - $ref: '#/components/schemas/VectorStoreStaticChunkingStrategyOptions' + description: The options for the static chunking strategy. + allOf: + - $ref: '#/components/schemas/VectorStoreChunkingStrategyResponse' + description: A statically configured chunking strategy. + VectorStoreStatus: + anyOf: + - type: string + - type: string + enum: + - expired + - in_progress + - completed + description: Vector store possible status + VectorStoreUpdateOptions: + type: object + properties: + name: + type: string + nullable: true + description: The name of the vector store. + expires_after: + type: object + allOf: + - $ref: '#/components/schemas/VectorStoreExpirationPolicy' + nullable: true + description: Details on when this vector store expires + metadata: + type: object + additionalProperties: + type: string + nullable: true + description: A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length. + description: Request object for updating a vector store. + securitySchemes: + ApiKeyAuth: + type: apiKey + in: header + name: api-key + OAuth2Auth: + type: oauth2 + flows: + implicit: + authorizationUrl: https://login.microsoftonline.com/common/oauth2/v2.0/authorize + scopes: + https://cognitiveservices.azure.com/.default: '' +servers: + - url: '{endpoint}' + description: Azure OpenAI APIs for Assistants. + variables: + endpoint: + default: '' + description: An OpenAI endpoint supporting assistants functionality. diff --git a/specification/ai/data-plane/OpenAI.Assistants/readme.md b/specification/ai/data-plane/OpenAI.Assistants/readme.md index 9b882de86d65..df4143796096 100644 --- a/specification/ai/data-plane/OpenAI.Assistants/readme.md +++ b/specification/ai/data-plane/OpenAI.Assistants/readme.md @@ -57,3 +57,10 @@ These settings apply only when `--tag=release_2024_10_01_preview_autogen` is spe ``` yaml $(tag) == 'release_2024_10_01_preview_autogen' input-file: OpenApiV2/preview/2024-10-01-preview/assistants_generated.json ``` + +## OpenAI.Assistants 2025-01-01-preview (generated) +These settings apply only when `--tag=release_2025_01_01_preview_autogen` is specified on the command line. + +``` yaml $(tag) == 'release_2025_01_01_preview_autogen' +input-file: OpenApiV2/preview/2025-01-01-preview/assistants_generated.json +```