feat(api): DeepSeek V4 Flash 默认、HTTP 错讯与多供应商分层
- 主链路默认 deepseek-v4-flash,DEEPSEEK_THINKING_ENABLED 对齐旧非思考 chat - 评测台评审装配迁入 adapters/llm(deepseek_eval_judge、zhipu_eval_judge)与 eval_judge_spec - 拆分 llm_http_openai_chat_errors 与 llm_errors(DeepSeek/智谱品牌与文档链),llm_call 支持 http_error_vendor - EvalJudgeService 按 spec.provider 传入 allm_json_call;评测台前端文案改为 V4 Flash - 更新 .env 示例与 staging/production 的 DEEPSEEK_MODEL;补充 openai/供应商错讯测试 Made-with: Cursor
This commit is contained in:
@@ -7,6 +7,7 @@ from dataclasses import dataclass
|
||||
from typing import Any, Generic, TypeVar
|
||||
|
||||
from app.core.config import settings
|
||||
from app.core.eval_judge_spec import EvalJudgeProvider
|
||||
from app.core.llm_call import LLMCallError, allm_json_call
|
||||
from app.core.logging import get_logger
|
||||
from app.features.evaluation.judge_schemas import (
|
||||
@@ -284,8 +285,10 @@ class EvalJudgeService:
|
||||
judge_llm: Any | None,
|
||||
*,
|
||||
context_window_tokens: int | None = None,
|
||||
http_error_vendor: EvalJudgeProvider = "deepseek",
|
||||
) -> None:
|
||||
self._llm = judge_llm
|
||||
self._http_error_vendor: EvalJudgeProvider = http_error_vendor
|
||||
self._ctx_tokens = int(
|
||||
context_window_tokens or settings.eval_judge_context_window_tokens
|
||||
)
|
||||
@@ -329,6 +332,7 @@ class EvalJudgeService:
|
||||
TurnJudgeOutput,
|
||||
max_tokens=_TURN_MAX,
|
||||
agent="EvalJudgeService.judge_turn",
|
||||
http_error_vendor=self._http_error_vendor,
|
||||
)
|
||||
except LLMCallError as e:
|
||||
logger.warning("turn judge failed: {}", e)
|
||||
@@ -354,6 +358,7 @@ class EvalJudgeService:
|
||||
ConversationJudgeOutput,
|
||||
max_tokens=_CONV_JUDGE_JSON_MAX,
|
||||
agent="EvalJudgeService.judge_conversation",
|
||||
http_error_vendor=self._http_error_vendor,
|
||||
)
|
||||
return JudgeCallResult(output=out)
|
||||
except LLMCallError as e:
|
||||
@@ -496,6 +501,7 @@ class EvalJudgeService:
|
||||
512, int(settings.eval_judge_memoir_completion_max_tokens)
|
||||
),
|
||||
agent="EvalJudgeService.judge_memoir",
|
||||
http_error_vendor=self._http_error_vendor,
|
||||
)
|
||||
return JudgeCallResult(output=out)
|
||||
except LLMCallError as e:
|
||||
|
||||
Reference in New Issue
Block a user