pub enum ValueOrigin {
Literal,
ModuleConstant,
ClassConstant,
LocalConstant,
ParameterDefault,
EnvDefault,
}Expand description
Where a captured value came from.
Variants§
Literal
A string literal at the call.
ModuleConstant
A module-level name assigned exactly one string literal.
ClassConstant
A class attribute (MODEL = ... in the class body, or a single
self.model = "...") assigned exactly one string literal.
LocalConstant
A function-local name assigned exactly one string literal.
ParameterDefault
The default of the enclosing function’s parameter: a literal or a
same-file constant (def ask(model=GPT_MODEL)). Callers may pass
another value. With no gap only when every call of the function is in
this file and none passes another value; otherwise the call also
carries an unresolved_model gap: parameter_overridden (listing the
values in-file callers pass), unseen_callers (some calls cannot be
seen) or parameter_default (a public function another module may
call).
EnvDefault
The literal fallback of an environment or configuration lookup:
os.getenv("MODEL", "gpt-4o"), os.environ.get(...),
config("MODEL", default=...) (python-decouple, django-environ),
settings.get("model", "gpt-4o"), getattr(cfg, "model", "gpt-4o")
or os.getenv("MODEL") or "gpt-4o". The deployed value may differ, so
the call also carries an unresolved_model gap: confirm before
acting on it.