after_model(
self,
state: ResumeState,
runtime: Runtime[ContextT]
) -> dict| Name | Type | Description |
|---|---|---|
state* | ResumeState | |
runtime* | Runtime[ContextT] |
Write _context_tokens for the latest turn.
Model metadata is written by ConfigurableModelMiddleware from the
actual request that completed successfully; this hook only records token
usage from the most recent AIMessage.usage_metadata.
Current agent state; only messages is inspected.
LangGraph runtime required by the middleware interface.