mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
fix(anthropic): sanitize think tags across pass-through handlers
This commit is contained in:
parent
256c85a733
commit
2a1d986645
1 changed files with 6 additions and 4 deletions
|
|
@ -323,7 +323,7 @@ async def anthropic_messages(
|
|||
response = await init_response
|
||||
else:
|
||||
response = init_response
|
||||
return response
|
||||
return _sanitize_think_tag_text_blocks(response)
|
||||
|
||||
|
||||
def validate_anthropic_api_metadata(metadata: Optional[Dict] = None) -> Optional[Dict]:
|
||||
|
|
@ -458,10 +458,12 @@ def anthropic_messages_handler(
|
|||
**kwargs,
|
||||
)
|
||||
if _should_route_to_responses_api(custom_llm_provider):
|
||||
return LiteLLMMessagesToResponsesAPIHandler.anthropic_messages_handler(
|
||||
**_shared_kwargs
|
||||
return _sanitize_think_tag_text_blocks(
|
||||
LiteLLMMessagesToResponsesAPIHandler.anthropic_messages_handler(
|
||||
**_shared_kwargs
|
||||
)
|
||||
)
|
||||
return (
|
||||
return _sanitize_think_tag_text_blocks(
|
||||
LiteLLMMessagesToCompletionTransformationHandler.anthropic_messages_handler(
|
||||
**_shared_kwargs
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue