完善问题集,修改缓存失效时间到一个月
This commit is contained in:
parent
7560853a83
commit
ea7881851d
File diff suppressed because it is too large
Load Diff
13
ruoyi-fastapi-backend/doc/qa_spec.md
Normal file
13
ruoyi-fastapi-backend/doc/qa_spec.md
Normal file
@ -0,0 +1,13 @@
|
||||
### QA问答的修改原则
|
||||
1. 子问题(sub_questions)原则 :
|
||||
|
||||
- 子问题的答案必须能在主答案中找到
|
||||
- 子问题不是对主问题的扩展或深入,而是从主答案中提取的、用户可能问的相关问题
|
||||
- 如果主答案内容简单(如只有年份、数字等),通常不需要子问题
|
||||
- 每个问题保留2-3个子问题(如果适用)
|
||||
|
||||
2. 变体(variations)原则 :
|
||||
|
||||
- 变体是主问题的不同表达方式
|
||||
- 只保留3个代表性的变体
|
||||
- 变体应覆盖常见的问法变化(如:去掉疑问词、简化表达、换种说法)
|
||||
@ -59,7 +59,7 @@ class SemanticCacheService:
|
||||
CACHE_PREFIX = "rag:semantic:cache"
|
||||
MAX_CACHE_SIZE = 1000 # 每个chat_id最大缓存条数
|
||||
SIMILARITY_THRESHOLD = 0.6 # 相似度阈值
|
||||
CACHE_TTL_HOURS = 24 # 缓存过期时间(小时)
|
||||
CACHE_TTL_HOURS = 720 # 缓存过期时间(小时,一个月)
|
||||
|
||||
def __init__(self, redis_client=None):
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user