Slide 42
Slide 42 text
Using a system & user prompt
Remove the last line in runPrompt() and replace it with the following:
const systemPrompt = `Here's the user's todo list:
${this.todos().map(todo => `* ${todo.text} (${todo.done ?
'done' : 'not done'})`).join('\n')}`;
await this.chatModule.generate([
{ role: 'system', content: systemPrompt },
{ role: 'user', content: userPrompt },
], (_, reply) => this.reply.set(reply));
Angular-Apps smarter machen mit Generative AI: lokal und offlinefähig
Chat with data LAB #7