MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / action_schema_check

Function action_schema_check

rft/trainer/utils/gui_eval.py:40–51  ·  view source on GitHub ↗
(completions, **kwargs)

Source from the content-addressed store, hash-verified

38 return 0.0
39
40def action_schema_check(completions, **kwargs):
41 global global_executor
42 futures = [global_executor.submit(_action_schema_check,completion[0]["content"],) for completion in completions]
43 scores = []
44 for future in futures:
45 try:
46 scores.append(future.result(timeout=5)*0.3)
47 except TimeoutError as e:
48 print("Timeout while checking schema.")
49 scores.append(0.0)
50
51 return scores
52
53def _action_type_check(res:str, solution: dict):
54 if isinstance(solution,str):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected