Skip to content

Commit 0dfe92a

Browse files
committed
upgrade chatgpt-spring-boot-starter version to 1.0.2
1 parent 3e4b666 commit 0dfe92a

File tree

2 files changed

+41
-8
lines changed

2 files changed

+41
-8
lines changed

README.md

+37-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ You can use your own account api-key to let your demo work.
1111
<i>**The web page is written by ChatGPT for me, which is very simple. If anyone is good at the front end, you can create a pull request to help optimize it. Thank you.
1212
File Path: src/main/resources/static/index.html</i>
1313
## Usage
14-
1.clone the code.
15-
2.set your chatgpt.api-key in "application.yml".
16-
3.run it, and then you can chat with chatgpt by this api.
17-
14+
## 1.clone the code.
15+
## 2.set your chatgpt.api-key in "application.yml".
16+
## 3.run it, and then you can chat with chatgpt by this api.
17+
### 3.1 Single message
1818
+ request
1919
```shell
2020
curl --location --request GET '127.0.0.1:8080/send?message=how are you'
@@ -28,6 +28,39 @@ curl --location --request GET '127.0.0.1:8080/send?message=how are you'
2828
"data": "\n\nI'm doing well, thank you. How about you?"
2929
}
3030
```
31+
### 3.2 Multi message
32+
+ request
33+
```shell
34+
curl --location 'http://127.0.0.1:8080/multi/send' \
35+
--header 'Content-Type: application/json' \
36+
--data '[
37+
{
38+
"role": "system",
39+
"content": "You are a helpful assistant."
40+
},
41+
{
42+
"role": "user",
43+
"content": "Who won the world series in 2020?"
44+
},
45+
{
46+
"role": "assistant",
47+
"content": "The Los Angeles Dodgers won the World Series in 2020."
48+
},
49+
{
50+
"role": "user",
51+
"content": "Where was it played?"
52+
}
53+
]'
54+
```
55+
56+
+ response
57+
```json
58+
{
59+
"code": 200,
60+
"message": "success",
61+
"data": "The 2020 World Series was played at Globe Life Field, in Arlington, Texas."
62+
}
63+
```
3164

3265
# Author Info
3366
Email: flashvayne@gmail.com

src/main/resources/application.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ logbook:
1616
format:
1717
style: http
1818
chatgpt:
19-
api-key: sk-xxxxxxx #api-key. It can be generated in this link https://platform.openai.com/account/api-keys
19+
api-key: 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 #api-key. It can be generated in this link https://platform.openai.com/account/api-keys
2020
# some properties as below have default values. For descriptions of these fields, please refer to https://platform.openai.com/docs/api-reference/completions/create and https://platform.openai.com/docs/api-reference/chat/create
2121
# url: https://api.openai.com/v1/completions
2222
# max-tokens: 500
2323
# model: text-davinci-003
24-
# temperature: 0.0
24+
temperature: 0.6
2525
# top-p: 1.0
26-
# multi:
26+
multi:
2727
# model: gpt-3.5-turbo
2828
# url: https://api.openai.com/v1/chat/completions
2929
# max-tokens: 500
30-
# temperature: 0.0
30+
temperature: 0.6
3131
# top-p: 1.0

0 commit comments

Comments
 (0)