Merge pull request #1061 from A0000Xz/dev

修复了send_command方法中display_message未被使用的错误,并且让命令截断的消息能够保存并加入prompt
This commit is contained in:
UnCLAS-Prommer
2025-06-25 13:53:39 +08:00
committed by GitHub
4 changed files with 6 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ from src.manager.mood_manager import mood_manager # 导入情绪管理器
from src.chat.message_receive.chat_stream import get_chat_manager
from src.chat.message_receive.message import MessageRecv
from src.experimental.only_message_process import MessageProcessor
from src.chat.message_receive.storage import MessageStorage
from src.experimental.PFC.pfc_manager import PFCManager
from src.chat.focus_chat.heartflow_message_processor import HeartFCMessageReceiver
from src.chat.utils.prompt_builder import Prompt, global_prompt_manager
@@ -148,6 +149,7 @@ class ChatBot:
# 如果是命令且不需要继续处理,则直接返回
if is_command and not continue_process:
await MessageStorage.store_message(message, chat)
logger.info(f"命令处理完成,跳过后续消息处理: {cmd_result}")
return

View File

@@ -284,7 +284,7 @@ async def image_to_stream(image_base64: str, stream_id: str, storage_message: bo
return await _send_to_target("image", image_base64, stream_id, "", typing=False, storage_message=storage_message)
async def command_to_stream(command: Union[str, dict], stream_id: str, storage_message: bool = True) -> bool:
async def command_to_stream(command: Union[str, dict], stream_id: str, storage_message: bool = True, display_message: str = "") -> bool:
"""向指定流发送命令
Args:
@@ -295,7 +295,7 @@ async def command_to_stream(command: Union[str, dict], stream_id: str, storage_m
Returns:
bool: 是否发送成功
"""
return await _send_to_target("command", command, stream_id, "", typing=False, storage_message=storage_message)
return await _send_to_target("command", command, stream_id, display_message, typing=False, storage_message=storage_message)
async def custom_to_stream(

View File

@@ -322,6 +322,7 @@ class BaseAction(ABC):
command=command_data,
stream_id=self.chat_id,
storage_message=storage_message,
display_message=display_message
)
if success:

View File

@@ -162,6 +162,7 @@ class BaseCommand(ABC):
command=command_data,
stream_id=chat_stream.stream_id,
storage_message=storage_message,
display_message=display_message
)
if success: