gpt4free
gpt4free copied to clipboard
An error occurred: failed to do request: Get "https://you.com/api/streamingSearch?q=%E4%BD%A0%E5%A5%BD&page=1&count=10&safeSearch=Moderate&onShoppingPage=False&mkt=&responseFilter=WebPages%2CTranslations%2CTimeZone%2CComputation%2CRelatedSearches&domain=youchat&queryTraceId=6def63ea-1627-4269-ae3a-e4df91fc0899&chat=%5B%5D": dial tcp 31.13.85.53:443: i/o timeout (Client.Timeout exceeded while awaiting headers). Please make sure you are using a valid cloudflare clearance token and user agent.
An error occurred: failed to do request: Get "https://you.com/api/streamingSearch?q=%E4%BD%A0%E5%A5%BD&page=1&count=10&safeSearch=Moderate&onShoppingPage=False&mkt=&responseFilter=WebPages%2CTranslations%2CTimeZone%2CComputation%2CRelatedSearches&domain=youchat&queryTraceId=6def63ea-1627-4269-ae3a-e4df91fc0899&chat=%5B%5D": dial tcp 31.13.85.53:443: i/o timeout (Client.Timeout exceeded while awaiting headers). Please make sure you are using a valid cloudflare clearance token and user agent.
me too
me too!
setup proxy for provider
i have proxy, and its global proxy but still not good
https://github.com/xtekky/gpt4free/issues/381#/ can solve the problem
setup proxy for provider
how? could you show the detail
解决方法: 打开如下文件:
vim gpt4free/gpt4free/you/init.py
编辑代码,添加proxy:
proxy='x.x.x.x:xxxx'
proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}
解决方法: 打开如下文件:
vim gpt4free/gpt4free/you/init.py
编辑代码,添加proxy:
proxy='x.x.x.x:xxxx' proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}
proxy 的地址,要自己去搞一个吗?有途径吗?
i set a proxy,but is not work,i can not ping the "you.com".
解决方法: 打开如下文件:
vim gpt4free/gpt4free/you/init.py
编辑代码,添加proxy:
proxy='x.x.x.x:xxxx' proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}
__init__.py
@laulguo 我添加过了,但是还是不行,你现在能用吗?我以为这个you.com的地址服务挂掉了
解决方法: 打开如下文件: vim gpt4free/gpt4free/you/init.py 编辑代码,添加proxy:
proxy='x.x.x.x:xxxx' proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}
__init__.py
可以的,确保你的proxy是有效的
解决方法: 打开如下文件: vim gpt4free/gpt4free/you/init.py 编辑代码,添加proxy:
proxy='x.x.x.x:xxxx' proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}
proxy 的地址,要自己去搞一个吗?有途径吗?
加一 有什么途径吗、、?
proxies
如何确保我的proxy是有效的
proxies
如何确保我的proxy是有效的 首先确认你的proxy是否支持https 其次能连通,用工具测试一下,telnet,firefox,Thunder...
如果你设置好了代理,并且你用的是win11操作系统,你可以右击任务栏中的网络图标,进入设置,然后选择代理,之后有个“编辑”,按钮,点击此按钮,如下图,不过你需要把底下的文本框中的 locolhost 127.* 删除。就可以解决
打开 streamlit_app.py 为you.Completion.create 添加参数 proxy='填入你的代理(不需要http://前缀)'
Open streamlit_ App. py adds the parameter proxy to you. Completion. create='Fill in your proxy (no http://prefix/ required)'
就像这样
def get_answer(question: str) -> str:
# Set cloudflare clearance cookie and get answer from GPT-4 model
try:
result = you.Completion.create(prompt=question, proxy='127.0.0.1:4780')
return result.text
except Exception as e:
# Return error message if an exception occurs
return (
f'An error occurred: {e}. Please make sure you are using a valid cloudflare clearance token and user agent.'
)