feat(llm): forward configured reasoning_effort to native LLM calls

Add an optional reasoning_effort field to LLMConfig (e.g. low/medium/high/max)
and forward it to litellm.acompletion in both chat() and chat_stream() when
set. Unset by default so non-OpenAI providers are unaffected. Callers can
still override per-call via kwargs.
This commit is contained in:
cgycorey
2026-08-01 11:05:58 +01:00
parent 5f5fbf432e
commit 02290b3798
3 changed files with 108 additions and 0 deletions
+4
View File
@@ -569,6 +569,8 @@ class LLMProvider:
"max_tokens": max_tok,
**kwargs,
}
if self.config.reasoning_effort and "reasoning_effort" not in call_kwargs:
call_kwargs["reasoning_effort"] = self.config.reasoning_effort
if self._api_base:
call_kwargs["api_base"] = self._api_base
if self._api_key:
@@ -715,6 +717,8 @@ class LLMProvider:
"stream": True,
**kwargs,
}
if self.config.reasoning_effort and "reasoning_effort" not in call_kwargs:
call_kwargs["reasoning_effort"] = self.config.reasoning_effort
if self._api_base:
call_kwargs["api_base"] = self._api_base
if self._api_key: