Add structured transcription results#6642
Conversation
Expose structured transcription data from OpenAI responses, including duration, language, segments, words, and diarized speaker annotations. Close audio resource input streams and simplify redundant option checks. Closes spring-projects#6640 Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
Signed-off-by: Lucas Christian <lucaschgf7@gmail.com>
|
I found another upstream issue affecting the current diarized implementation. I tested the OpenAI API directly with However, I have opened an upstream issue and PR to address the SDK deserialization problem. I am waiting for feedback from the OpenAI team before continuing with the diarized integration, since merging the current implementation without handling this case would cause a runtime error for a response returned by the OpenAI API. My current expectation is that the field may remain required in the generated SDK model; the OpenAI API schema and SDKs in other languages currently describe |
Summary
AudioTranscriptionResult,AudioTranscriptionSegment, andAudioTranscriptionWordto expose structured transcription data.Breaking Change
AudioTranscription.getOutput()now returnsAudioTranscriptionResultinstead ofString.Use
.text()when only the transcription text is needed:Testing
./mvnw process-sources./mvnw javadoc:javadoc./mvnw clean package./mvnw -pl spring-ai-docs antoraCloses #6640