MCPcopy Create free account
hub / github.com/Mercury7353/PyBench / tool2dict

Function tool2dict

llms/utils.py:31–44  ·  view source on GitHub ↗
(tool: Tool)

Source from the content-addressed store, hash-verified

29
30
31def tool2dict(tool: Tool) -> Dict[str, str]:
32 parameters = property2dict(tool.function.parameters)
33 parameters["type"] = DataType.OBJECT.name
34 if "required" not in parameters:
35 parameters["required"] = []
36 new_tool = {
37 "type": "function",
38 "function": {
39 "name": tool.function.name,
40 "description": tool.function.description,
41 "parameters": parameters,
42 },
43 }
44 return new_tool
45
46
47def message2dict(

Callers 1

generateMethod · 0.90

Calls 1

property2dictFunction · 0.85

Tested by

no test coverage detected