MCPcopy Create free account
hub / github.com/THUDM/AutoWebGLM / parse_function_call

Function parse_function_call

eval.py:21–35  ·  view source on GitHub ↗
(function_call)

Source from the content-addressed store, hash-verified

19 return scores[0]["rouge-1"]['f']
20
21def parse_function_call(function_call):
22 pattern = r"(\w+)\((.*)\)"
23 match = re.match(pattern, function_call)
24
25 if match:
26 function_name = match.group(1)
27
28 def return_args(*args):
29 return args
30
31 function_args = eval(f'return_args({match.group(2)})')
32
33 return function_name, function_args
34
35 return None
36
37def extract(text):
38 ans = {

Callers 1

extractFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected