mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-02 21:31:37 +08:00
refactor: remove persist_output_message functionality and related database save logic
This commit is contained in:
@@ -881,7 +881,6 @@ async def web_agent_stream(
|
||||
source=WEB_AGENT_SOURCE,
|
||||
username=current_user.name,
|
||||
replay_mode=ReplyMode.CAPTURE_ONLY,
|
||||
persist_output_message=False,
|
||||
allow_message_tools=True,
|
||||
output_callback=output_callback,
|
||||
notification_callback=notification_callback,
|
||||
|
||||
@@ -136,7 +136,6 @@ def _start_ai_redo_task(history_id: int, prompt: str, progress_key: str):
|
||||
session_prefix=f"__agent_manual_redo_{history_id}",
|
||||
output_callback=update_output,
|
||||
reply_mode=ReplyMode.CAPTURE_ONLY,
|
||||
persist_output_message=False,
|
||||
allow_message_tools=False,
|
||||
)
|
||||
progress.update(
|
||||
@@ -182,7 +181,6 @@ def _start_batch_ai_redo_task(
|
||||
session_prefix="__agent_manual_redo_batch",
|
||||
output_callback=update_output,
|
||||
reply_mode=ReplyMode.CAPTURE_ONLY,
|
||||
persist_output_message=False,
|
||||
allow_message_tools=False,
|
||||
)
|
||||
progress.update(
|
||||
|
||||
@@ -12,7 +12,7 @@ from app.core.config import settings, global_vars
|
||||
from app.core.security import verify_token, verify_apitoken
|
||||
from app.db import get_async_db
|
||||
from app.db.models import User
|
||||
from app.db.models.message import Message
|
||||
from app.db.message_oper import MessageOper
|
||||
from app.db.user_oper import get_current_active_superuser
|
||||
from app.helper.service import ServiceConfigHelper
|
||||
from app.helper.webpush import is_webpush_subscription_gone
|
||||
@@ -120,7 +120,7 @@ async def get_web_message(
|
||||
获取WEB消息列表
|
||||
"""
|
||||
ret_messages = []
|
||||
messages = await Message.async_list_by_page(db, page=page, count=count)
|
||||
messages = await MessageOper(db).async_list_by_page(page=page, count=count)
|
||||
for message in messages:
|
||||
try:
|
||||
ret_messages.append(message.to_dict())
|
||||
@@ -130,6 +130,20 @@ async def get_web_message(
|
||||
return ret_messages
|
||||
|
||||
|
||||
@router.get("/notification", summary="获取通知消息", response_model=List[schemas.NotificationHistoryItem])
|
||||
async def get_notification_message(
|
||||
_: schemas.TokenPayload = Depends(verify_token),
|
||||
db: AsyncSession = Depends(get_async_db),
|
||||
page: Optional[int] = 1,
|
||||
count: Optional[int] = 20,
|
||||
):
|
||||
"""
|
||||
获取系统发送的通知消息列表。
|
||||
"""
|
||||
messages = await MessageOper(db).async_list_sent_by_page(page=page, count=count)
|
||||
return [schemas.NotificationHistoryItem(**message.to_dict()) for message in messages]
|
||||
|
||||
|
||||
def wechat_verify(
|
||||
echostr: str,
|
||||
msg_signature: str,
|
||||
|
||||
@@ -52,9 +52,6 @@ class _CollectingMoviePilotAgent(MoviePilotAgent):
|
||||
if self.stream_mode:
|
||||
self.stream_handler.emit(text)
|
||||
|
||||
async def _save_agent_message_to_db(self, message: str, title: str = ""):
|
||||
return None
|
||||
|
||||
|
||||
class _OpenAIStreamingHandler(StreamingHandler):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user