diff --git a/README.md b/README.md index 435e592..c54f3c6 100644 --- a/README.md +++ b/README.md @@ -156,6 +156,8 @@ app/ | `TOOLS_CODE_EXECUTION_ENABLED` | 可选,是否启用代码执行工具 | `false` | | `SHOW_SEARCH_LINK` | 可选,是否在响应中显示搜索结果链接 | `true` | | `SHOW_THINKING_PROCESS` | 可选,是否显示模型思考过程 | `true` | +| `THINKING_MODELS` | 可选,支持思考功能的模型列表 | `[]` | +| `THINKING_BUDGET_MAP` | 可选,思考功能预算映射 (模型名:预算值) | `{}` | | `BASE_URL` | 可选,Gemini API 基础 URL,默认无需修改 | `https://generativelanguage.googleapis.com/v1beta` | | `MAX_FAILURES` | 可选,允许单个key失败的次数 | `3` | | `MAX_RETRIES` | 可选,API 请求失败时的最大重试次数 | `3` | diff --git a/app/service/stats_service.py b/app/service/stats_service.py index faf30f9..45caa17 100644 --- a/app/service/stats_service.py +++ b/app/service/stats_service.py @@ -107,7 +107,9 @@ async def get_api_call_details(period: str) -> list[dict]: # Convert results to list of dicts and map status_code details = [] for row in results: - status = 'success' if 200 <= row['status_code'] < 300 else 'failure' + status = 'failure' # 默认状态为 failure,如果 status_code 有效且在 200-299 范围内则更新为 success + if row['status_code'] is not None: # 检查 status_code 是否为空 + status = 'success' if 200 <= row['status_code'] < 300 else 'failure' details.append({ "timestamp": row['timestamp'].isoformat(), # Use ISO format for JS compatibility "key": row['key'],