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

Method _async_execute

KVCOMM/agents/final_decision.py:676–694  ·  view source on GitHub ↗

To be overriden by the descendant class

(self, input:Dict[str,str],  spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], mode: str = "default", **kwargs)

Source from the content-addressed store, hash-verified

674 return max_output
675
676 async def _async_execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], mode: str = "default", **kwargs):
677 """ To be overriden by the descendant class """
678 """ Use the processed input to get the result """
679 output_num = {}
680 max_output = ""
681 max_output_num = 0
682 for info in spatial_info.values():
683 processed_output = await self.prompt_set.postprocess_answer(info['output'])
684 logger.debug("Processed output: {}", processed_output)
685 if processed_output in output_num:
686 output_num[processed_output] += 1
687 else:
688 output_num[processed_output] = 1
689 if output_num[processed_output] > max_output_num:
690 max_output = processed_output
691 max_output_num = output_num[processed_output]
692 if mode == "allow_kv_reuse":
693 return input.get("task"), max_output
694 return max_output

Callers

nothing calls this directly

Calls 3

valuesMethod · 0.80
postprocess_answerMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected