Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

.Net: Python: Bedrock connector rejects parallel tool calls (toolResult blocks not merged into one Converse message)

Đang mở
#14,073 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

@kimnamu đang làm issue này rồi.

Từ ngày 13/6/2026.

  • #14074 của @kimnamu — đang mở

Đá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
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
aws, python
Lĩnh vực
ai, backend

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ả

.NET python triage
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

Mở trong Codespaces

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.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/semantic-kernel

Tất cả issue của microsoft/semantic-kernel

Issue tương tự

Thêm issue về C#

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.