tools_runtime¶
ToolBackend
¶
Bases: Protocol
Protocol defining what a dynamic tool backend must implement.
Source code in wintermute/ai/tools_runtime.py
169 170 171 172 173 174 | |
ToolRegistry
¶
Source code in wintermute/ai/tools_runtime.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
get_definitions()
¶
Convert registered tools to OpenAI-compatible function definitions.
Source code in wintermute/ai/tools_runtime.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | |
load_tool_configs(json_path)
¶
Read distributable_db/tools.json and store in _path_mapping.
Source code in wintermute/ai/tools_runtime.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
unregister(name)
¶
Remove a single tool from the registry by name.
Returns True if a tool was actually removed, False if it
was already absent. Used by the cartridge manager when unloading
a cartridge so its methods stop showing up in the AI tool surface.
Source code in wintermute/ai/tools_runtime.py
105 106 107 108 109 110 111 112 | |
ToolsRuntime
¶
Orchestrates tool execution across local static tools (ToolRegistry) and dynamic backends (MCP Servers like Surgeon).
Source code in wintermute/ai/tools_runtime.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | |
get_all_tools()
async
¶
Combine static local tools with dynamic backend tools.
Source code in wintermute/ai/tools_runtime.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 | |
register_backend(backend)
¶
Register a dynamic backend (e.g., SurgeonBackend).
Source code in wintermute/ai/tools_runtime.py
186 187 188 | |
run_tool(name, args)
async
¶
Execute a tool by name. Checks dynamic backends first, then local registry.
Source code in wintermute/ai/tools_runtime.py
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | |
unregister_tools(names)
¶
Remove the given tool names from the global :data:tools registry.
Counterpart to :func:wintermute.ai.utils.tool_factory.register_tools +
:meth:ToolRegistry.register. Used by
:class:wintermute.cartridges.manager.CartridgeManager on unload so the
AI no longer sees cartridge methods that have been removed from memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
Iterable[str]
|
Iterable of tool names to drop. Names that are already absent are ignored silently. |
required |
Returns:
| Type | Description |
|---|---|
int
|
The number of tools actually removed. |
Source code in wintermute/ai/tools_runtime.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | |