-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
新增Claude聊天机器人接口(逆向cookie实现) #1382
Conversation
config-template.json
Outdated
@@ -4,6 +4,9 @@ | |||
"channel_type": "wx", | |||
"proxy": "", | |||
"hot_reload": false, | |||
"model": "claude", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model 和 channel_type 这两个参数重复了,可以移除下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
都改好啦,感谢指正!
感谢pr |
支持上下文记忆嘛 |
噢 |
看了下claude官网支持的国家,新加坡是在名单的,奇怪 |
是啊,是不是因为我用Linux系统的原因? |
好的,我试试 |
[ERROR][2023-09-02 15:59:15][chat_channel.py:280] - Worker return exception: invalid decimal literal (claude_ai_bot.py, line 98) |
return "5e399996-51aa-439f-94be-7c88ecfb0ab5" |
模型设置为: claude), receiver=@14e8d737b0dbc8e4fbdca85baa2d29cd
rel="dns-prefetch" href="https://www.anthropic.com/" crossorigin><script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
var tag = document.createElement('script'); [INFO][2023-09-02 16:06:57][main.py:307] - 模型响应无函数调用,跳过处理 |
恩ip问题
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年9月2日(周六) 下午4:09
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [zhayujie/chatgpt-on-wechat] 新增Claude聊天机器人接口(逆向cookie实现) (PR #1382)
模型设置为: claude), ***@***.***
[INFO][2023-09-02 16:06:54][main.py:97] - newgpt_turbo query=你好
[INFO][2023-09-02 16:06:54][bridge.py:38] - create bot claude for chat
<!DOCTYPE html><html lang="en" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"> <head><link
rel="dns-prefetch" href="https://www.anthropic.com/" crossorigin><script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script src="/js/site.js?id=9c708111992f94585c703251d84eb26b"></script> <script>(function() {
var tag = document.createElement('script');
tag.src = "https://cdn.usefathom.com/script.js";
tag.defer = true;
tag.setAttribute("data-site", "FWWARNSL");
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
})();
</script>
<script ***@***.******@***.******@***.******@***.******@***.******@***.***":"https://anthropic.com#creator"},"dateModified":"2023-05-11T07:21:04-07:00","datePublished":"2023-03-03T21:21:00-08:00","description":"Anthropic is an AI safety and research company that's working to build reliable, interpretable, and steerable AI systems.","headline":"App ***@***.***":"ImageObject","url":"https://www-images.anthropic.com/production/images/anthropic-social_share.png?w=1200&h=630&q=82&auto=format&fit=crop&dm=1676585898&s=21b0a416036ef14a47124429243b4041"},"inLanguage":"en-us","mainEntityOfPage":"https://www.anthropic.com/app-unavailable-in-region","name":"App ***@***.******@***.******@***.***":"LocalBusiness","alternateName":"Anthropic","description":"Anthropic is an AI safety and research company. We build reliable, interpretable, and steerable AI systems.","name":"Anthropic ***@***.******@***.******@***.***":"BreadcrumbList","description":"Breadcrumbs ***@***.******@***.***":"ListItem","item":"https://www.anthropic.com/app-unavailable-in-region","name":"App unavailable","position":2}],"name":"Breadcrumbs"}]}</script>
[INFO][2023-09-02 16:06:57][main.py:307] - 模型响应无函数调用,跳过处理
[ERROR][2023-09-02 16:06:58][claude_ai_bot.py:214] - Expecting value: line 2 column 9 (char 9)
Traceback (most recent call last):
File "/data/chatgpt-on-wechat/bot/claude/claude_ai_bot.py", line 144, in _chat
con_uuid = self.conversation_share_check(session_id)
File "/data/chatgpt-on-wechat/bot/claude/claude_ai_bot.py", line 103, in conversation_share_check
self.create_new_chat(self.con_uuid_dic[session_id])
File "/data/chatgpt-on-wechat/bot/claude/claude_ai_bot.py", line 126, in create_new_chat
return response.json()
File "/usr/local/lib/python3.10/dist-packages/curl_cffi/requests/cookies.py", line 54, in json
return loads(self.content, **kw)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 9 (char 9)
[WARNING][2023-09-02 16:07:00][claude_ai_bot.py:217] - [CLAUDE] do retry, times=0
[INFO][2023-09-02 16:07:00][claude_ai_bot.py:150] - [CLAUDEAI] query=你好
[ERROR][2023-09-02 16:07:01][claude_ai_bot.py:214] - Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "/data/chatgpt-on-wechat/bot/claude/claude_ai_bot.py", line 191, in _chat
data = json.loads(json_str)
File "/usr/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[WARNING][2023-09-02 16:07:03][claude_ai_bot.py:217] - [CLAUDE] do retry, times=1
[WARNING][2023-09-02 16:07:03][claude_ai_bot.py:138] - [CLAUDEAI] failed after maximum number of retry times
[INFO][2023-09-02 16:07:03][wechat_channel.py:189] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR]
请再问我一次吧), ***@***.***
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
无解,只能等API的方式了。 |
只是个ip的问题,处理方式还是有很多的,用下代理就可以了。 |
😄懒得折腾了,在SG还代理,岂不是没必要 |
单个代理一个月可能才几元钱 还是可以考虑下 |
指定对话id后没有生效,还是依然新建对话,请问有什么排查思路吗? |
指定对话id未生效是修复上下文隔离时造成的二次bug,暂不可用,即将与其它问题一同修复
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年9月3日(周日) 中午11:27
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [zhayujie/chatgpt-on-wechat] 新增Claude聊天机器人接口(逆向cookie实现) (PR #1382)
指定对话id后没有生效,还是依然新建对话,请问有什么排查思路吗?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
已提交pr修复 |
Claude cook有效,之前正常使用,未做任何改动,今日提示不可用:Invalid model |
逆向已经失效 |
甚至我的号还被封了
joyce677 ***@***.***>于2023年11月24日 周五11:36写道:
… 逆向已经失效
—
Reply to this email directly, view it on GitHub
<#1382 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A77NZSXMJRV2L7AH45HASRLYGAI3BAVCNFSM6AAAAAA4BEJWDWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRVGEYDSNBRGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
最近在忙,2024年一月份会进行更新 |
更新api支持方式啊。别用这种了。现在api还申请。 |
好的,我会考虑把两种都加上去。
…---原始邮件---
发件人: ***@***.***>
发送时间: 2023年12月5日(周二) 中午1:54
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [zhayujie/chatgpt-on-wechat] 新增Claude聊天机器人接口(逆向cookie实现) (PR #1382)
最近很忙,2024年一月份会进行更新
更新api支持方式啊。别用这种了。现在api还申请。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
新增Claude聊天机器人接口(逆向cookie实现,稳定不失效)
新增Claude聊天机器人接口(逆向cookie实现,稳定不失效)
新增Claude聊天机器人接口(逆向cookie实现,稳定不失效)
暂时不可用 会被封号,将在2024年一月份进行更新
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
添加 claude AI(逆向)bot
目前已知主流国家ip中 中国大陆和中国香港的不在claude支持名单中
相关参数
1.claude_api_cookie (选此bot时填写)
(有效期:目测一周,测试过有效期的小伙伴可以留言下)
获取cookie方法: 浏览器f12 打开控制台发送一条消息,复制完整cookie字符串即可
2. proxy(选此bot时非海外服务器时为必须项,claude需海外ip)
3. claude_uuid(可选,指定对话id,没有的话默认新建对话,不太了解claude机制的建议的直接置空,上下文共享优先级大于配置里的group_in_one_session,设定对话id即可指定对话又可强制全员共享该对话上下文)
新增依赖包
用于请求api的curl_cffi 包(必要),用于模拟指纹,是一种requests-like的包
curl_cffi包所在目录中不能存在中文
1.修改一切出现在报错中的中文为英文
2.重新采用 python -m venv venv 创建全新英文目录环境
生态小变动:
1.无法查看 tokens, 返回tokens = invisible
2.如文心一言接口一样去除role = system功能
改动均在该bot下,不影响其他接口。
待优化事项:
1.版本可能会提示 no module named bot.claude.claide_ai_session只需要把claude目录中的 claide_ai_session 文件加上 .py后缀2.claude_uuid指定对话暂不可用3.重复函数待删除4.ip被ban、cookie格式、速率限制相关提示5.........
应用测试