MCPcopy Index your code
hub / github.com/algorithmicsuperintelligence/optillm / solve

Method solve

optillm/leap.py:230–241  ·  view source on GitHub ↗
(self, initial_query: str)

Source from the content-addressed store, hash-verified

228 return self._extract_content(response, "applying principles to the query")
229
230 def solve(self, initial_query: str) -> str:
231 logger.info("Starting LEAP process")
232 examples = self.extract_examples_from_query(initial_query)
233 if not examples:
234 logger.warning("No examples found in the query. Proceeding with direct answer.")
235 return self.apply_principles(initial_query)
236
237 mistakes = self.generate_mistakes(examples)
238 self.generate_low_level_principles(mistakes)
239 self.generate_high_level_principles()
240
241 return self.apply_principles(initial_query)
242
243def leap(system_prompt: str, initial_query: str, client, model: str, request_config: dict = None, request_id: str = None) -> str:
244 leap_solver = LEAP(system_prompt, client, model, request_config=request_config, request_id=request_id)

Callers 3

leapFunction · 0.95
test.pyFile · 0.45
_discover_approachesMethod · 0.45

Tested by

no test coverage detected