@amitdeshmukh/ax-crew 5.0.0 → 7.0.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,6 +1,6 @@
1
1
  import { AxAgent, AxAI } from "@ax-llm/ax";
2
2
  import type { AxSignature, AxAgentic, AxFunction, AxProgramForwardOptions, AxProgramStreamingForwardOptions, AxGenStreamingOut } from "@ax-llm/ax";
3
- import type { StateInstance, FunctionRegistryType, UsageCost, CrewConfigInput, MCPTransportConfig } from "../types.js";
3
+ import type { StateInstance, FunctionRegistryType, UsageCost, AxCrewConfig, AxCrewOptions, MCPTransportConfig } from "../types.js";
4
4
  declare class StatefulAxAgent extends AxAgent<any, any> {
5
5
  state: StateInstance;
6
6
  axai: any;
@@ -39,21 +39,39 @@ declare class StatefulAxAgent extends AxAgent<any, any> {
39
39
  resetMetrics(): void;
40
40
  }
41
41
  /**
42
- * Represents a crew of agents with shared state functionality.
42
+ * AxCrew orchestrates a set of Ax agents that share state,
43
+ * tools (functions), optional MCP servers, streaming, and a built-in metrics
44
+ * registry for tokens, requests, and estimated cost.
45
+ *
46
+ * Typical usage:
47
+ * const crew = new AxCrew(config, AxCrewFunctions)
48
+ * await crew.addAllAgents()
49
+ * const planner = crew.agents?.get("Planner")
50
+ * const res = await planner?.forward({ task: "Plan something" })
51
+ *
52
+ * Key behaviors:
53
+ * - Validates and instantiates agents from a config-first model
54
+ * - Shares a mutable state object across all agents in the crew
55
+ * - Supports sub-agents and a function registry per agent
56
+ * - Tracks per-agent and crew-level metrics via MetricsRegistry
57
+ * - Provides helpers to add agents (individually, a subset, or all) and
58
+ * to reset metrics/costs when needed
43
59
  */
44
60
  declare class AxCrew {
45
61
  private crewConfig;
62
+ private options?;
46
63
  functionsRegistry: FunctionRegistryType;
47
64
  crewId: string;
48
65
  agents: Map<string, StatefulAxAgent> | null;
49
66
  state: StateInstance;
50
67
  /**
51
68
  * Creates an instance of AxCrew.
52
- * @param {CrewConfigInput} crewConfig - Either a path to the agent config file or a JSON object with crew configuration.
69
+ * @param {AxCrewConfig} crewConfig - JSON object with crew configuration.
53
70
  * @param {FunctionRegistryType} [functionsRegistry={}] - The registry of functions to use in the crew.
71
+ * @param {AxCrewOptions} [options] - Optional settings for the crew (e.g., telemetry).
54
72
  * @param {string} [crewId=uuidv4()] - The unique identifier for the crew.
55
73
  */
56
- constructor(crewConfig: CrewConfigInput, functionsRegistry?: FunctionRegistryType, crewId?: string);
74
+ constructor(crewConfig: AxCrewConfig, functionsRegistry?: FunctionRegistryType, options?: AxCrewOptions, crewId?: string);
57
75
  /**
58
76
  * Factory function for creating an agent.
59
77
  * @param {string} agentName - The name of the agent to create.
@@ -176,27 +176,45 @@ class StatefulAxAgent extends AxAgent {
176
176
  }
177
177
  }
178
178
  /**
179
- * Represents a crew of agents with shared state functionality.
179
+ * AxCrew orchestrates a set of Ax agents that share state,
180
+ * tools (functions), optional MCP servers, streaming, and a built-in metrics
181
+ * registry for tokens, requests, and estimated cost.
182
+ *
183
+ * Typical usage:
184
+ * const crew = new AxCrew(config, AxCrewFunctions)
185
+ * await crew.addAllAgents()
186
+ * const planner = crew.agents?.get("Planner")
187
+ * const res = await planner?.forward({ task: "Plan something" })
188
+ *
189
+ * Key behaviors:
190
+ * - Validates and instantiates agents from a config-first model
191
+ * - Shares a mutable state object across all agents in the crew
192
+ * - Supports sub-agents and a function registry per agent
193
+ * - Tracks per-agent and crew-level metrics via MetricsRegistry
194
+ * - Provides helpers to add agents (individually, a subset, or all) and
195
+ * to reset metrics/costs when needed
180
196
  */
181
197
  class AxCrew {
182
198
  crewConfig;
199
+ options;
183
200
  functionsRegistry = {};
184
201
  crewId;
185
202
  agents;
186
203
  state;
187
204
  /**
188
205
  * Creates an instance of AxCrew.
189
- * @param {CrewConfigInput} crewConfig - Either a path to the agent config file or a JSON object with crew configuration.
206
+ * @param {AxCrewConfig} crewConfig - JSON object with crew configuration.
190
207
  * @param {FunctionRegistryType} [functionsRegistry={}] - The registry of functions to use in the crew.
208
+ * @param {AxCrewOptions} [options] - Optional settings for the crew (e.g., telemetry).
191
209
  * @param {string} [crewId=uuidv4()] - The unique identifier for the crew.
192
210
  */
193
- constructor(crewConfig, functionsRegistry = {}, crewId = uuidv4()) {
211
+ constructor(crewConfig, functionsRegistry = {}, options, crewId = uuidv4()) {
194
212
  // Basic validation of crew configuration
195
213
  if (!crewConfig || typeof crewConfig !== 'object' || !('crew' in crewConfig)) {
196
214
  throw new Error('Invalid crew configuration');
197
215
  }
198
216
  // Validate each agent in the crew
199
- crewConfig.crew.forEach(agent => {
217
+ crewConfig.crew.forEach((agent) => {
200
218
  if (!agent.name || agent.name.trim() === '') {
201
219
  throw new Error('Agent name cannot be empty');
202
220
  }
@@ -204,6 +222,7 @@ class AxCrew {
204
222
  this.crewConfig = crewConfig;
205
223
  this.functionsRegistry = functionsRegistry;
206
224
  this.crewId = crewId;
225
+ this.options = options;
207
226
  this.agents = new Map();
208
227
  this.state = createState(crewId);
209
228
  // Make crewId discoverable to metrics
@@ -217,7 +236,7 @@ class AxCrew {
217
236
  */
218
237
  createAgent = async (agentName) => {
219
238
  try {
220
- const agentConfig = await parseAgentConfig(agentName, this.crewConfig, this.functionsRegistry, this.state);
239
+ const agentConfig = await parseAgentConfig(agentName, this.crewConfig, this.functionsRegistry, this.state, this.options);
221
240
  // Destructure with type assertion
222
241
  const { ai, name, description, signature, functions, subAgentNames, examples, tracker } = agentConfig;
223
242
  // Get subagents for the AI agent
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Built-in function registry for AxCrew agents.
3
+ *
4
+ * Contains common utility tools/functions that can be referenced by name from
5
+ * agent configs (e.g., "functions": ["CurrentDateTime", "DaysBetweenDates"]).
6
+ * You can pass this object to the AxCrew constructor or merge with your
7
+ * own registry.
8
+ * Example:
9
+ * const crew = new AxCrew(config, AxCrewFunctions); or
10
+ * const crew = new AxCrew(config, { ...AxCrewFunctions, ...myFunctions });
11
+ */
1
12
  declare const AxCrewFunctions: {
2
13
  CurrentDateTime: import("@ax-llm/ax").AxFunction;
3
14
  DaysBetweenDates: import("@ax-llm/ax").AxFunction;
@@ -1,5 +1,15 @@
1
1
  import { CurrentDateTime, DaysBetweenDates } from './dateTime.js';
2
- // Built-in functions
2
+ /**
3
+ * Built-in function registry for AxCrew agents.
4
+ *
5
+ * Contains common utility tools/functions that can be referenced by name from
6
+ * agent configs (e.g., "functions": ["CurrentDateTime", "DaysBetweenDates"]).
7
+ * You can pass this object to the AxCrew constructor or merge with your
8
+ * own registry.
9
+ * Example:
10
+ * const crew = new AxCrew(config, AxCrewFunctions); or
11
+ * const crew = new AxCrew(config, { ...AxCrewFunctions, ...myFunctions });
12
+ */
3
13
  const AxCrewFunctions = {
4
14
  CurrentDateTime,
5
15
  DaysBetweenDates
package/dist/index.d.ts CHANGED
@@ -1,15 +1,32 @@
1
1
  import { AxCrew } from './agents/index.js';
2
2
  import { AxCrewFunctions } from './functions/index.js';
3
- import type { CrewConfigInput, AgentConfig } from './types.js';
3
+ import type { AxCrewConfig, AgentConfig } from './types.js';
4
4
  import type { UsageCost, AggregatedMetrics, AggregatedCosts, StateInstance, FunctionRegistryType } from './types.js';
5
+ /**
6
+ * Metrics types and helpers for request counts, token usage, and estimated cost.
7
+ *
8
+ * Re-exports the metrics module for convenience:
9
+ * - Types: TokenUsage, MetricsSnapshot, etc.
10
+ * - Namespace: MetricsRegistry (record/snapshot/reset helpers)
11
+ */
5
12
  export * from './metrics/index.js';
13
+ /**
14
+ * MetricsRegistry provides functions to record requests, tokens, and cost,
15
+ * and to snapshot/reset metrics at agent or crew granularity.
16
+ */
6
17
  export { MetricsRegistry } from './metrics/index.js';
7
18
  /**
8
- * The configuration for an AxCrew.
9
- *
10
- * @property {AgentConfig[]} crew - The agents that make up the crew.
19
+ * Create and manage a crew of Ax agents that share state and metrics.
20
+ * See the `AxCrew` class for full documentation.
21
+ */
22
+ declare const _AxCrew: typeof AxCrew;
23
+ /**
24
+ * Built-in function registry with common tools that can be referenced by name
25
+ * from agent configs, or extended with your own functions.
11
26
  */
12
- interface AxCrewConfig {
13
- crew: AgentConfig[];
14
- }
15
- export { AxCrew, AxCrewFunctions, FunctionRegistryType, type AggregatedMetrics, type AggregatedCosts, type AgentConfig, type CrewConfigInput, type AxCrewConfig, type StateInstance, type UsageCost, };
27
+ declare const _AxCrewFunctions: typeof AxCrewFunctions;
28
+ export {
29
+ /** See class JSDoc on the `AxCrew` implementation. */
30
+ _AxCrew as AxCrew,
31
+ /** Built-in function registry; see file docs in `src/functions/index.ts`. */
32
+ _AxCrewFunctions as AxCrewFunctions, FunctionRegistryType, type AggregatedMetrics, type AggregatedCosts, type AgentConfig, type AxCrewConfig, type StateInstance, type UsageCost, };
package/dist/index.js CHANGED
@@ -1,5 +1,30 @@
1
1
  import { AxCrew } from './agents/index.js';
2
2
  import { AxCrewFunctions } from './functions/index.js';
3
+ /**
4
+ * Metrics types and helpers for request counts, token usage, and estimated cost.
5
+ *
6
+ * Re-exports the metrics module for convenience:
7
+ * - Types: TokenUsage, MetricsSnapshot, etc.
8
+ * - Namespace: MetricsRegistry (record/snapshot/reset helpers)
9
+ */
3
10
  export * from './metrics/index.js';
11
+ /**
12
+ * MetricsRegistry provides functions to record requests, tokens, and cost,
13
+ * and to snapshot/reset metrics at agent or crew granularity.
14
+ */
4
15
  export { MetricsRegistry } from './metrics/index.js';
5
- export { AxCrew, AxCrewFunctions, };
16
+ /**
17
+ * Create and manage a crew of Ax agents that share state and metrics.
18
+ * See the `AxCrew` class for full documentation.
19
+ */
20
+ const _AxCrew = AxCrew;
21
+ /**
22
+ * Built-in function registry with common tools that can be referenced by name
23
+ * from agent configs, or extended with your own functions.
24
+ */
25
+ const _AxCrewFunctions = AxCrewFunctions;
26
+ export {
27
+ /** See class JSDoc on the `AxCrew` implementation. */
28
+ _AxCrew as AxCrew,
29
+ /** Built-in function registry; see file docs in `src/functions/index.ts`. */
30
+ _AxCrewFunctions as AxCrewFunctions, };
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { AxFunction, AxSignature, AxModelConfig, AxMCPStreamableHTTPTransportOptions, AxProgramForwardOptions } from '@ax-llm/ax';
2
- export type Provider = 'openai' | 'anthropic' | 'google-gemini' | 'mistral' | 'groq' | 'cohere' | 'together' | 'deepseek' | 'ollama' | 'huggingface' | 'openrouter' | 'azure-openai' | 'reka' | 'x-grok';
1
+ import type { AxFunction, AxSignature, AxModelConfig, AxMCPStreamableHTTPTransportOptions, AxProgramForwardOptions, AxAIArgs } from '@ax-llm/ax';
2
+ export type Provider = AxAIArgs<any>['name'];
3
3
  /**
4
4
  * A state instance that is shared between agents.
5
5
  * This can be used to store data that becomes available to all agents and functions in an out-of-band manner.
@@ -177,9 +177,56 @@ interface AgentConfig {
177
177
  mcpServers?: Record<string, MCPTransportConfig>;
178
178
  }
179
179
  /**
180
- * The input type for the agent config. This can be a path to a JSON file or a JSON object.
180
+ * The configuration object for an AxCrew instance.
181
+ *
182
+ * @property {AgentConfig[]} crew - The agents that make up the crew.
183
+ * @example
184
+ * const config: AxCrewConfig = {
185
+ * crew: [
186
+ * {
187
+ * name: "Agent1",
188
+ * description: "Agent 1 description",
189
+ * signature: "signature",
190
+ * provider: "provider",
191
+ * providerKeyName: "providerKeyName",
192
+ * ai: {
193
+ * model: "model",
194
+ * temperature: 0,
195
+ * },
196
+ * options: {
197
+ * debug: true,
198
+ * },
199
+ * functions: ["function1", "function2"],
200
+ * agents: ["agent2"],
201
+ * },
202
+ * {
203
+ * name: "Agent2",
204
+ * description: "Agent 2 description",
205
+ * signature: "signature",
206
+ * provider: "provider",
207
+ * providerKeyName: "providerKeyName",
208
+ * ai: {
209
+ * model: "model",
210
+ * temperature: 0,
211
+ * }
212
+ * ]
213
+ * }
214
+ * const crew = new AxCrew(config);
181
215
  */
182
- type CrewConfigInput = string | {
216
+ interface AxCrewConfig {
183
217
  crew: AgentConfig[];
184
- };
185
- export { type AgentConfig, type CrewConfigInput, type AggregatedMetrics, type StateInstance, type FunctionRegistryType, type MCPStdioTransportConfig, type MCPHTTPSSETransportConfig, type MCPStreamableHTTPTransportConfig, type MCPTransportConfig, type ModelUsage, type ModelInfo, type UsageCost, type AggregatedCosts };
218
+ }
219
+ /**
220
+ * Options for the AxCrew instance, specifically allowing optional OpenTelemetry injection.
221
+ *
222
+ * @property {Object} [telemetry] - Telemetry configuration.
223
+ * @property {any} [telemetry.tracer] - OpenTelemetry Tracer instance.
224
+ * @property {any} [telemetry.meter] - OpenTelemetry Meter instance.
225
+ */
226
+ interface AxCrewOptions {
227
+ telemetry?: {
228
+ tracer?: any;
229
+ meter?: any;
230
+ };
231
+ }
232
+ export { type AgentConfig, type AxCrewConfig, type AxCrewOptions, type AggregatedMetrics, type StateInstance, type FunctionRegistryType, type MCPStdioTransportConfig, type MCPHTTPSSETransportConfig, type MCPStreamableHTTPTransportConfig, type MCPTransportConfig, type ModelUsage, type ModelInfo, type UsageCost, type AggregatedCosts };
@@ -2,6 +2,8 @@ import { AxCrew } from "../dist/index.js";
2
2
  import { AxCrewFunctions } from "../dist/functions/index.js";
3
3
  import type { AxCrewConfig } from "../dist/index.js";
4
4
  import type { Provider } from "../dist/types.js";
5
+ import dotenv from "dotenv";
6
+ dotenv.config();
5
7
 
6
8
  // Example agent configuration
7
9
  const agentConfig: AxCrewConfig = {
@@ -26,10 +28,10 @@ const agentConfig: AxCrewConfig = {
26
28
  name: "writer",
27
29
  description: "A writing agent that creates content",
28
30
  signature: "topic:string -> article:string",
29
- provider: "anthropic" as Provider,
30
- providerKeyName: "ANTHROPIC_API_KEY",
31
+ provider: "google-gemini" as Provider,
32
+ providerKeyName: "GEMINI_API_KEY",
31
33
  ai: {
32
- model: "claude-3-haiku-20240307",
34
+ model: "gemini-2.5-flash-lite",
33
35
  maxTokens: 4000,
34
36
  stream: true
35
37
  },
@@ -1,4 +1,5 @@
1
- import { AxCrew, AxCrewConfig } from "../dist/index.js";
1
+ import { AxCrew } from "../dist/index.js";
2
+ import type { AxCrewConfig } from "../dist/types.js";
2
3
 
3
4
  import dotenv from "dotenv";
4
5
  dotenv.config();
@@ -7,31 +8,23 @@ dotenv.config();
7
8
  const config = {
8
9
  crew: [
9
10
  {
10
- name: "MapsAgent",
11
- description: "A specialized agent with access to Google Maps APIs that can: geocode addresses to coordinates and vice versa, search for and get details about places, calculate travel distances and times between multiple locations, provide elevation data, and generate navigation directions between points.",
12
- prompt: "You are a precise geospatial assistant with expert knowledge of Google Maps APIs. Answer user queries by combining place search, geocoding, distance matrix, elevation, and directions. Provide concise, actionable answers, include travel mode assumptions, and cite uncertainties. When location is ambiguous, ask a brief clarifying question before proceeding.",
13
- signature: 'userQuery:string "a question to be answered" -> answer:string "the answer to the question"',
14
- provider: "anthropic",
15
- providerKeyName: "ANTHROPIC_API_KEY",
11
+ name: "Context7DocsAgent",
12
+ description: "A specialized agent with access to Context7 Docs APIs that can: search for and get details about API docs",
13
+ signature: 'apiDocQuery:string "a question to be answered" -> apiDocAnswer:string "the answer to the question"',
14
+ provider: "google-gemini",
15
+ providerKeyName: "GEMINI_API_KEY",
16
16
  ai: {
17
- model: "claude-3-5-sonnet-latest",
17
+ model: "gemini-2.5-pro",
18
18
  temperature: 0,
19
- maxTokens: 1000,
20
- stream: true
19
+ stream: false
21
20
  },
22
21
  options: {
23
22
  debug: true
24
23
  },
25
24
  "mcpServers": {
26
- "google-maps": {
25
+ "context7": {
27
26
  "command": "npx",
28
- "args": [
29
- "-y",
30
- "@modelcontextprotocol/server-google-maps"
31
- ],
32
- "env": {
33
- "GOOGLE_MAPS_API_KEY": process.env.GOOGLE_MAPS_API_KEY
34
- }
27
+ "args": ["-y", "@upstash/context7-mcp", "--api-key", process.env.CONTEXT7_API_KEY]
35
28
  }
36
29
  },
37
30
  },
@@ -41,35 +34,19 @@ const config = {
41
34
  prompt: "You are a manager agent that orchestrates tools and sub-agents. Read the user's objective, optionally produce a short plan, then call the MapsAgent when geospatial knowledge is needed. Keep answers direct and avoid extraneous commentary.",
42
35
  signature:
43
36
  'question:string "a question to be answered" -> answer:string "the answer to the question"',
44
- provider: "openai",
45
- providerKeyName: "OPENAI_API_KEY",
37
+ provider: "google-gemini",
38
+ providerKeyName: "GEMINI_API_KEY",
46
39
  ai: {
47
- model: "gpt-4o-mini",
40
+ model: "gemini-2.5-pro",
48
41
  maxTokens: 1000,
49
42
  temperature: 0,
50
- stream: true
43
+ stream: false
51
44
  },
52
45
  options: {
53
46
  debug: true,
54
47
  },
55
- agents: ["MapsAgent"]
56
- },
57
- {
58
- name: "MathAgent",
59
- description: "Solves math problems",
60
- signature:
61
- 'mathProblem:string "a sentence describing a math problem to be solved using Python code" -> solution:string "the answer to the math problem"',
62
- provider: "google-gemini",
63
- providerKeyName: "GEMINI_API_KEY",
64
- ai: {
65
- model: "gemini-1.5-pro",
66
- temperature: 0,
67
- stream: true
68
- },
69
- options: {
70
- debug: false,
71
- },
72
- },
48
+ agents: ["Context7DocsAgent"]
49
+ }
73
50
  ],
74
51
  };
75
52
 
@@ -81,9 +58,9 @@ await crew.addAllAgents();
81
58
 
82
59
  // Get agent instances
83
60
  const managerAgent = crew.agents?.get("ManagerAgent");
84
- const mapsAgent = crew.agents?.get("MapsAgent");
61
+ const context7DocsAgent = crew.agents?.get("Context7DocsAgent");
85
62
 
86
- const userQuery: string = "Are there any cool bars around the Eiffel Tower in Paris within 5 min walking distance";
63
+ const userQuery: string = "How do i create an agent in the @amitdeshmukh/ax-crew framework and configure it to use an MCP server? Give me a concrete example.";
87
64
 
88
65
  console.log(`\n\nQuestion: ${userQuery}`);
89
66
 
@@ -97,7 +74,7 @@ const main = async (): Promise<void> => {
97
74
  // Print metrics
98
75
  console.log("\nMetrics:\n+++++++++++++++++++++++++++++++++");
99
76
  console.log("Manager Agent Metrics:", JSON.stringify((managerAgent as any)?.getMetrics?.(), null, 2));
100
- console.log("Maps Agent Metrics:", JSON.stringify((mapsAgent as any)?.getMetrics?.(), null, 2));
77
+ console.log("Context7 Docs Agent Metrics:", JSON.stringify((context7DocsAgent as any)?.getMetrics?.(), null, 2));
101
78
  console.log("Crew Metrics:", JSON.stringify((crew as any)?.getCrewMetrics?.(), null, 2));
102
79
  };
103
80
 
@@ -1,19 +1,20 @@
1
1
  import { AxCrew } from "../dist/index.js";
2
+ import type { AxCrewConfig } from "../dist/types.js";
2
3
 
3
4
  import dotenv from "dotenv";
4
5
  dotenv.config();
5
6
 
6
7
  // Define the crew configuration
7
- const config = {
8
+ const config: AxCrewConfig = {
8
9
  crew: [
9
10
  {
10
11
  name: "DeepResearchAgent",
11
12
  description: "A specialized agent that performs deep research using perplexity",
12
- signature: 'researchTopic:string "a topic of interest" -> result:string "The result of the research"',
13
- provider: "openai",
14
- providerKeyName: "OPENAI_API_KEY",
13
+ signature: 'researchTopic:string "a topic of interest" -> researchResult:string "The result of the research"',
14
+ provider: "google-gemini",
15
+ providerKeyName: "GEMINI_API_KEY",
15
16
  ai: {
16
- model: "gpt-4.1",
17
+ model: "gemini-2.5-flash-lite",
17
18
  temperature: 0.1,
18
19
  },
19
20
  options: {
@@ -1,4 +1,5 @@
1
- import { AxCrew, AxCrewConfig } from "../dist/index.js";
1
+ import { AxCrew } from "../dist/index.js";
2
+ import type { AxCrewConfig } from "../dist/types.js";
2
3
 
3
4
  const crewConfig: AxCrewConfig = {
4
5
  crew: [
@@ -1,15 +1,16 @@
1
1
  import { AxCrew } from "../dist/index.js";
2
+ import type { AxCrewConfig } from "../dist/types.js";
2
3
 
3
4
  import dotenv from "dotenv";
4
5
  dotenv.config();
5
6
 
6
7
  // Define the crew configuration
7
- const config = {
8
+ const config: AxCrewConfig = {
8
9
  crew: [
9
10
  {
10
11
  name: "XSearchAgent",
11
12
  description: "A specialized agent that can search X (Twitter) posts for the latest news and updates about specific topics, people, or events. It can find trending posts, recent tweets, and real-time information from X platform.",
12
- signature: 'searchQuery:string "a search query" -> result:string "the response to the user query citing relevant sources including X posts and other web sources"',
13
+ signature: 'searchQuery:string "a search query" -> searchResults:string "the response to the user query citing relevant sources including X posts and other web sources"',
13
14
  provider: "grok",
14
15
  providerKeyName: "GROK_API_KEY",
15
16
  ai: {
@@ -55,8 +56,8 @@ const main = async (): Promise<void> => {
55
56
  if (response) {
56
57
  try {
57
58
  for await (const chunk of response) {
58
- if (chunk.delta && typeof chunk.delta === 'object' && 'results' in chunk.delta) {
59
- process.stdout.write(chunk.delta.results);
59
+ if (chunk.delta && typeof chunk.delta === 'object' && 'searchResults' in chunk.delta) {
60
+ process.stdout.write(chunk.delta.searchResults);
60
61
  }
61
62
  }
62
63
  console.log('\n');
@@ -1,5 +1,7 @@
1
1
  import { AxCrew } from "../dist/index.js";
2
2
  import type { AxCrewConfig } from "../src/index.js";
3
+ import dotenv from "dotenv";
4
+ dotenv.config();
3
5
 
4
6
  // Define the crew configuration
5
7
  const config: AxCrewConfig = {
@@ -12,11 +14,11 @@ const config: AxCrewConfig = {
12
14
  provider: "google-gemini",
13
15
  providerKeyName: "GEMINI_API_KEY",
14
16
  ai: {
15
- model: "gemini-1.5-pro",
17
+ model: "gemini-2.5-flash-lite",
16
18
  temperature: 0,
17
19
  },
18
20
  options: {
19
- debug: false,
21
+ debug: true,
20
22
  codeExecution: true,
21
23
  },
22
24
  },
@@ -25,10 +27,10 @@ const config: AxCrewConfig = {
25
27
  description: "Completes a user specified task",
26
28
  signature:
27
29
  'question:string "a question to be answered" -> answer:string "the answer to the question"',
28
- provider: "openai",
29
- providerKeyName: "OPENAI_API_KEY",
30
+ provider: "google-gemini",
31
+ providerKeyName: "GEMINI_API_KEY",
30
32
  ai: {
31
- model: "gpt-4o-mini",
33
+ model: "gemini-2.5-flash-lite",
32
34
  maxTokens: 1000,
33
35
  temperature: 0,
34
36
  },
@@ -15,7 +15,7 @@ const config: AxCrewConfig = {
15
15
  provider: "google-gemini",
16
16
  providerKeyName: "GEMINI_API_KEY",
17
17
  ai: {
18
- model: "gemini-2.0-flash",
18
+ model: "gemini-2.5-flash",
19
19
  maxTokens: 1000,
20
20
  temperature: 0,
21
21
  },
@@ -33,7 +33,7 @@ const config: AxCrewConfig = {
33
33
  provider: "google-gemini",
34
34
  providerKeyName: "GEMINI_API_KEY",
35
35
  ai: {
36
- model: "gemini-1.5-pro",
36
+ model: "gemini-2.5-pro",
37
37
  temperature: 0,
38
38
  },
39
39
  options: {