.Net: Python: Bedrock connector rejects parallel tool calls (toolResult blocks not merged into one Converse message)
Maintainer thường phản hồi trong vòng 6 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
Hướng nghiên cứu
Bắt đầu trong connectors/ai/bedrock/services/bedrock_chat_completion.py:173-180 và so sánh cách định dạng lịch sử với anthropic_chat_completion.py, nơi các thông báo công cụ song song liên tiếp được gộp lại. Xem xét kernel.py invoke_function_call và bài kiểm thử hồi quy không cần mạng hiện có. Được xem là hoàn thành khi các khối toolUse song song và các khối toolResult của chúng được nhóm vào các thông báo Converse đơn lẻ cần thiết cho các yêu cầu tiếp theo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
Using the Python Bedrock chat completion connector with a model that calls multiple tools in one turn (e.g. Claude Sonnet 4.5), the follow-up Converse request is rejected:
Expected toolResult blocks at messages.X.content for the following Ids: ... but found: ...
Root cause
The function-calling loop (kernel.py invoke_function_call) appends one ChatMessageContent per tool call and one per tool result. BedrockChatCompletion._prepare_chat_history_for_request (connectors/ai/bedrock/services/bedrock_chat_completion.py:173-180) maps each ChatMessageContent 1:1 to a Converse message, so N parallel tool results become N separate role:"user" messages, each with a single toolResult. Converse requires all toolResult blocks for an assistant turn in a single user message (and all toolUse blocks in a single assistant message).
Expected behavior
Chat history with parallel tool calls is usable in follow-up requests without manual merging.
Note
This is the Python counterpart of #13647 (reported for .NET). The sibling Anthropic connector already merges consecutive parallel tool messages (anthropic_chat_completion.py: formatted_messages[-1][content_key] += ...); the Bedrock connector does not. I have a minimal fix + network-free regression test ready and would be happy to open a PR.
Platform
Python, semantic_kernel.connectors.ai.bedrock.
- Ngôn ngữ chính
- C#
- Star
- 28.7k
- Fork
- 4.8k
- Merge trung bình
- 7 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 59
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/semantic-kernel
-
.Net: gpt-image-1 is the default image model in the .NET OpenAI connector, and OpenAI shuts it down on October 23Có thể đã có người làm @nightcityblade đã nhận 24 ngày trước. Đang mở.NET triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/semantic-kernel#14526 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Python: VolatileMemoryStore.get_batch and get_nearest_matches ignore with_embeddings=False (deepcopy result is discarded)Có thể đã có người làm @VANDRANKI đã nhận 26 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/semantic-kernel#14522 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Python: VolatileMemoryStore.get_nearest_match returns an un-awaited coroutine instead of a (MemoryRecord, score) tupleCó thể đã có người làm @VANDRANKI đã nhận 26 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/semantic-kernel#14521 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
.Net: Bug: BinaryContent does not decode the %xx escapes of a non-base64 data URICó thể đã có người làm @Laurianti đã nhận 26 ngày trước. Đang mở.NET triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/semantic-kernel#14518 ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Python: FunctionCallContent.combine_arguments drops a streamed "{}" chunk, producing invalid JSON argumentsCó thể đã có người làm @VANDRANKI đã nhận 27 ngày trước. Đang mởpython triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
microsoft/semantic-kernel#14512 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
Tất cả issue của microsoft/semantic-kernel
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Tyrrrz/YoutubeDownloader#912 ·
-
broken link websiteĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
README says main uses .NET 9 while the current branch targets .NET 10Có thể đã có người làm @dajiaohuang đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
ardalis/CleanArchitecture#1098 ·
-
good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
madeyoga/AuthEndpoints#365 ·
Maintainer thường phản hồi trong vòng 1 ngày