@amitdeshmukh/ax-crew 4.1.2 → 6.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.
package/src/types.ts CHANGED
@@ -3,26 +3,13 @@ import type {
3
3
  AxSignature,
4
4
  AxModelConfig,
5
5
  AxMCPStreamableHTTPTransportOptions,
6
- AxProgramForwardOptions
6
+ AxProgramForwardOptions,
7
+ AxAIArgs
7
8
  } from '@ax-llm/ax';
8
9
 
9
- // Canonical provider slugs supported by ai() factory
10
- export type Provider =
11
- // Canonical slugs per docs
12
- | 'openai'
13
- | 'anthropic'
14
- | 'google-gemini'
15
- | 'mistral'
16
- | 'groq'
17
- | 'cohere'
18
- | 'together'
19
- | 'deepseek'
20
- | 'ollama'
21
- | 'huggingface'
22
- | 'openrouter'
23
- | 'azure-openai'
24
- | 'reka'
25
- | 'x-grok'
10
+ // Provider ids are derived from Ax's factory arg type so new providers added in Ax
11
+ // are picked up at compile time without updating AxCrew.
12
+ export type Provider = AxAIArgs<any>['name'];
26
13
 
27
14
  /**
28
15
  * A state instance that is shared between agents.
@@ -196,6 +183,11 @@ interface AgentConfig {
196
183
  ai: AxModelConfig & { model: string };
197
184
  debug?: boolean;
198
185
  apiURL?: string;
186
+ /**
187
+ * Provider-specific arguments that are forwarded to the underlying Ax factory.
188
+ * Example (azure-openai): { resourceName, deploymentName, version }
189
+ */
190
+ providerArgs?: Record<string, unknown>;
199
191
  options?: Partial<AxProgramForwardOptions<any>> & Record<string, any>;
200
192
  functions?: string[];
201
193
  agents?: string[];
@@ -204,13 +196,49 @@ interface AgentConfig {
204
196
  }
205
197
 
206
198
  /**
207
- * The input type for the agent config. This can be a path to a JSON file or a JSON object.
199
+ * The configuration object for an AxCrew instance.
200
+ *
201
+ * @property {AgentConfig[]} crew - The agents that make up the crew.
202
+ * @example
203
+ * const config: AxCrewConfig = {
204
+ * crew: [
205
+ * {
206
+ * name: "Agent1",
207
+ * description: "Agent 1 description",
208
+ * signature: "signature",
209
+ * provider: "provider",
210
+ * providerKeyName: "providerKeyName",
211
+ * ai: {
212
+ * model: "model",
213
+ * temperature: 0,
214
+ * },
215
+ * options: {
216
+ * debug: true,
217
+ * },
218
+ * functions: ["function1", "function2"],
219
+ * agents: ["agent2"],
220
+ * },
221
+ * {
222
+ * name: "Agent2",
223
+ * description: "Agent 2 description",
224
+ * signature: "signature",
225
+ * provider: "provider",
226
+ * providerKeyName: "providerKeyName",
227
+ * ai: {
228
+ * model: "model",
229
+ * temperature: 0,
230
+ * }
231
+ * ]
232
+ * }
233
+ * const crew = new AxCrew(config);
208
234
  */
209
- type CrewConfigInput = string | { crew: AgentConfig[] };
235
+ interface AxCrewConfig {
236
+ crew: AgentConfig[]
237
+ }
210
238
 
