智能体训练完成后(status=done),就可以通过对话接口向它提问了。
响应数据根据是否是流式响应而变化,可以参考下面的请求示例进行判断:

cURL 请求示例

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
}'

Postman 请求流式响应示例

向智能体提问

Postman 请求非流式响应示例

向智能体提问