feat: add summary using Anthropic API
This commit is contained in:
13
utils/anthropic.ts
Normal file
13
utils/anthropic.ts
Normal 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 }]
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user