@aidejs/tools 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +7 -7
- package/package.json +1 -1
- package/src/index.js +7 -4
- package/types/index.d.ts +10 -1
package/README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
<img src="
|
|
1
|
+
<img src="./docs/images/logo.png" />
|
|
2
2
|
|
|
3
3
|
# [Aidejs](https://github.com/NN-Studio/Aidejs)
|
|
4
4
|
一个用于构建人工智能代理的JavaScript框架,它提供了一组工具和库,使创建智能应用程序变得轻松和高效
|
|
5
5
|
|
|
6
|
+
## 功能列表
|
|
7
|
+
|
|
8
|
+
通过类似拼积木的方式,你可以轻松地组合各个模块完成个性化的 AI 应用开发。
|
|
9
|
+
|
|
10
|
+
下面是可用模块:
|
|
11
|
+
|
|
6
12
|
<p>
|
|
7
13
|
<a href="https://github.com/NN-Studio/Aidejs/issues">
|
|
8
14
|
<img src="https://img.shields.io/github/issues/NN-Studio/Aidejs" alt="issue">
|
|
@@ -15,12 +21,6 @@
|
|
|
15
21
|
</a>
|
|
16
22
|
</p>
|
|
17
23
|
|
|
18
|
-
## 功能列表
|
|
19
|
-
|
|
20
|
-
通过类似拼积木的方式,你可以轻松地组合各个模块完成个性化的 AI 应用开发。
|
|
21
|
-
|
|
22
|
-
下面是可用模块:
|
|
23
|
-
|
|
24
24
|
<table>
|
|
25
25
|
<thead>
|
|
26
26
|
<tr>
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
install(Aidejs) {
|
|
2
|
+
install(Aidejs, options) {
|
|
3
3
|
|
|
4
4
|
// 工具列表
|
|
5
5
|
const tools = {
|
|
@@ -10,9 +10,12 @@ module.exports = {
|
|
|
10
10
|
// 注册工具
|
|
11
11
|
for (let toolType in tools) {
|
|
12
12
|
for (let toolItem of tools[toolType]) {
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
let functionName = toolItem.description.function.name;
|
|
14
|
+
if (!options.exclude || !options.exclude(toolType, functionName)) {
|
|
15
|
+
let toolName = `aidejs_${toolType}_` + functionName;
|
|
16
|
+
toolItem.description.function.name = toolName;
|
|
17
|
+
Aidejs.registerTool(toolName, toolItem);
|
|
18
|
+
}
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
21
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type Aidejs from "@aidejs/core"
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
install(Aidejs: Aidejs
|
|
4
|
+
install(Aidejs: Aidejs, options?: {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 过滤若干不希望安装的工具
|
|
8
|
+
* @param toolType <string> 工具类型
|
|
9
|
+
* @param toolName <string> 工具名称
|
|
10
|
+
* @returns boolean 如果返回true,就表示当前工具不希望安装
|
|
11
|
+
*/
|
|
12
|
+
exclude?: (toolType: string, toolName: string) => boolean
|
|
13
|
+
}): void
|
|
5
14
|
}
|