22 lines
578 B
TypeScript
22 lines
578 B
TypeScript
import { getModel } from '@push.rocks/smartai';
|
|
import { startChat } from '../ts_cli/index.js';
|
|
|
|
const apiKey = process.env.ANTHROPIC_TOKEN;
|
|
if (!apiKey) {
|
|
console.error('Missing ANTHROPIC_TOKEN environment variable.');
|
|
console.error('Usage: ANTHROPIC_TOKEN=sk-... tsx demo/demo.cli.ts');
|
|
process.exit(1);
|
|
}
|
|
|
|
const model = getModel({
|
|
provider: 'anthropic',
|
|
model: 'claude-sonnet-4-5-20250929',
|
|
apiKey,
|
|
});
|
|
|
|
await startChat({
|
|
model,
|
|
system: 'You are a friendly, concise assistant. Keep responses short unless asked for detail.',
|
|
modelName: 'Claude Sonnet',
|
|
});
|