@amitdeshmukh/ax-crew 2.0.2 → 2.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/.env.example +7 -1
- package/dist/agents/agentConfig.js +1 -0
- package/dist/agents/index.js +1 -0
- package/dist/config/index.js +8 -0
- package/package.json +1 -1
- package/src/agents/agentConfig.ts +1 -0
- package/src/agents/index.ts +1 -0
- package/src/config/index.ts +8 -0
- package/src/functions/index.ts +1 -2
- package/AmazonSalesData.csv +0 -101
- package/dist/agents/importFunctions.js +0 -25
- package/dist/functions/GoogleSearch.js +0 -28
- package/src/agents/importFunctions.ts +0 -31
- package/src/functions/GoogleSearch.ts +0 -34
package/.env.example
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
# API Keys
|
|
1
|
+
# API Keys (only set the ones you need)
|
|
2
2
|
OPENAI_API_KEY=sk-******************BlLB
|
|
3
3
|
ANTHROPIC_API_KEY=sk-ant-api********cQAA
|
|
4
|
+
GEMINI_API_KEY=sk-gemini-api********cQAA
|
|
5
|
+
COHERE_API_KEY=sk-cohere-api********cQAA
|
|
6
|
+
MISTRAL_API_KEY=sk-mistral-api********cQAA
|
|
7
|
+
GROK_API_KEY=sk-grok-api********cQAA
|
|
8
|
+
TOGETHER_API_KEY=sk-together-api********cQAA
|
|
9
|
+
HUGGINGFACE_API_KEY=sk-huggingface-api********cQAA
|
|
@@ -50,6 +50,7 @@ const parseAgentConfig = (agentConfigFilePath) => {
|
|
|
50
50
|
*
|
|
51
51
|
* @param {string} agentName - The identifier for the AI agent to be initialized.
|
|
52
52
|
* @param {string} agentConfigFilePath - The file path to the YAML configuration for the agent.
|
|
53
|
+
* @param {FunctionRegistryType} functions - The functions available to the agent.
|
|
53
54
|
* @param {Object} state - The state object for the agent.
|
|
54
55
|
* @returns {Object} An object containing the Agents AI instance, its name, description, signature, functions and subAgentList.
|
|
55
56
|
* @throws {Error} Throws an error if the agent configuration is missing, the provider is unsupported,
|
package/dist/agents/index.js
CHANGED
|
@@ -20,6 +20,7 @@ class AxCrew {
|
|
|
20
20
|
/**
|
|
21
21
|
* Creates an instance of AxCrew.
|
|
22
22
|
* @param {string} configFilePath - Path to the agent config file.
|
|
23
|
+
* @param {FunctionRegistryType} [functionsRegistry={}] - The registry of functions to use in the crew.
|
|
23
24
|
* @param {string} [crewId=uuidv4()] - The unique identifier for the crew.
|
|
24
25
|
*/
|
|
25
26
|
constructor(configFilePath, functionsRegistry = {}, crewId = uuidv4()) {
|
package/dist/config/index.js
CHANGED
|
@@ -5,10 +5,18 @@ const ANTHROPIC_API_KEY = process.env.ANTHROPIC_API_KEY;
|
|
|
5
5
|
const OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
|
6
6
|
const COHERE_API_KEY = process.env.COHERE_API_KEY;
|
|
7
7
|
const GEMINI_API_KEY = process.env.GEMINI_API_KEY;
|
|
8
|
+
const GROQ_API_KEY = process.env.GROQ_API_KEY;
|
|
9
|
+
const TOGETHER_API_KEY = process.env.TOGETHER_API_KEY;
|
|
10
|
+
const MISTRAL_API_KEY = process.env.MISTRAL_API_KEY;
|
|
11
|
+
const HUGGINGFACE_API_KEY = process.env.HUGGINGFACE_API_KEY;
|
|
8
12
|
const PROVIDER_API_KEYS = {
|
|
9
13
|
COHERE_API_KEY,
|
|
10
14
|
GEMINI_API_KEY,
|
|
11
15
|
OPENAI_API_KEY,
|
|
12
16
|
ANTHROPIC_API_KEY,
|
|
17
|
+
GROQ_API_KEY,
|
|
18
|
+
TOGETHER_API_KEY,
|
|
19
|
+
MISTRAL_API_KEY,
|
|
20
|
+
HUGGINGFACE_API_KEY
|
|
13
21
|
};
|
|
14
22
|
export { PROVIDER_API_KEYS, };
|
package/package.json
CHANGED
|
@@ -76,6 +76,7 @@ const parseAgentConfig = (agentConfigFilePath: string): {crew: AgentConfig[]} =>
|
|
|
76
76
|
*
|
|
77
77
|
* @param {string} agentName - The identifier for the AI agent to be initialized.
|
|
78
78
|
* @param {string} agentConfigFilePath - The file path to the YAML configuration for the agent.
|
|
79
|
+
* @param {FunctionRegistryType} functions - The functions available to the agent.
|
|
79
80
|
* @param {Object} state - The state object for the agent.
|
|
80
81
|
* @returns {Object} An object containing the Agents AI instance, its name, description, signature, functions and subAgentList.
|
|
81
82
|
* @throws {Error} Throws an error if the agent configuration is missing, the provider is unsupported,
|
package/src/agents/index.ts
CHANGED
|
@@ -42,6 +42,7 @@ class AxCrew {
|
|
|
42
42
|
/**
|
|
43
43
|
* Creates an instance of AxCrew.
|
|
44
44
|
* @param {string} configFilePath - Path to the agent config file.
|
|
45
|
+
* @param {FunctionRegistryType} [functionsRegistry={}] - The registry of functions to use in the crew.
|
|
45
46
|
* @param {string} [crewId=uuidv4()] - The unique identifier for the crew.
|
|
46
47
|
*/
|
|
47
48
|
constructor(
|
package/src/config/index.ts
CHANGED
|
@@ -6,6 +6,10 @@ const ANTHROPIC_API_KEY: string | undefined = process.env.ANTHROPIC_API_KEY;
|
|
|
6
6
|
const OPENAI_API_KEY: string | undefined = process.env.OPENAI_API_KEY;
|
|
7
7
|
const COHERE_API_KEY: string | undefined = process.env.COHERE_API_KEY;
|
|
8
8
|
const GEMINI_API_KEY: string | undefined = process.env.GEMINI_API_KEY;
|
|
9
|
+
const GROQ_API_KEY: string | undefined = process.env.GROQ_API_KEY;
|
|
10
|
+
const TOGETHER_API_KEY: string | undefined = process.env.TOGETHER_API_KEY;
|
|
11
|
+
const MISTRAL_API_KEY: string | undefined = process.env.MISTRAL_API_KEY;
|
|
12
|
+
const HUGGINGFACE_API_KEY: string | undefined = process.env.HUGGINGFACE_API_KEY;
|
|
9
13
|
|
|
10
14
|
interface ProviderApiKeys {
|
|
11
15
|
[key: string]: string | undefined;
|
|
@@ -16,6 +20,10 @@ const PROVIDER_API_KEYS: ProviderApiKeys = {
|
|
|
16
20
|
GEMINI_API_KEY,
|
|
17
21
|
OPENAI_API_KEY,
|
|
18
22
|
ANTHROPIC_API_KEY,
|
|
23
|
+
GROQ_API_KEY,
|
|
24
|
+
TOGETHER_API_KEY,
|
|
25
|
+
MISTRAL_API_KEY,
|
|
26
|
+
HUGGINGFACE_API_KEY
|
|
19
27
|
};
|
|
20
28
|
|
|
21
29
|
export {
|
package/src/functions/index.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { AxFunction } from '@ax-llm/ax';
|
|
2
2
|
import { CurrentDateTime, DaysBetweenDates } from './dateTime.js';
|
|
3
3
|
|
|
4
|
-
//
|
|
4
|
+
// FunctionRegistryType
|
|
5
5
|
type FunctionRegistryType = {
|
|
6
6
|
[key: string]: AxFunction | { new(state: Record<string, any>): { toFunction: () => AxFunction } };
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
const AxCrewFunctions = {
|
|
11
10
|
CurrentDateTime,
|
|
12
11
|
DaysBetweenDates,
|
package/AmazonSalesData.csv
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
Region,Country,Item Type,Sales Channel,Order Priority,Order Date,Order ID,Ship Date,Units Sold,Unit Price,Unit Cost,Total Revenue,Total Cost,Total Profit
|
|
2
|
-
Australia and Oceania,Tuvalu,Baby Food,Offline,H,5/28/2010,669165933,6/27/2010,9925,255.28,159.42,2533654.00,1582243.50,951410.50
|
|
3
|
-
Central America and the Caribbean,Grenada,Cereal,Online,C,8/22/2012,963881480,9/15/2012,2804,205.70,117.11,576782.80,328376.44,248406.36
|
|
4
|
-
Europe,Russia,Office Supplies,Offline,L,5/2/2014,341417157,5/8/2014,1779,651.21,524.96,1158502.59,933903.84,224598.75
|
|
5
|
-
Sub-Saharan Africa,Sao Tome and Principe,Fruits,Online,C,6/20/2014,514321792,7/5/2014,8102,9.33,6.92,75591.66,56065.84,19525.82
|
|
6
|
-
Sub-Saharan Africa,Rwanda,Office Supplies,Offline,L,2/1/2013,115456712,2/6/2013,5062,651.21,524.96,3296425.02,2657347.52,639077.50
|
|
7
|
-
Australia and Oceania,Solomon Islands,Baby Food,Online,C,2/4/2015,547995746,2/21/2015,2974,255.28,159.42,759202.72,474115.08,285087.64
|
|
8
|
-
Sub-Saharan Africa,Angola,Household,Offline,M,4/23/2011,135425221,4/27/2011,4187,668.27,502.54,2798046.49,2104134.98,693911.51
|
|
9
|
-
Sub-Saharan Africa,Burkina Faso,Vegetables,Online,H,7/17/2012,871543967,7/27/2012,8082,154.06,90.93,1245112.92,734896.26,510216.66
|
|
10
|
-
Sub-Saharan Africa,Republic of the Congo,Personal Care,Offline,M,7/14/2015,770463311,8/25/2015,6070,81.73,56.67,496101.10,343986.90,152114.20
|
|
11
|
-
Sub-Saharan Africa,Senegal,Cereal,Online,H,4/18/2014,616607081,5/30/2014,6593,205.70,117.11,1356180.10,772106.23,584073.87
|
|
12
|
-
Asia,Kyrgyzstan,Vegetables,Online,H,6/24/2011,814711606,7/12/2011,124,154.06,90.93,19103.44,11275.32,7828.12
|
|
13
|
-
Sub-Saharan Africa,Cape Verde,Clothes,Offline,H,8/2/2014,939825713,8/19/2014,4168,109.28,35.84,455479.04,149381.12,306097.92
|
|
14
|
-
Asia,Bangladesh,Clothes,Online,L,1/13/2017,187310731,3/1/2017,8263,109.28,35.84,902980.64,296145.92,606834.72
|
|
15
|
-
Central America and the Caribbean,Honduras,Household,Offline,H,2/8/2017,522840487,2/13/2017,8974,668.27,502.54,5997054.98,4509793.96,1487261.02
|
|
16
|
-
Asia,Mongolia,Personal Care,Offline,C,2/19/2014,832401311,2/23/2014,4901,81.73,56.67,400558.73,277739.67,122819.06
|
|
17
|
-
Europe,Bulgaria,Clothes,Online,M,4/23/2012,972292029,6/3/2012,1673,109.28,35.84,182825.44,59960.32,122865.12
|
|
18
|
-
Asia,Sri Lanka,Cosmetics,Offline,M,11/19/2016,419123971,12/18/2016,6952,437.20,263.33,3039414.40,1830670.16,1208744.24
|
|
19
|
-
Sub-Saharan Africa,Cameroon,Beverages,Offline,C,4/1/2015,519820964,4/18/2015,5430,47.45,31.79,257653.50,172619.70,85033.80
|
|
20
|
-
Asia,Turkmenistan,Household,Offline,L,12/30/2010,441619336,1/20/2011,3830,668.27,502.54,2559474.10,1924728.20,634745.90
|
|
21
|
-
Australia and Oceania,East Timor,Meat,Online,L,7/31/2012,322067916,9/11/2012,5908,421.89,364.69,2492526.12,2154588.52,337937.60
|
|
22
|
-
Europe,Norway,Baby Food,Online,L,5/14/2014,819028031,6/28/2014,7450,255.28,159.42,1901836.00,1187679.00,714157.00
|
|
23
|
-
Europe,Portugal,Baby Food,Online,H,7/31/2015,860673511,9/3/2015,1273,255.28,159.42,324971.44,202941.66,122029.78
|
|
24
|
-
Central America and the Caribbean,Honduras,Snacks,Online,L,6/30/2016,795490682,7/26/2016,2225,152.58,97.44,339490.50,216804.00,122686.50
|
|
25
|
-
Australia and Oceania,New Zealand,Fruits,Online,H,9/8/2014,142278373,10/4/2014,2187,9.33,6.92,20404.71,15134.04,5270.67
|
|
26
|
-
Europe,Moldova ,Personal Care,Online,L,5/7/2016,740147912,5/10/2016,5070,81.73,56.67,414371.10,287316.90,127054.20
|
|
27
|
-
Europe,France,Cosmetics,Online,H,5/22/2017,898523128,6/5/2017,1815,437.20,263.33,793518.00,477943.95,315574.05
|
|
28
|
-
Australia and Oceania,Kiribati,Fruits,Online,M,10/13/2014,347140347,11/10/2014,5398,9.33,6.92,50363.34,37354.16,13009.18
|
|
29
|
-
Sub-Saharan Africa,Mali,Fruits,Online,L,5/7/2010,686048400,5/10/2010,5822,9.33,6.92,54319.26,40288.24,14031.02
|
|
30
|
-
Europe,Norway,Beverages,Offline,C,7/18/2014,435608613,7/30/2014,5124,47.45,31.79,243133.80,162891.96,80241.84
|
|
31
|
-
Sub-Saharan Africa,The Gambia,Household,Offline,L,5/26/2012,886494815,6/9/2012,2370,668.27,502.54,1583799.90,1191019.80,392780.10
|
|
32
|
-
Europe,Switzerland,Cosmetics,Offline,M,9/17/2012,249693334,10/20/2012,8661,437.20,263.33,3786589.20,2280701.13,1505888.07
|
|
33
|
-
Sub-Saharan Africa,South Sudan,Personal Care,Offline,C,12/29/2013,406502997,1/28/2014,2125,81.73,56.67,173676.25,120423.75,53252.50
|
|
34
|
-
Australia and Oceania,Australia,Office Supplies,Online,C,10/27/2015,158535134,11/25/2015,2924,651.21,524.96,1904138.04,1534983.04,369155.00
|
|
35
|
-
Asia,Myanmar,Household,Offline,H,1/16/2015,177713572,3/1/2015,8250,668.27,502.54,5513227.50,4145955.00,1367272.50
|
|
36
|
-
Sub-Saharan Africa,Djibouti,Snacks,Online,M,2/25/2017,756274640,2/25/2017,7327,152.58,97.44,1117953.66,713942.88,404010.78
|
|
37
|
-
Central America and the Caribbean,Costa Rica,Personal Care,Offline,L,5/8/2017,456767165,5/21/2017,6409,81.73,56.67,523807.57,363198.03,160609.54
|
|
38
|
-
Middle East and North Africa,Syria,Fruits,Online,L,11/22/2011,162052476,12/3/2011,3784,9.33,6.92,35304.72,26185.28,9119.44
|
|
39
|
-
Sub-Saharan Africa,The Gambia,Meat,Online,M,1/14/2017,825304400,1/23/2017,4767,421.89,364.69,2011149.63,1738477.23,272672.40
|
|
40
|
-
Asia,Brunei,Office Supplies,Online,L,4/1/2012,320009267,5/8/2012,6708,651.21,524.96,4368316.68,3521431.68,846885.00
|
|
41
|
-
Europe,Bulgaria,Office Supplies,Online,M,2/16/2012,189965903,2/28/2012,3987,651.21,524.96,2596374.27,2093015.52,503358.75
|
|
42
|
-
Sub-Saharan Africa,Niger,Personal Care,Online,H,3/11/2017,699285638,3/28/2017,3015,81.73,56.67,246415.95,170860.05,75555.90
|
|
43
|
-
Middle East and North Africa,Azerbaijan,Cosmetics,Online,M,2/6/2010,382392299,2/25/2010,7234,437.20,263.33,3162704.80,1904929.22,1257775.58
|
|
44
|
-
Sub-Saharan Africa,The Gambia,Cereal,Offline,H,6/7/2012,994022214,6/8/2012,2117,205.70,117.11,435466.90,247921.87,187545.03
|
|
45
|
-
Europe,Slovakia,Vegetables,Online,H,10/6/2012,759224212,11/10/2012,171,154.06,90.93,26344.26,15549.03,10795.23
|
|
46
|
-
Asia,Myanmar,Clothes,Online,H,11/14/2015,223359620,11/18/2015,5930,109.28,35.84,648030.40,212531.20,435499.20
|
|
47
|
-
Sub-Saharan Africa,Comoros,Cereal,Offline,H,3/29/2016,902102267,4/29/2016,962,205.70,117.11,197883.40,112659.82,85223.58
|
|
48
|
-
Europe,Iceland,Cosmetics,Online,C,12/31/2016,331438481,12/31/2016,8867,437.20,263.33,3876652.40,2334947.11,1541705.29
|
|
49
|
-
Europe,Switzerland,Personal Care,Online,M,12/23/2010,617667090,1/31/2011,273,81.73,56.67,22312.29,15470.91,6841.38
|
|
50
|
-
Europe,Macedonia,Clothes,Offline,C,10/14/2014,787399423,11/14/2014,7842,109.28,35.84,856973.76,281057.28,575916.48
|
|
51
|
-
Sub-Saharan Africa,Mauritania,Office Supplies,Offline,C,1/11/2012,837559306,1/13/2012,1266,651.21,524.96,824431.86,664599.36,159832.50
|
|
52
|
-
Europe,Albania,Clothes,Online,C,2/2/2010,385383069,3/18/2010,2269,109.28,35.84,247956.32,81320.96,166635.36
|
|
53
|
-
Sub-Saharan Africa,Lesotho,Fruits,Online,L,8/18/2013,918419539,9/18/2013,9606,9.33,6.92,89623.98,66473.52,23150.46
|
|
54
|
-
Middle East and North Africa,Saudi Arabia,Cereal,Online,M,3/25/2013,844530045,3/28/2013,4063,205.70,117.11,835759.10,475817.93,359941.17
|
|
55
|
-
Sub-Saharan Africa,Sierra Leone,Office Supplies,Offline,M,11/26/2011,441888415,1/7/2012,3457,651.21,524.96,2251232.97,1814786.72,436446.25
|
|
56
|
-
Sub-Saharan Africa,Sao Tome and Principe,Fruits,Offline,H,9/17/2013,508980977,10/24/2013,7637,9.33,6.92,71253.21,52848.04,18405.17
|
|
57
|
-
Sub-Saharan Africa,Cote d'Ivoire,Clothes,Online,C,6/8/2012,114606559,6/27/2012,3482,109.28,35.84,380512.96,124794.88,255718.08
|
|
58
|
-
Australia and Oceania,Fiji,Clothes,Offline,C,6/30/2010,647876489,8/1/2010,9905,109.28,35.84,1082418.40,354995.20,727423.20
|
|
59
|
-
Europe,Austria,Cosmetics,Offline,H,2/23/2015,868214595,3/2/2015,2847,437.20,263.33,1244708.40,749700.51,495007.89
|
|
60
|
-
Europe,United Kingdom,Household,Online,L,1/5/2012,955357205,2/14/2012,282,668.27,502.54,188452.14,141716.28,46735.86
|
|
61
|
-
Sub-Saharan Africa,Djibouti,Cosmetics,Offline,H,4/7/2014,259353148,4/19/2014,7215,437.20,263.33,3154398.00,1899925.95,1254472.05
|
|
62
|
-
Australia and Oceania,Australia,Cereal,Offline,H,6/9/2013,450563752,7/2/2013,682,205.70,117.11,140287.40,79869.02,60418.38
|
|
63
|
-
Europe,San Marino,Baby Food,Online,L,6/26/2013,569662845,7/1/2013,4750,255.28,159.42,1212580.00,757245.00,455335.00
|
|
64
|
-
Sub-Saharan Africa,Cameroon,Office Supplies,Online,M,11/7/2011,177636754,11/15/2011,5518,651.21,524.96,3593376.78,2896729.28,696647.50
|
|
65
|
-
Middle East and North Africa,Libya,Clothes,Offline,H,10/30/2010,705784308,11/17/2010,6116,109.28,35.84,668356.48,219197.44,449159.04
|
|
66
|
-
Central America and the Caribbean,Haiti,Cosmetics,Offline,H,10/13/2013,505716836,11/16/2013,1705,437.20,263.33,745426.00,448977.65,296448.35
|
|
67
|
-
Sub-Saharan Africa,Rwanda,Cosmetics,Offline,H,10/11/2013,699358165,11/25/2013,4477,437.20,263.33,1957344.40,1178928.41,778415.99
|
|
68
|
-
Sub-Saharan Africa,Gabon,Personal Care,Offline,L,7/8/2012,228944623,7/9/2012,8656,81.73,56.67,707454.88,490535.52,216919.36
|
|
69
|
-
Central America and the Caribbean,Belize,Clothes,Offline,M,7/25/2016,807025039,9/7/2016,5498,109.28,35.84,600821.44,197048.32,403773.12
|
|
70
|
-
Europe,Lithuania,Office Supplies,Offline,H,10/24/2010,166460740,11/17/2010,8287,651.21,524.96,5396577.27,4350343.52,1046233.75
|
|
71
|
-
Sub-Saharan Africa,Madagascar,Clothes,Offline,L,4/25/2015,610425555,5/28/2015,7342,109.28,35.84,802333.76,263137.28,539196.48
|
|
72
|
-
Asia,Turkmenistan,Office Supplies,Online,M,4/23/2013,462405812,5/20/2013,5010,651.21,524.96,3262562.10,2630049.60,632512.50
|
|
73
|
-
Middle East and North Africa,Libya,Fruits,Online,L,8/14/2015,816200339,9/30/2015,673,9.33,6.92,6279.09,4657.16,1621.93
|
|
74
|
-
Sub-Saharan Africa,Democratic Republic of the Congo,Beverages,Online,C,5/26/2011,585920464,7/15/2011,5741,47.45,31.79,272410.45,182506.39,89904.06
|
|
75
|
-
Sub-Saharan Africa,Djibouti,Cereal,Online,H,5/20/2017,555990016,6/17/2017,8656,205.70,117.11,1780539.20,1013704.16,766835.04
|
|
76
|
-
Middle East and North Africa,Pakistan,Cosmetics,Offline,L,7/5/2013,231145322,8/16/2013,9892,437.20,263.33,4324782.40,2604860.36,1719922.04
|
|
77
|
-
North America,Mexico,Household,Offline,C,11/6/2014,986435210,12/12/2014,6954,668.27,502.54,4647149.58,3494663.16,1152486.42
|
|
78
|
-
Australia and Oceania,Federated States of Micronesia,Beverages,Online,C,10/28/2014,217221009,11/15/2014,9379,47.45,31.79,445033.55,298158.41,146875.14
|
|
79
|
-
Asia,Laos,Vegetables,Offline,C,9/15/2011,789176547,10/23/2011,3732,154.06,90.93,574951.92,339350.76,235601.16
|
|
80
|
-
Europe,Monaco,Baby Food,Offline,H,5/29/2012,688288152,6/2/2012,8614,255.28,159.42,2198981.92,1373243.88,825738.04
|
|
81
|
-
Australia and Oceania,Samoa ,Cosmetics,Online,H,7/20/2013,670854651,8/7/2013,9654,437.20,263.33,4220728.80,2542187.82,1678540.98
|
|
82
|
-
Europe,Spain,Household,Offline,L,10/21/2012,213487374,11/30/2012,4513,668.27,502.54,3015902.51,2267963.02,747939.49
|
|
83
|
-
Middle East and North Africa,Lebanon,Clothes,Online,L,9/18/2012,663110148,10/8/2012,7884,109.28,35.84,861563.52,282562.56,579000.96
|
|
84
|
-
Middle East and North Africa,Iran,Cosmetics,Online,H,11/15/2016,286959302,12/8/2016,6489,437.20,263.33,2836990.80,1708748.37,1128242.43
|
|
85
|
-
Sub-Saharan Africa,Zambia,Snacks,Online,L,1/4/2011,122583663,1/5/2011,4085,152.58,97.44,623289.30,398042.40,225246.90
|
|
86
|
-
Sub-Saharan Africa,Kenya,Vegetables,Online,L,3/18/2012,827844560,4/7/2012,6457,154.06,90.93,994765.42,587135.01,407630.41
|
|
87
|
-
North America,Mexico,Personal Care,Offline,L,2/17/2012,430915820,3/20/2012,6422,81.73,56.67,524870.06,363934.74,160935.32
|
|
88
|
-
Sub-Saharan Africa,Sao Tome and Principe,Beverages,Offline,C,1/16/2011,180283772,1/21/2011,8829,47.45,31.79,418936.05,280673.91,138262.14
|
|
89
|
-
Sub-Saharan Africa,The Gambia,Baby Food,Offline,M,2/3/2014,494747245,3/20/2014,5559,255.28,159.42,1419101.52,886215.78,532885.74
|
|
90
|
-
Middle East and North Africa,Kuwait,Fruits,Online,M,4/30/2012,513417565,5/18/2012,522,9.33,6.92,4870.26,3612.24,1258.02
|
|
91
|
-
Europe,Slovenia,Beverages,Offline,C,10/23/2016,345718562,11/25/2016,4660,47.45,31.79,221117.00,148141.40,72975.60
|
|
92
|
-
Sub-Saharan Africa,Sierra Leone,Office Supplies,Offline,H,12/6/2016,621386563,12/14/2016,948,651.21,524.96,617347.08,497662.08,119685.00
|
|
93
|
-
Australia and Oceania,Australia,Beverages,Offline,H,7/7/2014,240470397,7/11/2014,9389,47.45,31.79,445508.05,298476.31,147031.74
|
|
94
|
-
Middle East and North Africa,Azerbaijan,Office Supplies,Online,M,6/13/2012,423331391,7/24/2012,2021,651.21,524.96,1316095.41,1060944.16,255151.25
|
|
95
|
-
Europe,Romania,Cosmetics,Online,H,11/26/2010,660643374,12/25/2010,7910,437.20,263.33,3458252.00,2082940.30,1375311.70
|
|
96
|
-
Central America and the Caribbean,Nicaragua,Beverages,Offline,C,2/8/2011,963392674,3/21/2011,8156,47.45,31.79,387002.20,259279.24,127722.96
|
|
97
|
-
Sub-Saharan Africa,Mali,Clothes,Online,M,7/26/2011,512878119,9/3/2011,888,109.28,35.84,97040.64,31825.92,65214.72
|
|
98
|
-
Asia,Malaysia,Fruits,Offline,L,11/11/2011,810711038,12/28/2011,6267,9.33,6.92,58471.11,43367.64,15103.47
|
|
99
|
-
Sub-Saharan Africa,Sierra Leone,Vegetables,Offline,C,6/1/2016,728815257,6/29/2016,1485,154.06,90.93,228779.10,135031.05,93748.05
|
|
100
|
-
North America,Mexico,Personal Care,Offline,M,7/30/2015,559427106,8/8/2015,5767,81.73,56.67,471336.91,326815.89,144521.02
|
|
101
|
-
Sub-Saharan Africa,Mozambique,Household,Offline,L,2/10/2012,665095412,2/15/2012,5367,668.27,502.54,3586605.09,2697132.18,889472.91
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
/**
|
|
4
|
-
* Dynamically imports functions from a given directory path.
|
|
5
|
-
* @param {string} dirPath - The directory path where function implementations are located.
|
|
6
|
-
* @returns {Promise<FunctionMap>} A promise that resolves to the map of functions.
|
|
7
|
-
*/
|
|
8
|
-
export const importFunctionsFromDirectory = async (dirPath) => {
|
|
9
|
-
const functions = {};
|
|
10
|
-
// Dynamically import all files from the provided directory path
|
|
11
|
-
const files = fs.readdirSync(dirPath);
|
|
12
|
-
for (const file of files) {
|
|
13
|
-
if (file.endsWith('.js')) {
|
|
14
|
-
const modulePath = path.join(dirPath, file);
|
|
15
|
-
try {
|
|
16
|
-
const importedModule = await import(modulePath);
|
|
17
|
-
Object.assign(functions, importedModule);
|
|
18
|
-
}
|
|
19
|
-
catch (e) {
|
|
20
|
-
console.error(`Error importing function from ${modulePath}:`, e);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return functions;
|
|
25
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
export class GoogleSearch {
|
|
3
|
-
constructor(state) {
|
|
4
|
-
this.state = state;
|
|
5
|
-
this.apiKey = state.googleSearchApiKey;
|
|
6
|
-
}
|
|
7
|
-
async query(query) {
|
|
8
|
-
const res = await axios.get("http://google.com/?q=" + query);
|
|
9
|
-
return res.data;
|
|
10
|
-
}
|
|
11
|
-
async toFunction() {
|
|
12
|
-
return {
|
|
13
|
-
name: 'GoogleSearch',
|
|
14
|
-
description: 'Use this function to search google for links related to the query',
|
|
15
|
-
parameters: {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
query: {
|
|
19
|
-
description: 'The search query',
|
|
20
|
-
type: 'string'
|
|
21
|
-
},
|
|
22
|
-
required: ['query']
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
func: (query) => this.query(query)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AxFunction } from "@ax-llm/ax";
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
|
|
5
|
-
// Define a mapping from function names to their respective handlers
|
|
6
|
-
export type FunctionMap = {
|
|
7
|
-
[key: string]: AxFunction | { new(state: Record<string, any>): { toFunction: () => AxFunction } };
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Dynamically imports functions from a given directory path.
|
|
12
|
-
* @param {string} dirPath - The directory path where function implementations are located.
|
|
13
|
-
* @returns {Promise<FunctionMap>} A promise that resolves to the map of functions.
|
|
14
|
-
*/
|
|
15
|
-
export const importFunctionsFromDirectory = async (dirPath: string): Promise<FunctionMap> => {
|
|
16
|
-
const functions: FunctionMap = {};
|
|
17
|
-
// Dynamically import all files from the provided directory path
|
|
18
|
-
const files = fs.readdirSync(dirPath);
|
|
19
|
-
for (const file of files) {
|
|
20
|
-
if (file.endsWith('.js')) {
|
|
21
|
-
const modulePath = path.join(dirPath, file);
|
|
22
|
-
try {
|
|
23
|
-
const importedModule = await import(modulePath);
|
|
24
|
-
Object.assign(functions, importedModule);
|
|
25
|
-
} catch (e) {
|
|
26
|
-
console.error(`Error importing function from ${modulePath}:`, e);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return functions;
|
|
31
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import axios from 'axios'
|
|
2
|
-
|
|
3
|
-
export class GoogleSearch {
|
|
4
|
-
private apiKey: string;
|
|
5
|
-
state: any;
|
|
6
|
-
|
|
7
|
-
constructor(state: any) {
|
|
8
|
-
this.state = state;
|
|
9
|
-
this.apiKey = state.googleSearchApiKey;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async query(query: string) {
|
|
13
|
-
const res = await axios.get("http://google.com/?q=" + query)
|
|
14
|
-
return res.data
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async toFunction() {
|
|
18
|
-
return {
|
|
19
|
-
name: 'GoogleSearch',
|
|
20
|
-
description: 'Use this function to search google for links related to the query',
|
|
21
|
-
parameters: {
|
|
22
|
-
type: 'object',
|
|
23
|
-
properties: {
|
|
24
|
-
query: {
|
|
25
|
-
description: 'The search query',
|
|
26
|
-
type: 'string'
|
|
27
|
-
},
|
|
28
|
-
required: ['query']
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
func: (query: string) => this.query(query)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|