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
Hi all, I am using the Javascript API to invoke an agent from inside a Lambda, e.g.,
const response = await bedrockAgentRuntimeClient.send(invokeAgentCommand)
for await (const streamEvent of response.completion) {
...
}
Sometimes I want to stop and break the connection early before all the events are read. According to this, breaking out of the loop should close the connection. However, I noticed that when I do that and the lambda handler completes, the lambda stays active for about 2 minutes. I assume this is because the connection to the Bedrock stream stays open until a timeout on the bedrock client.
Is there a way to gracefully stop the connection without waiting for all of the events?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all, I am using the Javascript API to invoke an agent from inside a Lambda, e.g.,
Sometimes I want to stop and break the connection early before all the events are read. According to this, breaking out of the loop should close the connection. However, I noticed that when I do that and the lambda handler completes, the lambda stays active for about 2 minutes. I assume this is because the connection to the Bedrock stream stays open until a timeout on the bedrock client.
Is there a way to gracefully stop the connection without waiting for all of the events?
Beta Was this translation helpful? Give feedback.
All reactions