zhayujie / chatgpt-on-wechat

基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择GPT3.5/GPT-4o/GPT-o1/ Claude/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Claude/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
https://docs.link-ai.tech/cow
MIT License
30.9k stars 8.08k forks source link

新增一种快捷在chatgpt-on-wechat里使用dify的方法 #1894

Closed fatwang2 closed 3 months ago

fatwang2 commented 6 months ago

⚠️ 搜索是否存在类似issue

总结

我看之前有人提dify相关的PR没有通过,我换了种方式实现在cow里无缝接入dify,接入后可以使用dify的agent、workflow、knowledge base等功能,同时也可以通过dify快速接入各种新的大模型,点击链接即可部署 dify2openai

举例

No response

动机

No response

Fone520 commented 5 months ago

牛逼兄dei!!!

fatwang2 commented 5 months ago

我看一直没人回,以为大家不需要了,其实我还有一个 coze 的,类似

Fone520 commented 5 months ago

我看一直没人回,以为大家不需要了,其实我还有一个 coze 的,类似

刚好需要,哈哈哈谢谢啦大佬

Fone520 commented 5 months ago

coze免费可太爽了

我看一直没人回,以为大家不需要了,其实我还有一个 coze 的,类似

fatwang2 commented 5 months ago

coze 的 API 不是免费的,跟 OpenAI 一个价

perryrighthere commented 5 months ago

大佬,dify2openai啥时候能支持多模态,非常感谢!!!

MILKMILKKING commented 5 months ago

我一直没人回,以为大家都不需要了,其实我还有一个小秘密,类似

我想要听这个小秘密!给点提示

fatwang2 commented 5 months ago

是不是翻译的问题,我说的是coze。。。

On Tue, Jun 4, 2024 at 12:08 AM MILKMILKKING @.***> wrote:

我一直没人回,以为大家都不需要了,其实我还有一个小秘密,类似

我想要听这个小秘密!给点提示

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2145602619, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSXGC73ZJFSKH3L2CV3ZFSIJLAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBVGYYDENRRHE . You are receiving this because you authored the thread.Message ID: @.***>

MILKMILKKING commented 5 months ago

哈哈哈 是翻译问题,我看成了你还有一个小秘密。

anycallzh commented 5 months ago

我看一直没人回,以为大家不需要了,其实我还有一个 coze 的,类似

期待大佬的coze调用秘密

fatwang2 commented 5 months ago

coze 的就是这个,也可以接入 cow

https://github.com/fatwang2/coze2openai

anycallzh @.***>于2024年6月4日 周二11:52写道:

我看一直没人回,以为大家不需要了,其实我还有一个 coze 的,类似

期待大佬的coze调用秘密

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2146534558, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSTMUPAB3YCVU224243ZFU2WNAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBWGUZTINJVHA . You are receiving this because you authored the thread.Message ID: @.***>

MILKMILKKING commented 5 months ago

coze 的 API 不是免费的,跟 OpenAI 一个价

弱弱的问一下,COZE API不是免费的话,那调用这个优势在哪里呢?只是因为可以编排工作流吗?是不是可以有免费实现的方法?

fatwang2 commented 5 months ago

国内是免费的

MILKMILKKING @.***>于2024年6月4日 周二11:54写道:

coze 的 API 不是免费的,跟 OpenAI 一个价

弱弱的问一下,COZE API不是免费的话,那调用这个优势在哪里呢?只是因为可以编排工作流吗?是不是可以有免费实现的方法?

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2146536252, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSXDSWGLEYTGBOT7FTLZFU27PAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBWGUZTMMRVGI . You are receiving this because you authored the thread.Message ID: @.***>

tianzecn commented 4 months ago

dify转为api后,速度会有影响吗,功能是不是有缺失

fatwang2 commented 4 months ago

你可以看下我的项目说明

brokenman1 @.***>于2024年6月22日 周六14:11写道:

dify转为api后,速度会有影响吗,功能是不是有缺失

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2183830407, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSTJJJDYAZXSL4HNLY3ZIUIS7AVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTHAZTANBQG4 . You are receiving this because you authored the thread.Message ID: @.***>

tianzecn commented 4 months ago

你可以看下我的项目说明 brokenman1 @.>于2024年6月22日 周六14:11写道: dify转为api后,速度会有影响吗,功能是不是有缺失 — Reply to this email directly, view it on GitHub <#1894 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSTJJJDYAZXSL4HNLY3ZIUIS7AVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTHAZTANBQG4 . You are receiving this because you authored the thread.Message ID: @.>

请问自已服务器部署的DIFY能转为openaiapi吗。。

