Cialtion commited on
Commit
2eddab0
·
verified ·
1 Parent(s): 55271ca

Upload rt_tools.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. rt_tools.py +23 -0
rt_tools.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ class RTTools:
4
+ # 简化版工具:函数名和参数极短,最大化体现速度优势
5
+ CONTACT_TOOL = {
6
+ "type": "function",
7
+ "function": {
8
+ "name": "add_contact",
9
+ "description": "Add a contact.",
10
+ "parameters": {
11
+ "type": "object",
12
+ "properties": {
13
+ "name": {"type": "string", "description": "Name"},
14
+ "phone": {"type": "string", "description": "Phone"}
15
+ },
16
+ "required": ["name", "phone"]
17
+ }
18
+ }
19
+ }
20
+
21
+ @classmethod
22
+ def get_all(cls):
23
+ return "\n".join([json.dumps(cls.CONTACT_TOOL)])