ChatDOC
  1. Questions
ChatDOC
  • Documents
    • Upload Document
      POST
    • Upload Document
      POST
    • Get Document
      GET
    • Delete Document
      DELETE
    • Download Document
      GET
  • Collections
    • Create Collection
      POST
    • Clone Document To Collection
      POST
  • Questions
    • Get Suggested Questions
      GET
    • Ask Question
      POST
    • Get Question
      GET
    • Ask Question With Multiple Documents
      POST
  • Users
    • Get Quota
      GET
  1. Questions

Ask Question With Multiple Documents

Develop Env
https://dev.your-api-server.com
Develop Env
https://dev.your-api-server.com
POST
/questions/multi-documents
Chat with multiple documents, similar with POST /questions.
Consume one question quota no matter how many documents you ask upon.
Response:
Same as POST /questions.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://dev.your-api-server.com/questions/multi-documents' \
--header 'Content-Type: application/json' \
--data-raw '{
    "question": "string",
    "stream": true,
    "selected_meta": {
        "material": "string",
        "upload_id": "string",
        "rects": [
            {
                "pageNumber": 1,
                "outline": [
                    1,
                    1,
                    1,
                    1
                ]
            }
        ]
    },
    "history": [],
    "search_entire_doc": true,
    "detailed_citation": false,
    "language": "string",
    "model_type": "gpt-3.5-turbo",
    "upload_ids": [
        "string"
    ]
}'
Response Response Example
200 - Example 1
null

Request

Body Params application/json
question
string 
Question
required
question to ask
>= 1 characters<= 3000 characters
stream
boolean 
Stream
optional
If set, partial message deltas will be sent, like in ChatGPT of OpenAI. Tokens will be sent as data-only server-sent events as they become available.
Default:
true
selected_meta
Selected Meta
optional
When use Ask About Selected Text, this field is acquired from EVENT_TYPES.CHAT_ICON_CLICKED of our DOCViewerSDK.
Any of
material
string 
Material
required
upload_id
string 
Upload Id
required
rects
array[object (PDFViewerRect) {2}] 
Rects
required
>= 1 items
history
array[object (ChatMessage) {2}] 
History
optional
chat history, used for Threaded Chat, this parameter simulates OpenAI' API. history is question and answer pairs, which is a list of ChatMessage objects. The max input tokens of history, selected_meta.material and question is 8000, which is a little less than OpenAI's limit of Embedding models. Sample parameter is as follows:
[
{"role": "user", "content": "Who..."},
{"role": "assistant", "content": "The..."},
{"role": "user", "content": "Where..."}
{"role": "assistant", "content": "The..."},
]
role
enum<string> 
required
An enumeration.
Allowed values:
assistantuser
content
string 
Content
required
search_entire_doc
boolean 
Search Entire Doc
optional
if true: limit responses to current file's information, else: responses go freely with knowledge of our AI
Default:
true
detailed_citation
boolean 
Detailed Citation
optional
Whether to show the source at the end of each sentence or not. Requires enabling the search_entire_doc setting.
Default:
false
language
string 
Language
optional
preferred language of answer to the question, if not provided, we will try to detect the language automatically, which is flexible and also works well. You'd better use ISO language name, such as English, Chinese. But we can't promise, when AI can't answer your question well, it generally answers in English.
model_type
enum<string> 
optional
Supported LLM enumeration.
Allowed values:
gpt-3.5-turbogpt-4gpt-4o
Default:
gpt-3.5-turbo
upload_ids
array[string]
Upload Ids
required
Type must be a string list of upload ids
>= 1 items<= 30 items
Examples

Responses

🟢200Successful Response
application/json
Body
No schema defined
🟠422Validation Error
Modified at 2024-07-26 06:57:23
Previous
Get Question
Next
Get Quota
Built with