@aigne/example-mcp-puppeteer 1.3.2 → 1.5.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/index.ts +3 -3
- package/package.json +4 -3
package/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env npx -y bun
|
|
2
2
|
|
|
3
3
|
import assert from "node:assert";
|
|
4
|
-
import {
|
|
4
|
+
import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
|
|
5
|
+
import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
|
|
5
6
|
import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
|
|
6
7
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
7
|
-
import { runChatLoopInTerminal } from "@aigne/core/utils/run-chat-loop.js";
|
|
8
8
|
|
|
9
9
|
const { OPENAI_API_KEY } = process.env;
|
|
10
10
|
assert(OPENAI_API_KEY, "Please set the OPENAI_API_KEY environment variable");
|
|
@@ -26,6 +26,7 @@ const engine = new ExecutionEngine({
|
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const agent = AIAgent.from({
|
|
29
|
+
name: "example_puppeteer",
|
|
29
30
|
instructions: `\
|
|
30
31
|
## Steps to extract content from a website
|
|
31
32
|
1. navigate to the url
|
|
@@ -40,7 +41,6 @@ await runChatLoopInTerminal(userAgent, {
|
|
|
40
41
|
welcome:
|
|
41
42
|
"Hello! I'm a chatbot that can extract content from a website. Try asking me a question!",
|
|
42
43
|
defaultQuestion: "What is the content of https://www.arcblock.io",
|
|
43
|
-
onResponse: (response) => console.log(getMessage(response)),
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
process.exit(0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-mcp-puppeteer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework and Puppeteer MCP Server to extract content from websites using Puppeteer",
|
|
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-puppeteer",
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"openai": "^4.
|
|
19
|
+
"openai": "^4.93.0",
|
|
20
20
|
"zod": "^3.24.2",
|
|
21
|
-
"@aigne/core": "^1.
|
|
21
|
+
"@aigne/core": "^1.7.0",
|
|
22
|
+
"@aigne/cli": "^1.2.0"
|
|
22
23
|
},
|
|
23
24
|
"scripts": {
|
|
24
25
|
"start": "npx -y bun run index.ts",
|