@atgs/tapeworm 0.1.1 → 0.1.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/README.md +33 -40
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-

|
|
2
2
|
|
|
3
3
|
# Tapeworm
|
|
4
4
|
|
|
5
|
-
Tapeworm is an in-browser and
|
|
5
|
+
Tapeworm is an in-browser and Node agent framework.
|
|
6
6
|
|
|
7
7
|
This is the root package for Tapeworm. You can consume other packages like @atgs/tapeworm_bedrock for AWS Bedrock support.
|
|
8
8
|
|
|
@@ -16,47 +16,40 @@ It provides an object-oriented API to create agents that run either on Node or w
|
|
|
16
16
|
- Supports `function` tools
|
|
17
17
|
- Supports Ollama models
|
|
18
18
|
|
|
19
|
-
## Example
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let a = input.a;
|
|
44
|
-
let b = input.b;
|
|
45
|
-
return a + b;
|
|
46
|
-
}
|
|
47
|
-
|
|
19
|
+
## Example (uses Babel plugin @atgs/babel-plugin-tapeworm-decorator)
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
@Tool({ description: "Adds 2 numbers together" })
|
|
23
|
+
class AdditionTool extends Tool {
|
|
24
|
+
@TParam({
|
|
25
|
+
name: "a",
|
|
26
|
+
description: "The first number to add",
|
|
27
|
+
required: true,
|
|
28
|
+
type: "number",
|
|
29
|
+
})
|
|
30
|
+
@TParam({
|
|
31
|
+
name: "b",
|
|
32
|
+
description: "The second number to add",
|
|
33
|
+
required: true,
|
|
34
|
+
type: "number",
|
|
35
|
+
})
|
|
36
|
+
@TOutput("The sum of inputs a and b")
|
|
37
|
+
execute(input) {
|
|
38
|
+
let a = +input.a;
|
|
39
|
+
let b = +input.b;
|
|
40
|
+
console.log("Adding " + a + " and " + b + ": " + (a + b));
|
|
41
|
+
return a + b;
|
|
42
|
+
}
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
agent.model = ollama;
|
|
57
|
-
|
|
58
|
-
await agent.invoke("What is 9 + 10"); // Most likely doesn't print 21.
|
|
45
|
+
const agent = Agent.builder()
|
|
46
|
+
.name("calculatorAgent")
|
|
47
|
+
.tools([new AdditionTool()])
|
|
48
|
+
.systemPrompt("You are an agent that runs math operations.")
|
|
49
|
+
.model(ollama)
|
|
50
|
+
.build();
|
|
59
51
|
|
|
52
|
+
await agent.invoke("What is 9 + 10?");
|
|
60
53
|
```
|
|
61
54
|
|
|
62
55
|
## Roadmap
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atgs/tapeworm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tapeworm.cjs.js",
|
|
6
6
|
"module": "dist/tapeworm.es.js",
|
|
7
7
|
"browser": "dist/tapeworm.umd.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
"import": "./dist/tapeworm.es.js",
|
|
10
|
+
"require": "./dist/tapeworm.cjs.js"
|
|
11
|
+
},
|
|
8
12
|
"types": "dist/index.d.ts",
|
|
9
13
|
"files": [
|
|
10
14
|
"dist",
|