Interface RealtimeServerEvent.Visitor
- 
                    
                    - All Implemented Interfaces:
 
 public interface RealtimeServerEvent.Visitor<T extends Object>An interface that defines how to map each variant of RealtimeServerEvent to a value of type T. 
- 
                
                    
                    - 
                                
                            
                                Method SummaryModifier and Type Method Description abstract TvisitConversationCreated(ConversationCreatedEvent conversationCreated)Returned when a conversation is created. abstract TvisitConversationItemCreated(ConversationItemCreatedEvent conversationItemCreated)Returned when a conversation item is created. abstract TvisitConversationItemDeleted(ConversationItemDeletedEvent conversationItemDeleted)Returned when an item in the conversation is deleted by the client with a conversation.item.deleteevent.abstract TvisitConversationItemInputAudioTranscriptionCompleted(ConversationItemInputAudioTranscriptionCompletedEvent conversationItemInputAudioTranscriptionCompleted)This event is the output of audio transcription for user audio written to the user audio buffer. abstract TvisitConversationItemInputAudioTranscriptionDelta(ConversationItemInputAudioTranscriptionDeltaEvent conversationItemInputAudioTranscriptionDelta)Returned when the text value of an input audio transcription content part is updated. abstract TvisitConversationItemInputAudioTranscriptionFailed(ConversationItemInputAudioTranscriptionFailedEvent conversationItemInputAudioTranscriptionFailed)Returned when input audio transcription is configured, and a transcription request for a user message failed. abstract TvisitConversationItemRetrieved(RealtimeServerEvent.ConversationItemRetrieved conversationItemRetrieved)Returned when a conversation item is retrieved with conversation.item.retrieve.abstract TvisitConversationItemTruncated(ConversationItemTruncatedEvent conversationItemTruncated)Returned when an earlier assistant audio message item is truncated by the client with a conversation.item.truncateevent.abstract TvisitError(ErrorEvent error)Returned when an error occurs, which could be a client problem or a server problem. abstract TvisitInputAudioBufferCleared(InputAudioBufferClearedEvent inputAudioBufferCleared)Returned when the input audio buffer is cleared by the client with a input_audio_buffer.clearevent.abstract TvisitInputAudioBufferCommitted(InputAudioBufferCommittedEvent inputAudioBufferCommitted)Returned when an input audio buffer is committed, either by the client or automatically in server VAD mode. abstract TvisitInputAudioBufferSpeechStarted(InputAudioBufferSpeechStartedEvent inputAudioBufferSpeechStarted)Sent by the server when in server_vadmode to indicate that speech has been detected in the audio buffer.abstract TvisitInputAudioBufferSpeechStopped(InputAudioBufferSpeechStoppedEvent inputAudioBufferSpeechStopped)Returned in server_vadmode when the server detects the end of speech in the audio buffer.abstract TvisitRateLimitsUpdated(RateLimitsUpdatedEvent rateLimitsUpdated)Emitted at the beginning of a Response to indicate the updated rate limits. abstract TvisitResponseAudioDelta(ResponseAudioDeltaEvent responseAudioDelta)Returned when the model-generated audio is updated. abstract TvisitResponseAudioDone(ResponseAudioDoneEvent responseAudioDone)Returned when the model-generated audio is done. abstract TvisitResponseAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent responseAudioTranscriptDelta)Returned when the model-generated transcription of audio output is updated. abstract TvisitResponseAudioTranscriptDone(ResponseAudioTranscriptDoneEvent responseAudioTranscriptDone)Returned when the model-generated transcription of audio output is done streaming. abstract TvisitResponseContentPartAdded(ResponseContentPartAddedEvent responseContentPartAdded)Returned when a new content part is added to an assistant message item during response generation. abstract TvisitResponseContentPartDone(ResponseContentPartDoneEvent responseContentPartDone)Returned when a content part is done streaming in an assistant message item. abstract TvisitResponseCreated(ResponseCreatedEvent responseCreated)Returned when a new Response is created. abstract TvisitResponseDone(ResponseDoneEvent responseDone)Returned when a Response is done streaming. abstract TvisitResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent responseFunctionCallArgumentsDelta)Returned when the model-generated function call arguments are updated. abstract TvisitResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent responseFunctionCallArgumentsDone)Returned when the model-generated function call arguments are done streaming. abstract TvisitResponseOutputItemAdded(ResponseOutputItemAddedEvent responseOutputItemAdded)Returned when a new Item is created during Response generation. abstract TvisitResponseOutputItemDone(ResponseOutputItemDoneEvent responseOutputItemDone)Returned when an Item is done streaming. abstract TvisitResponseTextDelta(ResponseTextDeltaEvent responseTextDelta)Returned when the text value of a "text" content part is updated. abstract TvisitResponseTextDone(ResponseTextDoneEvent responseTextDone)Returned when the text value of a "text" content part is done streaming. abstract TvisitSessionCreated(SessionCreatedEvent sessionCreated)Returned when a Session is created. abstract TvisitSessionUpdated(SessionUpdatedEvent sessionUpdated)Returned when a session is updated with a session.updateevent, unless there is an error.abstract TvisitTranscriptionSessionUpdated(TranscriptionSessionUpdatedEvent transcriptionSessionUpdated)Returned when a transcription session is updated with a transcription_session.updateevent, unless there is an error.abstract TvisitOutputAudioBufferStarted(RealtimeServerEvent.OutputAudioBufferStarted outputAudioBufferStarted)WebRTC Only: Emitted when the server begins streaming audio to the client. abstract TvisitOutputAudioBufferStopped(RealtimeServerEvent.OutputAudioBufferStopped outputAudioBufferStopped)WebRTC Only: Emitted when the output audio buffer has been completely drained on the server, and no more audio is forthcoming. abstract TvisitOutputAudioBufferCleared(RealtimeServerEvent.OutputAudioBufferCleared outputAudioBufferCleared)WebRTC Only: Emitted when the output audio buffer is cleared. Tunknown(JsonValue json)Maps an unknown variant of RealtimeServerEvent to a value of type T. - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        visitConversationCreatedabstract T visitConversationCreated(ConversationCreatedEvent conversationCreated) Returned when a conversation is created. Emitted right after session creation. 
 - 
                                        visitConversationItemCreatedabstract T visitConversationItemCreated(ConversationItemCreatedEvent conversationItemCreated) Returned when a conversation item is created. There are several scenarios that produce this event: - The server is generating a Response, which if successful will produce either one or two Items, which will be of type - message(role- assistant) or type- function_call.
