feat(agent): upgrade langchain to v1.0+

This commit is contained in:
jxxghp
2026-03-22 21:41:12 +08:00
parent ea4e0dd764
commit 5cded77387
5 changed files with 31 additions and 17 deletions

View File

@@ -9,12 +9,11 @@ from typing import Optional, List, Dict, Tuple, Set
import websocket
from app.chain.message import MessageChain
from app.core.cache import FileCache
from app.core.config import settings
from app.core.context import MediaInfo, Context
from app.core.metainfo import MetaInfo
from app.log import logger
from app.schemas.types import MessageChannel
from app.utils.string import StringUtils
@@ -27,6 +26,7 @@ class WeChatBot:
"""
_default_ws_url = "wss://openws.work.weixin.qq.com"
_ds_url = f"http://127.0.0.1:{settings.PORT}/api/v1/message?token={settings.API_TOKEN}"
_heartbeat_interval = 30
_ack_timeout = 10
@@ -361,13 +361,14 @@ class WeChatBot:
def _forward_to_message_chain(self, userid: str, text: str) -> None:
def _run():
try:
MessageChain().handle_message(
# FIXME
"""MessageChain().handle_message(
channel=MessageChannel.Wechat,
source=self._config_name,
userid=userid,
username=userid,
text=text,
)
)"""
except Exception as err:
logger.error(f"企业微信智能机器人转发消息失败:{err}")