mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
fix(anthropic): leave a message that is not an object to litellm's validation under main's breakpoint strip
This commit is contained in:
parent
5dbc8de52b
commit
69117370f2
1 changed files with 4 additions and 1 deletions
|
|
@ -907,7 +907,10 @@ class AnthropicCacheControlHook(CustomPromptManagement):
|
|||
)
|
||||
)
|
||||
processed_messages = copy.deepcopy(
|
||||
[without_prompt_cache_breakpoints(message) for message in messages]
|
||||
[
|
||||
without_prompt_cache_breakpoints(message) if isinstance(message, dict) else message # pyright: ignore[reportUnnecessaryIsInstance] # a caller can send a non-object message
|
||||
for message in messages
|
||||
]
|
||||
if not openai_dialect and message_points and _translates_prompt_cache_breakpoint(model, custom_llm_provider)
|
||||
else messages
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue