-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs_ia_agents.js
More file actions
26 lines (22 loc) · 787 Bytes
/
js_ia_agents.js
File metadata and controls
26 lines (22 loc) · 787 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
const { Agent, PraisonAIAgents } = require("praisonai");
const storyAgent = new Agent({
instructions:"Você é um contador de histórias criativo. Crie histórias envolventes.",
name: "Contador de Histórias",
});
const summarizeAgent = new Agent({
Instructions: "Você resume histórias em resumos breves e envolventes." ,
name: "Resumidor"
});
const agents = new PraisonAIAgents({
agents: [storyAgent , summarizeAgent],
tasks: [ "Criar uma história curta sobre uma floresta mágica",
"Resumir a história em 2 frases" ]
});
agents.start()
.then(responses => {
console.log('\n--- História ---:\n');
console.log(responses[0]);
console.log('\n--- Resumo ---\n');
console.log(responses[1]);
})
.catch(error => console.error('Error:', error));