New Release 3.9.2
simple-openai has been updated to support:
Usage of existing Json Schemas (in addition to defining them by classes) for Structured Outputs.
Usage of custom Json Object Mappers for loading Jackson Modules for example to understand date/time types.
New Release 3.10.0 - Realtime API
simple-openai has been updated to support Realtime API , so you can enable sync speech-to-speech communication in your Java applications, as well as multimodality (audio, text) and function calling.
Here you can see a demo code of Realtime:
public static void main(String[] args) throws LineUnavailableException, InterruptedException {
var sound = new Sound();
var openAI = SimpleOpenAI.builder()
.apiKey(System.getenv("OPENAI_API_KEY"))
.realtimeConfig(RealtimeConfig.of("gpt-4o-realtime-preview-2024-10-01"))
.build();
var configuration = Configuration.builder()
.modality(Modality.AUDIO)
.instructions("Respond with short, direct sentences.")
.voice(Configuration.VoiceRealtime.ECHO)
.outputAudioFormat(Configuration.AudioFormatRealtime.PCM16)
.inputAudioTranscription(null)
.turnDetection(null)
.temperature(0.9)
.build();
var realtime = openAI.realtime();
This file has been truncated. show original