MCPcopy Create free account
hub / github.com/THUDM/AgentTuning / run

Method run

eval_heldout/rewoo/nodes/Worker.py:96–108  ·  view source on GitHub ↗

Run query through WolframAlpha and parse result.

(self, query: str)

Source from the content-addressed store, hash-verified

94 super().__init__()
95
96 def run(self, query: str) -> str:
97 """Run query through WolframAlpha and parse result."""
98 res = self.wolfram_client.query(query)
99
100 try:
101 answer = next(res.results).text
102 except StopIteration:
103 return "Wolfram Alpha wasn't able to answer it"
104
105 if answer is None or answer == "":
106 return "No good Wolfram Alpha Result was found"
107 else:
108 return f"Answer: {answer}"
109
110
111class WolframAlphaWorker(Node):

Callers 1

runMethod · 0.95

Calls 1

nextFunction · 0.85

Tested by

no test coverage detected