Skip to content

Python: Bug in multi-tool parameter parsing when using BedrockChatCompletion with the Converse Stream API #12202

Closed

Description

@ja-bot

Describe the bug
When an agent runs with BedrockChatCompletion using the Converse Stream API, tool parameters are not correctly parsed when more than 1 tool is used. For instance, if tool_a and tool_b are going to be executed with parameters {"param_11": "value_11"} and {"param_21": "value_21"} respectively, the parsing of content blocks in BedrockChatCompletion produces {"param_11": "value_11"}{"param_21": "value_21"} and {"param_21": "value_21"}, which is wrong (in addition to be invalid JSON for the first).

To Reproduce
Define a plugin with at least 2 tools (with at least 1 parameter each) and an agent with BedrockChatCompletion using the Converse Stream API. Then, ask the agent to run the 2 tools.

Expected behavior
Tool calls and their parameters should be correctly parsed.

Platform

  • Language: Python
  • Source: main branch of repository
  • AI model: any

Activity

  1. ja-bot commented on May 20, 2025

    @ja-bot
    ContributorAuthor

    I have a small change that fixes this problem. I'll open a PR for that.

  2. ja-bot commented on May 20, 2025

    @ja-bot
    ContributorAuthor

    This PR fixes the problem: #12203

  3. added a commit that references this issue on May 23, 2025
    3e771ec
  4. added a commit that references this issue on May 26, 2025
    ba086d5
  5. added a commit that references this issue on Sep 15, 2025
    f4d1677
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ai connectorAnything related to AI connectorsbugSomething isn't workingpythonPull requests for the Python Semantic Kernel

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions