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

[Feature]: Handle one system message for Bedrock Anthropic models more gracefully #6411

Closed
PragyaTripathi opened this issue Oct 23, 2024 · 1 comment · Fixed by #6421
Closed
Assignees
Labels
enhancement New feature or request

Comments

@PragyaTripathi
Copy link

PragyaTripathi commented Oct 23, 2024

The Feature

When one message with role system is passed, LiteLLM correctly extracts out system message to be sent as system parameter for Anthropic. However, it leaves with no messages left to LLM. The code throws exception which can be hard to decipher.
litellm/llms/prompt_templates/factory.py\", line 2401, in _bedrock_converse_messages_pt\n if messages[0].get(\"role\") is not None and messages[0][\"role\"] == \"assistant\":\nIndexError: list index out of range\n"

Motivation, pitch

LiteLLM's abstraction of message type passing for different LLMs is amazing. However, when there are issues like above, a more clear message would really help users to understand what has gone wrong and how to fix it.

Twitter / LinkedIn details

No response

@PragyaTripathi PragyaTripathi added the enhancement New feature or request label Oct 23, 2024
@krrishdholakia krrishdholakia self-assigned this Oct 24, 2024
@krrishdholakia
Copy link
Contributor

great point - will get this done today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants