MCPcopy Create free account
hub / github.com/Alibaba-NLP/VRAG / parse_tool_call

Function parse_tool_call

demo/vimrag_app.py:685–694  ·  view source on GitHub ↗

从 content 中解析 tool call

(content_text)

Source from the content-addressed store, hash-verified

683
684
685def parse_tool_call(content_text):
686 """从 content 中解析 tool call"""
687 try:
688 if "<tool_call>" in content_text and "</tool_call>" in content_text:
689 json_str = content_text.split("<tool_call>")[-1].split("</tool_call>")[0]
690 tool_data = json5.loads(json_str)
691 return tool_data.get('name'), tool_data.get('arguments', {})
692 except Exception:
693 pass
694 return None, {}
695
696
697def get_file_type_icon(file_type):

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected