跳到主要内容

Create a prompt token

POST 

/bv/aisk/v1/prompts/tokens

This API is used to create a prompt token for the further streaming prompt used.

Request

Body

required
    source objectrequired

    Required. The generate source of the prompt token.

    type stringrequired

    Possible values: [PROMPT_TOKEN_SOURCE_TYPE_CHATBOT_ID, PROMPT_TOKEN_SOURCE_TYPE_PUBLISH_TOKEN]

    Required. The source type to generate the prompt token.

    chatbot_id string

    Optional. The id of the chatbot. It's required when the type is PROMPT_TOKEN_SOURCE_TYPE_CHATBOT_ID. It will generate the prompt token based on the specified chatbot with the current setting.

    publish_token string

    Optional. The chatbot publish token. It's required when the type is PROMPT_TOKEN_SOURCE_TYPE_PUBLISH_TOKEN. It will generate the prompt token based on the chatbot publish token.

    setting object

    Optional. The generate setting of the prompt token.

    citation object

    Optional. Indicates the citation setting of the sources which will be used in the response answer. The default will have no restrictions, all sources will be available. It can be set to restricted mode, and the response answer will be limited to the sources that the user can access.

    mode Optional. The citation mode for sources in the prompt. Default: `PROMPT_CITATION_MODE_ALL` (string)

    Possible values: [PROMPT_CITATION_MODE_ALL, PROMPT_CITATION_MODE_RESTRICTED]

    user_id string

    Optional. The id of the user subject that the citation will be restricted to. It'll available when the mode is PROMPT_CITATION_MODE_RESTRICTED. The default will be the user in the access token if not specified. It's friendly for integration and can on behalf of/specify the user prompt with the AiSK from the custom user management system.

Responses

A successful response.

Schema
    token string

    The token to prompt with the chatbot.

    expires_in int32

    Indicates the lifetime in seconds of the token.

    expired_at date-time

    Indicates the time when the token will be expired.

Loading...