fatwang2 commented 4 months ago

也可以的

brokenman1 @.***>于2024年6月22日 周六14:28写道:

你可以看下我的项目说明 brokenman1 @.

>于2024年6月22日 周六14:11写道: … <#m8385846842367621280> dify转为api后,速度会有影响吗,功能是不是有缺失 — Reply to this email directly, view it on GitHub <#1894 (comment) https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2183830407>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSTJJJDYAZXSL4HNLY3ZIUIS7AVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTHAZTANBQG4 https://github.com/notifications/unsubscribe-auth/A77NZSTJJJDYAZXSL4HNLY3ZIUIS7AVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTHAZTANBQG4 . You are receiving this because you authored the thread.Message ID: @.>

请问自已服务器部署的DIFY能转为openaiapi吗。。

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2183853390, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSX5DUPP4PAX4IS7S5DZIUKQ7AVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBTHA2TGMZZGA . You are receiving this because you were mentioned.Message ID: @.***>

balcklive commented 3 months ago

@fatwang2 老铁,这个dify2openai和chatgpt-on-wechat放在一起跑通过吗?我试了好像不行啊,我的配置文件如下:

"channel_type": "wx",
"model": "dify", "open_ai_api_key": "xxxxx", "proxy": "http://myipAddress:3000/v1/chat/completions",
"hot_reload": false,

报错内容如下: [WARNING][2024-07-07 23:03:23][chat_gpt_session.py:86] - num_tokens_from_messages() is not implemented for model dify. Returning num tokens assuming gpt-3.5-turbo. [WARNING][2024-07-07 23:03:23][chat_gpt_bot.py:150] - [CHATGPT] APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [WARNING][2024-07-07 23:03:28][chat_gpt_bot.py:160] - [CHATGPT] 第1次重试 [WARNING][2024-07-07 23:03:28][chat_gpt_bot.py:150] - [CHATGPT] APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [WARNING][2024-07-07 23:03:33][chat_gpt_bot.py:160] - [CHATGPT] 第2次重试 [WARNING][2024-07-07 23:03:34][chat_gpt_bot.py:150] - [CHATGPT] APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [INFO][2024-07-07 23:03:34][wechat_channel.py:217] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR] 我连接不到你的网络), receiver=@93c919ba28217dc1a9da47fd28e3f2ce9a9190068d98329a0b4a285025128b66

fatwang2 commented 3 months ago

可以,你变量填错了

balcklive @.***>于2024年7月7日 周日23:08写道:

@fatwang2 https://github.com/fatwang2 老铁,这个dify2openai和chatgpt-on-wechat放在一起跑通过吗?我试了好像不行啊,我的配置文件如下:

"channel_type": "wx", "model": "dify", "open_ai_api_key": "xxxxx", "proxy": "http://myipAddress:3000/v1/chat/completions", "hot_reload": false,

报错内容如下: [WARNING][2024-07-07 23:03:23][chat_gpt_session.py:86] - num_tokens_from_messages() is not implemented for model dify. Returning num tokens assuming gpt-3.5-turbo. [WARNING][2024-07-07 23:03:23][chat_gpt_bot.py:150] - [CHATGPT] APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [WARNING][2024-07-07 23:03:28][chat_gpt_bot.py:160] - [CHATGPT] 第1次重试 [WARNING][2024-07-07 23:03:28][chat_gpt_bot.py:150] - [CHATGPT] APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [WARNING][2024-07-07 23:03:33][chat_gpt_bot.py:160] - [CHATGPT] 第2次重试 [WARNING][2024-07-07 23:03:34][chat_gpt_bot.py:150] - [CHATGPT] APIConnectionError: Error communicating with OpenAI: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response')) [INFO][2024-07-07 23:03:34][wechat_channel.py:217] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR] 我连接不到你的网络), @.***

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2212480544, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSTCVWCGLIQHRJNXAJLZLFKYBAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJSGQ4DANJUGQ . You are receiving this because you were mentioned.Message ID: @.***>

balcklive commented 3 months ago

@fatwang2 哪个变量啊

fatwang2 commented 3 months ago

这是 apibase,不是 proxy

balcklive @.***>于2024年7月8日 周一22:42写道:

@fatwang2 https://github.com/fatwang2 哪个变量啊

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2214280506, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSRBQF2FUXBNHTPNKS3ZLKQPFAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGI4DANJQGY . You are receiving this because you were mentioned.Message ID: @.***>

balcklive commented 3 months ago

