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(