Chat
Chat with document collections and AI agents.
The number of chats to return.
The timestamp to start after.
The ID of the collection.
The ID of the agent. If no agent_id or collection_id is specified, the default agent "Jack Of All Trades" will be used.
Whether to include empty chats with collections and agents created by the user.
GET /api/chat HTTP/1.1
Host: www.openindex.ai
Authorization: Bearer JWT
Accept: */*
A list of chats.
{
"ok": true,
"chats": [
{
"id": "text",
"userId": "text",
"createdAt": 1,
"updatedAt": 1,
"agentId": "text",
"collectionId": "text",
"status": "text",
"current": [
{}
],
"auto": {},
"tools": [
{
"id": "text",
"checked": true
}
]
}
]
}
Enter null to create a new conversation or an existing chatId to continue a conversation
Override the model to use for this reply among the list of supported models.
Publicly accessible URL of the last uploaded file. Typically used to feed an image to a multi-modal model.
2-letter ISO code of the language the model should use to reply.
en
POST /api/chat HTTP/1.1
Host: www.openindex.ai
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 195
{
"chatId": "text",
"agentId": "text",
"collectionId": "text",
"message": "text",
"streaming": true,
"tools": [
{
"id": "text",
"checked": true
}
],
"model": "gpt-3.5-turbo",
"lastUploadedFile": "text",
"language": "en"
}
{
"ok": true,
"message": "text",
"error": "text",
"sources": [
"text"
],
"followup": {},
"context": {},
"chatId": "text",
"agentId": "text",
"collectionId": "text"
}
Please see the list of supported models for the model
parameter above.
If you pass true
to the parameter streaming
, the API will open a stream returning a JSON Lines format (i.e. one json object per line).
Last updated