@openrouter/ai-sdk-provider 2.1.1 → 2.1.2

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/README.md CHANGED
@@ -19,13 +19,13 @@ yarn add @openrouter/ai-sdk-provider
19
19
 
20
20
  ```bash
21
21
  # For pnpm
22
- pnpm add @openrouter/ai-sdk-provider@ai-sdk-v5
22
+ pnpm add @openrouter/ai-sdk-provider@1.5.4
23
23
 
24
24
  # For npm
25
- npm install @openrouter/ai-sdk-provider@ai-sdk-v5
25
+ npm install @openrouter/ai-sdk-provider@1.5.4
26
26
 
27
27
  # For yarn
28
- yarn add @openrouter/ai-sdk-provider@ai-sdk-v5
28
+ yarn add @openrouter/ai-sdk-provider@1.5.4
29
29
  ```
30
30
 
31
31
  ## Provider Instance
package/dist/index.js CHANGED
@@ -3512,7 +3512,16 @@ var OpenRouterChatLanguageModel = class {
3512
3512
  if (reasoningStarted && !textStarted) {
3513
3513
  controller.enqueue({
3514
3514
  type: "reasoning-end",
3515
- id: reasoningId || generateId()
3515
+ id: reasoningId || generateId(),
3516
+ // Include accumulated reasoning_details so the AI SDK can update
3517
+ // the reasoning part's providerMetadata with the correct signature.
3518
+ // The signature typically arrives in the last reasoning delta,
3519
+ // but reasoning-start only carries the first delta's metadata.
3520
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
3521
+ openrouter: {
3522
+ reasoning_details: accumulatedReasoningDetails
3523
+ }
3524
+ } : void 0
3516
3525
  });
3517
3526
  reasoningStarted = false;
3518
3527
  }
@@ -3714,7 +3723,14 @@ var OpenRouterChatLanguageModel = class {
3714
3723
  if (reasoningStarted) {
3715
3724
  controller.enqueue({
3716
3725
  type: "reasoning-end",
3717
- id: reasoningId || generateId()
3726
+ id: reasoningId || generateId(),
3727
+ // Include accumulated reasoning_details so the AI SDK can update
3728
+ // the reasoning part's providerMetadata with the correct signature.
3729
+ providerMetadata: accumulatedReasoningDetails.length > 0 ? {
3730
+ openrouter: {
3731
+ reasoning_details: accumulatedReasoningDetails
3732
+ }
3733
+ } : void 0
3718
3734
  });
3719
3735
  }
3720
3736
  if (textStarted) {
@@ -4505,7 +4521,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
4505
4521
  }
4506
4522
 
4507
4523
  // src/version.ts
4508
- var VERSION2 = false ? "0.0.0-test" : "2.1.1";
4524
+ var VERSION2 = false ? "0.0.0-test" : "2.1.2";
4509
4525
 
4510
4526
  // src/provider.ts
4511
4527
  function createOpenRouter(options = {}) {