(tool: Tool)
| 29 | |
| 30 | |
| 31 | def 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 | |
| 47 | def message2dict( |
no test coverage detected