Skip to content

[Bug]: anthropic stop_sequences: each stop sequence must contain non-whitespace #3286

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

Closed
PrinceBaghel258025 opened this issue Apr 25, 2024 · 0 comments · Fixed by #3436 or #7484
Closed
Labels
bug Something isn't working

Comments

@PrinceBaghel258025
Copy link

What happened?

calling anthropic/claude-3-haiku-20240307 with openai sdk using litellm proxy models throws
stop_sequences: each stop sequence must contain non-whitespace

const runner = await llmClient.chat.completions.create({
    model: "haiku", // alias for anthropic/claude-3-haiku-20240307
    messages: [
      {
        role: "system",
        content: SYSTEM_PROMPT,
      },
      {
        role: "user",
        content: prompt,
      },
    ],
    max_tokens: 150,
    temperature: 0.7,
    stop: ["\n"],
  });

Relevant log output

BadRequestError: 400 AnthropicException - AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"stop_sequences: each stop sequence must contain non-whitespace"}}
at Function.generate (D:\Techno Culture\ella-backend\backend\mock-gpt\node_modules\openai\src\error.ts:67:14)
at OpenAI.makeStatusError (D:\Techno Culture\ella-backend\backend\mock-gpt\node_modules\openai\src\core.ts:381:21)
at OpenAI.makeRequest (D:\Techno Culture\ella-backend\backend\mock-gpt\node_modules\openai\src\core.ts:444:24)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async D:\Techno Culture\ella-backend\backend\mock-gpt\src\index.ts:258:18 {     
atus: 400,
aders: {
connection: 'keep-alive',
'content-length': '248',
'content-type': 'application/json',
date: 'Thu, 25 Apr 2024 04:19:01 GMT',
'strict-transport-security': 'max-age=15724800; includeSubDomains'

ror: {
message: 'AnthropicException - AnthropicException - {"type":"error","error":{"type":"invalid_request_error","message":"stop_sequences: each stop sequence must contain non-whitespace"}}',     
type: null,
param: null,
code: 400

de: 400,
ram: null,
pe: null

Twitter / LinkedIn details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant