You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... and the agent response.completion"I attempted to retrieve the latest pollution data but was unable to due to an error with the function call format"
So looks like the agent called the query-pm-values-fnc as required, but I don't have any invocation log stream for that function. So to me the Agent actually did not invoke the action/lambda.
Also, when I test the agent from AWS Console the test goes well. The agent invokes the query-pm-values-fnc and returns the answer with the values from the query.
My understanding of the issue is that there is somethings wrong with the InvokeAgentCommand execution, since the agent thinks he has invoked the action/lambda, while it did not.
Regression Issue
Select this option if this issue appears to be a regression.
I have also tried to let BedRock to create a default lambda function for the action described in the screenshot. BedRock created a python based lambda, I made it to just return a json array to be read by the model to create an answer with it.
In this case, I still have BedRock invoking the lambda only when testing the agent from AWS Console UI (I see lambda invocation logs from the agent). While instead I invoke the agent from code InvokeAgentCommand the agent skips invoking the lambda (I don't see any invocation logs)
My fault guys.. there is no bug. I am sorry for not having figured out before.
Basically when you run your agent testing from AWS Console UI, by default you test the DRAFT version of the agent. While when you invoke the agent from code (lambda/webapp) using the AWS SDK you run the agent version specified in the agent alias. That's why I was having different results (agent working in AWS Console UI, not working on my app).
I solved by forcing an agent "prepare" (just after the creation), then an alias update targeting a new version.
After creating the new version and having the agent alias targeting it, the invocation of the agent from lambda does work as in the AWS Console UI.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Checkboxes for prior research
Describe the bug
Hi guys,
I have a lambda function
chat_ask_bot_fnc
that runsInvokeAgentCommand
(as for the example code from docs https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javascriptv3/example_code/bedrock-agent-runtime/actions/invoke-agent.js):The agent is configured to invoke the action-group/lambda
query-pm-values-fnc
(to get data from dynamo):I see the agent response in logs from lambda
chat_ask_bot_fnc
returned byawait client.send(command)
:... and the agent
response.completion
"I attempted to retrieve the latest pollution data but was unable to due to an error with the function call format"So looks like the agent called the
query-pm-values-fnc
as required, but I don't have any invocation log stream for that function. So to me the Agent actually did not invoke the action/lambda.Also, when I test the agent from AWS Console the test goes well. The agent invokes the
query-pm-values-fnc
and returns the answer with the values from the query.My understanding of the issue is that there is somethings wrong with the
InvokeAgentCommand
execution, since the agent thinks he has invoked the action/lambda, while it did not.Regression Issue
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
nodejs 20
Reproduction Steps
Included above...
Observed Behavior
Agent
response.completion
"I attempted to retrieve the latest pollution data but was unable to due to an error with the function call format".Registered action/lambda is actually not called.
Expected Behavior
Agent
response.completion
contains data from the result of the invoked lambda.Lambda should be invoked.
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: