wwwzhouhui / Claude2-PyAPI

一个使用python 实现Claude2 创建会话、聊天、发送附件、获取历史会话,清理历史记录等功能的api接口,可以对接第三方系统作为二次开发使用。
MIT License
305 stars 49 forks source link

requests.exceptions.ProxyError #2

Open flyingantwjy opened 11 months ago

flyingantwjy commented 11 months ago

requests.exceptions.ProxyError: HTTPSConnectionPool(host='claude.ai', port=443): Max retries exceeded with url: /api/organizations (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000279EFE8C1C8>: Failed to establish a new connection: [WinError 10061]
由于目标计算机积极拒绝,无法连接。')))

QvQQ commented 11 months ago

@flyingantwjy 把claude_api.py文件末尾的代理地址换成你自己的就可以了。

m89498837 commented 11 months ago

@flyingantwjy 把claude_api.py文件末尾的代理地址换成你自己的就可以了。 请问怎么换?

flyingantwjy commented 11 months ago

我也不会,到现在没弄好  

Wang Jiayin @.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年8月9日(星期三) 上午8:56 收件人: @.>; 抄送: "Wang @.>; @.>; 主题: Re: [wwwzhouhui/Claude2-PyAPI] requests.exceptions.ProxyError (Issue #2)

@flyingantwjy 把claude_api.py文件末尾的代理地址换成你自己的就可以了。 请问怎么换?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

QvQQ commented 11 months ago

看这个作者新增的doc代理设置

flyingantwjy commented 11 months ago

谢谢  

Wang Jiayin @.***

 

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2023年8月9日(星期三) 上午10:40 收件人: @.>; 抄送: "Wang @.>; @.>; 主题: Re: [wwwzhouhui/Claude2-PyAPI] requests.exceptions.ProxyError (Issue #2)

看这个作者新增的doc代理设置

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

flyingantwjy commented 11 months ago

现在出现这个问题了:File "e:/人工智能/claude/Claude2-PyAPI-master/Claude2-PyAPI-master/console_chat.py", line 27, in main conversation_id = conversation['uuid'] KeyError: 'uuid'

wwwzhouhui commented 11 months ago

以上问题都是因为国内网络的问题,我前几天更新了代码,通过代理方式解决。 env 配置文件增加

HTTP_PROXY="http://127.0.0.1:10809" HTTPS_PROXY="https://127.0.0.1:10809"

SOCKS5_PROXY="socks5://127.0.0.1:10808"

ISPROXY=True 参考这地方 另外感谢 @QvQQ 给出的解答。

wwwzhouhui commented 11 months ago

@flyingantwjy 代理配置的时候不要使用带有TLS 方式。端口不要使用443端口访问的,因为需要客户端证书配置,这个代码需要修改比较麻烦,所以建议代理走80端口访问