Bedrock agent lambda function

0

Hi, I am creating a simple project where I have data in an S3 bucket which I want Bedrock agent to query, when a question is asked. The data is in html format and I am using Amazon OpenSearch serverless as a vector database. I have got most of the moving parts in order like I have data in s3 bucket and another bucket with openapi spec. I have created knowledge base and agent using console.

My first task is to test that agent from console. So when I ask a question in agent console, I am hoping the lambda invokes and returns response. I am just not sure how to write the lambda function. Maybe I am thinking it wrong or searching wrong but I just don't seem to find a resolution. How should I structure the lambda function to just accept the event, query s3 (or hopefully vector db) for answer and return to agent console?

Thanks for your guidance in advance.

1 Resposta
0

It should not be very different than writing the code in other platforms. You should deploy an API Gateway that will get the request from the console, API Gateway will invoke the Lambda function. In the function you have a handler method that you should use to extract the relevant data from the event object and then invoke some method that reads the data from S3 and invokes the Bedrock API.

profile pictureAWS
ESPECIALISTA
Uri
respondido há 2 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas