From 44c0a7f63e471d3de1b8121010e65ef57d14ec37 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Sat, 23 Mar 2024 00:27:05 -0700 Subject: [PATCH] fix(factory.py): fix anthropic check --- litellm/llms/prompt_templates/factory.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index 5e918eb7fd..5bb5e1d0b1 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -700,13 +700,6 @@ def anthropic_messages_pt(messages: list): if assistant_content: new_messages.append({"role": "assistant", "content": assistant_content}) - if ( - msg_i < len(messages) - and messages[msg_i]["role"] != user_message_types - and messages[msg_i]["role"] != "assistant" - ): - raise Exception(f"Invalid role passed in - {messages[msg_i]}") - if new_messages[0]["role"] != "user": if litellm.modify_params: new_messages.insert(