import Anthropic from '@anthropic-ai/sdk';
const DEFAULT_MODEL = 'claude-sonnet-4-6';
export async function runWithAnthropic(prompt, model = DEFAULT_MODEL) {
    if (!process.env.ANTHROPIC_API_KEY) {
        throw new Error('ANTHROPIC_API_KEY is not set. Add it to your .env file.');
    }
    const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });
    const response = await client.messages.create({
        model,
        max_tokens: 8096,
        messages: [{ role: 'user', content: prompt }],
    });
    const textBlocks = response.content.filter((b) => b.type === 'text');
    return textBlocks.map((b) => b.text).join('');
}
