feat: add extra_body config for model-specific API parameters

Allows passing arbitrary parameters (e.g., enable_thinking, reasoning_effort)
to the LLM API request body via config.yaml, solving reasoning-only response
loops with models like Qwen 3.x without requiring code changes per model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 19:15:35 -05:00
parent 22f10cd8e9
commit 220c6613e4
3 changed files with 16 additions and 0 deletions

View File

@@ -151,6 +151,10 @@ class LLMClient:
if tools:
payload["tools"] = tools
# Merge model-specific extra parameters (e.g., enable_thinking, reasoning_effort)
if self._config.extra_body:
payload.update(self._config.extra_body)
try:
async with self._client.stream(
"POST", self._config.api_path, json=payload