28 lines
959 B
Python
28 lines
959 B
Python
"""Application wiring for the client Agent."""
|
|||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from config.database.milvus import client as milvus_client
|
||
|
|
from config.database.mysql import get_session_factory
|
||
|
|
from config.database.redis import client as redis_client
|
||
|
|
from service.client_agent.runtime import build_client_runtime
|
||
|
|
from service.customer_agent.config import DatabaseConfigProvider
|
||
|
|
from tool.llm import llm as llm_client
|
||
|
|
|
||
|
|
|
||
|
|
def build_default_runtime():
|
||
|
|
"""Build the client Agent runtime using project-wide dependencies."""
|
||
|
|
provider = DatabaseConfigProvider(session_factory=get_session_factory())
|
||
|
|
return build_client_runtime(
|
||
|
|
redis=redis_client(),
|
||
|
|
milvus_client=milvus_client(),
|
||
|
|
llm_client=llm_client,
|
||
|
|
config_getter=provider.get,
|
||
|
|
audit_writer=provider.write_audit,
|
||
|
|
)
|
||
|
|
|
||
|
|
|
||
|
|
def get_memory_service(runtime):
|
||
|
|
"""返回 client_agent 使用的统一 MemoryService 入口。"""
|
||
|
|
return runtime.memory_service
|