Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# src/services/rag/__init__.py
|
||||
"""RAG服务模块"""
|
||||
|
||||
from .retriever import Retriever, retrieve_regulations
|
||||
@@ -9,4 +8,4 @@ __all__ = [
|
||||
"Retriever", "retrieve_regulations",
|
||||
"ContextBuilder", "build_rag_context",
|
||||
"PromptTemplates", "get_prompt_template"
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# src/services/rag/context_builder.py
|
||||
"""RAG上下文构建服务 - 构建LLM输入上下文"""
|
||||
|
||||
from typing import List, Dict, Optional
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# src/services/rag/prompt_templates.py
|
||||
"""RAG Prompt模板 - 合规问答专用Prompt"""
|
||||
|
||||
from typing import Dict, Optional
|
||||
@@ -293,4 +292,4 @@ def get_prompt_template(name: str) -> PromptTemplate:
|
||||
template = PromptTemplates.get_template(name)
|
||||
if not template:
|
||||
raise ValueError(f"不存在的模板: {name}")
|
||||
return template
|
||||
return template
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# src/services/rag/retriever.py
|
||||
"""RAG检索服务 - 封装Milvus检索"""
|
||||
|
||||
from typing import List, Dict, Optional, Any
|
||||
|
||||
Reference in New Issue
Block a user