Chat API
Ask question over multiple related documents in a chat session.
Endpoint | /md/chat |
URL | https://us-central.unstract.com/api/v1/md/chat |
Method | POST |
Headers | Authorization: Bearer <platform_key> |
Request Body Form Data
Field | Type | Description |
---|---|---|
email | (text) | User email |
doc_ids | (text, repeated) | OPTIONAL document IDs to be included in the chat |
search_tags | (text, repeated) | Tags for metadata search over indexed files |
chat_session_id | (text) | OPTIONAL session ID of ongoing chat |
question | (text) | Question to be asked over chat session |
explain | (text) | OPTIONAL Enable tracing [true |
Success Response
-
Status:
200
-
Content-Type:
application/json
-
Body:
{
"response": "",
"reason": {},
"follow_up": "",
"session_id": ""
} -
Example:
{
"response": "The quarter with the highest revenue was Q4 2021, with a revenue of $5,778 million.",
"reason": {},
"follow_up": "",
"session_id": "b46b61c4-3e41-441c-9ec3-95c3bd60c9fc"
}
Error Response
-
Status:
4xx or 5xx
-
Content-Type:
application/json
-
Body:
{
"description": "",
"status": 0,
"message": ""
} -
Example:
{
"description": "Unauthorized",
"status": 401,
"message": "Invalid API Key or Email. Please check user and the active key under platform settings."
}