fix: handle bedrock content block start/stop events

This commit is contained in:
Richard Hao
2026-01-18 10:58:11 +08:00
parent 21e6944abb
commit 64db4a270d

View File

@@ -588,6 +588,17 @@ class BedrockRelayService {
}
}
if (bedrockChunk.type === 'content_block_start') {
return {
type: 'content_block_start',
data: {
type: 'content_block_start',
index: bedrockChunk.index || 0,
content_block: bedrockChunk.content_block || { type: 'text', text: '' }
}
}
}
if (bedrockChunk.type === 'content_block_delta') {
return {
type: 'content_block_delta',
@@ -598,6 +609,16 @@ class BedrockRelayService {
}
}
if (bedrockChunk.type === 'content_block_stop') {
return {
type: 'content_block_stop',
data: {
type: 'content_block_stop',
index: bedrockChunk.index || 0
}
}
}
if (bedrockChunk.type === 'message_delta') {
return {
type: 'message_delta',