Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nice-jiang opened this issue Sep 30, 2024 · 1 comment

Comments

@nice-jiang
Copy link

nice-jiang commented Sep 30, 2024

版本 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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant