Ask a question¶
POST /document-intelligence/v1/collections/{collection_id}/chat
Ask a question across a collection and get a written answer plus the passages it was drawn from.
Parameters¶
| Name | In | Required | Notes |
|---|---|---|---|
collection_id |
path | yes | - |
Request body¶
| Field | Type | Required | Notes |
|---|---|---|---|
query |
string | yes | The question to ask. max 4000 characters |
session_id |
string | no | Omit to start a new conversation. The id comes back in the response; sending it on the next call is what lets a follow-up question understand "it". |
Example¶
curl -X POST "https://api.futuresmart.ai/document-intelligence/v1/collections/{collection_id}/chat" \
-H "Authorization: Bearer $FS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"query": "<query>"
}'
Responses¶
200
| Field | Type | Required | Notes |
|---|---|---|---|
answer |
string | yes | - |
session_id |
string | no | - |
sections |
array of Section | yes | - |
follow_up |
array of string | no | defaults to [] |
Every failure, a malformed request included, comes back in the shared envelope with a stable code to branch on. See Errors.