@ai-sdk/openai 4.0.46 → 4.0.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/openai",
3
- "version": "4.0.46",
3
+ "version": "4.0.47",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -35,16 +35,16 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@ai-sdk/provider": "4.0.7",
39
- "@ai-sdk/provider-utils": "5.0.29"
38
+ "@ai-sdk/provider": "4.0.8",
39
+ "@ai-sdk/provider-utils": "5.0.30"
40
40
  },
41
41
  "devDependencies": {
42
+ "@ai-sdk/test-server": "2.0.1",
42
43
  "@types/node": "22.19.19",
44
+ "@vercel/ai-tsconfig": "0.0.0",
43
45
  "tsup": "^8.5.1",
44
46
  "typescript": "5.8.3",
45
- "zod": "3.25.76",
46
- "@ai-sdk/test-server": "2.0.1",
47
- "@vercel/ai-tsconfig": "0.0.0"
47
+ "zod": "3.25.76"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "zod": "^3.25.76 || ^4.1.8"
@@ -40,7 +40,7 @@ export function convertOpenAIChatUsage(
40
40
  },
41
41
  outputTokens: {
42
42
  total: completionTokens,
43
- text: completionTokens - reasoningTokens,
43
+ text: Math.max(0, completionTokens - reasoningTokens),
44
44
  reasoning: reasoningTokens,
45
45
  },
46
46
  raw: usage,
@@ -133,7 +133,19 @@ class OpenAIResponsesBatch {
133
133
  options: BatchV4StartOptions<OpenAIBatchRequest>,
134
134
  ): Promise<BatchV4StartResult> {
135
135
  const fileParts: string[] = [];
136
- const warnings: BatchV4StartResult['warnings'] = [];
136
+ const warnings: BatchV4StartResult['warnings'] =
137
+ options.webhookUrl == null
138
+ ? []
139
+ : [
140
+ {
141
+ warning: {
142
+ type: 'unsupported',
143
+ feature: 'webhookUrl',
144
+ details:
145
+ 'The OpenAI Batch API does not support per-batch webhook URLs.',
146
+ },
147
+ },
148
+ ];
137
149
 
138
150
  for (const request of options.requests) {
139
151
  const preparedRequest = await this.options.prepareRequest(request);