MCPcopy Index your code
hub / github.com/THUDM/AgentBench / union

Method union

src/server/tasks/knowledgegraph/api.py:127–138  ·  view source on GitHub ↗

Set union. Returns (new_variable, "Observation: ...").

(self, variable1: Variable, variable2: Variable)

Source from the content-addressed store, hash-verified

125 return new_variable, rtn_str
126
127 def union(self, variable1: Variable, variable2: Variable):
128 """
129 Set union. Returns (new_variable, "Observation: ...").
130 """
131 if variable1.type != variable2.type:
132 raise ValueError("union: two variables must have the same type")
133 if not isinstance(variable1, Variable) or not isinstance(variable2, Variable):
134 raise ValueError("union: variable must be a variable")
135
136 rtn_str = f"Observation: variable ##, which are instances of {variable1.type}"
137 new_variable = Variable(variable1.type, f"(OR {variable1.program} {variable2.program})")
138 return new_variable, rtn_str
139
140 def count(self, variable: Variable):
141 """

Callers

nothing calls this directly

Calls 1

VariableClass · 0.85

Tested by

no test coverage detected