- Issue created by @narendraR
- First commit to issue fork.
- 🇩🇪Germany marcus_johansson
The issue was that text messages are not always returned when tools are being used.
It seems that tools are not getting set in provider as I am getting error Warning: Undefined array key "text" in Drupal\ai_provider_aws_bedrock\Plugin\AiProvider\BedrockProvider->chat() (line 409 of modules/contrib/ai_provider_aws_bedrock/src/Plugin/AiProvider/BedrockProvider.php).
as
$response['output']['message']['content'][0] does not have text
key.
$response = $this->client->converse($payload); results in below output:
$response = {Aws\Result}
data = {array[5]}
output = {array[1]}
message = {array[2]}
role = "assistant"
content = {array[1]}
0 = {array[1]}
toolUse = {array[3]}
toolUseId = "tooluse_PXMU86kwQ5ycPxam-XXXXX"
name = "ai_agent_get_js_component"
input = {array[1]}
component_name = "custom_components"
stopReason = "tool_use"
Active
1.1
Code
The issue was that text messages are not always returned when tools are being used.