The Custom Assistants module enables the creation of custom AI experts based on roles, processes, tasks, and areas of specialization needed, described by the user.
Input
Loading...
Description
The Custom Assistants module enables you to create custom assistants. You can give it a name, a purpose and connect it to your document repository so that it informs its responses to users from your ingested documents.
Create
Creates a custom assistant and returns its ID. The id will later be used to allow users to interact with it.
{
"user": "b5601df8-6af3-4c1a-9ded-b7df4c506eab",
"name": "Soffos",
"role": "Your role is to help people with their workflow."
}
Request fields
user string Required
Unique ID representing the end-user for security and rate-limiting purposes.
name string Required
The name/identity of your custom assistant.
role string Required
A description of your bot's purpose. You may also describe its tone when responding. The system may not be able to follow complex instructions specified in this field.
Unique ID representing the end-user for security and rate-limiting purposes.
chatbot_ids string list Optional
Specify the id of the custom assistants you need to see the details for. Don't pass this parameter if you wish to see all your created custom assistants.
Example response
Copy Code
{
"chatbots": [
{
"name": "Soffos",
"role": "Your role is to help people with their workflow.",
"created_at": "2023-08-04T12:06:55.313781",
"chatbot_id": "78e31f2e432d47aa96d5932b756af11a"
}
]
}
Response fields
chatbots dictionary list
A list of dictionaries with details about your custom assistants.
Delete
Deleting a custom assistant will also delete all the conversation history for that custom assistant.
{
"user": "b5601df8-6af3-4c1a-9ded-b7df4c506eab",
"chatbot_id": "78e31f2e432d47aa96d5932b756af11a",
"session_id": "<specify a session id>",
"user_id": "<give unique identifier of the user - can be the same as the user field>",
"mode": "closed",
"bot_document_ids": [
"e177b434d5754c0eba6247dc8134ce59"
],
"context_document_ids": [
"87f4026bb62a465f898081945be19467"
],
"message": "Hello, how are you?"
}
Request fields
user string Required
Unique ID representing the end-user for security and rate-limiting purposes.
chatbot_id string Required
The custom assistant's id.
session_id string Required
A unique session id for mapping the records to your application. It is recommended that you provide a UUID.
user_id string Required
A unique user id. It is recommended that your provide a UUID.
mode string Required
The value can only be one of:
open: The bot will respond with any information it can generate out of its training data and its "background" content that has been provided to it (more info on that below).
closed: The bot's responses will be confined within the scope and content of the provided ingested documents.
hybrid: The bot may respond from the provided documents, but not restricted to the content of those documents.
session_name string Optional
You may give a name to the session by providing it in this field. This is useful for situations where the user wants to give a title to their conversation on your application's UI. If not provided, the custom assistant will generate one a few messages into the conversation and return it alongside its response.
bot_document_ids string list Optional
Here you can specify documents that describe the bot's background and its perception of itself. For example, if the custom assistant represents your company you may upload a document stating what the custom assistant is to the company and some information about the company that your wish the custom assistant to be able to answer regardless of its selected mode or context documents. It is advised to use this field strictly for the purpose described here to avoid unpredictable behavior.
context_document_ids string list Required when mode is closed or hybrid, ignored when mode is open
Pass the ids of the documents that you wish to inform your bot with for the specific user/session. Applicable for closed and hybrid modes as described above.
Example response
Copy Code
{
"response": "Hello! My name is Soffos and I'm here to help you with your work. Please let me know if you have any questions.",
"session_name": null,
"messages": [
{
"text": "Hello, how are you?",
"source": "user"
},
{
"text": "Hello! My name is Soffos and I'm here to help you with your work. Please let me know if you have any questions.",
"source": "assistant"
}
],
"context": "<Passages from ingested document that were relevant to the query>",
}
Response fields
response string
The bot's response to the last message
session_name string
On the user's third message, the bot will respond with a generated conversation title, unless provided by the user beforehand. The user may change this by passing it in the request as described above.
messages dictionary list
A list of the conversation's messages so far.
context
Passages search for content to respond with. This is a default behavior in closed and hybrid mode despite having cases where the context is not needed to formulate the answer.
Unique ID representing the end-user for security and rate-limiting purposes.
chatbot_id string Required
The custom assistant's id.
user_id string Required
The id of the user we wish to fetch the conversations for.
Example response
Copy Code
{
"sessions": [
{
"session_id": "<some session id>",
"session_name": null,
"messages": [
{
"text": "Hello, how are you?",
"source": "user"
},
{
"text": "Hello! My name is Soffos and I'm here to help you with your work. Please let me know if you have any questions.",
"source": "assistant"
}
]
}
]
}
Response fields
sessions dictionary list
A list of dictionaries containing the session_id, session_name, and messages of each conversation matching our search.
Unique ID representing the end-user for security and rate-limiting purposes.
chatbot_id string Required
The custom assistant's id.
user_id string Required
The id of the user we wish to delete the conversations for.
We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By continuing to use our website, you consent to our use of cookies.