@koi-language/koi 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli/koi.js +14 -17
package/package.json
CHANGED
package/src/cli/koi.js
CHANGED
|
@@ -489,30 +489,27 @@ async function initProject(projectName) {
|
|
|
489
489
|
package "${projectName}"
|
|
490
490
|
|
|
491
491
|
role Worker { can execute }
|
|
492
|
-
role Lead { can delegate }
|
|
493
492
|
|
|
494
|
-
Agent
|
|
495
|
-
|
|
496
|
-
const name = args.name
|
|
497
|
-
return { message: "Hello from ${projectName}, " + name + "!" }
|
|
498
|
-
}
|
|
499
|
-
}
|
|
493
|
+
Agent Greeter : Worker {
|
|
494
|
+
llm default = { provider: "openai", model: "gpt-4o-mini" }
|
|
500
495
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
}
|
|
496
|
+
on greet(args: Json) {
|
|
497
|
+
playbook """
|
|
498
|
+
Generate a friendly and creative greeting for \${args.name}.
|
|
504
499
|
|
|
505
|
-
|
|
506
|
-
|
|
500
|
+
The greeting should:
|
|
501
|
+
- Start with "Hello"
|
|
502
|
+
- Include the person's name
|
|
503
|
+
- Add a motivational message or fun fact
|
|
504
|
+
- Be brief (2-3 sentences)
|
|
507
505
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
return result
|
|
506
|
+
Respond in JSON format:
|
|
507
|
+
{ "greeting": "your greeting here", "emoji": "an appropriate emoji" }
|
|
508
|
+
"""
|
|
512
509
|
}
|
|
513
510
|
}
|
|
514
511
|
|
|
515
|
-
run
|
|
512
|
+
run Greeter.greet({ name: "World" })
|
|
516
513
|
`;
|
|
517
514
|
|
|
518
515
|
fs.writeFileSync(path.join(projectPath, 'src', 'main.koi'), exampleCode);
|