Skip to content

Commit 3315221

Browse files
committed
fix: change _create_tool_functions to return dict instead of list
DSPy RLM's tools parameter expects dict[str, Callable] not list. This fixes the 'list object has no attribute items' error. Agent-Id: agent-01069cef-6b08-41f1-a15d-29feb2ccaea1
1 parent f439651 commit 3315221

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

npx/python/cli/virtual_runner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def _sync_call(self, coro):
9393
def _create_tool_functions(self):
9494
"""Create sync tool wrapper functions for DSPy RLM.
9595
96-
Returns a list of three sync tool functions as closures that capture
96+
Returns a dict of three sync tool functions as closures that capture
9797
self by reference (so self._repo_tools can change between review calls).
9898
9999
Returns:
100-
List of [fetch_file, list_dir, search_code] functions
100+
Dict mapping tool name to function: {fetch_file, list_dir, search_code}
101101
"""
102102
runner = self
103103

@@ -179,7 +179,7 @@ def search_code(query: str) -> str:
179179
lines.append(f"{path}")
180180
return "\n".join(lines)
181181

182-
return [fetch_file, list_dir, search_code]
182+
return {"fetch_file": fetch_file, "list_dir": list_dir, "search_code": search_code}
183183

184184
def _ensure_configured(self):
185185
"""Configure DSPy and RLM on first use."""

0 commit comments

Comments
 (0)