这是 apibase,不是 proxy balcklive @.>于2024年7月8日 周一22:42写道: @fatwang2 https://github.com/fatwang2 哪个变量啊 — Reply to this email directly, view it on GitHub <#1894 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSRBQF2FUXBNHTPNKS3ZLKQPFAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGI4DANJQGY . You are receiving this because you were mentioned.Message ID: @.>

正确的变量名是:open_ai_api_base;是吗?

fatwang2 commented 3 months ago

你研究下 cow 的变量就理解了

balcklive @.***>于2024年7月8日 周一23:04写道:

这是 apibase,不是 proxy balcklive @.

>于2024年7月8日 周一22:42写道: … <#m-5201735528531908494> @fatwang2 https://github.com/fatwang2 https://github.com/fatwang2 https://github.com/fatwang2 哪个变量啊 — Reply to this email directly, view it on GitHub <#1894 (comment) https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2214280506>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSRBQF2FUXBNHTPNKS3ZLKQPFAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGI4DANJQGY https://github.com/notifications/unsubscribe-auth/A77NZSRBQF2FUXBNHTPNKS3ZLKQPFAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGI4DANJQGY . You are receiving this because you were mentioned.Message ID: @.>

正确的变量名是:open_ai_api_base;是吗?

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2214374598, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSVYZCHRB4BNAZAZULTZLKTBBAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJUGM3TINJZHA . You are receiving this because you were mentioned.Message ID: @.***>

bberppub commented 3 months ago

牛的牛的,马上star

fattank commented 3 months ago

请教楼主,你的项目如何让微信不封号?

fatwang2 commented 3 months ago

项目封号问题要找 cow ,跟我这个无关

Tank @.***>于2024年7月14日 周日11:02写道:

请教楼主,你的项目如何让微信不封号?

— Reply to this email directly, view it on GitHub https://github.com/zhayujie/chatgpt-on-wechat/issues/1894#issuecomment-2227177718, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSS5E323KK66JCXZDRDZMHS4DAVCNFSM6AAAAABGGHI7F2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGE3TONZRHA . You are receiving this because you were mentioned.Message ID: @.***>

t89210827 commented 1 month ago

