triage/config.py
iomgaa 4d08c52e53 重构:优化评价器模块并统一代码规范
主要变更:
- 重命名PreDiagnosisEvaluation为Evaluator,统一术语
- 调整评分范围从-5到5改为0到5,优化评价标准
- 重构代码结构,按照disease_analyst标准实现
- 添加必需的run和build_prompt函数
- 更新配置文件,支持gpt-oss:latest模型
- 完善Claude指导文档和代理规范

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 21:42:05 +08:00

90 lines
2.5 KiB
Python

import os
API_KEY = "sk-263038d4bf4e46a0bed16532587cff40"
# {project_root}/medsynthai
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# LLM model configuration based on agno
LLM_CONFIG = {
"deepseek": {
"class": "DeepSeek",
"params": {
"id": "deepseek-chat",
"api_key": API_KEY,
"base_url": "https://api.deepseek.com"
}
},
"gpt-oss:latest": {
"class": "Ollama",
"params": {
"id": "gpt-oss:latest",
"host": "192.168.31.228",
"options": {"think": False} # 关闭思考模式
}
},
"deepseek-v3": {
"class": "OpenAILike",
"params": {
"id": "deepseek-v3",
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": API_KEY
}
},
"deepseek-r1": {
"class": "OpenAILike",
"params": {
"id": "deepseek-r1",
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": API_KEY
}
},
"qwen-max": {
"class": "OpenAILike",
"params": {
"id": "qwen-max",
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": API_KEY
}
},
"qwen-vl-max": {
"class": "OpenAILike", # 使用OpenAI兼容类
"params": {
"id": "qwen-vl-max",
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1", # OpenAI兼容端点 # 降低随机性,提高结果一致性
"api_key": API_KEY
}
},
"aliyun": {
"class": "OpenAILike",
"params": {
"id": "qwen-max", # 默认使用qwen-max模型
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": API_KEY
}
}
}
AGENT_CONFIG = {
"medical_image_analysis_agent": "qwen-vl-max"
}
RAG_CONFIG = {
"lightrag": {
"working_dir": "./Vector_DB_Med",
"tokenizer_name": "trueto/medbert-base-chinese",
"model_name": "trueto/medbert-base-chinese",
"embedding_dim": 768,
"max_token_size": 512
},
"chroma_db": {
"api_key": API_KEY,
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"collection_name": "doctor",
"batch_size": 100,
"chroma_db_path": os.path.join(BASE_DIR, "static/rag/chroma_db"),
"csv_path": os.path.join(BASE_DIR, "static/files/zhongkang_doctor_list.csv")
}
}