- 从服务器拉取完整代码 - 按框架规范整理项目结构 - 配置 Drone CI 测试环境部署 - 包含后端(FastAPI)、前端(Vue3)、管理端 技术栈: Vue3 + TypeScript + FastAPI + MySQL
152 lines
3.6 KiB
Python
152 lines
3.6 KiB
Python
"""
|
||
AI 服务模块
|
||
|
||
包含:
|
||
- AIService: 本地 AI 服务(支持 4sapi + OpenRouter 降级)
|
||
- LLM JSON Parser: 大模型 JSON 输出解析器
|
||
- KnowledgeAnalysisServiceV2: 知识点分析服务(Python 原生实现)
|
||
- ExamGeneratorService: 试题生成服务(Python 原生实现)
|
||
- CourseChatServiceV2: 课程对话服务(Python 原生实现)
|
||
- PracticeSceneService: 陪练场景准备服务(Python 原生实现)
|
||
- AbilityAnalysisService: 智能工牌能力分析服务(Python 原生实现)
|
||
- AnswerJudgeService: 答案判断服务(Python 原生实现)
|
||
- PracticeAnalysisService: 陪练分析报告服务(Python 原生实现)
|
||
"""
|
||
|
||
from .ai_service import (
|
||
AIService,
|
||
AIResponse,
|
||
AIConfig,
|
||
AIServiceError,
|
||
AIProvider,
|
||
DEFAULT_MODEL,
|
||
MODEL_ANALYSIS,
|
||
MODEL_CREATIVE,
|
||
MODEL_IMAGE_GEN,
|
||
quick_chat,
|
||
)
|
||
|
||
from .llm_json_parser import (
|
||
parse_llm_json,
|
||
parse_with_fallback,
|
||
safe_json_loads,
|
||
clean_llm_output,
|
||
diagnose_json_error,
|
||
validate_json_schema,
|
||
ParseResult,
|
||
JSONParseError,
|
||
JSONUnrecoverableError,
|
||
)
|
||
|
||
from .knowledge_analysis_v2 import (
|
||
KnowledgeAnalysisServiceV2,
|
||
knowledge_analysis_service_v2,
|
||
)
|
||
|
||
from .exam_generator_service import (
|
||
ExamGeneratorService,
|
||
ExamGeneratorConfig,
|
||
exam_generator_service,
|
||
generate_exam,
|
||
)
|
||
|
||
from .course_chat_service import (
|
||
CourseChatServiceV2,
|
||
course_chat_service_v2,
|
||
)
|
||
|
||
from .practice_scene_service import (
|
||
PracticeSceneService,
|
||
PracticeScene,
|
||
PracticeSceneResult,
|
||
practice_scene_service,
|
||
prepare_practice_knowledge,
|
||
)
|
||
|
||
from .ability_analysis_service import (
|
||
AbilityAnalysisService,
|
||
AbilityAnalysisResult,
|
||
AbilityDimension,
|
||
CourseRecommendation,
|
||
ability_analysis_service,
|
||
)
|
||
|
||
from .answer_judge_service import (
|
||
AnswerJudgeService,
|
||
JudgeResult,
|
||
answer_judge_service,
|
||
judge_answer,
|
||
)
|
||
|
||
from .practice_analysis_service import (
|
||
PracticeAnalysisService,
|
||
PracticeAnalysisResult,
|
||
ScoreBreakdownItem,
|
||
AbilityDimensionItem,
|
||
DialogueAnnotation,
|
||
Suggestion,
|
||
practice_analysis_service,
|
||
analyze_practice_session,
|
||
)
|
||
|
||
__all__ = [
|
||
# AI Service
|
||
"AIService",
|
||
"AIResponse",
|
||
"AIConfig",
|
||
"AIServiceError",
|
||
"AIProvider",
|
||
"DEFAULT_MODEL",
|
||
"MODEL_ANALYSIS",
|
||
"MODEL_CREATIVE",
|
||
"MODEL_IMAGE_GEN",
|
||
"quick_chat",
|
||
# JSON Parser
|
||
"parse_llm_json",
|
||
"parse_with_fallback",
|
||
"safe_json_loads",
|
||
"clean_llm_output",
|
||
"diagnose_json_error",
|
||
"validate_json_schema",
|
||
"ParseResult",
|
||
"JSONParseError",
|
||
"JSONUnrecoverableError",
|
||
# Knowledge Analysis V2
|
||
"KnowledgeAnalysisServiceV2",
|
||
"knowledge_analysis_service_v2",
|
||
# Exam Generator V2
|
||
"ExamGeneratorService",
|
||
"ExamGeneratorConfig",
|
||
"exam_generator_service",
|
||
"generate_exam",
|
||
# Course Chat V2
|
||
"CourseChatServiceV2",
|
||
"course_chat_service_v2",
|
||
# Practice Scene V2
|
||
"PracticeSceneService",
|
||
"PracticeScene",
|
||
"PracticeSceneResult",
|
||
"practice_scene_service",
|
||
"prepare_practice_knowledge",
|
||
# Ability Analysis V2
|
||
"AbilityAnalysisService",
|
||
"AbilityAnalysisResult",
|
||
"AbilityDimension",
|
||
"CourseRecommendation",
|
||
"ability_analysis_service",
|
||
# Answer Judge V2
|
||
"AnswerJudgeService",
|
||
"JudgeResult",
|
||
"answer_judge_service",
|
||
"judge_answer",
|
||
# Practice Analysis V2
|
||
"PracticeAnalysisService",
|
||
"PracticeAnalysisResult",
|
||
"ScoreBreakdownItem",
|
||
"AbilityDimensionItem",
|
||
"DialogueAnnotation",
|
||
"Suggestion",
|
||
"practice_analysis_service",
|
||
"analyze_practice_session",
|
||
]
|