@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.
@@ -2849,7 +2849,7 @@ var AnthropicMessagesLanguageModel = class {
2849
2849
  type: "tool-call",
2850
2850
  toolCallId: contentBlock.toolCallId,
2851
2851
  toolName,
2852
- input: contentBlock.input,
2852
+ input: contentBlock.input === "" ? "{}" : contentBlock.input,
2853
2853
  providerExecuted: contentBlock.providerExecuted
2854
2854
  });
2855
2855
  }
@@ -3016,22 +3016,20 @@ var AnthropicMessagesLanguageModel = class {
3016
3016
  );
3017
3017
  const [streamForFirstChunk, streamForConsumer] = transformedStream.tee();
3018
3018
  stream = streamForConsumer;
3019
- const reader = streamForFirstChunk.getReader();
3020
- (async () => {
3019
+ const firstChunkReader = streamForFirstChunk.getReader();
3020
+ try {
3021
+ const { done } = await firstChunkReader.read();
3022
+ if (!done) {
3023
+ firstChunkReader.cancel();
3024
+ }
3025
+ } catch (error) {
3021
3026
  try {
3022
- const { done } = await reader.read();
3023
- if (!done) {
3024
- await reader.cancel();
3025
- }
3026
- } catch (error) {
3027
- try {
3028
- await reader.cancel();
3029
- } catch (e) {
3030
- }
3031
- } finally {
3032
- reader.releaseLock();
3027
+ firstChunkReader.cancel();
3028
+ } catch (e) {
3033
3029
  }
3034
- })();
3030
+ } finally {
3031
+ firstChunkReader.releaseLock();
3032
+ }
3035
3033
  return returnPromise.promise;
3036
3034
  }
3037
3035
  };