757 B
757 B
layout
| layout |
|---|
| default |
systemPrompt: Configurando el Comportamiento
String simple:
const agent = createAgent({
model: "mistral:mistral-large-latest",
tools: [weatherTool],
systemPrompt: "Eres un asistente meteorológico. Sé conciso y preciso.",
});
SystemMessage (para features avanzados como cache de Anthropic):
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" } }
],
}),
});