recursive-llm-ts 2.0.2 → 2.0.4
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 +10 -4
- package/dist/bunpy-bridge.js +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,14 +14,20 @@ npm install recursive-llm-ts
|
|
|
14
14
|
- **Python 3.9+** - Required for the underlying recursive-llm Python package
|
|
15
15
|
- **pip** - Python package manager
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
### Python Dependencies
|
|
18
|
+
|
|
19
|
+
**Important:** After installing the package, you must install Python dependencies:
|
|
18
20
|
|
|
19
|
-
#### For Bun Users
|
|
20
|
-
If using Bun, also install `bunpy`:
|
|
21
21
|
```bash
|
|
22
|
-
|
|
22
|
+
cd node_modules/recursive-llm-ts/recursive-llm
|
|
23
|
+
pip install -e .
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
This installs `litellm`, `RestrictedPython`, and other required Python packages.
|
|
27
|
+
|
|
28
|
+
#### For Bun Users
|
|
29
|
+
Bunpy is included as a dependency, so no additional installation needed.
|
|
30
|
+
|
|
25
31
|
The package will automatically detect your runtime and use the appropriate Python bridge:
|
|
26
32
|
- **Node.js** → uses `pythonia` (included)
|
|
27
33
|
- **Bun** → uses `bunpy` (peer dependency)
|
package/dist/bunpy-bridge.js
CHANGED
|
@@ -76,10 +76,18 @@ class BunpyBridge {
|
|
|
76
76
|
}
|
|
77
77
|
// Import sys module to add path
|
|
78
78
|
const sys = this.python.import('sys');
|
|
79
|
-
const
|
|
79
|
+
const pythonPackagePath = path.join(__dirname, '..', 'recursive-llm');
|
|
80
|
+
const pythonSrcPath = path.join(pythonPackagePath, 'src');
|
|
80
81
|
sys.path.insert(0, pythonSrcPath);
|
|
81
82
|
// Import the rlm module
|
|
82
|
-
|
|
83
|
+
try {
|
|
84
|
+
this.rlmModule = this.python.import('rlm');
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
throw new Error('Failed to import rlm module. Python dependencies may not be installed.\n' +
|
|
88
|
+
`Run: pip install -e ${pythonPackagePath}\n` +
|
|
89
|
+
`Original error: ${error.message || error}`);
|
|
90
|
+
}
|
|
83
91
|
});
|
|
84
92
|
}
|
|
85
93
|
completion(model_1, query_1, context_1) {
|
package/package.json
CHANGED