2. Chat with the Chatbot
Chat with the Chatbot
The Chat API enables programmatic interaction with chatbots through a POST request. This API is accessible to users with a paid subscription and facilitates communication with chatbots.
Path Parameters
bot_uid (string, required): The unique ID of the chatbot with which you intend to engage in conversation.
Body Parameters
Content-Type of the request should be set to application/json
q (string, required): The question you want to pose to the chatbot.
conversation_uid (string, optional): The session ID for the chat. Note that you should not manually construct a session ID. After conversing with the chatbot, a session ID will be returned. If you wish to continue the same session, you can pass this session ID in subsequent interactions.
language (string, optional, default is auto): The desired language for chatting with the chatbot. Currently supports English, French, Spanish, Russian, Simplified Chinese, and more. Refer to the table below for language codes.
stream (boolean, optional, default is False): Indicates whether to enable streaming output.
Returns
Normal
Stream
Data
answer (string): The chatbot's response to the question.
conversation_uid (string): The session ID for the current conversation.
is_qa_mode (boolean): Indicates whether it's in QA mode (QA mode provides references to answers).
question (string): The user's posed question.
system_message (string): System-generated message for displaying system notifications.
Note: In streaming mode, the response data is separated by the magic number "645130146e8d07b175fd8b1d5682d520" Before this magic number is a JSON string, and after the magic number is the actual answer.
Language Codes
Last updated