I have a Bedrock agent with an action group connected to a lambda, and defined with an API schema. Despite ensuring that my lambda response matches the schema from the documentation (.html#agents-lambda-response), I still see the following error when the agent attempts to call my endpoint:
ERROR DependencyFailedException: The server encountered an error processing the Lambda response. Check the Lambda response and retry the request
This is what the lambda returns:
{
"messageVersion": "1.0",
"response": {
"actionGroup": "downstream-actions",
"apiPath": "/hello",
"httpMethod": "GET",
"httpStatusCode": 200,
"responseBody": {
"application/json": {
"body": "{\"message\":\"Hello, world!\"}"
}
}
}
}
The lambda is Node. I have tried stringifying the entire object before returning it as well to the same result. Am I missing something?
Edit: including api schema:
{
openapi: '3.0.0',
info: {
title: 'Downstream Action API',
version: '1.0.0',
description: 'API for invoking downstream actions',
},
paths: {
'/hello': {
get: {
summary: 'Get a hello world message',
description: 'Simple endpoint that returns a hello world message',
operationId: 'getHello',
responses: {
'200': {
description: 'Successful response',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
message: {
type: 'string',
},
},
},
},
},
},
},
},
},
},
}
I have a Bedrock agent with an action group connected to a lambda, and defined with an API schema. Despite ensuring that my lambda response matches the schema from the documentation (https://docs.aws.amazon.com/bedrock/latest/userguide/agents-lambda.html#agents-lambda-response), I still see the following error when the agent attempts to call my endpoint:
ERROR DependencyFailedException: The server encountered an error processing the Lambda response. Check the Lambda response and retry the request
This is what the lambda returns:
{
"messageVersion": "1.0",
"response": {
"actionGroup": "downstream-actions",
"apiPath": "/hello",
"httpMethod": "GET",
"httpStatusCode": 200,
"responseBody": {
"application/json": {
"body": "{\"message\":\"Hello, world!\"}"
}
}
}
}
The lambda is Node. I have tried stringifying the entire object before returning it as well to the same result. Am I missing something?
Edit: including api schema:
{
openapi: '3.0.0',
info: {
title: 'Downstream Action API',
version: '1.0.0',
description: 'API for invoking downstream actions',
},
paths: {
'/hello': {
get: {
summary: 'Get a hello world message',
description: 'Simple endpoint that returns a hello world message',
operationId: 'getHello',
responses: {
'200': {
description: 'Successful response',
content: {
'application/json': {
schema: {
type: 'object',
properties: {
message: {
type: 'string',
},
},
},
},
},
},
},
},
},
},
}
Share
Improve this question
edited 2 days ago
Haskell
asked Feb 5 at 17:37
HaskellHaskell
3773 gold badges7 silver badges15 bronze badges
2
- hard to say without also seeing your API schema – emma ray Commented Feb 9 at 4:44
- @emmaray updated to include – Haskell Commented 2 days ago
1 Answer
Reset to default 0If anyone stumbles upon this question, I got it to work by setting architecture: lambda.Architecture.ARM_64
on my agent-invoked lambda.