更新聊天机器人设置
POST
/api/v1/update-chatbot-settings更新聊天机器人设置 API 允许您编辑聊天机器人的设置,例如其名称、基本提示、初始消息、建议消息、可见性状态、域限制、IP 限制、AI 模型等。
请求参数
Header 参数
content-type
string
必需
示例值:
application/json
Body 参数application/json
collectCustomerInformation
object
可选
包含要从客户收集的信息的对象。
name
object
必需
styles
object
可选
包含样式参数的对象,允许您自定义聊天机器人用户界面的外观。
theme
string
必需
为聊天机器人界面主题选择“深色”或“浅色”。
userMessageColor
string
必需
以十六进制格式定义用户消息颜色
buttonColor
string
必需
使用十六进制格式设置聊天气泡按钮颜色。
displayName
string
必需
在聊天界面中显示品牌名称。
autoOpenChatWindowAfter
integer
必需
在定义的时间(以秒为单位)后自动打开聊天窗口。
alignChatButton
string
必需
在界面中对齐聊天机器人按钮,“左”或“右”。
chatbotId
string
必需
指您要与之交互的聊天机器人的 ID(可在聊天机器人设置页面上找到)。
name
string
可选
聊天机器人的新名称。
instructions
string
可选
基本提示;有关聊天机器人应如何表现的说明。
initialMessages
array[string]
可选
包含聊天机器人要使用的初始消息的字符串数组。这些消息将是聊天机器人向用户打招呼的内容。
suggestedMessages
array[string]
可选
包含聊天机器人使用的建议消息的字符串数组。这些消息将显示在聊天机器人界面中的文本输入上方。
visibility
string
可选
聊天机器人的可见性状态,可以设置为“private”或“can_be_embedded”。
onlyAllowOnAddedDomains
boolean
可选
一个布尔值标志,用于启用或禁用仅在特定域上允许聊天机器人 iframe 和小部件。
domains
array[string]
可选
包含聊天机器人允许的域的字符串数组。
ipLimit
integer
可选
一台设备每秒发送的消息数量限制。
ipLimitTimeframe
integer
可选
应用消息限制的时间范围(以秒为单位)。
ipLimitMessage
string
可选
超出 IP 限制时显示的消息。
model
string
可选
聊天机器人使用的AI模型,此时可以设置为'gpt-4'或'gpt-3.5-turbo'。如果未设置,则使用聊天机器人设置中设置的模型。“gpt-4”选项仅适用于标准和无限计划。
temp
number
可选
AI模型的温度参数,范围为[0, 1]。较高的值(如 0.8)将使输出更加随机,而较低的值(如 0.2)将使其更加集中和确定性。
示例
{
"collectCustomerInformation": {
"name": {
"label": "Name",
"active": true
}
},
"styles": {
"theme": "dark",
"userMessageColor": "#3B81F7",
"buttonColor": "#3B81F7",
"displayName": "Product Hunt",
"autoOpenChatWindowAfter": 4,
"alignChatButton": "left"
},
"chatbotId": "[Your ChatbotID]",
"name": "my Chatbot",
"instructions": "I want you to act as a document that I am having a conversation with. Your name is \"AI Assistant\". You will provide me with answers from the given info. If the answer is not included, say exactly \"Hmm, I am not sure.\" and stop after that. Refuse to answer any question not about the info. Never break character.",
"initialMessages": [
"Hi! What can I help you with?"
],
"suggestedMessages": [
"Hi! What are you?"
],
"visibility": "private",
"onlyAllowOnAddedDomains": true,
"domains": [
"example.com"
],
"ipLimit": 20,
"ipLimitTimeframe": 240,
"ipLimitMessage": "Too many messages in a row",
"model": "gpt-4",
"temp": 0.2
}
示例代码
返回响应
成功(200)
请求有误(400)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
object {0}
示例
成功示例
返回成功消息,表明聊天机器人设置已成功更新。
修改于 6 个月前