Docs
Chat with Chatbot
Chat with Chatbot
Learn how to chat with a 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
Parameter | Type | Required | Description |
---|---|---|---|
bot_uid | string | Yes | The unique ID of the chatbot with which you intend to engage in conversation. |
Body Parameters
The Content-Type of the request should be set to application/json
.
Parameter | Type | Required | Description |
---|---|---|---|
q | string | Yes | 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 | The desired language for chatting with the chatbot. Currently supports English, French, Spanish, Russian, Simplified Chinese, and more. Default is auto. |
stream | boolean | Optional | Indicates whether to enable streaming output. Default is False. |
Returns
Normal
Stream
Data
Field | Type | Description |
---|---|---|
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. |
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.
Appendix
1. Language Codes
Code | Name | Native Name | Remark |
---|---|---|---|
auto | Auto | Auto | Automatically determines language based on input |
en | English | English | |
fr | French | Français | |
es | Spanish | Español | |
ru | Russian | Русский | |
zh-Hans | Simplified Chinese | 中文 (简体) | |
zh-Hant | Traditional Chinese | 中文 (繁體) | |
ar | Arabic | العربية | |
de | German | Deutsch | |
jp | Japanese | 日本語 | |
pt | Portuguese | Português | |
hi | Hindi | हिंदी | |
ko | Korean | 한국어 | |
it | Italian | Italiano | |
uk | Ukrainian | Українська |