ChatBot API
The ChatBot API allows you to try out different Large Language Models (LLMs) from providers like Mistral, OpenAI, and Claude.
For more details on the supported LLM models and their capabilities, please refer to the ChatBot.
Chat with LLM
POST
/stream_chat
Headers
Name | Value |
---|---|
Content-Type |
|
Authorization |
|
Body
Name | Type | Description |
---|---|---|
llm | string | -> The
|
llm_model | string | -> The For example, if the
Similarly, if the
Ensure that the -> Supported values are :
|
history | List of Dictionary (Python) or map (C++) | -> The
-> The history should be provided as a list of dictionaries, where each dictionary represents a message. The dictionary should have the following structure: The Here's an example of the |
system_msg | string | -> The |
temperature | float | -> The -> Higher temperature values (closer to 1) will result in more diverse and creative output, while lower values (closer to 0) will lead to more deterministic and conservative responses. |
image_analyze | bool | -> If you are passing image URLs and want the model to analyze the images, set the |
enable_tool | bool | -> To use the tools supported by the Chat API, enable the
-> After enabling the |
tools | dictionary or map | -> The
-> The |
take_route | bool | -> Enable routing functionality by setting this parameter to true. Routing allows defining two LLM models: a strong model and a weak model. The router selects the weak model for general queries and the strong model for advanced queries. This approach optimizes costs by using the more expensive, powerful model only when necessary. |
router | dictionary or map | -> Use this dictionary to specify the LLM and LLM model for both strong and weak cases. Ex. |
Example of Input body parameters :
After passing the necessary parameters and executing the Chat API, you will receive a stream response. A successful response will look similar to the following:
Response
The Chat API response is a streaming response, which means you will receive the output in chunks as the model generates the response. The response will continue to stream until the generation is complete.
The response will contain the following elements:
output
: This object contains the generated text output from the model.
The text output from the LLM can be obtained from the output
parameter. When the response is complete, the final chunk will contain a null
value in the output
parameter, indicating the end of the stream.
Run the API
To test this API, please use the following link:
Parse File
Use this endpoint to add a PDF, CSV, TXT or DOC/DOCX document to the Qolaba AI database. The API will parse the document and store it in the vector database, returning a unique ID that can be used to retrieve information from the document using the Large Language Model (LLM).
Please note the following guidelines when indexing Document:
The PDF, DOC/DOCX file should not exceed 200 pages.
The CSV file should not contain more than 30 columns and 500 rows.
When uploading a CSV file to the API, the first row must contain the column names. This helps the Large Language Model (LLM) better understand the values in each row of the CSV file.
Ensure that the document does not contain any sensitive or confidential information.
The unique ID returned after indexing the document can be used in subsequent requests to the Chat API to retrieve relevant information from the document.
POST
/pdfVectorStore
Headers
Name | Value |
---|---|
Content-Type |
|
Authorization |
|
Body
Name | Type | Description |
---|---|---|
| string | The |
Response
Upon successfully indexing a document, the API will return a response with the unique identifier of the indexed document in output
parameter.
You can use the unique identifier in subsequent requests to the Chat API to retrieve information from the indexed PDF.
Run the API
To test this API, please use the following link:
Last updated