@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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @ai-sdk/openai
2
2
 
3
+ ## 4.0.47
4
+
5
+ ### Patch Changes
6
+
7
+ - 591d25b: feat: add batch completion webhooks. `experimental_startTextBatch` accepts a `webhookUrl`, and the gateway provider registers it through the batch `callbackUrl` contract and exports typed async-job metadata. Direct Anthropic and OpenAI batch providers return an unsupported warning when the option is provided.
8
+ - 2214258: Prevent negative text output token counts when providers report reasoning tokens. Perplexity reasoning tokens are now treated as separate from completion tokens.
9
+ - Updated dependencies [591d25b]
10
+ - @ai-sdk/provider@4.0.8
11
+ - @ai-sdk/provider-utils@5.0.30
12
+
3
13
  ## 4.0.46
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -270,7 +270,7 @@ function convertOpenAIChatUsage(usage) {
270
270
  },
271
271
  outputTokens: {
272
272
  total: completionTokens,
273
- text: completionTokens - reasoningTokens,
273
+ text: Math.max(0, completionTokens - reasoningTokens),
274
274
  reasoning: reasoningTokens
275
275
  },
276
276
  raw: usage
@@ -8614,7 +8614,15 @@ var OpenAIResponsesBatch = class {
8614
8614
  async startBatch(options) {
8615
8615
  var _a, _b, _c, _d;
8616
8616
  const fileParts = [];
8617
- const warnings = [];
8617
+ const warnings = options.webhookUrl == null ? [] : [
8618
+ {
8619
+ warning: {
8620
+ type: "unsupported",
8621
+ feature: "webhookUrl",
8622
+ details: "The OpenAI Batch API does not support per-batch webhook URLs."
8623
+ }
8624
+ }
8625
+ ];
8618
8626
  for (const request of options.requests) {
8619
8627
  const preparedRequest = await this.options.prepareRequest(request);
8620
8628
  fileParts.push(
@@ -10498,7 +10506,7 @@ var OpenAISkills = class {
10498
10506
  };
10499
10507
 
10500
10508
  // src/version.ts
10501
- var VERSION = true ? "4.0.46" : "0.0.0-test";
10509
+ var VERSION = true ? "4.0.47" : "0.0.0-test";
10502
10510
 
10503
10511
  // src/openai-provider.ts
10504
10512
  function createOpenAI(options = {}) {