@agentforge-ai/cli 0.3.2 → 0.4.0

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.
@@ -1,22 +1,62 @@
1
1
  import { Agent } from '@agentforge-ai/core';
2
2
 
3
3
  /**
4
- * A sample AgentForge agent.
4
+ * AgentForge Your First Agent
5
5
  *
6
- * This is a starting point for your own agent. Modify the instructions,
7
- * model, and tools to suit your needs.
6
+ * This starter agent demonstrates how to configure an AI agent with
7
+ * AgentForge's multi-provider support. You can use OpenAI, OpenRouter,
8
+ * Anthropic, Google, or xAI as your LLM provider.
9
+ *
10
+ * Set your provider and API key in the .env file:
11
+ * OPENAI_API_KEY=sk-...
12
+ * OPENROUTER_API_KEY=sk-or-...
13
+ * ANTHROPIC_API_KEY=sk-ant-...
8
14
  */
15
+
16
+ // ─── Main Agent ────────────────────────────────────────────────────────
9
17
  const myAgent = new Agent({
10
18
  id: 'my-first-agent',
11
19
  name: 'My First Agent',
12
20
  instructions: `You are a helpful AI assistant built with AgentForge.
13
21
  You can help users with a variety of tasks.
14
- Be concise, accurate, and friendly.`,
22
+ Be concise, accurate, and friendly.
23
+
24
+ When you don't know something, say so honestly.
25
+ When asked about your capabilities, mention that you're powered by AgentForge.`,
26
+
27
+ // Choose your model — supports multiple providers:
28
+ // OpenAI: "openai:gpt-4o-mini", "openai:gpt-4o"
29
+ // OpenRouter: "openrouter:anthropic/claude-3.5-sonnet", "openrouter:google/gemini-pro"
30
+ // Anthropic: "anthropic:claude-3-5-sonnet-20241022"
31
+ // Google: "google:gemini-2.0-flash"
32
+ // xAI: "xai:grok-2"
15
33
  model: 'openai:gpt-4o-mini',
16
34
  });
17
35
 
18
36
  export default myAgent;
19
37
 
20
- // Example usage:
38
+ // ─── Example: Agent with Custom Tools ──────────────────────────────────
39
+ // import { z } from 'zod';
40
+ //
41
+ // const researchAgent = new Agent({
42
+ // id: 'research-agent',
43
+ // name: 'Research Agent',
44
+ // instructions: 'You are a research assistant that helps find and summarize information.',
45
+ // model: 'openrouter:anthropic/claude-3.5-sonnet',
46
+ // tools: [
47
+ // {
48
+ // name: 'calculator',
49
+ // description: 'Perform mathematical calculations',
50
+ // inputSchema: z.object({ expression: z.string() }),
51
+ // outputSchema: z.object({ result: z.number() }),
52
+ // handler: async (input) => {
53
+ // const result = Function('"use strict"; return (' + input.expression + ')')();
54
+ // return { result };
55
+ // },
56
+ // },
57
+ // ],
58
+ // });
59
+
60
+ // ─── Example: Using the Agent ──────────────────────────────────────────
21
61
  // const response = await myAgent.generate('Hello, what can you do?');
22
62
  // console.log(response.text);