fix: 移除 response_format=json_object,改为依赖 prompt 约束
回退上一条推断式修复(模型名匹配没有官方依据)。 改为在 script_service 调用层直接移除该参数: - system prompt 已明确要求'只输出纯 JSON' - safe_parse_ai_json_response 已做容错解析和 markdown 清洗 - 不依赖特定模型对 response_format 的支持
This commit is contained in:
@@ -181,12 +181,7 @@ class VolcengineProvider(LLMProvider):
|
||||
if "reasoning_effort" in kwargs:
|
||||
request_params["extra_body"] = {"reasoning_effort": kwargs["reasoning_effort"]}
|
||||
|
||||
# 豆包系列模型不支持 response_format.type="json_object"
|
||||
# 仅对兼容模型(如 DeepSeek、GPT 系列)启用
|
||||
if (
|
||||
kwargs.get("response_format") == "json_object"
|
||||
and "doubao" not in (model_id or "").lower()
|
||||
):
|
||||
if kwargs.get("response_format") == "json_object":
|
||||
request_params["response_format"] = {"type": "json_object"}
|
||||
|
||||
# 调用 API
|
||||
|
||||
Reference in New Issue
Block a user