easy-rag/tests/config.py

84 lines
2.3 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
测试配置文件
包含所有测试相关的配置参数
"""
# 服务器配置
BASE_URL = "http://localhost:8000"
HEALTH_CHECK_ENDPOINT = "/api/health"
UPLOAD_ENDPOINT = "/api/upload"
CHAT_ENDPOINT = "/api/chat"
DOCUMENTS_ENDPOINT = "/api/documents"
# 并发测试配置
CONCURRENT_CONFIG = {
"light": {
"health_checks": 3,
"uploads": 2,
"queries": 5,
"doc_lists": 2
},
"standard": {
"health_checks": 10,
"uploads": 5,
"queries": 10,
"doc_lists": 3
},
"stress": {
"health_checks": 20,
"uploads": 10,
"queries": 25,
"doc_lists": 5
}
}
# 性能阈值配置
PERFORMANCE_THRESHOLDS = {
"response_time": {
"health_check": 0.1, # 100ms
"upload": 5.0, # 5秒
"chat": 3.0, # 3秒
"doc_list": 0.5 # 500ms
},
"success_rate": {
"excellent": 0.95, # 95%
"good": 0.90, # 90%
"acceptable": 0.80 # 80%
},
"system": {
"cpu_warning": 80, # 80%
"memory_warning": 85 # 85%
}
}
# 测试数据配置
TEST_DATA = {
"sample_documents": [
"这是一个关于人工智能的测试文档。人工智能是计算机科学的重要分支。",
"机器学习是人工智能的核心技术之一,包括监督学习、无监督学习和强化学习。",
"深度学习使用神经网络模型来处理复杂的数据模式,在图像识别和自然语言处理方面表现出色。",
"自然语言处理NLP是让计算机理解和生成人类语言的技术。",
"计算机视觉技术使计算机能够识别和理解图像中的内容。"
],
"sample_questions": [
"什么是人工智能?",
"机器学习有哪些类型?",
"深度学习的应用领域有哪些?",
"自然语言处理的主要任务是什么?",
"计算机视觉技术的用途是什么?",
"AI和ML有什么区别",
"神经网络是如何工作的?",
"监督学习和无监督学习的区别?",
"强化学习的特点是什么?",
"图像识别技术的原理是什么?"
]
}
# 报告配置
REPORT_CONFIG = {
"output_dir": "test_reports",
"formats": ["md", "json"],
"include_charts": True,
"auto_cleanup": True
}