- The input audio buffer has been committed, either by the client or the server (in - server_vadmode). The server will take the content of the input audio buffer and add it to a new user message Item.
- The client has sent a - conversation.item.createevent to add a new Item to the Conversation.
 
 - 
                                        visitConversationItemDeletedabstract T visitConversationItemDeleted(ConversationItemDeletedEvent conversationItemDeleted) Returned when an item in the conversation is deleted by the client with a conversation.item.deleteevent. This event is used to synchronize the server's understanding of the conversation history with the client's view.
 - 
                                        visitConversationItemInputAudioTranscriptionCompletedabstract T visitConversationItemInputAudioTranscriptionCompleted(ConversationItemInputAudioTranscriptionCompletedEvent conversationItemInputAudioTranscriptionCompleted) This event is the output of audio transcription for user audio written to the user audio buffer. Transcription begins when the input audio buffer is committed by the client or server (in server_vadmode). Transcription runs asynchronously with Response creation, so this event may come before or after the Response events.Realtime API models accept audio natively, and thus input transcription is a separate process run on a separate ASR (Automatic Speech Recognition) model. The transcript may diverge somewhat from the model's interpretation, and should be treated as a rough guide. 
 - 
                                        visitConversationItemInputAudioTranscriptionDeltaabstract T visitConversationItemInputAudioTranscriptionDelta(ConversationItemInputAudioTranscriptionDeltaEvent conversationItemInputAudioTranscriptionDelta) Returned when the text value of an input audio transcription content part is updated. 
 - 
                                        visitConversationItemInputAudioTranscriptionFailedabstract T visitConversationItemInputAudioTranscriptionFailed(ConversationItemInputAudioTranscriptionFailedEvent conversationItemInputAudioTranscriptionFailed) Returned when input audio transcription is configured, and a transcription request for a user message failed. These events are separate from other errorevents so that the client can identify the related Item.
 - 
                                        visitConversationItemRetrievedabstract T visitConversationItemRetrieved(RealtimeServerEvent.ConversationItemRetrieved conversationItemRetrieved) Returned when a conversation item is retrieved with conversation.item.retrieve.
 - 
                                        visitConversationItemTruncatedabstract T visitConversationItemTruncated(ConversationItemTruncatedEvent conversationItemTruncated) Returned when an earlier assistant audio message item is truncated by the client with a conversation.item.truncateevent. This event is used to synchronize the server's understanding of the audio with the client's playback.This action will truncate the audio and remove the server-side text transcript to ensure there is no text in the context that hasn't been heard by the user. 
 - 
                                        visitErrorabstract T visitError(ErrorEvent error) Returned when an error occurs, which could be a client problem or a server problem. Most errors are recoverable and the session will stay open, we recommend to implementors to monitor and log error messages by default. 
 - 
                                        visitInputAudioBufferClearedabstract T visitInputAudioBufferCleared(InputAudioBufferClearedEvent inputAudioBufferCleared) Returned when the input audio buffer is cleared by the client with a input_audio_buffer.clearevent.
 - 
                                        visitInputAudioBufferCommittedabstract T visitInputAudioBufferCommitted(InputAudioBufferCommittedEvent inputAudioBufferCommitted) Returned when an input audio buffer is committed, either by the client or automatically in server VAD mode. The item_idproperty is the ID of the user message item that will be created, thus aconversation.item.createdevent will also be sent to the client.
 - 
                                        visitInputAudioBufferSpeechStartedabstract T visitInputAudioBufferSpeechStarted(InputAudioBufferSpeechStartedEvent inputAudioBufferSpeechStarted) Sent by the server when in server_vadmode to indicate that speech has been detected in the audio buffer. This can happen any time audio is added to the buffer (unless speech is already detected). The client may want to use this event to interrupt audio playback or provide visual feedback to the user.The client should expect to receive a input_audio_buffer.speech_stoppedevent when speech stops. Theitem_idproperty is the ID of the user message item that will be created when speech stops and will also be included in theinput_audio_buffer.speech_stoppedevent (unless the client manually commits the audio buffer during VAD activation).
 - 
                                        visitInputAudioBufferSpeechStoppedabstract T visitInputAudioBufferSpeechStopped(InputAudioBufferSpeechStoppedEvent inputAudioBufferSpeechStopped) Returned in server_vadmode when the server detects the end of speech in the audio buffer. The server will also send anconversation.item.createdevent with the user message item that is created from the audio buffer.
 - 
                                        visitRateLimitsUpdatedabstract T visitRateLimitsUpdated(RateLimitsUpdatedEvent rateLimitsUpdated) Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is created some tokens will be "reserved" for the output tokens, the rate limits shown here reflect that reservation, which is then adjusted accordingly once the Response is completed. 
 - 
                                        visitResponseAudioDeltaabstract T visitResponseAudioDelta(ResponseAudioDeltaEvent responseAudioDelta) Returned when the model-generated audio is updated. 
 - 
                                        visitResponseAudioDoneabstract T visitResponseAudioDone(ResponseAudioDoneEvent responseAudioDone) Returned when the model-generated audio is done. Also emitted when a Response is interrupted, incomplete, or cancelled. 
 - 
                                        visitResponseAudioTranscriptDeltaabstract T visitResponseAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent responseAudioTranscriptDelta) Returned when the model-generated transcription of audio output is updated. 
 - 
                                        visitResponseAudioTranscriptDoneabstract T visitResponseAudioTranscriptDone(ResponseAudioTranscriptDoneEvent responseAudioTranscriptDone) Returned when the model-generated transcription of audio output is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled. 
 - 
                                        visitResponseContentPartAddedabstract T visitResponseContentPartAdded(ResponseContentPartAddedEvent responseContentPartAdded) Returned when a new content part is added to an assistant message item during response generation. 
 - 
                                        visitResponseContentPartDoneabstract T visitResponseContentPartDone(ResponseContentPartDoneEvent responseContentPartDone) Returned when a content part is done streaming in an assistant message item. Also emitted when a Response is interrupted, incomplete, or cancelled. 
 - 
                                        visitResponseCreatedabstract T visitResponseCreated(ResponseCreatedEvent responseCreated) Returned when a new Response is created. The first event of response creation, where the response is in an initial state of in_progress.
 - 
                                        visitResponseDoneabstract T visitResponseDone(ResponseDoneEvent responseDone) Returned when a Response is done streaming. Always emitted, no matter the final state. The Response object included in the response.doneevent will include all output Items in the Response but will omit the raw audio data.
 - 
                                        visitResponseFunctionCallArgumentsDeltaabstract T visitResponseFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent responseFunctionCallArgumentsDelta) Returned when the model-generated function call arguments are updated. 
 - 
                                        visitResponseFunctionCallArgumentsDoneabstract T visitResponseFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent responseFunctionCallArgumentsDone) Returned when the model-generated function call arguments are done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled. 
 - 
                                        visitResponseOutputItemAddedabstract T visitResponseOutputItemAdded(ResponseOutputItemAddedEvent responseOutputItemAdded) Returned when a new Item is created during Response generation. 
 - 
                                        visitResponseOutputItemDoneabstract T visitResponseOutputItemDone(ResponseOutputItemDoneEvent responseOutputItemDone) Returned when an Item is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled. 
 - 
                                        visitResponseTextDeltaabstract T visitResponseTextDelta(ResponseTextDeltaEvent responseTextDelta) Returned when the text value of a "text" content part is updated. 
 - 
                                        visitResponseTextDoneabstract T visitResponseTextDone(ResponseTextDoneEvent responseTextDone) Returned when the text value of a "text" content part is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled. 
 - 
                                        visitSessionCreatedabstract T visitSessionCreated(SessionCreatedEvent sessionCreated) Returned when a Session is created. Emitted automatically when a new connection is established as the first server event. This event will contain the default Session configuration. 
 - 
                                        visitSessionUpdatedabstract T visitSessionUpdated(SessionUpdatedEvent sessionUpdated) Returned when a session is updated with a session.updateevent, unless there is an error.
 - 
                                        visitTranscriptionSessionUpdatedabstract T visitTranscriptionSessionUpdated(TranscriptionSessionUpdatedEvent transcriptionSessionUpdated) Returned when a transcription session is updated with a transcription_session.updateevent, unless there is an error.
 - 
                                        visitOutputAudioBufferStartedabstract T visitOutputAudioBufferStarted(RealtimeServerEvent.OutputAudioBufferStarted outputAudioBufferStarted) WebRTC Only: Emitted when the server begins streaming audio to the client. This event is emitted after an audio content part has been added ( response.content_part.added) to the response. Learn more.
 - 
                                        visitOutputAudioBufferStoppedabstract T visitOutputAudioBufferStopped(RealtimeServerEvent.OutputAudioBufferStopped outputAudioBufferStopped) WebRTC Only: Emitted when the output audio buffer has been completely drained on the server, and no more audio is forthcoming. This event is emitted after the full response data has been sent to the client ( response.done). Learn more.
 - 
                                        visitOutputAudioBufferClearedabstract T visitOutputAudioBufferCleared(RealtimeServerEvent.OutputAudioBufferCleared outputAudioBufferCleared) WebRTC Only: Emitted when the output audio buffer is cleared. This happens either in VAD mode when the user has interrupted ( input_audio_buffer.speech_started), or when the client has emitted theoutput_audio_buffer.clearevent to manually cut off the current audio response. Learn more.
 - 
                                        unknownT unknown(JsonValue json) Maps an unknown variant of RealtimeServerEvent to a value of type T. An instance of RealtimeServerEvent can contain an unknown variant if it was deserialized from data that doesn't match any known variant. For example, if the SDK is on an older version than the API, then the API may respond with new variants that the SDK is unaware of. 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-