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

[Bug]: 配置了openai_api_base,但还是走的官方url,这样使得第三方的api key不能使用 #107

Open
1 task done
lepingzhang opened this issue Dec 19, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@lepingzhang
Copy link

Search for answers in existing issues

  • I have searched issues, there is no issue related to the problem I encountered

Python version

python 3.10

Issue description

因为不走openai_api_base的地址,所以一直是please ask me again。进行了重新拉取部署,也进行了更换电脑设备,均还是走官方的api网址。

Repro steps

No response

Relevant log output

No response

@lepingzhang lepingzhang added the bug Something isn't working label Dec 19, 2023
@QAbot-zh
Copy link

检查下是不是config文件加载为空了,我也遇到过因为config加载导致的配置问题:#103 (comment)

@lepingzhang
Copy link
Author

检查下是不是config文件加载为空了,我也遇到过因为config加载导致的配置问题:#103 (comment)

按照教程运行后提示如下:
[INFO][2023-12-21 10:57:15][wechat.py:40] - App startup successfully!
[INFO][2023-12-21 10:57:15][wechat.py:178] - [Websocket] connected
这样似乎是正常运行的

@QAbot-zh
Copy link

检查下是不是config文件加载为空了,我也遇到过因为config加载导致的配置问题:#103 (comment)

按照教程运行后提示如下: [INFO][2023-12-21 10:57:15][wechat.py:40] - App startup successfully! [INFO][2023-12-21 10:57:15][wechat.py:178] - [Websocket] connected 这样似乎是正常运行的

你像我原来那个帖子一样,在chatgpt初始化的地方打印一下config和openai_api_base,看看它程序实际使用的是什么

@zhangliyi
Copy link

如果用openai的sdk调用第三方apikey和base_url时就会报这个错,我也碰到了类似情况。最后自己用requests实现v1/chat/completion接口就没问题了。

@QAbot-zh
Copy link

如果用openai的sdk调用第三方apikey和base_url时就会报这个错,我也碰到了类似情况。最后自己用requests实现v1/chat/completion接口就没问题了。

用openai的sdk调用第三方apikey和base_url是可以的,问题主要还是出在config的初始化,我自己是每次调用的时候给apikey和base_url赋值,是可以调用成功的。

@RichardQt
Copy link

如果用openai的sdk调用第三方apikey和base_url时就会报这个错,我也碰到了类似情况。最后自己用requests实现v1/chat/completion接口就没问题了。

用openai的sdk调用第三方apikey和base_url是可以的,问题主要还是出在config的初始化,我自己是每次调用的时候给apikey和base_url赋值,是可以调用成功的。

请问大佬是如何调用第三方apikey

@QAbot-zh
Copy link

QAbot-zh commented Mar 5, 2024

如果用openai的sdk调用第三方apikey和base_url时就会报这个错,我也碰到了类似情况。最后自己用requests实现v1/chat/completion接口就没问题了。

用openai的sdk调用第三方apikey和base_url是可以的,问题主要还是出在config的初始化,我自己是每次调用的时候给apikey和base_url赋值,是可以调用成功的。

请问大佬是如何调用第三方apikey

config.json配置好api_key和api_base,然后app.py里把load_config()提前执行
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants