Download OpenAPI specification:
Processes chat requests with specified model and chat history, optionally using documents and images.
model required | string <string> Name of the model to use for the chat (e.g., "thyris1" or "thyris1-turbo"). |
input required | string <string> Input text to send to the model. Cannot exceed the model's maximum input character limit.
To find the maximum input character limit either refer to our documentation, or programmatically get the model's metadata from the |
chat_history | Array of strings <= 10 items [ items <string >[ items <string > ] ] Array of previous messages, where each message is an array containing user and assistant messages. Cannot be more than 10 items. |
use_documents_from | string <string> Name of the document collection to use for RAG if any. |
n_documents | integer Default: 5 Number of documents to retrieve if using a document collection. If the number is too small, the chat model will not have enough context to generate a response. Similarly, if the number is too large, the chat model will have too much context and may reach the maximum context size. |
image | string <string> Base64 encoded image to send to the model. The image should be in the following format "data:image/ |
{- "model": "thyris1",
- "input": "Why is the sky blue?",
- "chat_history": [
- [
- "Hello",
- "Hi! How can I help you?"
], - [
- "What’s the weather?",
- "Sunny and warm."
]
], - "use_documents_from": "my-collection",
- "n_documents": 5,
- "image": "data:image/jpeg;base64,/9j/4AAQS...KVyj//Z"
}
{- "model": "thyris1",
- "created_at": "2023-10-15T10:30:00Z",
- "message": "The weather is sunny and warm.",
- "sources": [
- "my-document"
], - "usage": {
- "apiKeyID": "00000000-0000-0000-0000-000000000001",
- "chatModel": "thyris1-chat",
- "embeddingModel": "thyris1-embedding",
- "inference": {
- "approxTextInputTokens": 10,
- "approxImageInputTokens": 100,
- "approxContextTokens": 100,
- "approxSystemTokens": 100,
- "inputTokens": 10,
- "outputTokens": 10,
- "duration": 100
}, - "documentStore": {
- "embeddingTokens": 10,
- "chunks": 10,
- "chunkSizeSum": 100,
- "duration": 100
}
}
}
Creates a document collection with the specified key. A collection is a logical group of documents.
collectionKey required | string <string> <= 32 characters Example: my-collection Key of the document collection. |
model required | string <string> The model to use for creating embeddings for the collection. Any document added to the collection will be embedded using this model. |
description | string <string> <= 256 characters Description of the collection. |
{- "model": "thyris1-embedding",
- "description": "A collection of documents about the world."
}
{- "id": "00000000-0000-0000-0000-000000000001"
}
Deletes a document collection with the specified key.
collectionKey required | string <string> Example: my-collection Key of the document collection. |
{- "error": "Invalid input parameters."
}
Adds documents to a document collection.
collectionKey required | string <string> <= 32 characters Example: my-collection Key of the document collection. |
documentKey required | string <string> <= 64 characters Example: my-document Key of the document. |
description | string <string> <= 256 characters The description of the document |
content required | string <string> Document text. Cannot exceed 1 MiB (hard-limit irrespective of the model).
The max size of the document is dependent on the maximum document size of the collection's model.
To find the maximum document size, refer to the model's documentation or programmatically get the model's metadata from the |
chunkSize | integer >= 1 Chunk size (currently in characters) of the documents when tokenizing.
Defaults to the embedding model maximum. Cannot be larger than the model maximum. The number of tokens in the chunk should not exceed the model's maximum chunk count.
The resulting chunk count (based on document size and chunkSize) cannot exceed the model's maximum chunk count in one request.
For a better result, it is recommended to use define the chunk size based on the chat model and not just the embedding model.
For example, a small chunk size can result in giving a very fragmented context to the chat model.
Similarly, a large chunk size can result in giving a very broad context to the chat model and even exceed the chat model's context size.
The maximum chunk size is dependent on the model.
To find the maximum chunk size, refer to the model's documentation or programmatically get the model's metadata from the |
{- "description": "A document about the world",
- "content": "Hello, world!",
- "chunkSize": 1536
}
{- "documentId": "00000000-0000-0000-0000-000000000001",
- "usage": {
- "apiKeyID": "00000000-0000-0000-0000-000000000001",
- "embeddingModel": "thyris1-embedding",
- "documentStore": {
- "embeddingTokens": 10,
- "chunks": 10,
- "chunkSizeSum": 100,
- "duration": 100
}
}
}
Deletes a document from a document collection.
collectionKey required | string <string> Example: my-collection Key of the document collection. |
documentKey required | string <string> Example: my-document Key of the document. |
{- "error": "Invalid input parameters."
}
Get a list of available models with parameters
{- "object": "string",
- "data": [
- {
- "id": "string",
- "created": 0,
- "object": "model",
- "owned_by": "string",
- "type": "chat",
- "params": {
- "maxInputChars": 1000
}
}
]
}