请问一下应该如何配置通义千问 一直都是Error: Connection error.
版本 v0.3.5.dev1
使用docker-compose启动
模型配置
其中API Key是从此处获取
系统模型设置-助手模型设置
构建-新建助手设置
会话只用当前助手
就会报Error: Connection error.
我不知道哪里出了问题 日志也是说的是Connection error.
排除apikey和模型名字的问题 bisheng-backend容器中使用
curl -X POST https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions -H "Authorization: Bearer xxxxxxxxxxxxxx" -H "Content-Type: application/json" -d '{
"model": "qwen-max",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "你是谁?"
}
]
}'
可以得到返回
{"choices":[{"message":{"role":"assistant","content":"我是来自阿里云的超大规模语言模型,我叫通义千问。"},"finish_reason":"stop","index":0,"logprobs":null}],"object":"chat.completion","usage":{"prompt_tokens":22,"completion_tokens":17,"total_tokens":39},"created":1727680241,"system_fingerprint":null,"model":"qwen-max","id":"chatcmpl-a0eccdb0-6627-9c51-9016-bd248e1db318"}
问题已经解决 apikey复制过来后多了一个空格导致 还是浏览器里改了这个框的password属性才看到有空格
这里提个建议 因为复制过来就看不到明文了 所以默认认为是对的 这里是否可以在右边加一个小眼睛的按钮 点一下可以看到明文的功能 方便排查
已解决就OK