symfonic.capabilities.tools.capability¶
capability ¶
Lazy tool routing as something Agent can be handed.
The resolver in :mod:~symfonic.capabilities.tools.routing decides which tools
a turn may use; :mod:symfonic.kernel.palette binds that subset at the
model-call boundary. This is the twenty lines that hand the declaration and the
handler to the kernel at once, the way MemoryCapability did for memory.
A resolution stage, and it must run before the model. PROMPT_ASSEMBLY is
the phase that does, and the palette is the one thing here that a later phase
could not supply: by POST_MODEL the model has already been offered whatever
it was going to be offered.
Absence remains disabled. Without a router or an explicit unavailable report, nothing starts routing implicitly. An opt-in unavailable report retains the full compiled palette before selection policy, warns at composition, and resolves a reasoned outcome. Alone it is not compatibility admission evidence.
Selection stages, if any, run here. stages= composes the public
selection pipeline — an allowlist, a role palette, a policy ceiling, a forced
choice — and its answer is what this contributes. Before that argument existed
the seven stages were public, constructible, and unreachable: nothing in the
kernel ran them, so procedural_force_tool_choice='hard' had a class and no
path to the model. The router and the stages compose rather than compete: the
router says which tools this turn is about and the stages apply the
deployment's policy to that set.
ToolsCapability
dataclass
¶
ToolsCapability(entries_for: Callable[[Any], Any] | None = None, registered: tuple[str, ...] = (), cue_from: Callable[[Any], str] = lambda request: str(getattr(request, 'prompt', '') or ''), stages: tuple[Any, ...] = (), preconditions: tuple[Any, ...] = (), routing_unavailable: RoutingUnavailable | None = None, warning_already_issued: bool = False, count_unavailable: bool = True)
Narrow the palette a turn offers the model, from the turn's own cue.
contribute ¶
Declare the routing stage and the handler that answers it.
Source code in src/symfonic/capabilities/tools/capability.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 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 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | |