Skip to main content

Ask questions to Copilot

POST 

/wiki/ask

History

VersionChanges
v6.35.0Added in: v6.35.0

Request

Query Parameters

    teamID stringrequired

    The team ID

    requestUserID string

    User ID, this parameter can only be passed when calling as an Oauth bot. It is used to perform operations as the specified user

Body

required

The question to ask Copilot and other parameters.

    oneOf

    start a new Copilot ask request.

    scopeType string

    Possible values: [global, space, page, attachment]

    the type of scopeID, default is global

    scopeID string

    the ID of the pre-defined scopeType, may be SpaceID, PageID or AttachmentID. When scopeType is global, it is not required.

    query string

    The question/request sent to Copilot.

    language string

    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.

    generateRelatedQuestions boolean

    Whether to generate related questions, default is true.

    config

    object

    configurations to run the ask request

    expandQuery boolean

    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.

    enableCache boolean

    Whether to enable cache for the ask request. Default is true.

Responses

Data will be returned in SSE format

If any error occurs, the response will have the following error codes:

CodeError
409Exceed copilot usage quota. Premise deployment has no usage quota limitation
510Generic Copilot error
511No Copilot license
512Copilot is not installed
513Invalid request parameters, refer to the error message for details
601Authorization error when calling external AI services
602Exceed quota error when calling external AI services
604Cannot connect to external AI services
605Permission denied when calling external AI Services

Schema

    oneOf

    step type response, indicating the current step of the Copilot process.

    type string

    Possible values: [step]

    step string

    Possible values: [embedding, searching, reranking, thinking, generating]

Loading...