(self)
| 56 | self.productivity_date = productivity_date or "default" |
| 57 | |
| 58 | async def initialize(self): |
| 59 | self.tools = [ |
| 60 | ShellAgentTool( |
| 61 | self, |
| 62 | security_manager=self.security_manager, |
| 63 | default_working_dir=self.default_working_dir, |
| 64 | default_env=self.default_env, |
| 65 | default_conda_env=self.default_conda_env, |
| 66 | model=self.model, |
| 67 | ), |
| 68 | # ReadFileTool(self), # Disabled: replaced by productivity read_file when use_clawwork_productivity is True |
| 69 | WriteFileTool(self), |
| 70 | ListDirTool(self), |
| 71 | RunShellTool(self), |
| 72 | ] |
| 73 | if not self.use_clawwork_productivity: |
| 74 | self.tools.insert(1, ReadFileTool(self)) |
| 75 | if self.use_clawwork_productivity: |
| 76 | from openspace.grounding.backends.shell.productivity_tools import get_productivity_tools |
| 77 | extra = get_productivity_tools( |
| 78 | self, |
| 79 | data_path=self.default_working_dir, |
| 80 | current_date=self.productivity_date, |
| 81 | ) |
| 82 | if extra: |
| 83 | self.tools.extend(extra) |
| 84 | logger.info("ClawWork productivity tools enabled: %s", [t.name for t in extra]) |
| 85 | else: |
| 86 | logger.warning("use_clawwork_productivity is True but livebench not available; productivity tools not added.") |
| 87 | return {"tools": [t.name for t in self.tools]} |
| 88 | |
| 89 | class PythonScriptTool(BaseTool): |
| 90 | _name = "_python_exec" |
no test coverage detected