image Please press confirm on your phone. Loading the contact, this may take a little while. <PIL.PngImagePlugin.PngImageFile image mode=1 size=450x450 at 0x7F992F1ABFA0> [DEBUG][2024-09-05 15:37:53][wechat_channel.py:151] - Login success [INFO][2024-09-05 15:37:53][wechat_channel.py:131] - Wechat login success, user_id: @eed8d3d14cb9b084cb1ba3543893beee22c322617e746023625868cd25404423, nickname: bot Start auto replying. [DEBUG][2024-09-05 15:38:24][wechat_channel.py:180] - [WX]receive text msg: {"MsgId": "7785080238091107815", "FromUserName": "@24e853d03600c3d2b28e1046b1f7adeb", "ToUserName": "@eed8d3d14cb9b084cb1ba3543893beee22c322617e746023625868cd25404423", "MsgType": 1, "Content": "bot 上户口", "Status": 3, "ImgStatus": 1, "CreateTime": 1725521903, "VoiceLength": 0, "PlayLength": 0, "FileName": "", "FileSize": "", "MediaId": "", "Url": "", "AppMsgType": 0, "StatusNotifyCode": 0, "StatusNotifyUserName": "", "RecommendInfo": {"UserName": "", "NickName": "", "QQNum": 0, "Province": "", "City": "", "Content": "", "Signature": "", "Alias": "", "Scene": 0, "VerifyFlag": 0, "AttrStatus": 0, "Sex": 0, "Ticket": "", "OpCode": 0}, "ForwardFlag": 0, "AppInfo": {"AppID": "", "Type": 0}, "HasProductId": 0, "Ticket": "", "ImgHeight": 0, "ImgWidth": 0, "SubMsgType": 0, "NewMsgId": 7785080238091107815, "OriContent": "", "EncryFileName": "", "User": {"MemberList": [], "Uin": 0, "UserName": "@24e853d03600c3d2b28e1046b1f7adeb", "NickName": "行", "HeadImgUrl": "/cgi-bin/mmwebwx-bin/webwxgeticon?seq=660890051&username=@24e853d03600c3d2b28e1046b1f7adeb&skey=@crypt_d3ab0270_9a7734a78f974676277355cd8f7fcad9", "ContactFlag": 3, "MemberCount": 0, "RemarkName": "佟子青", "HideInputBarFlag": 0, "Sex": 1, "Signature": "生有热烈 藏与俗常", "VerifyFlag": 0, "OwnerUin": 0, "PYInitial": "X", "PYQuanPin": "xing", "RemarkPYInitial": "TZQ", "RemarkPYQuanPin": "tongziqing", "StarFriend": 0, "AppAccountFlag": 0, "Statues": 0, "AttrStatus": 106599, "Province": "", "City": "", "Alias": "", "SnsFlag": 401, "UniFriend": 0, "DisplayName": "", "ChatRoomId": 0, "KeyWord": "T77", "EncryChatRoomId": "", "IsOwner": 0}, "Type": "Text", "Text": "bot 上户口"}, cmsg=ChatMessage: id=7785080238091107815, create_time=1725521903, ctype=TEXT, content=bot 上户口, from_user_id=@24e853d03600c3d2b28e1046b1f7adeb, from_user_nickname=行, to_user_id=@eed8d3d14cb9b084cb1ba3543893beee22c322617e746023625868cd25404423, to_user_nickname=bot, other_user_id=@24e853d03600c3d2b28e1046b1f7adeb, other_user_nickname=行, is_group=False, is_at=False, actual_user_id=None, actual_user_nickname=None, at_list=None [DEBUG][2024-09-05 15:38:24][chat_channel.py:345] - [chat_channel] consume context: Context(type=TEXT, content=上户口, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x7f992f1aaa40>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@24e853d03600c3d2b28e1046b1f7adeb', 'receiver': '@24e853d03600c3d2b28e1046b1f7adeb'}) [DEBUG][2024-09-05 15:38:24][chat_channel.py:168] - [chat_channel] ready to handle context: Context(type=TEXT, content=上户口, kwargs={'isgroup': False, 'msg': <channel.wechat.wechat_message.WechatMessage object at 0x7f992f1aaa40>, 'origin_ctype': <ContextType.TEXT: 1>, 'openai_api_key': None, 'gpt_model': None, 'session_id': '@24e853d03600c3d2b28e1046b1f7adeb', 'receiver': '@24e853d03600c3d2b28e1046b1f7adeb'}) [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin GODCMD triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2024-09-05 15:38:24][godcmd.py:220] - [Godcmd] on_handle_context. content: 上户口 [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin KEYWORD triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2024-09-05 15:38:24][keyword.py:52] - [keyword] on_handle_context. content: 上户口 [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin LINKAI triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin ROLE triggered by event Event.ON_HANDLE_CONTEXT [INFO][2024-09-05 15:38:24][bridge.py:68] - create bot chatGPT for chat [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin DUNGEON triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2024-09-05 15:38:24][dungeon.py:73] - [Dungeon] on_handle_context. content: ['上户口'] [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin HELLO triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2024-09-05 15:38:24][hello.py:90] - [Hello] on_handle_context. content: 上户口 [DEBUG][2024-09-05 15:38:24][plugin_manager.py:189] - Plugin FINISH triggered by event Event.ON_HANDLE_CONTEXT [DEBUG][2024-09-05 15:38:24][finish.py:30] - [Finish] on_handle_context. content: 上户口 [DEBUG][2024-09-05 15:38:24][chat_channel.py:190] - [chat_channel] ready to handle context: type=TEXT, content=上户口 [INFO][2024-09-05 15:38:24][chat_gpt_bot.py:49] - [CHATGPT] query=上户口 [DEBUG][2024-09-05 15:38:27][session_manager.py:70] - prompt tokens used=71 [DEBUG][2024-09-05 15:38:27][chat_gpt_bot.py:66] - [CHATGPT] session query=[{'role': 'system', 'content': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。'}, {'role': 'user', 'content': '上户口'}] [ERROR][2024-09-05 15:38:27][chat_gpt_bot.py:155] - [CHATGPT] Exception: 'str' object has no attribute 'get' Traceback (most recent call last): File "/app/bot/chatgpt/chat_gpt_bot.py", line 123, in reply_text response = openai.ChatCompletion.create(api_key=api_key, messages=session.messages, *args) File "/usr/local/lib/python3.10/site-packages/openai/api_resources/chat_completion.py", line 25, in create return super().create(args, **kwargs) File "/usr/local/lib/python3.10/site-packages/openai/api_resources/abstract/engine_apiresource.py", line 153, in create response, , api_key = requestor.request( File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 298, in request resp, got_stream = self._interpret_response(result, stream) File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 700, in _interpret_response self._interpret_response_line( File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line raise self.handle_error_response( File "/usr/local/lib/python3.10/site-packages/openai/api_requestor.py", line 418, in handle_error_response error_code=error_data.get("code"), AttributeError: 'str' object has no attribute 'get'

报这个错误 是我哪个配置有问题吗 求助大佬