recursive-llm-ts 1.0.2 → 1.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/package.json
CHANGED
|
@@ -54,14 +54,31 @@ class RLM:
|
|
|
54
54
|
_current_depth: Internal current depth tracker
|
|
55
55
|
**llm_kwargs: Additional LiteLLM parameters
|
|
56
56
|
"""
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
# Patch for recursive-llm-ts bug where config is passed as 2nd positional arg
|
|
58
|
+
if isinstance(recursive_model, dict):
|
|
59
|
+
config = recursive_model
|
|
60
|
+
# Reset recursive_model default
|
|
61
|
+
self.recursive_model = config.get('recursive_model', model)
|
|
62
|
+
self.api_base = config.get('api_base', api_base)
|
|
63
|
+
self.api_key = config.get('api_key', api_key)
|
|
64
|
+
self.max_depth = config.get('max_depth', max_depth)
|
|
65
|
+
self.max_iterations = config.get('max_iterations', max_iterations)
|
|
66
|
+
|
|
67
|
+
# Extract other llm kwargs
|
|
68
|
+
excluded = {'recursive_model', 'api_base', 'api_key', 'max_depth', 'max_iterations'}
|
|
69
|
+
self.llm_kwargs = {k: v for k, v in config.items() if k not in excluded}
|
|
70
|
+
# Merge with any actual kwargs passed
|
|
71
|
+
self.llm_kwargs.update(llm_kwargs)
|
|
72
|
+
else:
|
|
73
|
+
self.recursive_model = recursive_model or model
|
|
74
|
+
self.api_base = api_base
|
|
75
|
+
self.api_key = api_key
|
|
76
|
+
self.max_depth = max_depth
|
|
77
|
+
self.max_iterations = max_iterations
|
|
78
|
+
self.llm_kwargs = llm_kwargs
|
|
79
|
+
|
|
63
80
|
self._current_depth = _current_depth
|
|
64
|
-
self.
|
|
81
|
+
self.model = model
|
|
65
82
|
|
|
66
83
|
self.repl = REPLExecutor()
|
|
67
84
|
|