Skip to content

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

Closed
@ja-bot

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

Metadata

Metadata

Assignees

Labels

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

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions