Add Bedrock InvokeModel and InvokeModelWithResponseStream and support multi-turn tool calling across providers - #175
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Required Bedrock content-type headers and robust deterministic stream validation are missing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds mock Bedrock text-generation support for synchronous and streaming invocation.
Changes:
- Adds Titan text responses with token headers.
- Adds AWS EventStream streaming responses.
- Adds endpoint tests.
File summaries
| File | Description |
|---|---|
bedrock.py |
Implements synchronous and streaming invocation responses. |
test_mock_server.py |
Adds coverage for invocation endpoints. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pull request dashboard statusWaiting on reviewers · refreshed 2026-09-05 01:33 UTC Review the latest changes. Status above doesn't look right?
|
There was a problem hiding this comment.
🟡 Changes recommended
Repeated tool use is incorrectly suppressed, and the Titan stream payload does not match the expected response schema.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Balanced
…chunks A tool name was treated as exhausted for the whole message history, so a new user turn offering the same tool got text instead of a call. Both providers now look only at the messages since the last user message, and apply the same precedence: no result in this turn calls the tool, a result with calls to attribute it to calls only an uncalled tool, and a result with no matching call ends the exchange. InvokeModelWithResponseStream also carried the non-streaming tokenCount fields. Titan streams index plus a cumulative totalOutputTextTokenCount that is null until the final chunk. Assisted-by: Claude Opus 5
be3183a to
f41bf98
Compare
What does this change do?
InvokeModelandInvokeModelWithResponseStreammock endpoints with token headers and AWS EventStream responses.Why?
Some gaps identified when migrating pythong-genai repo to this runner - open-telemetry/opentelemetry-python-genai#623