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

Bedrock: empty content for certain prompts with max_tokens 1 #399

Open
dandv opened this issue Apr 24, 2024 · 0 comments
Open

Bedrock: empty content for certain prompts with max_tokens 1 #399

dandv opened this issue Apr 24, 2024 · 0 comments
Assignees

Comments

@dandv
Copy link
Contributor

dandv commented Apr 24, 2024

import AnthropicBedrock from '@anthropic-ai/bedrock-sdk';

const client = new AnthropicBedrock();

async function main(prompt) {
  const message = await client.messages.create({
    max_tokens: 1,
    stream: false,
    messages: [{role: 'user', content: prompt}],
    model: 'anthropic.claude-3-sonnet-20240229-v1:0',
  });
  console.log('Response content: ', message.content);
}

await main('Explain quantum mechanics to a five year old');  // []  <-- ERROR
await main('Translate Hello into French and Spanish');  //  [ { type: 'text', text: 'Here' } ]
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

No branches or pull requests

3 participants