Context & Formatting¶
Resolve a dotted path against a mapping/object.
Examples:
>>> get_dotted({"a": {"b": 1}}, "a.b")
1
>>> class X: pass
>>> x = X(); x.v = 3
>>> get_dotted({"x": x}, "x.v")
3
Compile a reference spec into a resolver callable.
- Literals return as-is.
"key"fetches from context."key.inner.attr"traverses mappings/attributes.- In
strictmode, unresolved references raiseLookupError.
Returns:
| Type | Description |
|---|---|
Callable[[Mapping[str, Any]], Any]
|
A function |
Precompile a logging template with {dotted.refs}.
Supported tokens
{key.path}: read from context{result.path}: read from current step result{key.__len__}: length of the resolved value- zero-arg callables (e.g.
{plan.model_dump}) - dict/list are JSON-serialized
Returns:
| Type | Description |
|---|---|
Callable[[Mapping[str, Any], Any], str] | None
|
A renderer |