refactor: 移除 Redis/Rabbit 依赖,Agent Mongo 切至 ai_crm_angent_dev

This commit is contained in:
2026-10-22 00:02:46 +08:00
parent 8307ff95e4
commit 7685f280c6
25 changed files with 80 additions and 486 deletions
+8 -8
View File
@@ -13,17 +13,16 @@ from domain.models import Actor
from infrastructure.auth.jwt import parse_actor
from infrastructure.llm.factory import OpenAICompatibleStreamer
from infrastructure.llm.gateway import ServerLlmRuntimeGateway
from infrastructure.persistence.memory.cache import (
NoopLlmProtocolCapabilityCache,
NoopLlmRuntimeCache,
)
from infrastructure.persistence.mongo.client import get_db
from infrastructure.persistence.mongo.repositories import (
MongoMemoryRepository,
MongoMessageRepository,
MongoSessionRepository,
)
from infrastructure.persistence.redis.cache import (
RedisLlmProtocolCapabilityCache,
RedisLlmRuntimeCache,
get_redis,
)
async def current_actor(
@@ -41,8 +40,9 @@ async def current_actor(
async def llm_runtime_service(
settings: Settings = Depends(get_settings),
) -> LlmRuntimeService:
cache = RedisLlmRuntimeCache(get_redis(settings))
return LlmRuntimeService(settings, cache, ServerLlmRuntimeGateway(settings))
return LlmRuntimeService(
settings, NoopLlmRuntimeCache(), ServerLlmRuntimeGateway(settings)
)
async def session_service(
@@ -77,7 +77,7 @@ async def chat_service(
llm_runtime=llm_svc,
memory=mem_svc,
streamer=OpenAICompatibleStreamer(
RedisLlmProtocolCapabilityCache(get_redis(settings)),
NoopLlmProtocolCapabilityCache(),
capability_ttl_seconds=settings.llm_capability_ttl_seconds,
),
)