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

fix: drop unsupported non-whitespace characters for real when calling… #7484

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

WolframRavenwolf
Copy link

… anthropic with stop sequences

Title

Anthropic doesn't allow whitespace characters as stop-sequences. This fix expands upon a previous implementation and fully fixes the issue.

Relevant issues

Expands upon #3436 and fixes #3286 for real.

Type

🐛 Bug Fix

Changes

The original fix only applied to a single newline, which didn't help when other or multiple kinds of whitespace were used. This new implementation of the old fix now covers any and all types and numbers of whitespace, solving the issue completely.

Copy link

vercel bot commented Dec 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 31, 2024 5:55pm

@@ -257,17 +258,13 @@ def _map_stop_sequences(
) -> Optional[List[str]]:
new_stop: Optional[List[str]] = None
if isinstance(stop, str):
if (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

[Bug]: anthropic stop_sequences: each stop sequence must contain non-whitespace
2 participants