mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 17:49:19 +08:00
feat: 重构 Agent 目录为 api/agent/infrastructure 分层并更新启动入口
This commit is contained in:
@@ -9,10 +9,9 @@ from application.llm_settings_service import LlmRuntimeService
|
||||
from application.memory_service import MemoryService
|
||||
from application.session_service import SessionService
|
||||
from config.settings import Settings
|
||||
from agent.runtime import load_tools_for_turn
|
||||
from domain.models import Actor, ChatMessage, MessageRole
|
||||
from domain.ports import ChatStreamer, MessageRepository, SessionRepository
|
||||
from infrastructure.builtin_tools import builtin_tools
|
||||
from infrastructure.mcp_client import load_mcp_tools
|
||||
|
||||
|
||||
class ChatService:
|
||||
@@ -56,11 +55,11 @@ class ChatService:
|
||||
actor, thread_id=thread_id, text=text
|
||||
)
|
||||
memory_lines = await self._memory.lines_for_prompt(actor)
|
||||
mcp_tools = await load_mcp_tools(
|
||||
self._settings, company_id=actor.company_id, user_id=actor.user_id
|
||||
tools = await load_tools_for_turn(
|
||||
self._settings,
|
||||
company_id=actor.company_id,
|
||||
user_id=actor.user_id,
|
||||
)
|
||||
# 本地时间工具始终挂上,不依赖 MCP 是否可用
|
||||
tools = [*builtin_tools(), *mcp_tools]
|
||||
|
||||
history = await self._messages.list_recent(
|
||||
actor.company_id,
|
||||
|
||||
Reference in New Issue
Block a user