featherweight.context¶
context ¶
Per-attempt context the runner hands to tools through langchain's ToolRuntime.
Tools declare a runtime: ToolRuntime[RunContext] parameter; langchain fills it in and hides it
from the model, so tools stay plain static objects that can sit in an agent's allow-list.
RunContext
dataclass
¶
RunContext(
job_id: str | None,
run_id: str,
attempt_id: str,
identity: IdentityT | None = None,
)
Bases: Generic[IdentityT]
What a tool can ask for with runtime: ToolRuntime[RunContext[Teacher]]: LangChain fills it in and hides it from the model.