unable to get data using laravel when calling invokeAgent aws bedrock runtime #6008
Unanswered
GuruVasudevan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel call:
public function retrieveAgent()
{
try {
$result = $this->bedrockAgentRuntimeClient->invokeAgent([
'agentAliasId' => 'D4ME83NEPO',
'agentId' => '0O7BWE0V4H',
'sessionId' => 'abbc',
'inputText' => 'whchi country won soccer in 2023?',
'enableTrace' => true,
]);
Response:
Model Data
Data can be retrieved from the model object using the get() method of the
model (e.g.,
$result->get($key)
) or "accessing the result like anassociative array (e.g.
$result['key']
). You can also execute JMESPathexpressions on the result data using the search() method.
{
"completion": {},
"contentType": "application/json",
"sessionId": "abbc",
"@metadata": {
"statusCode": 200,
"effectiveUri":
"https://bedrock-agent-runtime.us-east-1.amazonaws.com/agents/0O7BWE0V4H/agentAliases/D4ME83NEPO/sessions/abbc/text",
"headers": {
"date": "Thu, 18 Apr 2024 16:43:37 GMT",
"content-type": "application/json",
"transfer-encoding": "chunked",
"connection": "keep-alive",
"x-amzn-requestid": "68adf488-af61-43e2-b162-90aa1df88689",
"x-amz-bedrock-agent-session-id": "abbc",
"x-amzn-bedrock-agent-content-type": "application/json"
},
"transferStats": {
"http": [
[]
]
}
}
}
Http Status code: 200, but no data being returned. please let me know what might be the cause.
Beta Was this translation helpful? Give feedback.
All reactions