Releases: linux-china/chatgpt-spring-boot-starter
Releases Β· linux-china/chatgpt-spring-boot-starter
0.9.0
0.8.0
Structured Output
Please refer OpenAI Structured Outputs for detail.
First you need to define an record for structured output:
@StructuredOutput(name = "java_example")
public record JavaExample(@Parameter("explanation") String explanation, @Parameter("answer") String answer,
@Parameter("code") String code, @Parameter("dependencies") List<String> dependencies) {
}
Then you can use structured output record as return type as following:
@ChatCompletion(system = "You are a helpful Java language assistant.")
Mono<JavaExample> generateJavaExample(String question);
Attention: if the return type is not Mono<String>
, and it means structured output.
0.7.0
Guys, sorry for long time to update.
- Models updated: chat(gpt-4o-mini), complete(gpt-3.5-turbo-instruct)
- Function call: use new
tools
instead offunction_call
(deprecated)
0.6.0
- Add embeddings and completion support
- Refactor: move chat related classes to chat package.
0.5.1
@joshlong did lots of contribution for this release, and thanks.
- Document updated by Josh Long
- Project structure adjusted by Josh Long, and Spring friendly now
- More powerful function resolution by Josh Long
- Improved function resolution in graalvm by Josh Long
- Prompt value could be from classpath and URL:
conversation=classpath:///conversation-prompt.txt
orconversation=https://example.com/conversation-prompt.txt
- Prompt value resolve with records support
0.4.0
- Prompt management added
- Prompt as Lambda/Function
- Reactive GPTFunction with
Mono
return type
0.3.0
ChatGPT interface support with functions built-in.
@GPTExchange
public interface GPTHelloService {
@ChatCompletion("You are a language translator, please translate the below text to Chinese.\n")
Mono<String> translateIntoChinese(String text);
@ChatCompletion("You are a language translator, please translate the below text from {0} to {1}.\n {2}")
Mono<String> translate(String sourceLanguage, String targetLanguage, String text);
}
Create ChatGPT interface service bean:
@Bean
public GPTHelloService gptHelloService(ChatGPTServiceProxyFactory proxyFactory) {
return proxyFactory.createClient(GPTHelloService.class);
}
0.2.1
- Add
proxy()
API inOpenAIChatAPI.java
for OpenAI REST API proxy. - Add
OpenAIProxyController
for proxy support. - Add PromptManager demo based on properties file
0.2.0
0.1.1
Initial release.
- Base on Spring Boot 3.0+
- Async with Spring Webflux
- Support ChatGPT Chat Stream
- Support ChatGPT functions