MCPcopy Create free account
hub / github.com/billxbf/ReWOO / Solver

Class Solver

nodes/Solver.py:5–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3
4
5class Solver(LLMNode):
6 def __init__(self, prefix=DEFAULT_PREFIX, suffix=DEFAULT_SUFFIX, model_name="text-davinci-003", stop=None):
7 super().__init__("Solver", model_name, stop, input_type=str, output_type=str)
8 self.prefix = prefix
9 self.suffix = suffix
10
11 def run(self, input, worker_log, log=False):
12 assert isinstance(input, self.input_type)
13 prompt = self.prefix + input + "\n" + worker_log + self.suffix + input + '\n'
14 response = self.call_llm(prompt, self.stop)
15 completion = response["output"]
16 if log:
17 return response
18 return completion

Callers 1

__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected