MCPcopy Create free account
hub / github.com/FastMAS/KVCOMM / extract_example

Method extract_example

KVCOMM/agents/final_decision.py:526–539  ·  view source on GitHub ↗
(self, prompt: str)

Source from the content-addressed store, hash-verified

524 }
525
526 def extract_example(self, prompt: str) -> list:
527 prompt = prompt['task']
528 lines = (line.strip() for line in prompt.split('\n') if line.strip())
529
530 results = []
531 lines_iter = iter(lines)
532 for line in lines_iter:
533 if line.startswith('>>>'):
534 function_call = line[4:]
535 expected_output = next(lines_iter, None)
536 if expected_output:
537 results.append(f"assert {function_call} == {expected_output}")
538
539 return results
540
541 def _execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any],**kwargs):
542 """ To be overriden by the descendant class """

Callers 1

_async_executeMethod · 0.95

Calls 1

splitMethod · 0.80

Tested by

no test coverage detected