@aigne/example-mcp-github 1.3.1 → 1.4.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/README.md +3 -6
- package/index.ts +4 -9
- package/package.json +3 -3
- package/usages.ts +2 -1
package/README.md
CHANGED
|
@@ -116,12 +116,9 @@ pnpm example # Run predefined examples
|
|
|
116
116
|
The following example demonstrates how to use the GitHub MCP server to search for repositories:
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
|
-
import {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
ExecutionEngine,
|
|
123
|
-
MCPAgent,
|
|
124
|
-
} from "@aigne/core";
|
|
119
|
+
import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
|
|
120
|
+
import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
|
|
121
|
+
|
|
125
122
|
|
|
126
123
|
// Load environment variables
|
|
127
124
|
const { OPENAI_API_KEY, GITHUB_PERSONAL_ACCESS_TOKEN } = process.env;
|
package/index.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env npx -y bun
|
|
2
2
|
|
|
3
3
|
import assert from "node:assert";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
OpenAIChatModel,
|
|
9
|
-
getMessage,
|
|
10
|
-
logger,
|
|
11
|
-
runChatLoopInTerminal,
|
|
12
|
-
} from "@aigne/core";
|
|
4
|
+
import { AIAgent, ExecutionEngine, MCPAgent, getMessage } from "@aigne/core";
|
|
5
|
+
import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
|
|
6
|
+
import { logger } from "@aigne/core/utils/logger.js";
|
|
7
|
+
import { runChatLoopInTerminal } from "@aigne/core/utils/run-chat-loop.js";
|
|
13
8
|
|
|
14
9
|
const { OPENAI_API_KEY, GITHUB_PERSONAL_ACCESS_TOKEN } = process.env;
|
|
15
10
|
assert(OPENAI_API_KEY, "Please set the OPENAI_API_KEY environment variable");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-mcp-github",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework and GitHub MCP Server to interact with GitHub repositories",
|
|
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-github",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"README.md"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"openai": "^4.
|
|
19
|
+
"openai": "^4.91.1",
|
|
20
20
|
"zod": "^3.24.2",
|
|
21
|
-
"@aigne/core": "^1.
|
|
21
|
+
"@aigne/core": "^1.6.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"start": "npx -y bun run index.ts",
|
package/usages.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert";
|
|
2
|
-
import { AIAgent, ExecutionEngine, MCPAgent
|
|
2
|
+
import { AIAgent, ExecutionEngine, MCPAgent } from "@aigne/core";
|
|
3
|
+
import { OpenAIChatModel } from "@aigne/core/models/openai-chat-model.js";
|
|
3
4
|
|
|
4
5
|
const { OPENAI_API_KEY, GITHUB_PERSONAL_ACCESS_TOKEN } = process.env;
|
|
5
6
|
assert(OPENAI_API_KEY, "Please set the OPENAI_API_KEY environment variable");
|