initial commit: slides + practica_resueltos + README

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-29 11:50:55 +02:00
commit 0aff31e2d3
203 changed files with 23207 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
---
layout: default
---
# Few-Shot Prompting
<div class="mt-8 text-sm">
<v-click>
<div class="mb-6">
**Few-shot**: Dar ejemplos al LLM para que aprenda el patrón deseado
</div>
</v-click>
<v-click>
```typescript
import { ChatPromptTemplate } from "@langchain/core/prompts";
const template = ChatPromptTemplate.fromMessages([
["system", "Clasifica el sentimiento de tweets"],
["human", "Me encanta este producto!"],
["ai", "positivo"],
["human", "No funciona bien :("],
["ai", "negativo"],
["human", "{tweet}"] // El tweet a clasificar
]);
const response = await model.invoke(
await template.invoke({ tweet: "Buena experiencia" })
);
// → "positivo"
```
</v-click>
</div>