-
Notifications
You must be signed in to change notification settings - Fork 75
/
chat.gpt
97 lines (83 loc) · 2.24 KB
/
chat.gpt
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
model: gpt-4o-mini
openai_api_key: sk-xxxx
---
# Simple Chat
What is Java?
# Function to execute SQL Query
You are SQL developer. Write SQL according to requirements, and execute it in MySQL database. {.system}
Query all employees whose salary is greater than the average.
```json {.functions}
[
{
"name": "execute_sql_query",
"description": "Execute SQL and return the result set",
"parameters": {
"type": "object",
"properties": {
"sql": {
"type": "string",
"description": "SQL to query"
}
},
"required": [
"sql"
]
}
}
]
```
##### ChatGPT
```json {.function_call}
{
"name" : "execute_sql_query",
"arguments" : {
"sql" : "SELECT * FROM employees WHERE salary > (SELECT AVG(salary) FROM employees)"
}
}
```
# Function to send email
Hi Jackie, could you write an email to Libing(libing.chen@gmail.com) and Sam(linux_china@hotmail.com) and invite them to join Mike's birthday party at 4 pm tomorrow? Thanks!
```json {.functions}
[
{
"name": "send_email",
"description": "Send email to recipients",
"parameters": {
"type": "object",
"properties": {
"recipients": {
"type": "array",
"items": {
"type": "string"
},
"description": "Recipients of email"
},
"subject": {
"type": "string",
"description": "Subject of email"
},
"content": {
"type": "string",
"description": "Content of email"
}
},
"required": [
"recipients",
"subject"
]
}
}
]
```
##### ChatGPT
```json {.function_call}
{
"name" : "send_email",
"arguments" : {
"recipients" : [ "libing.chen@gmail.com", "linux_china@hotmail.com" ],
"subject" : "Invitation to Mike's Birthday Party",
"content" : "Dear Libing and Sam,\n\nI hope this email finds you well. I am writing to invite you to Mike's birthday party, which will be held tomorrow at 4 pm. We would love for you to join us in celebrating this special occasion.\n\nPlease let me know if you are able to attend, so that we can make the necessary arrangements.\n\nLooking forward to seeing you!\n\nBest regards,\nJackie"
}
}
```