-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcommands_as_json.py
78 lines (76 loc) · 2.91 KB
/
commands_as_json.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
76
77
78
"""
In order for ChatGPT to use our functions, they need
they need to be described in a the format Dict[str, str]. If you have
a custom function, write the details of your function in
a new dictionary object in the commands array.
For more details, you can read the ChatGPT official documentation here:
https://platform.openai.com/docs/guides/gpt/function-calling
"""
commands = [
{
"name": "open_app",
"description": "Start an application on the user's computer if asked to, \
If the application is already opened, inform the user of that.",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the application"
},
},
"required": ["name"]
}
},
{
"name": "close_app",
"description": "Close an application on the user's computer if asked to. \
If the application is already closed, inform the user of that",
"parameters": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the application"
},
},
"required": ["name"]
}
},
{
"name": "use_spotify_player",
"description": "Uses an instance of the Spotify_Player class to play music on Spotify.",
"parameters": {
"type": "object",
"properties": {
"play_option": {
"type": "boolean",
"description": "Determines whether the user pause or play something on Spotify\
If the user wants to pause their music, or resume the current playback, then no other parameter is required\
True to play, False to pause"
},
"item": {
"type": "string",
"description": "The track that the user wants to play on Spotify."
},
"type": {
"type": "string",
"description": "The type of the item that the user wants to play",
"enum": ["track", "album", "playlist"]
}
},
"required": ["play_option"]
}
},
{
"name": "sleep",
"description": "If the user doesn't need any more assistance at the moment,\
or if you presume they are finished speaking to you for now, \
then this function should be called. You will take no more input until the user \
says the wake command 'hey stella' and requests more assistance.",
"parameters": {
"type": "object",
"properties": {}
}
}
]