主要更新: - 更新代理商端文档,明确项目由品牌方分配流程 - 新增Brief配置详情页(已配置)设计稿 - 完善工作台紧急待办中品牌新任务功能 - 整理Pencil设计文件中代理商端页面顺序 - 新增后端FastAPI框架及核心API - 新增前端Next.js页面和组件库 - 添加.gitignore排除构建和缓存文件 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.8 KiB
Python
55 lines
1.8 KiB
Python
"""服务层模块"""
|
|
from typing import Optional, Any
|
|
|
|
_openai_import_error: Optional[Exception] = None
|
|
|
|
try:
|
|
from app.services.ai_client import OpenAICompatibleClient, AIResponse, ConnectionTestResult
|
|
from app.services.ai_service import AIServiceFactory, get_ai_client_for_tenant
|
|
except ModuleNotFoundError as exc: # openai 依赖缺失时允许非 AI 路径正常导入
|
|
_openai_import_error = exc
|
|
OpenAICompatibleClient = None
|
|
AIResponse = None
|
|
ConnectionTestResult = None
|
|
AIServiceFactory = None
|
|
|
|
def get_ai_client_for_tenant(*_args: Any, **_kwargs: Any) -> Any:
|
|
raise ModuleNotFoundError(
|
|
"Optional dependency 'openai' is required for AI client usage."
|
|
) from _openai_import_error
|
|
|
|
# 视频处理服务(无外部依赖)
|
|
from app.services.video_download import VideoDownloadService, DownloadResult, get_download_service
|
|
from app.services.keyframe import KeyFrameExtractor, KeyFrame, ExtractionResult, get_keyframe_extractor
|
|
from app.services.asr import ASRService, VideoASRService, TranscriptionResult
|
|
from app.services.vision import VisionAnalysisService, CompetitorLogoDetector, VideoOCRService
|
|
from app.services.video_review import VideoReviewService
|
|
|
|
__all__ = [
|
|
# AI 客户端
|
|
"OpenAICompatibleClient",
|
|
"AIResponse",
|
|
"ConnectionTestResult",
|
|
"AIServiceFactory",
|
|
"get_ai_client_for_tenant",
|
|
# 视频下载
|
|
"VideoDownloadService",
|
|
"DownloadResult",
|
|
"get_download_service",
|
|
# 关键帧提取
|
|
"KeyFrameExtractor",
|
|
"KeyFrame",
|
|
"ExtractionResult",
|
|
"get_keyframe_extractor",
|
|
# ASR
|
|
"ASRService",
|
|
"VideoASRService",
|
|
"TranscriptionResult",
|
|
# 视觉分析
|
|
"VisionAnalysisService",
|
|
"CompetitorLogoDetector",
|
|
"VideoOCRService",
|
|
# 视频审核
|
|
"VideoReviewService",
|
|
]
|