211
239
  export {
212
240
  type AgentConfig,
213
- type CrewConfigInput,
241
+ type AxCrewConfig,
214
242
  type AggregatedMetrics,
215
243
  type StateInstance,
216
244
  type FunctionRegistryType,
@@ -1,5 +0,0 @@
1
- interface ProviderApiKeys {
2
- [key: string]: string | undefined;
3
- }
4
- declare const PROVIDER_API_KEYS: ProviderApiKeys;
5
- export { PROVIDER_API_KEYS, };
@@ -1,30 +0,0 @@
1
- import dotenv from 'dotenv';
2
- dotenv.config();
3
- // AI API keys
4
- const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
5
- const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
6
- const AZURE_OPENAI_API_KEY = process.env.AZURE_OPENAI_API_KEY;
7
- const COHERE_API_KEY = process.env.COHERE_API_KEY;
8
- const DEEPSEEK_API_KEY = process.env.DEEPSEEK_API_KEY;
9
- const GEMINI_API_KEY = process.env.GEMINI_API_KEY;
10
- const GROQ_API_KEY = process.env.GROQ_API_KEY;
11
- const TOGETHER_API_KEY = process.env.TOGETHER_API_KEY;
12
- const MISTRAL_API_KEY = process.env.MISTRAL_API_KEY;
13
- const HUGGINGFACE_API_KEY = process.env.HUGGINGFACE_API_KEY;
14
- const REKA_API_KEY = process.env.REKA_API_KEY;
15
- const GROK_API_KEY = process.env.GROK_API_KEY;
16
- const PROVIDER_API_KEYS = {
17
- COHERE_API_KEY,
18
- GEMINI_API_KEY,
19
- OPENAI_API_KEY,
20
- AZURE_OPENAI_API_KEY,
21
- ANTHROPIC_API_KEY,
22
- DEEPSEEK_API_KEY,
23
- GROQ_API_KEY,
24
- TOGETHER_API_KEY,
25
- MISTRAL_API_KEY,
26
- HUGGINGFACE_API_KEY,
27
- REKA_API_KEY,
28
- GROK_API_KEY
29
- };
30
- export { PROVIDER_API_KEYS, };
@@ -1,40 +0,0 @@
1
- import dotenv from 'dotenv';
2
- dotenv.config();
3
-
4
- // AI API keys
5
- const ANTHROPIC_API_KEY: string | undefined = process.env.ANTHROPIC_API_KEY;
6
- const OPENAI_API_KEY: string | undefined = process.env.OPENAI_API_KEY;
7
- const AZURE_OPENAI_API_KEY: string | undefined = process.env.AZURE_OPENAI_API_KEY;
8
- const COHERE_API_KEY: string | undefined = process.env.COHERE_API_KEY;
9
- const DEEPSEEK_API_KEY: string | undefined = process.env.DEEPSEEK_API_KEY;
10
- const GEMINI_API_KEY: string | undefined = process.env.GEMINI_API_KEY;
11
- const GROQ_API_KEY: string | undefined = process.env.GROQ_API_KEY;
12
- const TOGETHER_API_KEY: string | undefined = process.env.TOGETHER_API_KEY;
13
- const MISTRAL_API_KEY: string | undefined = process.env.MISTRAL_API_KEY;
14
- const HUGGINGFACE_API_KEY: string | undefined = process.env.HUGGINGFACE_API_KEY;
15
- const REKA_API_KEY: string | undefined = process.env.REKA_API_KEY;
16
- const GROK_API_KEY: string | undefined = process.env.GROK_API_KEY;
17
- // Note: Ollama typically doesn't require an API key for local usage
18
-
19
- interface ProviderApiKeys {
20
- [key: string]: string | undefined;
21
- }
22
-
23
- const PROVIDER_API_KEYS: ProviderApiKeys = {
24
- COHERE_API_KEY,
25
- GEMINI_API_KEY,
26
- OPENAI_API_KEY,
27
- AZURE_OPENAI_API_KEY,
28
- ANTHROPIC_API_KEY,
29
- DEEPSEEK_API_KEY,
30
- GROQ_API_KEY,
31
- TOGETHER_API_KEY,
32
- MISTRAL_API_KEY,
33
- HUGGINGFACE_API_KEY,
34
- REKA_API_KEY,
35
- GROK_API_KEY
36
- };
37
-
38
- export {
39
- PROVIDER_API_KEYS,
40
- };