修复ChatStream循环导入问题

This commit is contained in:
Windpicker-owo
2025-11-25 20:29:48 +08:00
parent 6b3b2a8245
commit c268ea2fb2
12 changed files with 65 additions and 44 deletions

View File

@@ -9,10 +9,9 @@ import re
import time
import traceback
from datetime import datetime, timedelta
from typing import Any, Literal
from typing import Any, Literal, TYPE_CHECKING
from src.chat.express.expression_selector import expression_selector
from src.chat.message_receive.chat_stream import ChatStream
from src.chat.message_receive.message import MessageSending, Seg, UserInfo
from src.chat.message_receive.uni_message_sender import HeartFCSender
from src.chat.utils.chat_message_builder import (
@@ -38,6 +37,9 @@ from src.plugin_system.apis import llm_api
from src.plugin_system.apis.permission_api import permission_api
from src.plugin_system.base.component_types import ActionInfo, EventType
if TYPE_CHECKING:
from src.chat.message_receive.chat_stream import ChatStream
logger = get_logger("replyer")
# 用于存储后台任务的集合,防止被垃圾回收
@@ -236,7 +238,7 @@ If you need to use the search tool, please directly call the function "lpmm_sear
class DefaultReplyer:
def __init__(
self,
chat_stream: ChatStream,
chat_stream: "ChatStream",
request_type: str = "replyer",
):
self.express_model = LLMRequest(model_set=model_config.model_task_config.replyer, request_type=request_type)