feat: add summary using Anthropic API

This commit is contained in:
Riccardo
2024-09-20 02:52:16 +02:00
parent 1917b040eb
commit c0a669dc0a
8 changed files with 325 additions and 59 deletions

13
utils/anthropic.ts Normal file
View File

@@ -0,0 +1,13 @@
import Anthropic from '@anthropic-ai/sdk';
export async function message(text: string) {
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY
});
return anthropic.messages.create({
model: 'claude-3-5-sonnet-20240620',
max_tokens: 1024,
messages: [{ role: 'user', content: text }]
});
}