initial commit: slides ready + upgraded
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
# systemPrompt: Configurando el Comportamiento
|
||||
|
||||
<div class="mt-4 text-xs">
|
||||
|
||||
<v-click>
|
||||
|
||||
**String simple:**
|
||||
|
||||
```typescript
|
||||
const agent = createAgent({
|
||||
model: "mistral:mistral-large-latest",
|
||||
tools: [weatherTool],
|
||||
systemPrompt: "Eres un asistente meteorológico. Sé conciso y preciso.",
|
||||
});
|
||||
```
|
||||
|
||||
</v-click>
|
||||
|
||||
<v-click>
|
||||
|
||||
**SystemMessage (para features avanzados como cache de Anthropic):**
|
||||
|
||||
```typescript
|
||||
import { SystemMessage } from "langchain";
|
||||
|
||||
const agent = createAgent({
|
||||
model: "anthropic:claude-sonnet-4-6",
|
||||
tools: [weatherTool],
|
||||
systemPrompt: new SystemMessage({
|
||||
content: [
|
||||
{ type: "text", text: "Eres un experto en clima...", cache_control: { type: "ephemeral" } }
|
||||
],
|
||||
}),
|
||||
});
|
||||
```
|
||||
|
||||
</v-click>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user