Skip to content

Titan Text Embeddings REST API

0

Hello,

Could you please specify the REST API invocation from Postman, to generate the embedding for text "Sense and Sensibility" using Amazon Titan Text Embeddings v2 ?

Thank you,

asked 10 months ago321 views

2 Answers
0
Accepted Answer

To generate an embedding for the text "Sense and Sensibility" using Amazon Titan Text Embeddings v2 via REST API in Postman, you would need to set up the following:

  1. HTTP Method: POST
  2. URL: https://bedrock-runtime.[region].amazonaws.com/model/amazon.titan-embed-text-v2:0/invoke

Headers:

  • Content-Type: application/json
  • Accept: application/json
  • Authorization: [Your AWS authentication credentials]

Request Body:

{
"inputText": "Sense and Sensibility",
"dimensions": 1024,
"normalize": true
}

The dimensions parameter is optional and accepts values of 256, 512, or 1024. If not specified, the default is 1024. The normalize parameter is also optional and determines whether the output embeddings should be normalized.

You can also use the optional embeddingTypes parameter to specify the type of embeddings you want (e.g., ["binary"]). Note that if you only request binary embeddings, the response will include embeddingsByType.binary instead of the standard embedding field.

The response will contain:

  • The embedding vector
  • The input text token count

Make sure you have the proper AWS authentication set up in your Postman environment to authorize the request.
Sources
Invoke Amazon Titan Text Embeddings on Amazon Bedrock - Amazon Bedrock
Invoke Amazon Titan Text Embeddings on Amazon Bedrock - AWS SDK Code Examples
Amazon Titan Embeddings G1 - Text - Amazon Bedrock
Submit a single prompt with InvokeModel - Amazon Bedrock

answered 10 months ago

AWS
EXPERT

reviewed 10 months ago

0

does it support batch input?

answered 10 months 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.