import Anthropic from '@anthropic-ai/sdk';
import * as dotenv from 'dotenv';

dotenv.config();

const anthropic = new Anthropic({
  apiKey: process.env.CLAUDE_API_KEY,
});

export const getClaudeClient = () => {
  return {
    generate: async (prompt: string) => {
      const response = await anthropic.messages.create({
        model: 'claude-3-opus-20240229',
        max_tokens: 2048,
        messages: [{ role: 'user', content: prompt }],
      });
      return response.content[0].text;
    },
  };
};
