1. maven dependency (currently only central Maven repository have this dependency, haven't add to Aliyun repository)
<dependency>
<groupId>cn.com.ogtwelve</groupId>
<artifactId>OGTwelveUtilPack</artifactId>
<version></version> <!--See whats the newest version is;-->
</dependency>
// how to use chatgpt using my dependency
// date time formatter and chatgpt can be used at the same time, if u want to use chatgpt, just add @EnableChatGPT
// if u want to use date time formatter, just add @EnableGlobalDateFormat
// if u want to use both, just add both of them
@SpringBootApplication
@EnableChatGPT
public class Application {
...
}
properties file :
# if use application.properties
# proxy depends on weather u have a vpn or not , if not just delete the proxyHost and proxyPort
# but without vpn, u might not be able to use the chatgpt api or just have to wait for a long time to get the response
# model and chatModel, about these parameters, u can go to openai's website to check out the model u want to use
# last parameter is the session expiration time, if u want the session to be expired in how many *minutes*, just change the number
openai.token=
openai.proxyHost=127.0.0.1
openai.proxyPort=4780
openai.model=
openai.chatModel=
openai.sessionExpirationTime=30
yaml file :
openai:
token:
proxyHost:
proxyPort:
model:
chatModel:
sessionExpirationTime:
1. maven dependency (currently only central Maven repository have this dependency, haven't add to Aliyun repository)
<dependency>
<groupId>cn.com.ogtwelve</groupId>
<artifactId>OGTwelveUtilPack</artifactId>
<version></version> <!--See whats the newest version is;-->
</dependency>
// version 1.16 and other thats below this number
@SpringBootApplication(scanBasePackages = "cn.com.ogtwelve.utils")
// version big than 1.18 will be using annotation to use time formatter
// better use above 1.2.0, because there won't be any waste output in the console
@SpringBootApplication
@EnableGlobalDateFormat
public class Application {
...
}