跳到主要内容

Create a Chatbot

Create Chatbot

After the source data and knowledge base were ready. Chatbot can be created by sending a POST request to the following API:POST bv/aisk/v1/chatbots


Configure the schedule request body with the following options:
ParameterRequiredDescription
nameyesNaming the chatbot.
modelyesLanguage model type.
creativityyesIt governs the randomness and thus the creativity of the responses, it is always a number between 0 and 1.
- 0 means the responses will be very straightforward, almost deterministic
- 1 means the responses can vary wildly
response_lengthyesThe response length setting of the chatbot
appearanceyesenable appearance setting of the chatbot
domain_controlyesTo control domain which allow user to access
rate limityesTo control the numbers of requests per period of time
quota limityesTo control the numbers of characters usage settings of chatbot

A successful response will contain an id, which is the identifier of the chatbot Here is an example of the response :

{
"chatbot": {
"id": "string",
"name": "string",
"status": "CHATBOT_STATUS_TRAINING",
"setting": {
"model": "MODEL_LITE",
"character_role": "string",
"character_description": "string",
"creativity": 0,
"response_length": {
"enabled": true,
"input": 0,
"output": 0
}
},
"appearance": {
"enabled": true,
"setting": {
"profile": {
"image": {
"id": "string",
"url": "string",
"name": "string"
},
"display_name": "string"
},
"message": {
"welcome": "string",
"placeholder": "string"
},
"theme": "CHATBOT_THEME_DARK",
"color": {
"user_message": "string",
"widget": "string"
}
}
},
"reference": {
"kb_selection": true,
"display_citation": true
},
"domain_control": {
"enabled": true,
"domains": [
"string"
]
},
"character_count": "string",
"rate_limit": {
"enabled": true,
"setting": {
"limit": 0,
"duration": "string",
"throttle_message": "string",
"vary_by": "RATE_LIMIT_VARY_BY_IP"
}
},
"quota_limit": {
"enabled": true,
"setting": {
"limit": 0,
"reset": "QUOTA_LIMIT_RESET_MINUTELY"
}
},
"created_at": "2024-02-04T14:33:28.866Z",
"updated_at": "2024-02-04T14:33:28.866Z"
}
}

Create an Access Token for Chatroom​

Once the chatbot is created, access token can be created by sending a POST request to the following API:POST bv/aisk/v1/chatbot/{id}/tokens Replace {id} with the ID of the created chatbot. While config chatbot settings will require validation with chatbot token in afterward.


Add Knowledge Base to Chatbot

Once chatbot has been created, which will need to create relationship among Knowledge Bases. This is able to complete specific knowledge warehouse ready for user ask quesitons. by sending request to API: POST bv/aisk/v1/chatbots/{id}/knowledge-bases/{knowledge_base_id} The request body should contain the following parameters:

ParameterRequiredDescription
idyesThe uuid of the chatbot.
knowledge_base_idyesThe uuid of knowledge bases.
can have list of ids