import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const embeddingResponse = await client.ai.embeddings.create({ bucket_name: 'bucket_name' });
console.log(embeddingResponse.data);{
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "<string>",
"status": "<string>",
"created_at": "<string>",
"finished_at": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Perform embedding on a Telnyx Storage Bucket using the a embedding model. The current supported file types are:
Any files not matching the above types will be attempted to be embedded as unstructured text.
This process can be slow, so it runs in the background and the user can check
the status of the task using the endpoint /ai/embeddings/{task_id}.
Important Note: When you update documents in a Telnyx Storage bucket, their associated embeddings are automatically kept up to date. If you add or update a file, it is automatically embedded. If you delete a file, the embeddings are deleted for that particular file.
You can also specify a custom loader param. Currently the only supported loader value is
intercom which loads Intercom article jsons as specified by the Intercom article API
This loader will split each article into paragraphs and save additional parameters relevant to Intercom docs, such as
article_url and heading. These values will be returned by the /v2/ai/embeddings/similarity-search endpoint in the loader_metadata field.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: 'My API Key',
});
const embeddingResponse = await client.ai.embeddings.create({ bucket_name: 'bucket_name' });
console.log(embeddingResponse.data);{
"data": {
"task_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"task_name": "<string>",
"status": "<string>",
"created_at": "<string>",
"finished_at": "<string>",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Supported models to vectorize and embed documents.
thenlper/gte-large, intfloat/multilingual-e5-large Supported types of custom document loaders for embeddings.
default, intercom Was this page helpful?