symfonic.capabilities.prompting.capability¶
capability ¶
The prompting capability, as something Agent can be handed — W2 phase 3.
Everything this module needs already existed. :mod:.assembly has been the
bridge to the kernel's vocabulary since T3.2.1 — "the capability declares a
stage and produces a value; it never calls the kernel" — and the compiler that
turns contributions into a prompt has been written and tested the whole time.
What was missing was the twenty lines that hand both to the kernel at once, and
a kernel that would run them.
So this is deliberately thin. If it needed to be clever, the seam would be wrong.
Prompting is the first capability migrated for a structural reason rather than
an arbitrary one: capabilities/memory/contribution.py converts a memory
declaration into a PromptContribution, and hydration describes itself as
the last memory step before the prompt compiler. Memory has nowhere to deliver
until this exists.
PromptingCapability
dataclass
¶
PromptingCapability(sources: Sequence[Any] = (), priority: int = -900, options: dict[str, Any] = dict())
Compile the layered prompt and contribute it to the turn's assembly.
Usage is the whole point of the phase::
Agent(provider, capabilities=[PromptingCapability(sources=[...])])
sources are the prompt contributions this capability compiles — the
same values the capability's own compiler has always taken. They are held
on the config rather than read from a global, so two agents in one process
do not share a prompt.
contribute ¶
Declare the stage and supply the handler that answers it.
Both in one value, which is what lets fold_contributions refuse a
declaration nothing runs. The compile happens here, at contribution
time, so the stage descriptor can carry the compiled digest — that is
what makes "this plan compiled this prompt" checkable from the plan
alone, without the plan carrying the prompt text.
Source code in src/symfonic/capabilities/prompting/capability.py
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 287 288 289 290 291 292 293 294 295 | |