initial commit: slides + practica_resueltos + README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# Usar Ollama con LangChain.js
|
||||
|
||||
<div class="text-sm mt-4">
|
||||
|
||||
<v-click>
|
||||
|
||||
## 📦 Instalación
|
||||
|
||||
```bash
|
||||
# 1. Descargar e instalar Ollama
|
||||
# https://ollama.com/download
|
||||
|
||||
# 2. Descargar un modelo
|
||||
ollama pull llama3.2
|
||||
|
||||
# 3. Instalar paquete LangChain
|
||||
npm install @langchain/ollama
|
||||
```
|
||||
|
||||
</v-click>
|
||||
|
||||
<v-click>
|
||||
|
||||
## 💻 Código
|
||||
|
||||
```typescript
|
||||
import { ChatOllama } from "@langchain/ollama";
|
||||
|
||||
const model = new ChatOllama({
|
||||
model: "llama3.2",
|
||||
baseUrl: "http://localhost:11434",
|
||||
});
|
||||
|
||||
const response = await model.invoke("¿Qué es LangChain?");
|
||||
console.log(response.content);
|
||||
```
|
||||
|
||||
</v-click>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user