mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
Merge pull request #17534 from colinlin-stripe/colinlin/opus-budget-thinking
[fix] parse <budget:thinking> blocks for opus 4.5
This commit is contained in:
commit
b6867184a8
2 changed files with 6 additions and 1 deletions
|
|
@ -1071,7 +1071,7 @@ def _parse_content_for_reasoning(
|
|||
return None, message_text
|
||||
|
||||
reasoning_match = re.match(
|
||||
r"<(?:think|thinking)>(.*?)</(?:think|thinking)>(.*)", message_text, re.DOTALL
|
||||
r"<(?:think|thinking|budget:thinking)>(.*?)</(?:think|thinking|budget:thinking)>(.*)", message_text, re.DOTALL
|
||||
)
|
||||
|
||||
if reasoning_match:
|
||||
|
|
|
|||
|
|
@ -1043,6 +1043,11 @@ def test_convert_model_response_object():
|
|||
"I am thinking here",
|
||||
"The sky is a canvas of blue",
|
||||
),
|
||||
(
|
||||
"<budget:thinking>I am thinking here</budget:thinking>The sky is a canvas of blue",
|
||||
"I am thinking here",
|
||||
"The sky is a canvas of blue",
|
||||
),
|
||||
("I am a regular response", None, "I am a regular response"),
|
||||
],
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue