chore: code cleaning (#21)

This commit is contained in:
Riccardo Senica
2024-11-23 09:13:15 +01:00
committed by GitHub
parent c4f03feffe
commit c300b2501d
31 changed files with 903 additions and 872 deletions

19
utils/anthropicClient.ts Normal file
View File

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