forked from linux-china/chatgpt-spring-boot-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.http
97 lines (87 loc) · 1.93 KB
/
index.http
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
97
### simple chat
POST http://localhost:8080/chat
Content-Type: text/plain
What's Java?
### ChatGPT simple chat for translation
POST https://api.openai.com/v1/chat/completions
Authorization: Bearer {{OPENAI_API_KEY}}
Content-Type: application/json
{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "I want you to act as an English to Chinese translator."
},
{
"role": "user",
"content": "Hello, how are you?"
}
]
}
### Azure simple chat for translation
POST {{AZURE_OPENAI_ENDPOINT}}
api-key: {{AZURE_OPENAI_KEY}}
Content-Type: application/json
{
"model": "gpt-35-turbo-0301",
"messages": [
{
"role": "system",
"content": "I want you to act as an English to Chinese translator."
},
{
"role": "user",
"content": "Hello, how are you?"
}
]
}
### ChatGPT stream
POST https://api.openai.com/v1/chat/completions
Authorization: Bearer {{OPENAI_API_KEY}}
Content-Type: application/json
{
"model": "gpt-3.5-turbo",
"stream": true,
"messages": [
{
"role": "user",
"content": "What is Java?"
}
]
}
### ChatGPT function call
POST https://api.openai.com/v1/chat/completions
Authorization: Bearer {{OPENAI_API_KEY}}
Content-Type: application/json
{
"model": "gpt-3.5-turbo-0613",
"messages": [
{
"role": "system",
"content": "You are SQL developer. Write SQL according to requirements, and execute it in MySQL database."
},
{
"role": "user",
"content": "Query all employees whose salary is greater than the average."
}
],
"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"
]
}
}
]
}