curl --request POST \
--url https://geekai.co/api/v1/agent/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"uuid": "29db255d-211c-4fc6-8fbe-af97fa59cafa",
"question": "要办理XXX怎么做",
"messages": [
{
"text": "你们的产品质保多久?",
"role": "human"
},
{
"text": "我们的产品标准质保期是一年",
"role": "ai"
}
],
"stream": false,
"sess_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}'
{
"message_id": "msg_123456789",
"content": "我们的退换货政策如下:...",
"reference": [
{
"content": "<string>",
"source": "<string>",
"confidence": 123
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}
与指定智能体进行对话交互,支持上下文对话和流式响应。
curl --request POST \
--url https://geekai.co/api/v1/agent/chat \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"uuid": "29db255d-211c-4fc6-8fbe-af97fa59cafa",
"question": "要办理XXX怎么做",
"messages": [
{
"text": "你们的产品质保多久?",
"role": "human"
},
{
"text": "我们的产品标准质保期是一年",
"role": "ai"
}
],
"stream": false,
"sess_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}'
{
"message_id": "msg_123456789",
"content": "我们的退换货政策如下:...",
"reference": [
{
"content": "<string>",
"source": "<string>",
"confidence": 123
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123
}
}
curl --location --request POST 'https://geekai.co/api/v1/agent/chat' \
--header 'Authorization: Bearer {YOUR_GEEKAI_API_KEY}' \
--header 'Content-Type: application/json' \
--data-raw '{
"uuid": "智能体ID",
"question": "用户问题",
"messages": [
{
"text": "历史问题1",
"role": "human"
},
{
"text": "历史回答1",
"role": "ai"
}
],
"stream": true
}'
JWT认证token
成功响应
The response is of type object
.