-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathai_functions.py
47 lines (47 loc) · 1.78 KB
/
ai_functions.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
#### This file contains the functions which allows OpenAI API to control program flow
functions=[
{
"name": "roll_dice",
"description": "Rolls dice. Only used when a player or DM wants to roll dice. Includes calls to in XdY format where Y is how many sides the die has and X is how many times it's rolled. Only invoke this function is the user is trying to roll the dice. Do not call this function if the user is reporting what they rolled.",
"parameters": {
"type": "object",
"properties": {
"side_count": {
"type": "integer",
"enum": [4, 6, 8, 10, 12, 20, 100],
},
"roll_count": {
"type": "integer",
"descripton": "The number of times the dice should be rolled."
},
},
"required": ["side_count", "roll_count"],
}
},
{
"name": "attack",
"description": "Initiates an attack on an enemy.",
"parameters": {
"type": "object",
"properties": {
"attacker_statistics": {
"type": "object",
"properties": {
"attack_power": { "type": "integer" },
"accuracy": { "type": "integer" },
"critical_chance": { "type": "integer" }
},
"required": ["attack_power", "accuracy", "critical_chance"]
},
"target_enemy_statistics": {
"type": "object",
"properties": {
"defense": { "type": "integer" },
"evasion": { "type": "integer" }
},
"required": ["defense", "evasion"]
}
},
"required": ["attacker_statistics", "target_enemy_statistics"]
}
},]