ai搜索对话
url:/ai_search_chat
method: POST
请求参数:
|参数名|参数类型|必选|参数说明|
|-|-|-|-|
|messages|dict|True|对话历史,长度必须为偶数|
|question|string|True|用户输入问题|
|llm_name|string|True|对话模型名称|
|prompt_template|string|False|提示词,默认为空|
|temperature|folat|False|模型温度(0~1,越大越发散),默认为0.95|
|reply_limit|int|False|回复长度,默认1024|
|api_key_config|string|True|api密钥配置|
返回参数:
|参数名|参数类型|参数说明|
|-|-|-|
|error|bool|是否有错误|
|result|string|对话回答|
请求参数示例:
```language
{
"messages": [],
"question": "今天的天气怎么样",
"llm_name": "ERNIE-Bot-4",
"prompt_template": "",
"reply_limit": 2048,
"temperature": 0.95,
"api_key_config": {
"qianfan_ak": "pB6srQV18RVymInzb8KYlfDP",
"qianfan_sk": "btmWS04bC4fIZ09IquWUF6VwNhYjOYGM"
}
}
```
返回参数示例(流式):
type=step:程序运行步骤
type=answer: 回答内容
type=document:相关文档
```language
{
"type": "answer",
"content": "然而,他并没有意识到这些故事都是虚构的,因此他的行为变得越来越疯狂和不可理解。"
}
{
"type": "documents",
"content": [
{
"page_content": "xxxxxxxxxxx",
"type": "WebPage",
"metadata": {
"source": "http://www.weather.com.cn/",
"page": 0,
"line": 0,
"key": "http://www.weather.com.cn/"
}
}
]
}
```