@ai-sdk/openai 3.0.109 → 3.0.111

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.
@@ -31,6 +31,16 @@ export type OpenaiResponsesProviderMetadata = {
31
31
  openai: ResponsesProviderMetadata;
32
32
  };
33
33
 
34
+ export type ResponsesToolCallProviderMetadata = {
35
+ itemId: string;
36
+ async?: boolean;
37
+ namespace?: string;
38
+ };
39
+
40
+ export type OpenaiResponsesToolCallProviderMetadata = {
41
+ openai: ResponsesToolCallProviderMetadata;
42
+ };
43
+
34
44
  export type ResponsesTextProviderMetadata = {
35
45
  itemId: string;
36
46
  phase?: 'commentary' | 'final_answer' | null;
@@ -10,6 +10,7 @@ export const customArgsSchema = lazySchema(() =>
10
10
  z.object({
11
11
  name: z.string(),
12
12
  description: z.string().optional(),
13
+ async: z.boolean().optional(),
13
14
  format: z
14
15
  .union([
15
16
  z.object({
@@ -41,6 +42,12 @@ export const customToolFactory = createProviderToolFactory<
41
42
  */
42
43
  description?: string;
43
44
 
45
+ /**
46
+ * Whether the model can continue generating after calling this tool
47
+ * without waiting for its result.
48
+ */
49
+ async?: boolean;
50
+
44
51
  /**
45
52
  * The output format specification for the tool.
46
53
  * Omit for unconstrained text output.
@@ -22,7 +22,9 @@ export const imageGenerationArgsSchema = lazySchema(() =>
22
22
  outputCompression: z.number().int().min(0).max(100).optional(),
23
23
  outputFormat: z.enum(['png', 'jpeg', 'webp']).optional(),
24
24
  partialImages: z.number().int().min(0).max(3).optional(),
25
- quality: z.enum(['auto', 'low', 'medium', 'high']).optional(),
25
+ quality: z
26
+ .enum(['auto', 'low', 'medium', 'high', 'xhigh', 'max'])
27
+ .optional(),
26
28
  size: z
27
29
  .enum(['1024x1024', '1024x1536', '1536x1024', 'auto'])
28
30
  .optional(),
@@ -92,16 +94,19 @@ type ImageGenerationArgs = {
92
94
 
93
95
  /**
94
96
  * The quality of the generated image.
95
- * One of low, medium, high, or auto. Default: auto.
97
+ * One of low, medium, high, xhigh, max, or auto. Default: auto.
98
+ * xhigh and max are supported by GPT Image 2.5 models.
96
99
  */
97
- quality?: 'auto' | 'low' | 'medium' | 'high';
100
+ quality?: 'auto' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
98
101
 
99
102
  /**
100
103
  * The size of the generated image.
101
- * One of 1024x1024, 1024x1536, 1536x1024, or auto.
104
+ * One of 1024x1024, 1024x1536, 1536x1024, or auto. GPT Image 2 and 2.5
105
+ * models also accept arbitrary WIDTHxHEIGHT sizes where both are divisible
106
+ * by 16, e.g. 1536x864.
102
107
  * Default: auto.
103
108
  */
104
- size?: 'auto' | '1024x1024' | '1024x1536' | '1536x1024';
109
+ size?: 'auto' | '1024x1024' | '1024x1536' | '1536x1024' | (string & {});
105
110
  };
106
111
 
107
112
  const imageGenerationToolFactory = createProviderToolFactoryWithOutputSchema<