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

使用Azure OpenAI API不需要科学上网,但是,我不填proxy,就会报错,填了就没问题。 #396

Closed
maopucheng opened this issue Dec 11, 2023 · 4 comments

Comments

@maopucheng
Copy link

maopucheng commented Dec 11, 2023

所以,配置文件中的proxy是必须填的吗?不填的时候报错如下:

Detailed traceback information:
Traceback (most recent call last):
File "D:\src\xiaogpt\xiaogpt\xiaogpt.py", line 403, in run_forever
await self.tts.synthesize(query, self.ask_gpt(query))
File "D:\src\xiaogpt\xiaogpt\tts\mi.py", line 31, in synthesize
async for text in text_stream:
File "D:\src\xiaogpt\xiaogpt\xiaogpt.py", line 283, in ask_gpt
answer = await self.chatbot.ask(query, **self.config.gpt_options)
File "D:\src\xiaogpt\xiaogpt\bot\chatgptapi_bot.py", line 51, in ask
async with httpx.AsyncClient(trust_env=True, proxies=self.proxy) as sess:
File "C:\Users\maopu\anaconda3\envs\py310\lib\site-packages\httpx_client.py", line 1395, in init
proxy_map = self._get_proxy_map(proxies, allow_env_proxies)
File "C:\Users\maopu\anaconda3\envs\py310\lib\site-packages\httpx_client.py", line 228, in _get_proxy_map
proxy = Proxy(url=proxies) if isinstance(proxies, (str, URL)) else proxies
File "C:\Users\maopu\anaconda3\envs\py310\lib\site-packages\httpx_config.py", line 334, in init
raise ValueError(f"Unknown scheme for proxy URL {url!r}")
ValueError: Unknown scheme for proxy URL URL('')

谢谢!

@DeadAt17
Copy link

我也遇到同样的问题

@DeadAt17
Copy link

我也遇到同样的问题

我把 /xiaogpt/bot/chatgptapi_bot.py line 51, 68 的proxy删了就可以用了。
async with httpx.AsyncClient(trust_env=True) as sess:

@yihong0618
Copy link
Owner

我们来修复下,谢谢

@yihong0618
Copy link
Owner

尝试修复了,请拉下最新代码

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

3 participants