-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_injection_example.js
More file actions
32 lines (26 loc) · 955 Bytes
/
Copy pathapi_injection_example.js
File metadata and controls
32 lines (26 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Ejemplo de inyección del "bless_claude_token" en un entorno Node.js / Backend
// Ideal para automatizaciones, bots o extensiones.
const fs = require('fs');
const { Anthropic } = require('@anthropic-ai/sdk');
const anthropic = new Anthropic({
apiKey: process.env.ANTHROPIC_API_KEY,
});
async function main() {
// 1. Cargamos tu Skill maestra desde el archivo local
const systemPrompt = fs.readFileSync('prompt_maestro.md', 'utf8');
// 2. Inyectamos la directiva en la configuración del modelo
const msg = await anthropic.messages.create({
model: "claude-3-5-sonnet-20240620",
max_tokens: 4000,
temperature: 0.2, // Temperatura baja para respuestas técnicas estrictas
system: systemPrompt, // <-- Aquí entra la magia del Token Economist
messages: [
{
role: "user",
content: "Necesito crear la estructura base para mi nuevo proyecto."
}
]
});
console.log(msg.content);
}
main();