gpt4free icon indicating copy to clipboard operation
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.

Open McraeleeLee opened this issue 1 year ago • 17 comments

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.

McraeleeLee avatar May 04 '23 08:05 McraeleeLee

me too

Bravo-Peng avatar May 04 '23 15:05 Bravo-Peng

me too!

pengGgxp avatar May 05 '23 01:05 pengGgxp

setup proxy for provider

laooopooo avatar May 05 '23 01:05 laooopooo

i have proxy, and its global proxy but still not good

pengGgxp avatar May 05 '23 02:05 pengGgxp

https://github.com/xtekky/gpt4free/issues/381#/ can solve the problem

laulguo avatar May 05 '23 03:05 laulguo

setup proxy for provider

how? could you show the detail

McraeleeLee avatar May 05 '23 03:05 McraeleeLee

解决方法: 打开如下文件:

vim gpt4free/gpt4free/you/init.py

编辑代码,添加proxy:

    proxy='x.x.x.x:xxxx'
    proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}

laooopooo avatar May 05 '23 05:05 laooopooo

解决方法: 打开如下文件:

vim gpt4free/gpt4free/you/init.py

编辑代码,添加proxy:

    proxy='x.x.x.x:xxxx'
    proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}

proxy 的地址,要自己去搞一个吗?有途径吗?

vual avatar May 05 '23 05:05 vual

i set a proxy,but is not work,i can not ping the "you.com".

LJD-1024 avatar May 05 '23 05:05 LJD-1024

解决方法: 打开如下文件:

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 avatar May 05 '23 06:05 laulguo

@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

LJD-1024 avatar May 05 '23 06:05 LJD-1024

可以的,确保你的proxy是有效的

laooopooo avatar May 05 '23 06:05 laooopooo

解决方法: 打开如下文件: vim gpt4free/gpt4free/you/init.py 编辑代码,添加proxy:

    proxy='x.x.x.x:xxxx'
    proxies = {'http': 'http://' + proxy, 'https': 'http://' + proxy} if proxy else {}

proxy 的地址,要自己去搞一个吗?有途径吗?

加一 有什么途径吗、、?

McraeleeLee avatar May 05 '23 06:05 McraeleeLee

proxies

如何确保我的proxy是有效的

McraeleeLee avatar May 05 '23 06:05 McraeleeLee

proxies

如何确保我的proxy是有效的 首先确认你的proxy是否支持https 其次能连通,用工具测试一下,telnet,firefox,Thunder...

laooopooo avatar May 05 '23 06:05 laooopooo

如果你设置好了代理,并且你用的是win11操作系统,你可以右击任务栏中的网络图标,进入设置,然后选择代理,之后有个“编辑”,按钮,点击此按钮,如下图,不过你需要把底下的文本框中的 locolhost 127.* 删除。就可以解决 image

pengGgxp avatar May 05 '23 07:05 pengGgxp

打开 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.'
        )

RougeWhite avatar May 06 '23 02:05 RougeWhite