|
|
@@ -51,14 +51,12 @@ class Context(SimpleNamespace):
|
|
|
def access(self, ctx: str) -> Any:
|
|
|
"""Accessor for context state with a dot-separated path"""
|
|
|
path = ctx.split(".")
|
|
|
- if path[0] == "context":
|
|
|
- return reduce(getattr, path[1:], self)
|
|
|
|
|
|
if path[0] == "env":
|
|
|
assert len(path) == 2
|
|
|
return os.environ.get(path[1])
|
|
|
|
|
|
- raise KeyError(ctx)
|
|
|
+ return reduce(getattr, path, self)
|
|
|
|
|
|
@overload
|
|
|
def fabricate(self, state: BaseModel, attr: Literal["inputs"]) -> Inputs: ...
|