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:
BIN
config/__pycache__/ai_accuracy_config.cpython-313.pyc
Normal file
BIN
config/__pycache__/ai_accuracy_config.cpython-313.pyc
Normal file
Binary file not shown.
@@ -21,7 +21,10 @@
|
||||
"Has it been updated on the same day": "has_updated_same_day",
|
||||
"Operating time": "operating_time",
|
||||
"AI建议": "ai_suggestion",
|
||||
"Issue Start Time": "updated_at"
|
||||
"Issue Start Time": "updated_at",
|
||||
"Wilfulness(责任人<E4BBBB>?": "wilfulness",
|
||||
"父<>?<3F>录": "parent_record",
|
||||
"AI建<49>??": "ai_suggestion"
|
||||
},
|
||||
"field_aliases": {
|
||||
"order_id": [
|
||||
|
||||
@@ -34,3 +34,27 @@ ANTHROPIC_CONFIG = LLMConfig(
|
||||
|
||||
# 默认使用千问模型
|
||||
DEFAULT_CONFIG = QWEN_CONFIG
|
||||
|
||||
|
||||
def get_default_llm_config() -> LLMConfig:
|
||||
"""
|
||||
获取默认的LLM配置
|
||||
优先从统一配置管理器获取,如果失败则使用本地配置
|
||||
"""
|
||||
try:
|
||||
from src.config.unified_config import get_config
|
||||
config = get_config()
|
||||
llm_dict = config.get_llm_config()
|
||||
|
||||
# 创建LLMConfig对象
|
||||
return LLMConfig(
|
||||
provider=llm_dict.get("provider", "qwen"),
|
||||
api_key=llm_dict.get("api_key", ""),
|
||||
base_url=llm_dict.get("base_url", "https://dashscope.aliyuncs.com/compatible-mode/v1"),
|
||||
model=llm_dict.get("model", "qwen-plus-latest"),
|
||||
temperature=llm_dict.get("temperature", 0.7),
|
||||
max_tokens=llm_dict.get("max_tokens", 2000)
|
||||
)
|
||||
except Exception:
|
||||
# 如果统一配置不可用,使用本地配置
|
||||
return DEFAULT_CONFIG
|
||||
|
||||
52
config/unified_config.json
Normal file
52
config/unified_config.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"database": {
|
||||
"url": "mysql+pymysql://tsp_assistant:password@43.134.68.207/tsp_assistant?charset=utf8mb4",
|
||||
"pool_size": 10,
|
||||
"max_overflow": 20,
|
||||
"pool_timeout": 30,
|
||||
"pool_recycle": 3600
|
||||
},
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"api_key": "",
|
||||
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
||||
"model": "qwen-turbo",
|
||||
"temperature": 0.7,
|
||||
"max_tokens": 2000,
|
||||
"timeout": 30
|
||||
},
|
||||
"server": {
|
||||
"host": "0.0.0.0",
|
||||
"port": 5000,
|
||||
"websocket_port": 8765,
|
||||
"debug": false,
|
||||
"log_level": "INFO"
|
||||
},
|
||||
"feishu": {
|
||||
"app_id": "",
|
||||
"app_secret": "",
|
||||
"app_token": "",
|
||||
"table_id": "",
|
||||
"status": "active",
|
||||
"sync_limit": 10,
|
||||
"auto_sync_interval": 0
|
||||
},
|
||||
"ai_accuracy": {
|
||||
"auto_approve_threshold": 0.95,
|
||||
"use_human_resolution_threshold": 0.9,
|
||||
"manual_review_threshold": 0.8,
|
||||
"ai_suggestion_confidence": 0.95,
|
||||
"human_resolution_confidence": 0.9,
|
||||
"prefer_human_when_low_accuracy": true,
|
||||
"enable_auto_approval": true,
|
||||
"enable_human_fallback": true
|
||||
},
|
||||
"system": {
|
||||
"backup_enabled": true,
|
||||
"backup_interval": 24,
|
||||
"max_backup_files": 7,
|
||||
"cache_enabled": true,
|
||||
"cache_ttl": 3600,
|
||||
"monitoring_enabled": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user