@sisu-ai/mw-react-parser 1.0.1 → 3.0.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 +14 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sisu-ai/mw-react-parser
|
|
2
2
|
|
|
3
|
-
Lightweight ReAct-style tool loop.
|
|
3
|
+
Lightweight ReAct-style tool loop. Lets the model decide an action in natural language, you parse it, execute, and then the model reflects and answers.
|
|
4
4
|
|
|
5
5
|
## Setup
|
|
6
6
|
```bash
|
|
@@ -10,11 +10,11 @@ npm i @sisu-ai/mw-react-parser
|
|
|
10
10
|
## Documentation
|
|
11
11
|
Discover what you can do through examples or documentation. Check it out at https://github.com/finger-gun/sisu
|
|
12
12
|
|
|
13
|
-
## Behavior
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
13
|
+
## Behavior (ReAct pattern)
|
|
14
|
+
- Think: Ask the model for an initial response with tools disabled (`toolChoice: 'none'`).
|
|
15
|
+
- Act: Parse `Action: <tool>` and `Action Input: <json or text>` from its message.
|
|
16
|
+
- Observe: Execute the named tool with parsed input, append a `role:'tool'` message.
|
|
17
|
+
- Reflect: Ask the model again to produce the final answer that incorporates the observation.
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
```ts
|
|
@@ -23,3 +23,11 @@ import { reactToolLoop } from '@sisu-ai/mw-react-parser';
|
|
|
23
23
|
const app = new Agent()
|
|
24
24
|
.use(reactToolLoop());
|
|
25
25
|
```
|
|
26
|
+
|
|
27
|
+
Prompting tip
|
|
28
|
+
- Seed system with the expected format, e.g.:
|
|
29
|
+
- `Use tools when helpful. Reply with\nAction: <tool>\nAction Input: <JSON>`
|
|
30
|
+
|
|
31
|
+
Customizing
|
|
32
|
+
- Provide your own tools via `@sisu-ai/mw-register-tools` and define strict zod schemas for reliable parsing.
|
|
33
|
+
- If you need a different action syntax, build a small middleware before/after to transform the assistant message.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sisu-ai/mw-react-parser",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"build": "tsc -b"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@sisu-ai/core": "0.
|
|
17
|
+
"@sisu-ai/core": "1.0.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|