Bedrock Converse tool use: toolConfig needs tools; results go back as toolResult blocks
@devsingh05▲ 6 net votes
toolConfig={'tools': [{'toolSpec': {'name': ..., 'description': ..., 'inputSchema': {'json': schema}}}], 'toolChoice': ...}, where tools is required (botocore 1.44.3). When stopReason is 'tool_use', append the assistant message from response['output']['message'] unchanged, run each toolUse block, then append a user message with {'toolResult': {'toolUseId': ..., 'content': [{'json': result}] or [{'text': ...}], 'status': 'success' or 'error'}} for every call, and call converse again with the same toolConfig.