Ask questions to Copilot
POST/wiki/ask
History
Version | Changes |
---|---|
v6.35.0 | Added in: v6.35.0 |
Request
Query Parameters
The team ID
User ID, this parameter can only be passed when calling as an Oauth bot. It is used to perform operations as the specified user
- application/json
Body
required
The question to ask Copilot and other parameters.
- MOD1
- MOD2
oneOf
start a new Copilot ask request.
Possible values: [global
, space
, page
, attachment
]
the type of scopeID, default is global
the ID of the pre-defined scopeType, may be SpaceID, PageID or AttachmentID. When scopeType is global, it is not required.
The question/request sent to Copilot.
The output language of the response, default is current user's language. The value should be a valid English name of the language, such as "Chinese", "English", "Japanese", etc.
Whether to generate related questions, default is true.
config
object
configurations to run the ask request
Whether to expand the query before searching the vector database. Query expansion will make the result more relevant, but may increase latency. For this options to work, the LLM models must support structured data generation. Default value for reasoning model is false, for other models is true.
Whether to enable cache for the ask request. Default is true.
continue a Copilot ask request, the requestID is required.
The question/request sent to Copilot.
The ID of the conversation to continue, required when continuing a Copilot ask request.
Responses
- 200
- 401
- 403
- 404
- 500
Data will be returned in SSE format
If any error occurs, the response will have the following error codes:
Code | Error |
---|---|
409 | Exceed copilot usage quota. Premise deployment has no usage quota limitation |
510 | Generic Copilot error |
511 | No Copilot license |
512 | Copilot is not installed |
513 | Invalid request parameters, refer to the error message for details |
601 | Authorization error when calling external AI services |
602 | Exceed quota error when calling external AI services |
604 | Cannot connect to external AI services |
605 | Permission denied when calling external AI Services |
- text/event-stream
- Schema
- Example (from schema)
Schema
- MOD1
- MOD2
- MOD3
- MOD4
- MOD5
- MOD6
Array [
]
Array [
]
Array [
]
oneOf
step type response, indicating the current step of the Copilot process.
Possible values: [step
]
Possible values: [embedding
, searching
, reranking
, thinking
, generating
]
Reasoning process response. Only returned when the COpilot is configured with a reasoning model.
Possible values: [reasoning
]
The reasoning token from Copilot.
The time cost of the reasoning process in milliseconds.
Answer/response process.
Possible values: [generating
]
The content of the response from Copilot.
Related questions response.
Possible values: [relatedQuestions
]
The related questions generated by Copilot.
Generation end response.
Possible values: [generationEnd
]
The full content of the response from Copilot.
The full reasoning content from Copilot, if available.
The total time cost of the reasoning process in milliseconds, if applicable.
references
object[]
The references used in the response, the first one is referenced in response as [info1], the second one is referenced as [info2], and so on.
Possible values: [page
, media
, attachment
]
The type of content, such as 'page' or 'media' or 'attachment'.
The ID of the item, such as PageID or AttachmentID.
The name of the file, if contentType is 'media'
attachments
object[]
The attachment information used in references
The name of the attachment.
The name of the page where the attachment is located.
The ID of the page where the attachment is located.
The ID of the space where the page is located.
The ID of the attachment. Used by reference itemID to identify the attachment.
pages
object[]
The page information used in references
The title of the page.
The ID of the page. Used by reference itemID to identify the page.
The ID of the space where the page is located.
The name of the space where the page is located.
End response.
Possible values: [end
]
The ID of the conversation, used to continue the conversation in the future.
The error code, 0 for success, other values indicate an error (see above error codes table).
The error message.
{}
Returned if the authentication credentials are incorrect or missing.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Unauthorized",
"errorMsg": "Access token is invalid"
}
Returns if the scope check fails.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Forbidden",
"errorMsg": "Scope is invalid"
}
Returned if the resource object was not found.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "NotFound",
"errorMsg": "Not Found"
}
Internal Server Error.
- application/json
- Schema
- Example (from schema)
Schema
The result of this request.
The error code of this request.
Error message for this request.
{
"result": "FAIL",
"errorCode": "Internal Server Error",
"errorMsg": "Internal Server Error"
}