(config)
| 134 | |
| 135 | |
| 136 | def build_tool(config) -> Tool: |
| 137 | |
| 138 | tool = Tool( |
| 139 | "Terminal", |
| 140 | "Tool to run shell commands.", |
| 141 | name_for_model="Terminal", |
| 142 | description_for_model = f"Run shell commands on this {get_platform()} machine.", |
| 143 | logo_url="https://your-app-url.com/.well-known/logo.png", |
| 144 | contact_email="hello@contact.com", |
| 145 | legal_info_url="hello@legal.com" |
| 146 | ) |
| 147 | |
| 148 | process: BashProcess = get_default_bash_process() |
| 149 | """Bash process to run commands.""" |
| 150 | |
| 151 | |
| 152 | @tool.get("/shell_run") |
| 153 | def shell_run(commands: str): |
| 154 | '''Run commands and return final output. |
| 155 | Queries to shell_run must ALWAYS have this structure: {\"commands\": query}.\n", |
| 156 | and query should be a command string. |
| 157 | ''' |
| 158 | return process.run(commands) |
| 159 | |
| 160 | return tool |
nothing calls this directly
no test coverage detected