Skip to content

Commit aaff76c

Browse files
committed
chore: minor check refactoring for bedrock messages tool use stream chunk transform
1 parent 08975f7 commit aaff76c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/bedrock/messages.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,12 +548,12 @@ export const BedrockConverseMessagesStreamChunkTransform = (
548548
const contentBlockStartEvent: RawContentBlockStartEvent = JSON.parse(
549549
ANTHROPIC_CONTENT_BLOCK_START_EVENT
550550
);
551-
if (parsedChunk.start?.toolUse) {
551+
if (parsedChunk.start?.toolUse && parsedChunk.start.toolUse.toolUseId) {
552552
contentBlockStartEvent.content_block = {
553553
type: 'tool_use',
554554
id: parsedChunk.start.toolUse.toolUseId,
555555
name: parsedChunk.start.toolUse.name,
556-
input: parsedChunk.start.toolUse.input || {},
556+
input: {},
557557
};
558558
}
559559
contentBlockStartEvent.index = parsedChunk.contentBlockIndex;

0 commit comments

Comments
 (0)