Files
life-echo/api/app/features/conversation/deps.py
Sully 53e0065e3e refactor(api): TOML 配置 SSOT、统一错误契约、Auth/事务加固与可观测性 (#33)
配置 SSOT(TOML + .env)
统一错误契约
Auth 与事务边界
Redis / Celery 可靠性:业务 Redis(DB/0)与 Celery broker/backend(DB/1)显式拆分;连接池、sync client
可观测性(OpenTelemetry + LGTM)
2026-05-22 13:44:50 +08:00

21 lines
716 B
Python

"""Conversation feature dependencies: get_conversation_service."""
from fastapi import Depends
from app.core.dependencies import get_object_storage
from app.features.conversation.service import ConversationService
from app.features.quota.deps import get_quota_service
from app.features.quota.service import QuotaService
from app.ports.storage import ObjectStorage
from app.core.deps_types import DbDep
def get_conversation_service(
db: DbDep,
quota_service: QuotaService = Depends(get_quota_service),
object_storage: ObjectStorage = Depends(get_object_storage),
) -> ConversationService:
return ConversationService(
db=db, quota_service=quota_service, object_storage=object_storage
)