feat: optimize AI suggestion and workorder sync - support same-day multiple update numbering - insert new suggestions at top maintaining reverse chronological order - reference process history when generating suggestions - simplify prompts to avoid forcing log analysis - fix Chinese comment encoding issues
This commit is contained in:
Binary file not shown.
Binary file not shown.
BIN
src/config/__pycache__/unified_config.cpython-311.pyc
Normal file
BIN
src/config/__pycache__/unified_config.cpython-311.pyc
Normal file
Binary file not shown.
@@ -84,9 +84,9 @@ class UnifiedConfig:
|
||||
self.config_dir = Path(config_dir)
|
||||
self.config_file = self.config_dir / "unified_config.json"
|
||||
|
||||
# 默认配置
|
||||
# 默认配置 - 从config/llm_config.py加载默认LLM配置
|
||||
self.database = DatabaseConfig()
|
||||
self.llm = LLMConfig()
|
||||
self.llm = self._load_default_llm_config()
|
||||
self.server = ServerConfig()
|
||||
self.feishu = FeishuConfig()
|
||||
self.ai_accuracy = AIAccuracyConfig()
|
||||
@@ -95,6 +95,23 @@ class UnifiedConfig:
|
||||
# 加载配置
|
||||
self.load_config()
|
||||
|
||||
def _load_default_llm_config(self) -> LLMConfig:
|
||||
"""加载默认LLM配置"""
|
||||
try:
|
||||
from config.llm_config import DEFAULT_CONFIG
|
||||
# 将config/llm_config.py中的配置转换为统一配置的格式
|
||||
return LLMConfig(
|
||||
provider=DEFAULT_CONFIG.provider,
|
||||
api_key=DEFAULT_CONFIG.api_key,
|
||||
base_url=DEFAULT_CONFIG.base_url,
|
||||
model=DEFAULT_CONFIG.model,
|
||||
temperature=DEFAULT_CONFIG.temperature,
|
||||
max_tokens=DEFAULT_CONFIG.max_tokens
|
||||
)
|
||||
except Exception as e:
|
||||
logger.warning(f"无法加载默认LLM配置,使用内置默认值: {e}")
|
||||
return LLMConfig()
|
||||
|
||||
def load_config(self):
|
||||
"""加载配置文件"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user