zhayujie / chatgpt-on-wechat

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

用gemini模型问问题报错 #2118

Open zhangxiansheng717 opened 4 days ago

zhangxiansheng717 commented 4 days ago

前置确认

⚠️ 搜索issues中是否已存在类似问题

操作系统类型?

Windows

运行的python版本是?

python 3.10

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

{ "channel_type": "wx", "model": "gemini", "open_ai_api_key": "", "open_ai_api_base": "", "gemini_api_key": "AIzaSyAP5sP8ZLW43gwglXXXXXXXXXXXXXX", "claude_api_key": "YOUR API KEY", "text_to_image": "dall-e-2", "voice_to_text": "gemini", "text_to_voice": "openai", "proxy": "", "hot_reload": false, "single_chat_prefix": [ ""], "single_chat_reply_prefix": "", "group_chat_prefix": [ "@Answer" ],

"group_chat_reply_prefix": "", "group_chat_reply_suffix": "", "group_name_white_list": [ "ALL_GROUP" ], "group_chat_in_one_session": ["ALL_GROUP"], "image_create_prefix": [ "画" ], "speech_recognition": true, "group_speech_recognition": false, "voice_reply_voice": false, "conversation_max_tokens": 2500, "expires_in_seconds": 3600, "character_desc": "你是基于大语言模型的AI智能助手,旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。", "temperature": 0.9, "use_linkai": false, "linkai_api_key": "", "linkai_app_code": "" }

问题描述 😯

扫码登录成功之后发了一句消息就报错 1719767793935

终端日志 📒

Start auto replying. [INFO][2024-07-01 00:59:26][bridge.py:68] - create bot gemini for chat [INFO][2024-07-01 00:59:36][google_gemini_bot.py:31] - [Gemini] query=你好 [ERROR][2024-07-01 00:59:36][google_gemini_bot.py:42] - [Gemini] fetch reply error, may contain unsafe content [ERROR][2024-07-01 00:59:36][google_gemini_bot.py:43] - module 'google.generativeai' has no attribute 'generate' [INFO][2024-07-01 00:59:36][wechat_channel.py:217] - [WX] sendMsg=Reply(type=ERROR, content=[ERROR] invoke [Gemini] api failed!), receiver=@4aa8465f33790c867940f368354d30bcc0a500c103e1e016bd8fbfce7f4b68e9 [INFO][2024-07-01 00:59:48][app.py:19] - signal 2 received, exiting... [INFO][2024-07-01 00:59:48][config.py:230] - [Config] User datas saved. Bye~ [INFO][2024-07-01 00:59:50][app.py:19] - signal 2 received, exiting... [INFO][2024-07-01 00:59:50][config.py:230] - [Config] User datas saved. Traceback (most recent call last): File "C:\Users\Administrator\chatgpt-on-wechat\app.py", line 71, in run() File "C:\Users\Administrator\chatgpt-on-wechat\app.py", line 64, in run time.sleep(1) File "C:\Users\Administrator\chatgpt-on-wechat\app.py", line 22, in func return old_handler(_signo, _stack_frame) KeyboardInterrupt

zhangxiansheng717 commented 4 days ago

用代码升级完:pip install -q -U google-generativeai,在发消息就卡住了 image