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개 답변
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
전문가
Uri
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