fix(llm_client): remove response_format json_object for local LLM compatibility

LM Studio and Ollama do not support response_format: json_object,
only json_schema or text. This causes errors when using local LLMs.

The existing markdown fence cleanup logic in chat_json() already
handles parsing JSON from raw LLM output, making response_format
unnecessary. This change follows the same pattern as commit 985f89f
which improved compatibility with diverse model outputs.

Tested with: LM Studio + qwen3.5-9b (full predict pipeline passes)
This commit is contained in:
iml1s 2026-03-11 02:20:25 +08:00
parent 985f89f49a
commit 481cc009a3
1 changed files with 2 additions and 1 deletions

View File

@ -88,7 +88,8 @@ class LLMClient:
messages=messages,
temperature=temperature,
max_tokens=max_tokens,
response_format={"type": "json_object"}
# 不設 response_format 以相容 LM Studio / Ollama 等本地模型
# 依賴 prompt 中的 JSON 指示 + 下方的 markdown 清理邏輯
)
# 清理markdown代码块标记
cleaned_response = response.strip()