Select Language:
If you want to generate an embedding for the text “Sense and Sensibility” using Amazon Titan Text Embeddings v2 through a REST API in Postman, here’s a simple guide to help you get started.
First, you need to set up your request with the right method and URL. Use the POST method and point it to this URL—make sure to replace the [region] placeholder with your actual AWS region:
https://bedrock-runtime.[region].amazonaws.com/model/amazon.titan-embed-text-v2:0/invoke
Next, add the required headers to your request. These are:
– Content-Type: application/json
– Accept: application/json
– Authorization: [your AWS credentials]
Now, for the request body, include the following JSON structure:
json
{
“inputText”: “Sense and Sensibility”,
“dimensions”: 1024,
“normalize”: true
}
Here’s what these options do:
– The “dimensions” controls the size of the embedding vector. You can choose 256, 512, or 1024, with 1024 being the default if you leave it out.
– The “normalize” determines whether the output vector should be scaled to a standard range for comparison.
If you want to specify the type of embeddings—like binary—you can include the “embeddingTypes” parameter. For example:
json
“embeddingTypes”: [“binary”]
Keep in mind, requesting only binary embeddings will change where the response data appears. Instead of a usual “embedding” field, your response will include “embeddingsByType.binary”.
Once you’ve sent the request, the response will include the actual embedding vector and the number of tokens in your input text.
Make sure your AWS credentials are properly configured in Postman to authorize your request. This setup will allow you to generate text embeddings efficiently.
For more detailed instructions or troubleshooting, consult the official AWS documentation links provided. These resources include examples of invoking Amazon Titan Text Embeddings and specifics about model parameters.
By following these steps, you can effortlessly create embeddings for any text using Amazon Titan in Postman.




