@aigne/example-mcp-sqlite 1.13.7 → 1.13.9
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 +6 -6
- package/usages.ts +9 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-mcp-sqlite",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.9",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework and Sqlite MCP Server to interact with a SQLite database",
|
|
5
5
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
6
6
|
"homepage": "https://github.com/AIGNE-io/aigne-framework/tree/main/examples/mcp-sqlite",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@aigne/
|
|
20
|
-
"@aigne/
|
|
21
|
-
"@aigne/
|
|
22
|
-
"@aigne/
|
|
19
|
+
"@aigne/agent-library": "^1.13.2",
|
|
20
|
+
"@aigne/cli": "^1.11.9",
|
|
21
|
+
"@aigne/openai": "^0.3.2",
|
|
22
|
+
"@aigne/core": "^1.20.1"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/bun": "^1.2.9",
|
|
26
|
-
"@aigne/test-utils": "^0.4.
|
|
26
|
+
"@aigne/test-utils": "^0.4.2"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"start": "bun run index.ts",
|
package/usages.ts
CHANGED
|
@@ -24,26 +24,29 @@ const aigne = new AIGNE({
|
|
|
24
24
|
const agent = AIAgent.from({
|
|
25
25
|
instructions: "You are a database administrator",
|
|
26
26
|
memory: new DefaultMemory(),
|
|
27
|
+
inputKey: "message",
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
console.log(
|
|
30
|
-
await aigne.invoke(agent,
|
|
31
|
+
await aigne.invoke(agent, {
|
|
32
|
+
message: "create a product table with columns name description and createdAt",
|
|
33
|
+
}),
|
|
31
34
|
);
|
|
32
35
|
// output:
|
|
33
36
|
// {
|
|
34
|
-
//
|
|
37
|
+
// message: "The product table has been created successfully with the columns: `name`, `description`, and `createdAt`.",
|
|
35
38
|
// }
|
|
36
39
|
|
|
37
|
-
console.log(await aigne.invoke(agent, "create 10 products for test"));
|
|
40
|
+
console.log(await aigne.invoke(agent, { message: "create 10 products for test" }));
|
|
38
41
|
// output:
|
|
39
42
|
// {
|
|
40
|
-
//
|
|
43
|
+
// message: "I have successfully created 10 test products in the database. Here are the products that were added:\n\n1. Product 1: $10.99 - Description for Product 1\n2. Product 2: $15.99 - Description for Product 2\n3. Product 3: $20.99 - Description for Product 3\n4. Product 4: $25.99 - Description for Product 4\n5. Product 5: $30.99 - Description for Product 5\n6. Product 6: $35.99 - Description for Product 6\n7. Product 7: $40.99 - Description for Product 7\n8. Product 8: $45.99 - Description for Product 8\n9. Product 9: $50.99 - Description for Product 9\n10. Product 10: $55.99 - Description for Product 10\n\nIf you need any further assistance or operations, feel free to ask!",
|
|
41
44
|
// }
|
|
42
45
|
|
|
43
|
-
console.log(await aigne.invoke(agent, "how many products?"));
|
|
46
|
+
console.log(await aigne.invoke(agent, { message: "how many products?" }));
|
|
44
47
|
// output:
|
|
45
48
|
// {
|
|
46
|
-
//
|
|
49
|
+
// message: "There are 10 products in the database.",
|
|
47
50
|
// }
|
|
48
51
|
|
|
49
52
|
await aigne.shutdown();
|