MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / initialize

Method initialize

openspace/grounding/backends/shell/session.py:58–87  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
89class PythonScriptTool(BaseTool):
90 _name = "_python_exec"

Callers 1

create_sessionMethod · 0.95

Calls 7

get_productivity_toolsFunction · 0.90
ShellAgentToolClass · 0.85
WriteFileToolClass · 0.85
ListDirToolClass · 0.85
RunShellToolClass · 0.85
ReadFileToolClass · 0.85
infoMethod · 0.80

Tested by

no test coverage detected