Generate text using an available LLM (Large Language Model).
Successful Response
{- "text": [
- "Hello, World!"
]
}
{- "data": {
- "answer": [
- "string"
]
}
}
Generate text using an available LLM (Large Language Model) with streaming of tokens as they are generated. This allows for a faster response time and a better user experience overall as the user does not have to wait for the full output to complete before receiving a response.
Successful Response
{- "text": [
- "Hello, World!"
]
}
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
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 /embedding/{task_id}
.
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.
Successful Response
{- "bucket_name": "string",
- "document_chunk_size": 1024,
- "document_chunk_overlap_size": 512,
- "embedding_model": "thenlper/gte-large"
}
{- "data": {
- "task_id": "736fde4d-9029-4915-8189-01353d6982cb",
- "task_name": "string",
- "status": "string",
- "created_at": "string",
- "finished_at": "string",
- "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5"
}
}
Check the status of a current embedding task. Will be one of the following:
queued
- Task is waiting to be picked up by a workerprocessing
- The embedding task is runningsuccess
- Task completed successfully and the bucket is embeddedfailure
- Task failed and no files were embedded successfullypartial_success
- Some files were embedded successfully, but at least one failedSuccessful Response
{- "data": {
- "task_id": "736fde4d-9029-4915-8189-01353d6982cb",
- "task_name": "string",
- "status": "string",
- "created_at": "string",
- "finished_at": "string"
}
}
Get all embedded files for a given user bucket, including their processing status.
Successful Response
{- "data": [
- {
- "filename": "string",
- "status": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z",
- "last_embedded_at": "2019-08-24T14:15:22Z",
- "error_reason": "string"
}
]
}
Perform a similarity search on a Telnyx Storage Bucket, returning the most similar num_docs
document chunks to the query.
Currently the only available distance metric is cosine similarity which will return a distance
between 0 and 1.
The lower the distance, the more similar the returned document chunks are to the query.
A certainty
will also be returned, which is a value between 0 and 1 where the higher the certainty, the more similar the document.
You can read more about Weaviate distance metrics here: Weaviate Docs
If a bucket was embedded using a custom loader, such as intercom
, the additional metadata will be returned in the
loader_metadata
field.
Successful Response
{- "bucket_name": "string",
- "query": "string",
- "num_of_docs": 3
}
{- "data": [
- {
- "document_chunk": "string",
- "distance": 0,
- "metadata": {
- "source": "string",
- "checksum": "string",
- "embedding": "string",
- "filename": "string",
- "certainty": 0,
- "loader_metadata": { }
}
}
]
}