MCPcopy
hub / github.com/algorithmicsuperintelligence/optillm / evaluate

Method evaluate

optillm/rstar.py:303–314  ·  view source on GitHub ↗
(self, node: Node)

Source from the content-addressed store, hash-verified

301 return overlap / total_words > 0.7
302
303 def evaluate(self, node: Node) -> float:
304 # Extract the final answer from the node's state
305 answer, confidence = self.extract_answer(node.state)
306
307 # Check if the answer is a number
308 try:
309 float(answer)
310 logger.debug(f"Evaluated node. Answer: {answer}, Confidence: {confidence}, Value: {confidence}")
311 return confidence # Return the confidence as the value
312 except ValueError:
313 logger.debug(f"Evaluated node. Answer: {answer}, Confidence: {confidence}, Value: 0.0")
314 return 0.0 # If it's not a valid number, return a low score
315
316 def extract_answer(self, final_state: str) -> Tuple[str, float]:
317 logger.debug(f"Extracting answer from state: {final_state}")

Callers 2

simulate_asyncMethod · 0.95
simulateMethod · 0.95

Calls 1

extract_answerMethod · 0.95

Tested by

no test coverage detected