@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/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "@ai-sdk/provider-utils";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = true ? "3.0.0-beta.66" : "0.0.0-test";
14
+ var VERSION = true ? "3.0.0-beta.68" : "0.0.0-test";
15
15
 
16
16
  // src/anthropic-messages-language-model.ts
17
17
  import {
@@ -2877,7 +2877,7 @@ var AnthropicMessagesLanguageModel = class {
2877
2877
  type: "tool-call",
2878
2878
  toolCallId: contentBlock.toolCallId,
2879
2879
  toolName,
2880
- input: contentBlock.input,
2880
+ input: contentBlock.input === "" ? "{}" : contentBlock.input,
2881
2881
  providerExecuted: contentBlock.providerExecuted
2882
2882
  });
2883
2883
  }
@@ -3044,22 +3044,20 @@ var AnthropicMessagesLanguageModel = class {
3044
3044
  );
3045
3045
  const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();
3046
3046
  stream = streamForConsumer;
3047
- const reader = streamForFirstChunk.getReader();
3048
- (async () => {
3047
+ const firstChunkReader = streamForFirstChunk.getReader();
3048
+ try {
3049
+ const { done } = await firstChunkReader.read();
3050
+ if (!done) {
3051
+ firstChunkReader.cancel();
3052
+ }
3053
+ } catch (error) {
3049
3054
  try {
3050
- const { done } = await reader.read();
3051
- if (!done) {
3052
- await reader.cancel();
3053
- }
3054
- } catch (error) {
3055
- try {
3056
- await reader.cancel();
3057
- } catch (e) {
3058
- }
3059
- } finally {
3060
- reader.releaseLock();
3055
+ firstChunkReader.cancel();
3056
+ } catch (e) {
3061
3057
  }
3062
- })();
3058
+ } finally {
3059
+ firstChunkReader.releaseLock();
3060
+ }
3063
3061
  return returnPromise.promise;
3064
3062
  }
3065
3063
  };