recursive-llm-ts 2.0.2 → 2.0.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/dist/bunpy-bridge.js +21 -2
- package/package.json +1 -1
package/dist/bunpy-bridge.js
CHANGED
|
@@ -74,9 +74,28 @@ class BunpyBridge {
|
|
|
74
74
|
throw new Error('bunpy is not installed. Install it with: bun add bunpy\n' +
|
|
75
75
|
'Note: bunpy only works with Bun runtime, not Node.js');
|
|
76
76
|
}
|
|
77
|
-
// Import sys
|
|
77
|
+
// Import sys and subprocess modules
|
|
78
78
|
const sys = this.python.import('sys');
|
|
79
|
-
const
|
|
79
|
+
const subprocess = this.python.import('subprocess');
|
|
80
|
+
const os = this.python.import('os');
|
|
81
|
+
// Install Python dependencies if not already installed
|
|
82
|
+
const pythonPackagePath = path.join(__dirname, '..', 'recursive-llm');
|
|
83
|
+
try {
|
|
84
|
+
// Check if litellm is importable
|
|
85
|
+
try {
|
|
86
|
+
this.python.import('litellm');
|
|
87
|
+
}
|
|
88
|
+
catch (_a) {
|
|
89
|
+
// Install dependencies using pip
|
|
90
|
+
const result = subprocess.run([sys.executable, '-m', 'pip', 'install', '-e', pythonPackagePath], { capture_output: true, text: true, check: true });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch (installError) {
|
|
94
|
+
console.warn('[recursive-llm-ts] Failed to auto-install Python dependencies:', installError);
|
|
95
|
+
console.warn('[recursive-llm-ts] Please manually run: pip install -e', pythonPackagePath);
|
|
96
|
+
}
|
|
97
|
+
// Add Python source path
|
|
98
|
+
const pythonSrcPath = path.join(pythonPackagePath, 'src');
|
|
80
99
|
sys.path.insert(0, pythonSrcPath);
|
|
81
100
|
// Import the rlm module
|
|
82
101
|
this.rlmModule = this.python.import('rlm');
|
package/package.json
CHANGED