chore: 配置集中化、LLM 参数调整与 gitignore 更新
- config.example: 新增 MINERU_PREFER_V2、标题规则引擎、表单二次校正等配置项 - document_routes: DEV_MODE 判断统一收归 config.py - llm_utils: quick_yes_no max_tokens 10→128,避免截断过短回答 - knowledge/router: 路由 LLM 调用 max_tokens 100→512 - feedback: 反馈分析 LLM 调用 max_tokens 200→512 - .gitignore: 新增 scripts/ 和 plans/ 目录忽略规则 🤖 Generated with [Qoder][https://qoder.com]
This commit is contained in:
@@ -45,6 +45,7 @@ import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
from werkzeug.utils import secure_filename
|
||||
from auth.gateway import require_gateway_auth
|
||||
from config import DEV_MODE
|
||||
from core.status_codes import (
|
||||
UPLOAD_SUCCESS, BATCH_UPLOAD_SUCCESS, BAD_REQUEST, SUCCESS,
|
||||
NO_FILE, NO_FILE_SELECTED, NO_COLLECTION, NOT_FOUND,
|
||||
@@ -171,9 +172,9 @@ def serve_document_file(doc_path: str) -> Tuple[Any, int]:
|
||||
文件内容或错误响应
|
||||
|
||||
Note:
|
||||
仅在 DEV_MODE=true 时可用
|
||||
仅在 DEV_MODE=true 时可用(需在 .env 中显式设置)
|
||||
"""
|
||||
if os.environ.get('DEV_MODE', 'true').lower() == 'false':
|
||||
if not DEV_MODE:
|
||||
return error_response("FORBIDDEN", FORBIDDEN, "仅开发环境可用", http_status=403)
|
||||
|
||||
from config import DOCUMENTS_PATH
|
||||
|
||||
Reference in New Issue
Block a user