Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (1/3) #8247

Open
rokbenko opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working mlops user request

Comments

@rokbenko
Copy link

rokbenko commented Feb 4, 2025

What happened?

Using CrewAI (which utilizes LiteLLM in the background) with Anthropic LLM via Bedrock and setting the human_input parameter to a CrewAI task to True gives an error right after submitting (i.e., pressing the Enter button) feedback in the terminal:

Relevant part of the code:

/.../

@task
    def research_task(self) -> Task:
        return Task(
            config=self.tasks_config["research_task"],
            llm=LLM(
                model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
            ),
            expected_output="Expected output should be a Pydantic model of TaskOutput type with xxxxx, yyyyy and zzzzz properties.",
            output_pydantic=TaskOutput,
            human_input=True,
        )

/.../

Relevant log output

ERROR:root:LiteLLM call failed: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message
 Error during LLM call to classify human feedback: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (1/3)
ERROR:root:LiteLLM call failed: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message
 Error during LLM call to classify human feedback: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (2/3)
ERROR:root:LiteLLM call failed: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message
 Error during LLM call to classify human feedback: litellm.BadRequestError: Invalid Message bedrock requires at least one non-system message. Retrying... (3/3)
 Error processing feedback after multiple attempts.

Are you a ML Ops Team?

Yes

What LiteLLM version are you on ?

v1.57.4

Twitter / LinkedIn details

No response

@rokbenko rokbenko added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mlops user request
Projects
None yet
Development

No branches or pull requests

1 participant