SimpleTool / rt_tools.py
Cialtion's picture
Upload rt_tools.py with huggingface_hub
2eddab0 verified
raw
history blame
687 Bytes
import json
class RTTools:
# 简化版工具:函数名和参数极短,最大化体现速度优势
CONTACT_TOOL = {
"type": "function",
"function": {
"name": "add_contact",
"description": "Add a contact.",
"parameters": {
"type": "object",
"properties": {
"name": {"type": "string", "description": "Name"},
"phone": {"type": "string", "description": "Phone"}
},
"required": ["name", "phone"]
}
}
}
@classmethod
def get_all(cls):
return "\n".join([json.dumps(cls.CONTACT_TOOL)])