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

Class FinalDirect

KVCOMM/agents/final_decision.py:611–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609
610@AgentRegistry.register('FinalDirect')
611class FinalDirect(Node):
612 def __init__(self, id: str | None =None, domain: str = "", llm_name: str = "",):
613 """ Used for Directed IO """
614 super().__init__(id, "FinalDirect")
615 self.prompt_set = PromptSetRegistry.get(domain)
616
617 def _process_inputs(self, raw_inputs:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], **kwargs)->List[Any]:
618 """ To be overriden by the descendant class """
619 """ Process the raw_inputs(most of the time is a List[Dict]) """
620 return None
621
622 def _execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any],**kwargs):
623 """ To be overriden by the descendant class """
624 """ Use the processed input to get the result """
625 output = ""
626 info_list = []
627 for info in spatial_info.values():
628 info_list.append(info['output'])
629 if len(info_list):
630 output = info_list[-1]
631 return output
632
633 async def _async_execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], mode: str = "default", **kwargs):
634 """ To be overriden by the descendant class """
635 """ Use the processed input to get the result """
636 output = ""
637 info_list = []
638 for info in spatial_info.values():
639 info_list.append(info['output'])
640 if len(info_list):
641 output = info_list[-1]
642 if mode == "allow_kv_reuse":
643 return input.get("task"), output
644 return output
645
646
647@AgentRegistry.register('FinalMajorVote')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected