import { Pipeline } from '@astack-tech/core';
import { ModelProvider } from '@astack-tech/integrations';
const apiKey = process.env['DEEPSEEK_API_KEY'];
if (apiKey === undefined || apiKey === '') {
throw new Error('Set DEEPSEEK_API_KEY to run this example.');
}
const model = new ModelProvider.Deepseek({ apiKey, systemPrompt: 'Answer in one sentence.' });
console.log(await model.run('What is flow-based programming?'));
const reply = await model.chatCompletion([
{ role: 'user', content: 'Name one benefit of small components.' },
]);
console.log(reply.content);
const pipeline = new Pipeline();
pipeline.addComponent('llm', model);
console.log(await pipeline.run('llm.prompt', 'What is a port?', 'llm.completion'));