向聊天机器人发送消息
开发环境
开发环境
POST
/api/v1/chat
保存对话
conversationId``converstionId
错误处理
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/api/v1/chat' \
--header 'Authorization: Bearer <Your-Secret-Key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"messages": [
{ "content": "How can I help you?", "role": "assistant" },
{ "content": "What is chatbase?", "role": "user" }
],
"chatbotId": "<Your Chatbot ID>",
"stream": false,
"temperature": 0,
"model": "gpt-3.5-turbo",
"conversationId": "<Conversation ID generated on your end>"
}'
响应示例响应示例
{
"text": "Chatbase is an AI chatbot builder that lets you create a GPT-based chatbot that knows data."
}
请求参数
Header 参数
Authorization
string
必需
示例值:
Bearer <Your-Secret-Key>
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
返回响应
修改于 2024-03-20 09:39:11