Closed Aruen24 closed 1 year ago
+1
+1
+1
+1
在you.py 添加代理
response = client.get(f"https://you.com/api/streamingSearch", params = { "q" : prompt, "page" : page, "count" : count, "safeSearch" : safeSearch, "onShoppingPage" : onShoppingpage, "mkt" : mkt, "responseFilter" : responseFilter, "domain" : domain, "queryTraceId" : str(uuid4()) if queryTraceId is None else queryTraceId, "chat" : str(chat), # {"question":"","answer":" '"} }, proxy="http://127.0.0.1:7890" # 添加系统代理VPN )
i get same error!
在you.py 添加代理
response = client.get(f"https://you.com/api/streamingSearch", params = { "q" : prompt, "page" : page, "count" : count, "safeSearch" : safeSearch, "onShoppingPage" : onShoppingpage, "mkt" : mkt, "responseFilter" : responseFilter, "domain" : domain, "queryTraceId" : str(uuid4()) if queryTraceId is None else queryTraceId, "chat" : str(chat), # {"question":"","answer":" '"} }, proxy="http://127.0.0.1:7890" # 添加系统代理VPN )
Adding a proxy here can solve this problem
@ODomWang where is you.py file?
@ODomWang where is you.py file?
The original address is this https://github.com/xtekky/gpt4free/blob/main/you/__init__.py
I renamed it to you.py
在you.py 添加代理
response = client.get(f"https://you.com/api/streamingSearch", params = { "q" : prompt, "page" : page, "count" : count, "safeSearch" : safeSearch, "onShoppingPage" : onShoppingpage, "mkt" : mkt, "responseFilter" : responseFilter, "domain" : domain, "queryTraceId" : str(uuid4()) if queryTraceId is None else queryTraceId, "chat" : str(chat), # {"question":"","answer":" '"} }, proxy="http://127.0.0.1:7890" # 添加系统代理VPN )
not work for me
@ODomWang 用的v2rayN代理,加上ip和端口后 运行streamlit run streamlit_app.py An error occurred: failed to do request: Get "https://you.com/api/streamingSearch?q=%E4%BD%A0%E6%98%AF%E8%B0%81&page=1&count=10&safeSearch=Moderate&onShoppingPage=False&mkt=&responseFilter=WebPages%2CTranslations%2CTimeZone%2CComputation%2CRelatedSearches&domain=youchat&queryTraceId=5224fc07-8b2c-4ffd-85e4-f2c11cf06ca3&chat=%5B%5D": dial tcp 65.19.26.63:7890: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.. Please make sure you are using a valid cloudflare clearance token and user agent.
I copied ../you/ init. py to ../gui/you.py Local proxy port needs to be enabled, you need to use the proxy port in startup
My port is 7890
@ODomWang 用的v2rayN代理,加上ip和端口后 运行streamlit run streamlit_app.py An error occurred: failed to do request: Get "https://you.com/api/streamingSearch?q=%E4%BD%A0%E6%98%AF%E8%B0%81&page=1&count=10&safeSearch=Moderate&onShoppingPage=False&mkt=&responseFilter=WebPages%2CTranslations%2CTimeZone%2CComputation%2CRelatedSearches&domain=youchat&queryTraceId=5224fc07-8b2c-4ffd-85e4-f2c11cf06ca3&chat=%5B%5D": dial tcp 65.19.26.63:7890: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.. Please make sure you are using a valid cloudflare clearance token and user agent.
你这个端口也是7890吗 我用clash 没问题,看报错感觉端口有问题
@ODomWang An error occurred: failed to do request: Get "https://you.com/api/streamingSearch?q=%E4%BD%A0%E6%98%AF%E8%B0%81&page=1&count=10&safeSearch=Moderate&onShoppingPage=False&mkt=&responseFilter=WebPages%2CTranslations%2CTimeZone%2CComputation%2CRelatedSearches&domain=youchat&queryTraceId=2254a9f4-672e-453a-9e5d-e5d856fddfff&chat=%5B%5D": read tcp 192.168.99.124:52677-> 65.19.26.63:63289: i/o timeout (Client.Timeout exceeded while awaiting headers). Please make sure you are using a valid cloudflare clearance token and user agent.
What is my proxy port?
only copy ../you/ init. py to ../gui/you.py?
Answer :
\u5f88\u62b1\u6b49\uff0c\u6211\u65e0\u6cd5\u8fdb\u884c\u7ebf\u4e0b\u65c5\u6e38\u5b89\u6392\uff0c\u53ef\u4ee5\u4e3a\u60a8\u63d0\u4f9b\u76f8\u5173\u4fe1\u606f\u5e2e\u52a9\u60a8\u8ba1\u5212\u65c5\u6e38\u884c\u7a0b\u3002\u6e5b\u6c5f\u4f4d\u4e8e\u4e2d\u56fd\u5e7f\u4e1c\u7701\u7684\u897f\u90e8\u6d77\u5cb8\u7ebf\uff0c\u662f\u4e00\u4e2a\u7f8e\u4e3d\u7684\u6d77\u6ee8\u57ce\u5e02\uff0c\u6709\u8bb8\u591a\u503c\u5f97\u4e00\u6e38\u7684\u666f\u70b9\u548c\u7f8e\u98df\u3002\u60a8\u53ef\u4ee5\u524d\u5f80\u96f7\u5dde\u534a\u5c9b\u98ce\u666f\u533a\uff0c\u54c1\u5c1d\u5f53\u5730\u7684\u6d77\u9c9c\u7f8e\u98df\uff0c\u53c2\u89c2\u9ad8\u5dde\u5cad\u5357\u6c34\u4e61\u98ce\u60c5\u6587\u5316\u56ed\uff0c\u611f\u53d7\u5cad\u5357\u6587\u5316\u7684\u9b45\u529b\u3002\u53e6\u5916\uff0c\u6e5b\u6c5f\u8fd8\u6709\u8bb8\u591a\u5176\u5b83\u7684\u666f\u70b9\uff0c\u5982\u971e\u5c71\u516c\u56ed\u3001\u5927\u5751\u6587\u5316\u65c5\u6e38\u533a\u7b49\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u80fd\u591f\u5e2e\u52a9\u5230\u60a8\u3002
Answer :
\u5f88\u62b1\u6b49\uff0c\u6211\u65e0\u6cd5\u8fdb\u884c\u7ebf\u4e0b\u65c5\u6e38\u5b89\u6392\uff0c\u53ef\u4ee5\u4e3a\u60a8\u63d0\u4f9b\u76f8\u5173\u4fe1\u606f\u5e2e\u52a9\u60a8\u8ba1\u5212\u65c5\u6e38\u884c\u7a0b\u3002\u6e5b\u6c5f\u4f4d\u4e8e\u4e2d\u56fd\u5e7f\u4e1c\u7701\u7684\u897f\u90e8\u6d77\u5cb8\u7ebf\uff0c\u662f\u4e00\u4e2a\u7f8e\u4e3d\u7684\u6d77\u6ee8\u57ce\u5e02\uff0c\u6709\u8bb8\u591a\u503c\u5f97\u4e00\u6e38\u7684\u666f\u70b9\u548c\u7f8e\u98df\u3002\u60a8\u53ef\u4ee5\u524d\u5f80\u96f7\u5dde\u534a\u5c9b\u98ce\u666f\u533a\uff0c\u54c1\u5c1d\u5f53\u5730\u7684\u6d77\u9c9c\u7f8e\u98df\uff0c\u53c2\u89c2\u9ad8\u5dde\u5cad\u5357\u6c34\u4e61\u98ce\u60c5\u6587\u5316\u56ed\uff0c\u611f\u53d7\u5cad\u5357\u6587\u5316\u7684\u9b45\u529b\u3002\u53e6\u5916\uff0c\u6e5b\u6c5f\u8fd8\u6709\u8bb8\u591a\u5176\u5b83\u7684\u666f\u70b9\uff0c\u5982\u971e\u5c71\u516c\u56ed\u3001\u5927\u5751\u6587\u5316\u65c5\u6e38\u533a\u7b49\u3002\u5e0c\u671b\u8fd9\u4e9b\u4fe1\u606f\u80fd\u591f\u5e2e\u52a9\u5230\u60a8\u3002
这个地方进行编码格式转码 utf8_decode = answer.encode().decode("unicode_escape").replace('”}','').replace('"}','') st.caption("回复 :") st.markdown(utf8_decode)
Stay patient, we are currently investigating the error.
current the file path is /gpt4free/you/__init__.py
An error occurred: failed to do request: Get "https://you.com/api/streamingSearch?q=who+are+you&page=1&count=10&safeSearch=Moderate&onShoppingPage=False&mkt=&responseFilter=WebPages%2CTranslations%2CTimeZone%2CComputation%2CRelatedSearches&domain=youchat&queryTraceId=862abd70-02c8-4896-b65a-1ad061e0b410&chat=%5B%5D": dial tcp 80.87.199.46:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.. Please make sure you are using a valid cloudflare clearance token and user agent.