AWS bedrock hardening / native web search
we need to check on this.
context:
what about toolResult, shouldn't we handle that as well to make tool calling work properly along with anthropic provider which supports that?
Not for normal client-side tool calling.
In our Bedrock flow, tool calling works through toolUse, not toolResult:
outbound tool requests from the model are parsed from contentBlockStart / contentBlockDelta with toolUse in extract-tool-calls.ts
non-streaming Bedrock tool calls are parsed from block.toolUse in parse-provider-response.ts
when the client sends tool outputs back, we already encode them as Bedrock toolResult blocks in prepare-request-body.ts
So ignoring streamed delta.toolResult does not break standard OpenAI-style tool calling. toolResult is the return leg after a tool has run, not the model’s request to call a tool.
Where you are right:
if we want to support Bedrock-managed/server-side tools and expose their streamed results meaningfully, then toolResult needs explicit handling
but that should be a deliberate feature mapping, similar to our Anthropic-specific web_search_tool_result handling, not a generic “treat this like tool calling” patch
So:
for normal Bedrock tool calling: current behavior is fine
for Bedrock server-tool results: we likely need a separate implementation
Docs:
Bedrock tool use overview: https://docs.aws.amazon.com/bedrock/latest/userguide/tool-use.html
Converse / content blocks: https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_ContentBlock.html
0 条评论