mirror of
https://gitee.com/qqtt-ah/ai-crm.git
synced 2026-11-24 17:49:20 +08:00
refactor: 移除 Redis/Rabbit 依赖,Agent Mongo 切至 ai_crm_angent_dev
This commit is contained in:
@@ -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,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user