-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SDK doesn't handle return of control for agent actions #6592
Comments
Hi @v-giorgetti - thanks for reaching out. It sounds like |
Hey @aBurmeseDev, thanks for answering. {
"$metadata": {
"httpStatusCode": 200,
"requestId": "c905440f-0e00-45e0-b3b6-7f3f94e81006",
"attempts": 1,
"totalRetryDelay": 0
},
"contentType": "application/json",
"sessionId": "playground_user",
"completion": {
"options": {
"messageStream": {
"options": {
"inputStream": {},
"decoder": {
"headerMarshaller": {},
"messageBuffer": [],
"isEndOfStream": false
}
}
}
}
}
} Here is my InvokeAgent input : let options: InvokeAgentCommandInput = {
agentId: AGENT_CONFIG.agentId,
agentAliasId: AGENT_CONFIG.agentAlias,
sessionId: sessionId,
inputText: "bla bla bla"
};
const command = new InvokeAgentCommand(options);
const response: InvokeAgentCommandOutput = await client.send(command); Am I missing something? I'm also adding my action configuration |
And yes, by Python library I’m referring to boto3 |
Ok nvm, I was able to get the return control by extracting it from the const response: InvokeAgentCommandOutput = await client.send(command);
if (!response || !response.completion) {
return { sessionId: sessionId, completion: '' };
}
for await (const chunkEvent of response.completion) {
if (chunkEvent.returnControl) {
console.log('returnControl', chunkEvent.returnControl);
} else {
const chunk = chunkEvent.chunk;
const decodedResponse = new TextDecoder('utf-8').decode(chunk.bytes);
completion += decodedResponse;
}
} I was expecting to get it from the response as boto3 does, silly me! You may close the ticket. |
Checkboxes for prior research
Describe the bug
Hi, I'm currently implementing a chatbot to help our customers execute actions, and I've setup a test agent in AWS with a single action (defined in a group action) that is triggered when the customer asks to open a ticket.
This action is defined with the option return of control, which means I should get the payload so I can handle the action the user is trying to achieve.
Though I couldn't find any documentation that is providing the ability to do that, except in Python where the SDK provides a field in the InvokeAgent command response.
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
v20.15.0
Reproduction Steps
Observed Behavior
There is no field in the response that provide the payload of the action that is triggered
Response type is :
Expected Behavior
We should have a nullable returnControl field like the python library does
Possible Solution
No response
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: