bisheng icon indicating copy to clipboard operation
bisheng copied to clipboard

请问一下应该如何配置通义千问 一直都是Error: Connection error.

Open nice-jiang opened this issue 1 year ago • 1 comments

版本 v0.3.5.dev1 使用docker-compose启动 image

模型配置 image 其中API Key是从此处获取 image

系统模型设置-助手模型设置 image

构建-新建助手设置 image

会话只用当前助手 image 就会报Error: Connection error.

我不知道哪里出了问题 日志也是说的是Connection error. image

排除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"}

nice-jiang avatar Sep 30 '24 02:09 nice-jiang

问题已经解决 apikey复制过来后多了一个空格导致 还是浏览器里改了这个框的password属性才看到有空格 这里提个建议 因为复制过来就看不到明文了 所以默认认为是对的 这里是否可以在右边加一个小眼睛的按钮 点一下可以看到明文的功能 方便排查 image

nice-jiang avatar Sep 30 '24 09:09 nice-jiang

已解决就OK

sara2398 avatar Sep 22 '25 06:09 sara2398