-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfunc_prompt.py
76 lines (73 loc) · 2.67 KB
/
func_prompt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
MESSAGES = [{
"role": "user",
"content": "Help me understand following by describing as a detailed knowledge graph: {user_input}"
}]
FUNCTION_CALL = {"name": "knowledge_graph"}
FUNCTIONS = [{
"name": "knowledge_graph",
"description":
"Generate a knowledge graph with entities and relationships. "
"Use the colors to help differentiate between different node or edge types/categories. "
"Always provide light pastel colors that work well with black font.",
"parameters": {
"type": "object",
"properties": {
"metadata": {
"type": "object",
"properties": {
"createdDate": {"type": "string"},
"lastUpdated": {"type": "string"},
"description": {"type": "string"}
}
},
"nodes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {"type": "string"},
"label": {"type": "string"},
"type": {"type": "string"},
# Added color property
"color": {"type": "string"},
"properties": {
"type": "object",
"description": "Additional attributes for the node"
}
},
"required": [
"id",
"label",
"type",
"color",
] # Added color to required
},
},
"edges": {
"type": "array",
"items": {
"type": "object",
"properties": {
"from": {"type": "string"},
"to": {"type": "string"},
"relationship": {"type": "string"},
"direction": {"type": "string"},
# Added color property
"color": {"type": "string"},
"properties": {
"type": "object",
"description": "Additional attributes for the edge"
}
},
"required": [
"from",
"to",
"relationship",
"color"
] # Added color to required
},
},
},
"required": ["nodes", "edges"]
},
}]