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

Method _async_execute

KVCOMM/agents/final_decision.py:289–333  ·  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

287 return response
288
289 async def _async_execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any], mode: str = "default", **kwargs):
290 """ To be overriden by the descendant class """
291 """ Use the processed input to get the result """
292 if mode == "default":
293 request_uid = input.get("_request_uid")
294 inputs = await self._process_inputs(
295 input,
296 spatial_info,
297 temporal_info,
298 mode=mode,
299 **kwargs,
300 )
301 message = [
302 {"role": "system", "content": inputs["system_prompt"]},
303 {"role": "user", "content": inputs["user_prompt"]},
304 ]
305 result = await self.llm.agen(
306 message,
307 request_uid=request_uid,
308 agent_id=self.id,
309 agent_name=self.agent_name,
310 agent_role=self.role,
311 )
312 return result
313
314 mode_data = await self._process_inputs(
315 input,
316 spatial_info,
317 temporal_info,
318 mode=mode,
319 **kwargs,
320 )
321 request_uid = input.get("_request_uid") or kwargs.get("request_uid")
322 if request_uid is None:
323 raise ValueError("request_uid is required for request-scoped anchor updates.")
324 result = await self.llm.generate_for_agent(
325 request_uid=request_uid,
326 message=input["task"],
327 preferred_mode=mode_data["preferred_mode"],
328 output_dir=kwargs.get("output_dir"),
329 agent_id=self.id,
330 agent_name=self.agent_name,
331 agent_role=self.role,
332 )
333 return input["task"], result
334
335
336@AgentRegistry.register('FinalRefer')

Callers

nothing calls this directly

Calls 4

_process_inputsMethod · 0.95
generate_for_agentMethod · 0.80
getMethod · 0.45
agenMethod · 0.45

Tested by

no test coverage detected