Attach files to Amazon Bedrock inference request

0

How do I go about including a file attachment to an Amazon Bedrock inference request?

For example: Let's say I download a podcast episode. Then I use Amazon Transcribe to turn it into a plain text file. Then I want to attach the text file to Bedrock and prompt it to summarize the transcript.

How would I go about including the plain text file in my inference request to Bedrock?

I don't want to use Knowledge Bases. I just want to do a one-time submission of this particular attachment.

profile picture
asked a month ago179 views
4 Answers
0

Hi,

For your use-case you can consider using the Bedrock Converse API which would allow you to send a document/long text as part of a message and requests that the model describe/summarise the contents of the document.

Please refer this blog Getting started with the Amazon Bedrock Converse API and also the AWS documentation which has examples on how to send document or text.

Hope this is helpful.

Thanks, Rama

profile pictureAWS
EXPERT
answered a month ago
profile picture
EXPERT
reviewed a month ago
0

If real-time response is not the primary goal, you can use batch inference to save cost and process a lot of requests. The data should be placed in S3. https://docs.aws.amazon.com/bedrock/latest/userguide/batch-inference.html

AWS
Mi_Sha
answered a month ago
-1

Hi, you can use lambda in agent action I suppose.

profile picture
answered a month ago
-1

To include a file attachment in an Amazon Bedrock inference request, you need to send the request as a multipart/form-data request. This allows you to include both the text prompt and the file attachment in the same request.

example: https://github.com/aws-samples/dify-aws-tool

keithyu
answered 25 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions