@ai-sdk/openai 2.0.29 → 2.0.31

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,20 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 2.0.31
4
+
5
+ ### Patch Changes
6
+
7
+ - bb94467: feat(provider/openai): add maxToolCalls provider option
8
+ - 4a2b70e: feat(provider/openai): send item references for provider-executed tool results
9
+ - 643711d: feat (provider/openai): provider defined image generation tool support
10
+
11
+ ## 2.0.30
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [0294b58]
16
+ - @ai-sdk/provider-utils@3.0.9
17
+
3
18
  ## 2.0.29
4
19
 
5
20
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -112,6 +112,35 @@ declare const openaiTools: {
112
112
  filters: any[];
113
113
  };
114
114
  }>;
115
+ /**
116
+ * The image generation tool allows you to generate images using a text prompt,
117
+ * and optionally image inputs. It leverages the GPT Image model,
118
+ * and automatically optimizes text inputs for improved performance.
119
+ *
120
+ * Must have name `image_generation`.
121
+ *
122
+ * @param size - Image dimensions (e.g., 1024x1024, 1024x1536)
123
+ * @param quality - Rendering quality (e.g. low, medium, high)
124
+ * @param format - File output format
125
+ * @param compression - Compression level (0-100%) for JPEG and WebP formats
126
+ * @param background - Transparent or opaque
127
+ */
128
+ imageGeneration: (args?: {
129
+ background?: "auto" | "opaque" | "transparent";
130
+ inputFidelity?: "low" | "high";
131
+ inputImageMask?: {
132
+ fileId?: string;
133
+ imageUrl?: string;
134
+ };
135
+ model?: string;
136
+ moderation?: "auto";
137
+ outputCompression?: number;
138
+ outputFormat?: "png" | "jpeg" | "webp";
139
+ quality?: "auto" | "low" | "medium" | "high";
140
+ size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
141
+ }) => _ai_sdk_provider_utils.Tool<{}, {
142
+ result: string;
143
+ }>;
115
144
  /**
116
145
  * Web search allows models to access up-to-date information from the internet
117
146
  * and provide answers with sourced citations.
@@ -244,33 +273,34 @@ Default OpenAI provider instance.
244
273
  declare const openai: OpenAIProvider;
245
274
 
246
275
  declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
276
+ include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
277
+ "file_search_call.results": "file_search_call.results";
278
+ "message.output_text.logprobs": "message.output_text.logprobs";
279
+ "reasoning.encrypted_content": "reasoning.encrypted_content";
280
+ }>>>>;
281
+ instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
283
+ maxToolCalls: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
247
284
  metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
248
285
  parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
249
286
  previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
- store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
251
- user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ promptCacheKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
288
  reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
- strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
254
- instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
255
289
  reasoningSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ safetyIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
291
  serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
257
292
  auto: "auto";
258
293
  flex: "flex";
259
294
  priority: "priority";
260
295
  }>>>;
261
- include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
262
- "file_search_call.results": "file_search_call.results";
263
- "message.output_text.logprobs": "message.output_text.logprobs";
264
- "reasoning.encrypted_content": "reasoning.encrypted_content";
265
- }>>>>;
296
+ store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
297
+ strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
266
298
  textVerbosity: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
267
299
  low: "low";
268
300
  medium: "medium";
269
301
  high: "high";
270
302
  }>>>;
271
- promptCacheKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
- safetyIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
- logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
303
+ user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
304
  }, z.core.$strip>;
275
305
  type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
276
306
 
package/dist/index.d.ts CHANGED
@@ -112,6 +112,35 @@ declare const openaiTools: {
112
112
  filters: any[];
113
113
  };
114
114
  }>;
115
+ /**
116
+ * The image generation tool allows you to generate images using a text prompt,
117
+ * and optionally image inputs. It leverages the GPT Image model,
118
+ * and automatically optimizes text inputs for improved performance.
119
+ *
120
+ * Must have name `image_generation`.
121
+ *
122
+ * @param size - Image dimensions (e.g., 1024x1024, 1024x1536)
123
+ * @param quality - Rendering quality (e.g. low, medium, high)
124
+ * @param format - File output format
125
+ * @param compression - Compression level (0-100%) for JPEG and WebP formats
126
+ * @param background - Transparent or opaque
127
+ */
128
+ imageGeneration: (args?: {
129
+ background?: "auto" | "opaque" | "transparent";
130
+ inputFidelity?: "low" | "high";
131
+ inputImageMask?: {
132
+ fileId?: string;
133
+ imageUrl?: string;
134
+ };
135
+ model?: string;
136
+ moderation?: "auto";
137
+ outputCompression?: number;
138
+ outputFormat?: "png" | "jpeg" | "webp";
139
+ quality?: "auto" | "low" | "medium" | "high";
140
+ size?: "auto" | "1024x1024" | "1024x1536" | "1536x1024";
141
+ }) => _ai_sdk_provider_utils.Tool<{}, {
142
+ result: string;
143
+ }>;
115
144
  /**
116
145
  * Web search allows models to access up-to-date information from the internet
117
146
  * and provide answers with sourced citations.
@@ -244,33 +273,34 @@ Default OpenAI provider instance.
244
273
  declare const openai: OpenAIProvider;
245
274
 
246
275
  declare const openaiResponsesProviderOptionsSchema: z.ZodObject<{
276
+ include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
277
+ "file_search_call.results": "file_search_call.results";
278
+ "message.output_text.logprobs": "message.output_text.logprobs";
279
+ "reasoning.encrypted_content": "reasoning.encrypted_content";
280
+ }>>>>;
281
+ instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
282
+ logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
283
+ maxToolCalls: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
247
284
  metadata: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
248
285
  parallelToolCalls: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
249
286
  previousResponseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
- store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
251
- user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
287
+ promptCacheKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
252
288
  reasoningEffort: z.ZodOptional<z.ZodNullable<z.ZodString>>;
253
- strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
254
- instructions: z.ZodOptional<z.ZodNullable<z.ZodString>>;
255
289
  reasoningSummary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
+ safetyIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
291
  serviceTier: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
257
292
  auto: "auto";
258
293
  flex: "flex";
259
294
  priority: "priority";
260
295
  }>>>;
261
- include: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<{
262
- "file_search_call.results": "file_search_call.results";
263
- "message.output_text.logprobs": "message.output_text.logprobs";
264
- "reasoning.encrypted_content": "reasoning.encrypted_content";
265
- }>>>>;
296
+ store: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
297
+ strictJsonSchema: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
266
298
  textVerbosity: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
267
299
  low: "low";
268
300
  medium: "medium";
269
301
  high: "high";
270
302
  }>>>;
271
- promptCacheKey: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
- safetyIdentifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
- logprobs: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNumber]>>;
303
+ user: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
304
  }, z.core.$strip>;
275
305
  type OpenAIResponsesProviderOptions = z.infer<typeof openaiResponsesProviderOptionsSchema>;
276
306