File size: 687 Bytes
2eddab0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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)])