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
31.46k stars 8.19k forks source link

调用智谱API失败 #2399

Open caixinyuan opened 15 hours ago

caixinyuan commented 15 hours ago

前置确认

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

操作系统类型?

Linux

运行的python版本是?

python 3.9

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

Latest Release

运行的channel类型是?

wx(个人微信, itchat)

复现步骤 🕹

调用智谱 glm-4 模型失败

问题描述 😯

No response

终端日志 📒

[ERROR][2024-11-26 21:32:36][chat_channel.py:303] - Worker return exception: No module named 'pydantic_core._pydantic_core'
Traceback (most recent call last):
  File "/usr/lib/python3.9/concurrent/futures/thread.py", line 58, in run
  File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 170, in _handle
    reply = self._generate_reply(context)
  File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 182, in _generate_reply
    e_context = PluginManager().emit_event(
  File "/root/chatgpt-on-wechat/plugins/plugin_manager.py", line 191, in emit_event
    instance.handlers[e_context.event](e_context, *args, **kwargs)
  File "/root/chatgpt-on-wechat/plugins/role/role.py", line 105, in on_handle_context
    bot = Bridge().get_bot("chat")
  File "/root/chatgpt-on-wechat/bridge/bridge.py", line 74, in get_bot
    self.bots[typename] = create_bot(self.btype[typename])
  File "/root/chatgpt-on-wechat/bot/bot_factory.py", line 60, in create_bot
    from bot.zhipuai.zhipuai_bot import ZHIPUAIBot
  File "/root/chatgpt-on-wechat/bot/zhipuai/zhipuai_bot.py", line 15, in <module>
    from zhipuai import ZhipuAI
  File "/usr/lib/python3.9/site-packages/zhipuai/__init__.py", line 2, in <module>
    from ._client import ZhipuAI
  File "/usr/lib/python3.9/site-packages/zhipuai/_client.py", line 7, in <module>
    from .core import _jwt_token
  File "/usr/lib/python3.9/site-packages/zhipuai/core/__init__.py", line 1, in <module>
    from ._base_models import (
  File "/usr/lib/python3.9/site-packages/zhipuai/core/_base_models.py", line 17, in <module>
    from pydantic.fields import FieldInfo
  File "/usr/lib/python3.9/site-packages/pydantic/fields.py", line 17, in <module>
    from pydantic_core import PydanticUndefined
  File "/usr/lib/python3.9/site-packages/pydantic_core/__init__.py", line 6, in <module>
    from ._pydantic_core import (
ModuleNotFoundError: No module named 'pydantic_core._pydantic_core'
caixinyuan commented 14 hours ago
:~/chatgpt-on-wechat# pip3 install zhipuai
Requirement already satisfied: zhipuai in /usr/lib/python3.9/site-packages (2.1.5.20230904)
Requirement already satisfied: cachetools>=4.2.2 in /usr/lib/python3.9/site-packages (from zhipuai) (5.5.0)
Requirement already satisfied: httpx>=0.23.0 in /usr/lib/python3.9/site-packages (from zhipuai) (0.27.2)
Requirement already satisfied: pydantic<3.0,>=1.9.0 in /usr/lib/python3.9/site-packages (from zhipuai) (2.10.2)
Requirement already satisfied: pydantic-core>=2.14.6 in /usr/lib/python3.9/site-packages (from zhipuai) (2.27.1)
Requirement already satisfied: pyjwt<2.9.0,>=2.8.0 in /usr/lib/python3.9/site-packages (from zhipuai) (2.8.0)
Requirement already satisfied: anyio in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (4.6.2.post1)
Requirement already satisfied: certifi in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (2021.5.30)
Requirement already satisfied: httpcore==1.* in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (1.0.7)
Requirement already satisfied: idna in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (3.2)
Requirement already satisfied: sniffio in /usr/lib/python3.9/site-packages (from httpx>=0.23.0->zhipuai) (1.3.1)
Requirement already satisfied: h11<0.15,>=0.13 in /usr/lib/python3.9/site-packages (from httpcore==1.*->httpx>=0.23.0->zhipuai) (0.14.0)
Requirement already satisfied: annotated-types>=0.6.0 in /usr/lib/python3.9/site-packages (from pydantic<3.0,>=1.9.0->zhipuai) (0.7.0)
Requirement already satisfied: typing-extensions>=4.12.2 in /usr/lib/python3.9/site-packages (from pydantic<3.0,>=1.9.0->zhipuai) (4.12.2)
Requirement already satisfied: exceptiongroup>=1.0.2 in /usr/lib/python3.9/site-packages (from anyio->httpx>=0.23.0->zhipuai) (1.2.2)