In the official OpenAI node library Create embeddings if for example using the model text-embedding-ada-002
the embeddings returned is an array of around 1536
.
import {Configuration, OpenAIApi} from 'openai'
openai = new OpenAIApi(this.configuration)
const parameters= {
model: 'text-embedding-ada-002',
input: text,
}
// Make the embedding request and return the result
const resp = await openai.createEmbedding(parameters)
const embeddings = embedding?.data.data[0].embedding
I would like to be able to limit the length of the list of embeddings returned.