-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
When I call the InvokeAgentCommand send function, I receive a response, but the response doesn't include the chunk. When I use the same parameters in python3 (boto3), I get chunk in the result.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
"@aws-sdk/client-bedrock-agent-runtime": "^3.658.0"
Which JavaScript Runtime is this issue in?
React Native
Details of the browser/Node.js/ReactNative version
v22.7.0
Reproduction Steps
const testInput = {
agentId, // required
agentAliasId, // required
sessionId: _sessionId, // required
inputText: question,
};
const command = new InvokeAgentCommand(testInput);
const response = await client.send(command);
console.log ("!!!response: ", response);
let completion = ""
for await (const chunkEvent of response.completion) {
if (chunkEvent.chunk) {
const chunk = chunkEvent.chunk;
let decoded = new TextDecoder("utf-8").decode(chunk.bytes);
completion += decoded;
}
}
LOG.debug("!!!completion: ", completion);
Observed Behavior
!!!response in log =
{
"$metadata": {
"httpStatusCode": 200,
"requestId": "ae975225-b133-42c4-a8eb-0d425e650a40",
"attempts": 1,
"totalRetryDelay": 0
},
"contentType": "application/json",
"sessionId": "96c1843f-8f91-4ff8-8742-753c4a0dbf91",
"completion": {
"options": {
"messageStream": {
"options": {
"inputStream": {},
"decoder": {
"headerMarshaller": {},
"messageBuffer": [],
"isEndOfStream": false
}
}
}
}
}
}
Expected Behavior
I would expect response to look like:
{
"$metadata": {
"httpStatusCode": 200,
"requestId": "ae975225-b133-42c4-a8eb-0d425e650a40",
"attempts": 1,
"totalRetryDelay": 0
},
"contentType": "application/json",
"sessionId": "96c1843f-8f91-4ff8-8742-753c4a0dbf91",
"completion": {
"chunk" : [
...chunk data here...
],
"options": {
"messageStream": {
"options": {
"inputStream": {},
"decoder": {
"headerMarshaller": {},
"messageBuffer": [],
"isEndOfStream": false
}
}
}
}
}
}
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.