Package org.mockserver.llm.realtime
Class RealtimeTurn
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.llm.realtime.RealtimeTurn
A provider-neutral description of one scripted assistant response in a realtime voice session — the realtime
analogue of
Completion. The codecs turn it into the provider-correct ordered
WebSocket event sequence.
text— the visible/spoken text. InRealtimeModality.TEXTit is streamed as text deltas; inRealtimeModality.AUDIOit is streamed as the spoken-transcript delta stream.audioTranscript— an explicit spoken transcript; whennullthe transcript istext. Only used inRealtimeModality.AUDIO.audioBase64— synthetic audio bytes (base64) to emit as the single audio payload. Whennullthe codec emits a short silence placeholder per transcript token. The fidelity target is the event protocol, not audio DSP — these bytes are opaque placeholders.inputTokens/outputTokens— usage reported on the finalresponse.done(OpenAI) /usageMetadata(Gemini). WhenoutputTokensisnullthe codec reports the streamed transcript token count.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetText()inthashCode()static RealtimeTurnstatic RealtimeTurnrealtimeTurn(String text) The transcript to stream in audio modality — the explicitaudioTranscriptor, failing that,text.withAudioBase64(String audioBase64) withAudioTranscript(String audioTranscript) withInputTokens(Integer inputTokens) withOutputTokens(Integer outputTokens) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
RealtimeTurn
public RealtimeTurn()
-
-
Method Details
-
realtimeTurn
-
realtimeTurn
-
withText
-
getText
-
withAudioTranscript
-
getAudioTranscript
-
resolvedTranscript
The transcript to stream in audio modality — the explicitaudioTranscriptor, failing that,text. -
withAudioBase64
-
getAudioBase64
-
withInputTokens
-
getInputTokens
-
withOutputTokens
-
getOutputTokens
-
equals
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-