We should detect that the user entered an anthropic model and instead use anthropic's api:
import Anthropic from '@anthropic-ai/sdk';
const client = new Anthropic({
apiKey: process.env['ANTHROPIC_API_KEY'], // This is the default and can be omitted
});
async function main() {
const message = await client.messages.create({
max_tokens: 1024,
messages: [{ role: 'user', content: 'Hello, Claude' }],
model: 'claude-3-opus-20240229',
});
console.log(message.content);
}
It's currently on version 0.29.0. We can detect it's an anthropic model by checking if it contains any of the strings: claude/sonnet/haiku/opus for now.
We should detect that the user entered an anthropic model and instead use anthropic's api:
It's currently on version 0.29.0. We can detect it's an anthropic model by checking if it contains any of the strings: claude/sonnet/haiku/opus for now.