@ai-sdk/openai 2.0.67 → 2.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.68
4
+
5
+ ### Patch Changes
6
+
7
+ - a4c6a12: feat(provider/openai): support conversations api
8
+
3
9
  ## 2.0.67
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -325,6 +325,7 @@ declare const openaiTools: {
325
325
 
326
326
  type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | (string & {});
327
327
  declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyValidator<{
328
+ conversation?: string | null | undefined;
328
329
  include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
329
330
  instructions?: string | null | undefined;
330
331
  logprobs?: number | boolean | undefined;
package/dist/index.d.ts CHANGED
@@ -325,6 +325,7 @@ declare const openaiTools: {
325
325
 
326
326
  type OpenAIResponsesModelId = 'chatgpt-4o-latest' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo' | 'gpt-4-0613' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-mini' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4.1-nano' | 'gpt-4.1' | 'gpt-4' | 'gpt-4o-2024-05-13' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-11-20' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-5.1' | 'gpt-5.1-chat-latest' | 'gpt-5.1-codex-mini' | 'gpt-5.1-codex' | 'gpt-5-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-5-codex' | 'gpt-5-mini-2025-08-07' | 'gpt-5-mini' | 'gpt-5-nano-2025-08-07' | 'gpt-5-nano' | 'gpt-5-pro-2025-10-06' | 'gpt-5-pro' | 'gpt-5' | 'o1-2024-12-17' | 'o1' | 'o3-2025-04-16' | 'o3-mini-2025-01-31' | 'o3-mini' | 'o3' | (string & {});
327
327
  declare const openaiResponsesProviderOptionsSchema: _ai_sdk_provider_utils.LazyValidator<{
328
+ conversation?: string | null | undefined;
328
329
  include?: ("file_search_call.results" | "message.output_text.logprobs" | "reasoning.encrypted_content")[] | null | undefined;
329
330
  instructions?: string | null | undefined;
330
331
  logprobs?: number | boolean | undefined;
package/dist/index.js CHANGED
@@ -2898,6 +2898,7 @@ var openaiResponsesModelIds = [
2898
2898
  var openaiResponsesProviderOptionsSchema = (0, import_provider_utils22.lazyValidator)(
2899
2899
  () => (0, import_provider_utils22.zodSchema)(
2900
2900
  import_v417.z.object({
2901
+ conversation: import_v417.z.string().nullish(),
2901
2902
  include: import_v417.z.array(
2902
2903
  import_v417.z.enum([
2903
2904
  "reasoning.encrypted_content",
@@ -3150,6 +3151,13 @@ var OpenAIResponsesLanguageModel = class {
3150
3151
  providerOptions,
3151
3152
  schema: openaiResponsesProviderOptionsSchema
3152
3153
  });
3154
+ if ((openaiOptions == null ? void 0 : openaiOptions.conversation) && (openaiOptions == null ? void 0 : openaiOptions.previousResponseId)) {
3155
+ warnings.push({
3156
+ type: "unsupported-setting",
3157
+ setting: "conversation",
3158
+ details: "conversation and previousResponseId cannot be used together"
3159
+ });
3160
+ }
3153
3161
  const { input, warnings: inputWarnings } = await convertToOpenAIResponsesInput({
3154
3162
  prompt,
3155
3163
  systemMessageMode: modelConfig.systemMessageMode,
@@ -3212,6 +3220,7 @@ var OpenAIResponsesLanguageModel = class {
3212
3220
  }
3213
3221
  },
3214
3222
  // provider options:
3223
+ conversation: openaiOptions == null ? void 0 : openaiOptions.conversation,
3215
3224
  max_tool_calls: openaiOptions == null ? void 0 : openaiOptions.maxToolCalls,
3216
3225
  metadata: openaiOptions == null ? void 0 : openaiOptions.metadata,
3217
3226
  parallel_tool_calls: openaiOptions == null ? void 0 : openaiOptions.parallelToolCalls,
@@ -4484,7 +4493,7 @@ var OpenAITranscriptionModel = class {
4484
4493
  };
4485
4494
 
4486
4495
  // src/version.ts
4487
- var VERSION = true ? "2.0.67" : "0.0.0-test";
4496
+ var VERSION = true ? "2.0.68" : "0.0.0-test";
4488
4497
 
4489
4498
  // src/openai-provider.ts
4490
4499
  function createOpenAI(options = {}) {