@ai-sdk/anthropic 3.0.0-beta.66 → 3.0.0-beta.68

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,17 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.0-beta.68
4
+
5
+ ### Patch Changes
6
+
7
+ - 9e35785: fix(anthropic): send {} as tool input when streaming tool calls without arguments
8
+
9
+ ## 3.0.0-beta.67
10
+
11
+ ### Patch Changes
12
+
13
+ - eb56fc6: fix(anthropic): pull first chunk without async IIFE
14
+
3
15
  ## 3.0.0-beta.66
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "3.0.0-beta.66" : "0.0.0-test";
34
+ var VERSION = true ? "3.0.0-beta.68" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -2856,7 +2856,7 @@ var AnthropicMessagesLanguageModel = class {
2856
2856
  type: "tool-call",
2857
2857
  toolCallId: contentBlock.toolCallId,
2858
2858
  toolName,
2859
- input: contentBlock.input,
2859
+ input: contentBlock.input === "" ? "{}" : contentBlock.input,
2860
2860
  providerExecuted: contentBlock.providerExecuted
2861
2861
  });
2862
2862
  }
@@ -3023,22 +3023,20 @@ var AnthropicMessagesLanguageModel = class {
3023
3023
  );
3024
3024
  const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();
3025
3025
  stream = streamForConsumer;
3026
- const reader = streamForFirstChunk.getReader();
3027
- (async () => {
3026
+ const firstChunkReader = streamForFirstChunk.getReader();
3027
+ try {
3028
+ const { done } = await firstChunkReader.read();
3029
+ if (!done) {
3030
+ firstChunkReader.cancel();
3031
+ }
3032
+ } catch (error) {
3028
3033
  try {
3029
- const { done } = await reader.read();
3030
- if (!done) {
3031
- await reader.cancel();
3032
- }
3033
- } catch (error) {
3034
- try {
3035
- await reader.cancel();
3036
- } catch (e) {
3037
- }
3038
- } finally {
3039
- reader.releaseLock();
3034
+ firstChunkReader.cancel();
3035
+ } catch (e) {
3040
3036
  }
3041
- })();
3037
+ } finally {
3038
+ firstChunkReader.releaseLock();
3039
+ }
3042
3040
  return returnPromise.promise;
3043
3041
  }
3044
3042
  };