mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
fix: prefix OpenAI model with 'responses/' when thinking is enabled
- Add model prefixing to route OpenAI thinking requests to Responses API - Fixes test failure where model should be 'responses/gpt-5.2' instead of 'gpt-5.2' - Ensures OpenAI models with thinking parameter use Responses API for reasoning summary - Prevents double-prefixing with existing 'responses/' check
This commit is contained in:
parent
c15632d626
commit
3c0a10f05a
1 changed files with 4 additions and 1 deletions
|
|
@ -64,7 +64,10 @@ class LiteLLMMessagesToCompletionTransformationHandler:
|
|||
|
||||
model = completion_kwargs.get("model")
|
||||
if isinstance(model, str) and model and not model.startswith("responses/"):
|
||||
reasoning_effort = completion_kwargs.get("reasoning_effort")
|
||||
# Prefix model with "responses/" to route to OpenAI Responses API
|
||||
completion_kwargs["model"] = f"responses/{model}"
|
||||
|
||||
reasoning_effort = completion_kwargs.get("reasoning_effort")
|
||||
if isinstance(reasoning_effort, str) and reasoning_effort:
|
||||
completion_kwargs["reasoning_effort"] = {
|
||||
"effort": reasoning_effort,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue