feat: add WebAgent support for streaming and notifications

This commit is contained in:
jxxghp
2026-06-16 19:21:31 +08:00
parent 1c60d8ccd7
commit e8ae686d4f
8 changed files with 712 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ from typing import Optional, Type
from pydantic import BaseModel, Field, model_validator
from app.agent.tools.base import MoviePilotTool, ToolChain
from app.agent.tools.base import MoviePilotTool
from app.agent.tools.tags import ToolTag
from app.log import logger
from app.schemas import Notification, NotificationType
@@ -96,7 +96,7 @@ class SendLocalFileTool(MoviePilotTool):
resolved_path,
)
await ToolChain().async_post_message(
await self.send_notification_message(
Notification(
channel=channel,
source=self._source,

View File

@@ -4,7 +4,7 @@ from typing import Optional, Type
from pydantic import BaseModel, Field
from app.agent.llm.capability import AgentCapabilityManager
from app.agent.tools.base import MoviePilotTool, ToolChain
from app.agent.tools.base import MoviePilotTool
from app.agent.tools.tags import ToolTag
from app.core.config import settings
from app.log import logger
@@ -86,7 +86,7 @@ class SendVoiceMessageTool(MoviePilotTool):
f"use_voice={used_voice}, text_len={len(message)}"
)
await ToolChain().async_post_message(
await self.send_notification_message(
Notification(
channel=self._channel,
source=self._source,