@ai-sdk/anthropic 2.0.50 → 2.0.52
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 +12 -0
- package/dist/index.js +14 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -16
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +13 -15
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +13 -15
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -2651,7 +2651,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2651
2651
|
type: "tool-call",
|
|
2652
2652
|
toolCallId: contentBlock.toolCallId,
|
|
2653
2653
|
toolName,
|
|
2654
|
-
input: contentBlock.input,
|
|
2654
|
+
input: contentBlock.input === "" ? "{}" : contentBlock.input,
|
|
2655
2655
|
providerExecuted: contentBlock.providerExecuted
|
|
2656
2656
|
});
|
|
2657
2657
|
}
|
|
@@ -2818,22 +2818,20 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2818
2818
|
);
|
|
2819
2819
|
const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();
|
|
2820
2820
|
stream = streamForConsumer;
|
|
2821
|
-
const
|
|
2822
|
-
|
|
2821
|
+
const firstChunkReader = streamForFirstChunk.getReader();
|
|
2822
|
+
try {
|
|
2823
|
+
const { done } = await firstChunkReader.read();
|
|
2824
|
+
if (!done) {
|
|
2825
|
+
firstChunkReader.cancel();
|
|
2826
|
+
}
|
|
2827
|
+
} catch (error) {
|
|
2823
2828
|
try {
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
await reader.cancel();
|
|
2827
|
-
}
|
|
2828
|
-
} catch (error) {
|
|
2829
|
-
try {
|
|
2830
|
-
await reader.cancel();
|
|
2831
|
-
} catch (e) {
|
|
2832
|
-
}
|
|
2833
|
-
} finally {
|
|
2834
|
-
reader.releaseLock();
|
|
2829
|
+
firstChunkReader.cancel();
|
|
2830
|
+
} catch (e) {
|
|
2835
2831
|
}
|
|
2836
|
-
}
|
|
2832
|
+
} finally {
|
|
2833
|
+
firstChunkReader.releaseLock();
|
|
2834
|
+
}
|
|
2837
2835
|
return returnPromise.promise;
|
|
2838
2836
|
}
|
|
2839
2837
|
};
|