mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-06 05:33:57 +08:00
feat(agent): upgrade langchain to v1.0+
This commit is contained in:
@@ -11,7 +11,6 @@ from typing import Optional, List, Tuple
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from app.chain.message import MessageChain
|
||||
from app.core.cache import FileCache
|
||||
from app.core.context import MediaInfo, Context
|
||||
from app.core.metainfo import MetaInfo
|
||||
@@ -101,11 +100,12 @@ class QQBot:
|
||||
"""直接调用消息链处理,避免 HTTP 开销"""
|
||||
def _run():
|
||||
try:
|
||||
MessageChain().process(
|
||||
# FIXME
|
||||
"""MessageChain().process(
|
||||
body=payload,
|
||||
form={},
|
||||
args={"source": self._config_name},
|
||||
)
|
||||
)"""
|
||||
except Exception as e:
|
||||
logger.error(f"QQ Bot 转发消息失败: {e}")
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ class Telegram:
|
||||
# 发送正在输入状态
|
||||
try:
|
||||
_bot.send_chat_action(message.chat.id, 'typing')
|
||||
except Exception as e:
|
||||
logger.error(f"发送Telegram正在输入状态失败:{e}")
|
||||
except Exception as err:
|
||||
logger.error(f"发送Telegram正在输入状态失败:{err}")
|
||||
RequestUtils(timeout=15).post_res(self._ds_url, json=message.json)
|
||||
|
||||
@_bot.callback_query_handler(func=lambda call: True)
|
||||
|
||||
@@ -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}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user