MCPcopy Create free account
hub / github.com/THUDM/AgentBench / _extract_function

Method _extract_function

src/server/tasks/os_interaction/task.py:346–358  ·  view source on GitHub ↗
(func_name: str, arguments: List, thought: str)

Source from the content-addressed store, hash-verified

344 # added for function calling
345 @staticmethod
346 def _extract_function(func_name: str, arguments: List, thought: str):
347 ret = {"thought": thought, "action": None, "content": None}
348 if func_name == "bash_action":
349 ret["action"] = "bash"
350 ret["content"] = arguments[0]
351 if func_name == "finish_action":
352 ret["action"] = "commit"
353 ret["content"] = arguments[0] if arguments else None
354 if func_name == "answer_action":
355 ret["action"] = "commit"
356 ret["content"] = arguments[0]
357
358 return ret
359
360 async def start_sample(self, index, session: Session) -> TaskSampleExecutionResult:
361 if not self.env_controller_background_task:

Callers 1

_handle_agent_actionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected