MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / TypedVar

Class TypedVar

verifier/AgentVerifier/WorkflowToLean.py:59–78  ·  view source on GitHub ↗

A typed workflow variable used in reads/writes/parameters.

Source from the content-addressed store, hash-verified

57
58@dataclass
59class TypedVar:
60 """A typed workflow variable used in reads/writes/parameters."""
61 name: str
62 base_type: str # e.g. "TString", "TList TUnknown"
63 value: Optional[object] = None # populated only for parameters
64
65 def to_lean_typed(self) -> str:
66 parts = self.base_type.split()
67 lean_type = " .".join(parts)
68 return f'⟨"{self.name}", .{lean_type}⟩'
69
70 def to_dict(self) -> dict:
71 d: dict = {"name": self.name, "base_type": self.base_type}
72 if self.value is not None:
73 d["value"] = self.value
74 return d
75
76 @staticmethod
77 def from_dict(d: dict) -> "TypedVar":
78 return TypedVar(name=d["name"], base_type=d["base_type"], value=d.get("value"))
79
80
81# ---------- NodeIR ----------

Callers 4

from_dictMethod · 0.85
parse_task_jsonFunction · 0.85
build_readsFunction · 0.85
parse_body_stepsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected