diff --git a/async-openai/src/assistants/assistants_.rs b/async-openai/src/assistants/assistants_.rs index 44672381..c2793b86 100644 --- a/async-openai/src/assistants/assistants_.rs +++ b/async-openai/src/assistants/assistants_.rs @@ -11,6 +11,9 @@ use crate::{ /// Build assistants that can call models and use tools to perform tasks. /// /// [Get started with the Assistants API](https://platform.openai.com/docs/assistants) +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] pub struct Assistants<'c, C: Config> { client: &'c Client, pub(crate) request_options: RequestOptions, diff --git a/async-openai/src/assistants/messages.rs b/async-openai/src/assistants/messages.rs index 30c14e1d..b003eda0 100644 --- a/async-openai/src/assistants/messages.rs +++ b/async-openai/src/assistants/messages.rs @@ -9,6 +9,9 @@ use crate::{ }; /// Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] pub struct Messages<'c, C: Config> { /// The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to create a message for. pub thread_id: String, diff --git a/async-openai/src/assistants/mod.rs b/async-openai/src/assistants/mod.rs index 5016d90a..d153c5f0 100644 --- a/async-openai/src/assistants/mod.rs +++ b/async-openai/src/assistants/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod assistants_; mod messages; mod runs; diff --git a/async-openai/src/assistants/runs.rs b/async-openai/src/assistants/runs.rs index d93301e1..dc7e770d 100644 --- a/async-openai/src/assistants/runs.rs +++ b/async-openai/src/assistants/runs.rs @@ -15,6 +15,9 @@ use crate::types::assistants::AssistantEventStream; /// Represents an execution run on a thread. /// /// Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] pub struct Runs<'c, C: Config> { pub thread_id: String, client: &'c Client, diff --git a/async-openai/src/assistants/steps.rs b/async-openai/src/assistants/steps.rs index e0f8cde5..b2c971fd 100644 --- a/async-openai/src/assistants/steps.rs +++ b/async-openai/src/assistants/steps.rs @@ -6,6 +6,9 @@ use crate::{ }; /// Represents a step in execution of a run. +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] pub struct Steps<'c, C: Config> { pub thread_id: String, pub run_id: String, diff --git a/async-openai/src/assistants/threads.rs b/async-openai/src/assistants/threads.rs index d404fb48..5accc5dd 100644 --- a/async-openai/src/assistants/threads.rs +++ b/async-openai/src/assistants/threads.rs @@ -14,6 +14,9 @@ use crate::types::assistants::AssistantEventStream; /// Create threads that assistants can interact with. /// /// Related guide: [Assistants](https://platform.openai.com/docs/assistants/overview) +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] pub struct Threads<'c, C: Config> { client: &'c Client, pub(crate) request_options: RequestOptions, diff --git a/async-openai/src/client.rs b/async-openai/src/client.rs index 3e95032e..67488a9c 100644 --- a/async-openai/src/client.rs +++ b/async-openai/src/client.rs @@ -29,6 +29,7 @@ use crate::image::Images; #[cfg(feature = "moderation")] use crate::moderation::Moderations; #[cfg(feature = "assistant")] +#[allow(deprecated)] use crate::Assistants; #[cfg(feature = "audio")] use crate::Audio; @@ -55,6 +56,7 @@ use crate::Realtime; #[cfg(feature = "responses")] use crate::Responses; #[cfg(feature = "assistant")] +#[allow(deprecated)] use crate::Threads; #[cfg(feature = "upload")] use crate::Uploads; @@ -213,12 +215,20 @@ impl Client { /// To call [Assistants] group related APIs using this client. #[cfg(feature = "assistant")] + #[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." + )] + #[allow(deprecated)] pub fn assistants(&self) -> Assistants<'_, C> { Assistants::new(self) } /// To call [Threads] group related APIs using this client. #[cfg(feature = "assistant")] + #[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." + )] + #[allow(deprecated)] pub fn threads(&self) -> Threads<'_, C> { Threads::new(self) } diff --git a/async-openai/src/file.rs b/async-openai/src/file.rs index 3f33ab2a..ed408f89 100644 --- a/async-openai/src/file.rs +++ b/async-openai/src/file.rs @@ -21,15 +21,14 @@ impl<'c, C: Config> Files<'c, C> { } } - /// Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 1 TB. + /// Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, + /// and each project can store up to 2.5 TB of files in total. There is no organization-wide storage limit. /// /// The Assistants API supports files up to 2 million tokens and of specific file types. See the [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) for details. /// /// The Fine-tuning API only supports `.jsonl` files. The input also has certain required formats for fine-tuning [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) models. /// /// The Batch API only supports `.jsonl` files up to 200 MB in size. The input also has a specific required [format](https://platform.openai.com/docs/api-reference/batch/request-input). - /// - /// Please [contact us](https://help.openai.com/) if you need to increase these storage limits. #[crate::byot( T0 = Clone, R = serde::de::DeserializeOwned, diff --git a/async-openai/src/impls.rs b/async-openai/src/impls.rs index 508aa559..0b3470ca 100644 --- a/async-openai/src/impls.rs +++ b/async-openai/src/impls.rs @@ -34,6 +34,7 @@ use crate::{ admin::UserRoles, admin::Users, }; #[cfg(feature = "assistant")] +#[allow(deprecated)] use crate::{ assistants::Assistants, assistants::Messages, assistants::Runs, assistants::Steps, assistants::Threads, @@ -58,6 +59,7 @@ use crate::{ #[cfg(feature = "_api")] macro_rules! impl_request_options_builder { ($type:ident) => { + #[allow(deprecated)] impl<'c, C: crate::config::Config> crate::traits::RequestOptionsBuilder for $type<'c, C> { fn options_mut(&mut self) -> &mut crate::RequestOptions { &mut self.request_options diff --git a/async-openai/src/lib.rs b/async-openai/src/lib.rs index 28ac7215..77143d3c 100644 --- a/async-openai/src/lib.rs +++ b/async-openai/src/lib.rs @@ -313,6 +313,10 @@ pub use admin::{ UserRoles, Users, }; #[cfg(feature = "assistant")] +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] +#[allow(deprecated)] pub use assistants::{Assistants, Messages, Runs, Steps, Threads}; #[cfg(feature = "audio")] pub use audio::{Audio, Speech, Transcriptions, Translations}; diff --git a/async-openai/src/types/assistants/assistant.rs b/async-openai/src/types/assistants/assistant.rs index 437a5961..cfb376bf 100644 --- a/async-openai/src/types/assistants/assistant.rs +++ b/async-openai/src/types/assistants/assistant.rs @@ -69,6 +69,9 @@ pub enum AssistantVectorStoreChunkingStrategy { } /// Represents an `assistant` that can call the model and use tools. +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] #[derive(Clone, Serialize, Debug, Deserialize, PartialEq)] pub struct AssistantObject { /// The identifier, which can be referenced in API endpoints. @@ -170,6 +173,9 @@ pub enum AssistantTools { Function(AssistantToolsFunction), } +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] #[derive(Clone, Serialize, Default, Debug, Deserialize, Builder, PartialEq)] #[builder(name = "CreateAssistantRequestArgs")] #[builder(pattern = "mutable")] @@ -218,6 +224,9 @@ pub struct CreateAssistantRequest { pub response_format: Option, } +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] #[derive(Clone, Serialize, Default, Debug, Deserialize, Builder, PartialEq)] #[builder(name = "ModifyAssistantRequestArgs")] #[builder(pattern = "mutable")] @@ -266,6 +275,9 @@ pub struct ModifyAssistantRequest { pub response_format: Option, } +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] #[derive(Clone, Serialize, Default, Debug, Deserialize, PartialEq)] pub struct DeleteAssistantResponse { pub id: String, @@ -273,6 +285,9 @@ pub struct DeleteAssistantResponse { pub object: String, } +#[deprecated( + note = "Assistants API is deprecated and will be removed in August 2026. Use the Responses API." +)] #[derive(Clone, Serialize, Default, Debug, Deserialize, PartialEq)] pub struct ListAssistantsResponse { pub object: String, diff --git a/async-openai/src/types/assistants/mod.rs b/async-openai/src/types/assistants/mod.rs index c2d2debc..8438b1bd 100644 --- a/async-openai/src/types/assistants/mod.rs +++ b/async-openai/src/types/assistants/mod.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + mod api; mod assistant; mod impls; diff --git a/async-openai/src/types/files/file.rs b/async-openai/src/types/files/file.rs index 51b98145..e9814768 100644 --- a/async-openai/src/types/files/file.rs +++ b/async-openai/src/types/files/file.rs @@ -47,9 +47,13 @@ pub struct CreateFileRequest { /// The File object (not file name) to be uploaded. pub file: FileInput, - /// The intended purpose of the uploaded file. - /// - /// Use "assistants" for [Assistants](https://platform.openai.com/docs/api-reference/assistants) and [Message](https://platform.openai.com/docs/api-reference/messages) files, "vision" for Assistants image file inputs, "batch" for [Batch API](https://platform.openai.com/docs/guides/batch), "fine-tune" for [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning), "user_data" for flexible file type for any purpose, and "evals" for eval data sets. + /// The intended purpose of the uploaded file. One of: + /// - `assistants`: Used in the Assistants API + /// - `batch`: Used in the Batch API + /// - `fine-tune`: Used for fine-tuning + /// - `vision`: Images used for vision fine-tuning + /// - `user_data`: Flexible file type for any purpose + /// - `evals`: Used for eval data sets pub purpose: FilePurpose, /// The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted. diff --git a/async-openai/src/types/images/form.rs b/async-openai/src/types/images/form.rs index 5c885d71..93ff66f0 100644 --- a/async-openai/src/types/images/form.rs +++ b/async-openai/src/types/images/form.rs @@ -97,23 +97,20 @@ impl AsyncTryFrom for reqwest::multipart::Form { form = form.text("model", model.to_string()) } - if request.n.is_some() { - form = form.text("n", request.n.unwrap().to_string()) + if let Some(n) = request.n { + form = form.text("n", n.to_string()) } - if request.size.is_some() { - form = form.text("size", request.size.unwrap().to_string()) + if let Some(size) = request.size { + form = form.text("size", size.to_string()) } - if request.response_format.is_some() { - form = form.text( - "response_format", - request.response_format.unwrap().to_string(), - ) + if let Some(response_format) = request.response_format { + form = form.text("response_format", response_format.to_string()) } - if request.user.is_some() { - form = form.text("user", request.user.unwrap()) + if let Some(user) = request.user { + form = form.text("user", user) } Ok(form) } diff --git a/async-openai/src/types/videos/form.rs b/async-openai/src/types/videos/form.rs index 8c1d32e0..bbe4ff13 100644 --- a/async-openai/src/types/videos/form.rs +++ b/async-openai/src/types/videos/form.rs @@ -11,19 +11,25 @@ impl AsyncTryFrom for reqwest::multipart::Form { form = form.text("prompt", request.prompt); - if request.size.is_some() { - form = form.text("size", request.size.unwrap().to_string()); + if let Some(size) = request.size { + form = form.text("size", size.to_string()); } - if request.seconds.is_some() { - form = form.text("seconds", request.seconds.unwrap().to_string()); + if let Some(seconds) = request.seconds { + form = form.text("seconds", seconds.to_string()); } - if request.input_reference.is_some() { - let image_part = create_file_part(request.input_reference.unwrap().source).await?; + if let Some(input_reference) = request.input_reference { + let image_part = create_file_part(input_reference.source).await?; form = form.part("input_reference", image_part); } + if let Some(character_ids) = request.character_ids { + for character_id in character_ids { + form = form.text("character_ids[]", character_id); + } + } + Ok(form) } } diff --git a/async-openai/src/types/videos/video.rs b/async-openai/src/types/videos/video.rs index 9055a102..8af7cfd3 100644 --- a/async-openai/src/types/videos/video.rs +++ b/async-openai/src/types/videos/video.rs @@ -48,6 +48,8 @@ pub struct CreateVideoRequest { pub seconds: Option, /// Optional image reference that guides generation. pub input_reference: Option, + /// Character IDs to include in the generation. + pub character_ids: Option>, } #[derive(Clone, Default, Debug, Builder, PartialEq, Serialize)] diff --git a/openapi.documented.yml b/openapi.documented.yml index 29dc249d..d6225a83 100644 --- a/openapi.documented.yml +++ b/openapi.documented.yml @@ -58,6 +58,7 @@ paths: tags: - Assistants summary: List assistants + deprecated: true parameters: - name: limit in: query @@ -105,7 +106,6 @@ paths: x-oaiMeta: name: List assistants group: assistants - beta: true returns: A list of [assistant](https://platform.openai.com/docs/api-reference/assistants/object) objects. examples: response: | @@ -243,6 +243,7 @@ paths: tags: - Assistants summary: Create assistant + deprecated: true requestBody: required: true content: @@ -259,7 +260,6 @@ paths: x-oaiMeta: name: Create assistant group: assistants - beta: true returns: An [assistant](https://platform.openai.com/docs/api-reference/assistants/object) object. examples: - title: Code Interpreter @@ -486,6 +486,7 @@ paths: tags: - Assistants summary: Retrieve assistant + deprecated: true parameters: - in: path name: assistant_id @@ -503,7 +504,6 @@ paths: x-oaiMeta: name: Retrieve assistant group: assistants - beta: true returns: >- The [assistant](https://platform.openai.com/docs/api-reference/assistants/object) object matching the specified ID. @@ -606,6 +606,7 @@ paths: tags: - Assistants summary: Modify assistant + deprecated: true parameters: - in: path name: assistant_id @@ -629,7 +630,6 @@ paths: x-oaiMeta: name: Modify assistant group: assistants - beta: true returns: The modified [assistant](https://platform.openai.com/docs/api-reference/assistants/object) object. examples: response: | @@ -746,6 +746,7 @@ paths: tags: - Assistants summary: Delete assistant + deprecated: true parameters: - in: path name: assistant_id @@ -763,7 +764,6 @@ paths: x-oaiMeta: name: Delete assistant group: assistants - beta: true returns: Deletion status examples: response: | @@ -2784,7 +2784,7 @@ paths: operationId: listBatches tags: - Batch - summary: List batch + summary: List batches parameters: - in: query name: after @@ -2812,7 +2812,7 @@ paths: schema: $ref: '#/components/schemas/ListBatchesResponse' x-oaiMeta: - name: List batch + name: List batches group: batch returns: A list of paginated [Batch](https://platform.openai.com/docs/api-reference/batch/object) objects. examples: @@ -9833,8 +9833,8 @@ paths: puts(file_object) description: | Upload a file that can be used across various endpoints. Individual files - can be up to 512 MB, and the size of all files uploaded by one organization - can be up to 1 TB. + can be up to 512 MB, and each project can store up to 2.5 TB of files in + total. There is no organization-wide storage limit. - The Assistants API supports files up to 2 million tokens and of specific file types. See the [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) for @@ -31337,6 +31337,9 @@ paths: Learn when and how to compact long-running conversations in the [conversation state guide](https://platform.openai.com/docs/guides/conversation-state#managing-the-context-window). + + For ZDR-compatible compaction details, see [Compaction + (advanced)](https://platform.openai.com/docs/guides/conversation-state#compaction-advanced). examples: response: | { @@ -32854,7 +32857,6 @@ components: - metadata x-oaiMeta: name: The assistant object - beta: true example: | { "id": "asst_abc123", @@ -32874,6 +32876,7 @@ components: "temperature": 1.0, "response_format": "auto" } + deprecated: true AssistantStreamEvent: description: > Represents an event emitted when streaming a Run. @@ -40233,10 +40236,9 @@ components: The name of the file to upload. type: string purpose: - description: > + description: | The intended purpose of the uploaded file. - See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). type: string @@ -40250,12 +40252,12 @@ components: The number of bytes in the file you are uploading. type: integer mime_type: - description: > + description: | The MIME type of the file. - This must fall within the supported MIME types for your file purpose. See the supported MIME types - for assistants and vision. + This must fall within the supported MIME types for your file purpose. See + the supported MIME types for assistants and vision. type: string expires_after: $ref: '#/components/schemas/FileExpirationAfter' @@ -50920,12 +50922,16 @@ components: const: conversation.item.create previous_item_id: type: string - description: | - The ID of the preceding item after which the new item will be inserted. - If not set, the new item will be appended to the end of the conversation. + description: > + The ID of the preceding item after which the new item will be inserted. If not set, the new item + will be appended to the end of the conversation. + + If set to `root`, the new item will be added to the beginning of the conversation. - If set to an existing ID, it allows an item to be inserted mid-conversation. If the - ID cannot be found, an error will be returned and the item will not be added. + + + If set to an existing ID, it allows an item to be inserted mid-conversation. If the ID cannot be + found, an error will be returned and the item will not be added. item: $ref: '#/components/schemas/RealtimeConversationItem' required: @@ -50946,8 +50952,7 @@ components: "text": "hi" } ] - }, - "event_id": "b904fba0-0ec4-40af-8bbb-f908a9b26793", + } } RealtimeClientEventConversationItemDelete: type: object @@ -51226,8 +51231,8 @@ components: group: realtime example: | { - "type": "response.cancel" - "response_id": "resp_12345", + "type": "response.cancel", + "response_id": "resp_12345" } RealtimeClientEventResponseCreate: type: object @@ -51293,7 +51298,7 @@ components: "input": [ { "type": "item_reference", - "id": "item_12345", + "id": "item_12345" }, { "type": "message", @@ -51305,7 +51310,7 @@ components: } ] } - ], + ] } } RealtimeClientEventSessionUpdate: @@ -67031,6 +67036,13 @@ components: description: >- Output resolution formatted as width x height (allowed values: 720x1280, 1280x720, 1024x1792, 1792x1024). Defaults to 720x1280. + character_ids: + items: + type: string + example: char_123 + type: array + maxItems: 64 + description: Character IDs to include in the generation. type: object required: - prompt @@ -68404,10 +68416,14 @@ components: discriminator: propertyName: type FilePurpose: - description: > - The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `vision`: Images used for vision - fine-tuning - `user_data`: Flexible file type for any purpose - `evals`: Used for eval data sets + description: | + The intended purpose of the uploaded file. One of: + - `assistants`: Used in the Assistants API + - `batch`: Used in the Batch API + - `fine-tune`: Used for fine-tuning + - `vision`: Images used for vision fine-tuning + - `user_data`: Flexible file type for any purpose + - `evals`: Used for eval data sets type: string enum: - assistants @@ -68971,7 +68987,7 @@ x-oaiMeta: title: Chat Completions - id: assistants title: Assistants - beta: true + deprecated: true - id: administration title: Administration - id: legacy @@ -70172,11 +70188,14 @@ x-oaiMeta: path: streaming - id: assistants title: Assistants - beta: true - description: | - Build assistants that can call models and use tools to perform tasks. + deprecated: true + description: > - [Get started with the Assistants API](https://platform.openai.com/docs/assistants) + The Assistants API is deprecated and will be removed in August 2026. The recommended replacement is + the Responses API. [Learn more](https://platform.openai.com/docs/guides/migrate-to-responses). + + + Build assistants that can call models and use tools to perform tasks. navigationGroup: assistants sections: - type: endpoint @@ -70817,9 +70836,9 @@ x-oaiMeta: navigationGroup: legacy description: > Given a prompt, the model will return one or more predicted completions along with the probabilities - of alternative tokens at each position. Most developer should use our [Chat Completions - API](https://platform.openai.com/docs/guides/text-generation#text-generation-models) to leverage our - best and newest models. + of alternative tokens at each position. Most developers should use our [Responses + API](https://platform.openai.com/docs/api-reference/responses/create) to leverage our best and newest + models. sections: - type: endpoint key: createCompletion