Interface ResponseStreamEvent.Visitor
-
- All Implemented Interfaces:
public interface ResponseStreamEvent.Visitor<T extends Object>
An interface that defines how to map each variant of ResponseStreamEvent to a value of type T.
-
-
Method Summary
Modifier and Type Method Description abstract T
visitAudioDelta(ResponseAudioDeltaEvent audioDelta)
Emitted when there is a partial audio response. abstract T
visitAudioDone(ResponseAudioDoneEvent audioDone)
Emitted when the audio response is complete. abstract T
visitAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent audioTranscriptDelta)
Emitted when there is a partial transcript of audio. abstract T
visitAudioTranscriptDone(ResponseAudioTranscriptDoneEvent audioTranscriptDone)
Emitted when the full audio transcript is completed. abstract T
visitCodeInterpreterCallCodeDelta(ResponseCodeInterpreterCallCodeDeltaEvent codeInterpreterCallCodeDelta)
Emitted when a partial code snippet is added by the code interpreter. abstract T
visitCodeInterpreterCallCodeDone(ResponseCodeInterpreterCallCodeDoneEvent codeInterpreterCallCodeDone)
Emitted when code snippet output is finalized by the code interpreter. abstract T
visitCodeInterpreterCallCompleted(ResponseCodeInterpreterCallCompletedEvent codeInterpreterCallCompleted)
Emitted when the code interpreter call is completed. abstract T
visitCodeInterpreterCallInProgress(ResponseCodeInterpreterCallInProgressEvent codeInterpreterCallInProgress)
Emitted when a code interpreter call is in progress. abstract T
visitCodeInterpreterCallInterpreting(ResponseCodeInterpreterCallInterpretingEvent codeInterpreterCallInterpreting)
Emitted when the code interpreter is actively interpreting the code snippet. abstract T
visitCompleted(ResponseCompletedEvent completed)
Emitted when the model response is complete. abstract T
visitContentPartAdded(ResponseContentPartAddedEvent contentPartAdded)
Emitted when a new content part is added. abstract T
visitContentPartDone(ResponseContentPartDoneEvent contentPartDone)
Emitted when a content part is done. abstract T
visitCreated(ResponseCreatedEvent created)
An event that is emitted when a response is created. abstract T
visitError(ResponseErrorEvent error)
Emitted when an error occurs. abstract T
visitFileSearchCallCompleted(ResponseFileSearchCallCompletedEvent fileSearchCallCompleted)
Emitted when a file search call is completed (results found). abstract T
visitFileSearchCallInProgress(ResponseFileSearchCallInProgressEvent fileSearchCallInProgress)
Emitted when a file search call is initiated. abstract T
visitFileSearchCallSearching(ResponseFileSearchCallSearchingEvent fileSearchCallSearching)
Emitted when a file search is currently searching. abstract T
visitFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent functionCallArgumentsDelta)
Emitted when there is a partial function-call arguments delta. abstract T
visitFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent functionCallArgumentsDone)
Emitted when function-call arguments are finalized. abstract T
visitInProgress(ResponseInProgressEvent inProgress)
Emitted when the response is in progress. abstract T
visitFailed(ResponseFailedEvent failed)
An event that is emitted when a response fails. abstract T
visitIncomplete(ResponseIncompleteEvent incomplete)
An event that is emitted when a response finishes as incomplete. abstract T
visitOutputItemAdded(ResponseOutputItemAddedEvent outputItemAdded)
Emitted when a new output item is added. abstract T
visitOutputItemDone(ResponseOutputItemDoneEvent outputItemDone)
Emitted when an output item is marked done. abstract T
visitReasoningSummaryPartAdded(ResponseReasoningSummaryPartAddedEvent reasoningSummaryPartAdded)
Emitted when a new reasoning summary part is added. abstract T
visitReasoningSummaryPartDone(ResponseReasoningSummaryPartDoneEvent reasoningSummaryPartDone)
Emitted when a reasoning summary part is completed. abstract T
visitReasoningSummaryTextDelta(ResponseReasoningSummaryTextDeltaEvent reasoningSummaryTextDelta)
Emitted when a delta is added to a reasoning summary text. abstract T
visitReasoningSummaryTextDone(ResponseReasoningSummaryTextDoneEvent reasoningSummaryTextDone)
Emitted when a reasoning summary text is completed. abstract T
visitRefusalDelta(ResponseRefusalDeltaEvent refusalDelta)
Emitted when there is a partial refusal text. abstract T
visitRefusalDone(ResponseRefusalDoneEvent refusalDone)
Emitted when refusal text is finalized. abstract T
visitOutputTextAnnotationAdded(ResponseTextAnnotationDeltaEvent outputTextAnnotationAdded)
Emitted when a text annotation is added. abstract T
visitOutputTextDelta(ResponseTextDeltaEvent outputTextDelta)
Emitted when there is an additional text delta. abstract T
visitOutputTextDone(ResponseTextDoneEvent outputTextDone)
Emitted when text content is finalized. abstract T
visitWebSearchCallCompleted(ResponseWebSearchCallCompletedEvent webSearchCallCompleted)
Emitted when a web search call is completed. abstract T
visitWebSearchCallInProgress(ResponseWebSearchCallInProgressEvent webSearchCallInProgress)
Emitted when a web search call is initiated. abstract T
visitWebSearchCallSearching(ResponseWebSearchCallSearchingEvent webSearchCallSearching)
Emitted when a web search call is executing. T
unknown(JsonValue json)
Maps an unknown variant of ResponseStreamEvent to a value of type T. -
-
Method Detail
-
visitAudioDelta
abstract T visitAudioDelta(ResponseAudioDeltaEvent audioDelta)
Emitted when there is a partial audio response.
-
visitAudioDone
abstract T visitAudioDone(ResponseAudioDoneEvent audioDone)
Emitted when the audio response is complete.
-
visitAudioTranscriptDelta
abstract T visitAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent audioTranscriptDelta)
Emitted when there is a partial transcript of audio.
-
visitAudioTranscriptDone
abstract T visitAudioTranscriptDone(ResponseAudioTranscriptDoneEvent audioTranscriptDone)
Emitted when the full audio transcript is completed.
-
visitCodeInterpreterCallCodeDelta
abstract T visitCodeInterpreterCallCodeDelta(ResponseCodeInterpreterCallCodeDeltaEvent codeInterpreterCallCodeDelta)
Emitted when a partial code snippet is added by the code interpreter.
-
visitCodeInterpreterCallCodeDone
abstract T visitCodeInterpreterCallCodeDone(ResponseCodeInterpreterCallCodeDoneEvent codeInterpreterCallCodeDone)
Emitted when code snippet output is finalized by the code interpreter.
-
visitCodeInterpreterCallCompleted
abstract T visitCodeInterpreterCallCompleted(ResponseCodeInterpreterCallCompletedEvent codeInterpreterCallCompleted)
Emitted when the code interpreter call is completed.
-
visitCodeInterpreterCallInProgress
abstract T visitCodeInterpreterCallInProgress(ResponseCodeInterpreterCallInProgressEvent codeInterpreterCallInProgress)
Emitted when a code interpreter call is in progress.
-
visitCodeInterpreterCallInterpreting
abstract T visitCodeInterpreterCallInterpreting(ResponseCodeInterpreterCallInterpretingEvent codeInterpreterCallInterpreting)
Emitted when the code interpreter is actively interpreting the code snippet.
-
visitCompleted
abstract T visitCompleted(ResponseCompletedEvent completed)
Emitted when the model response is complete.
-
visitContentPartAdded
abstract T visitContentPartAdded(ResponseContentPartAddedEvent contentPartAdded)
Emitted when a new content part is added.
-
visitContentPartDone
abstract T visitContentPartDone(ResponseContentPartDoneEvent contentPartDone)
Emitted when a content part is done.
-
visitCreated
abstract T visitCreated(ResponseCreatedEvent created)
An event that is emitted when a response is created.
-
visitError
abstract T visitError(ResponseErrorEvent error)
Emitted when an error occurs.
-
visitFileSearchCallCompleted
abstract T visitFileSearchCallCompleted(ResponseFileSearchCallCompletedEvent fileSearchCallCompleted)
Emitted when a file search call is completed (results found).
-
visitFileSearchCallInProgress
abstract T visitFileSearchCallInProgress(ResponseFileSearchCallInProgressEvent fileSearchCallInProgress)
Emitted when a file search call is initiated.
-
visitFileSearchCallSearching
abstract T visitFileSearchCallSearching(ResponseFileSearchCallSearchingEvent fileSearchCallSearching)
Emitted when a file search is currently searching.
-
visitFunctionCallArgumentsDelta
abstract T visitFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent functionCallArgumentsDelta)
Emitted when there is a partial function-call arguments delta.
-
visitFunctionCallArgumentsDone
abstract T visitFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent functionCallArgumentsDone)
Emitted when function-call arguments are finalized.
-
visitInProgress
abstract T visitInProgress(ResponseInProgressEvent inProgress)
Emitted when the response is in progress.
-
visitFailed
abstract T visitFailed(ResponseFailedEvent failed)
An event that is emitted when a response fails.
-
visitIncomplete
abstract T visitIncomplete(ResponseIncompleteEvent incomplete)
An event that is emitted when a response finishes as incomplete.
-
visitOutputItemAdded
abstract T visitOutputItemAdded(ResponseOutputItemAddedEvent outputItemAdded)
Emitted when a new output item is added.
-
visitOutputItemDone
abstract T visitOutputItemDone(ResponseOutputItemDoneEvent outputItemDone)
Emitted when an output item is marked done.
-
visitReasoningSummaryPartAdded
abstract T visitReasoningSummaryPartAdded(ResponseReasoningSummaryPartAddedEvent reasoningSummaryPartAdded)
Emitted when a new reasoning summary part is added.
-
visitReasoningSummaryPartDone
abstract T visitReasoningSummaryPartDone(ResponseReasoningSummaryPartDoneEvent reasoningSummaryPartDone)
Emitted when a reasoning summary part is completed.
-
visitReasoningSummaryTextDelta
abstract T visitReasoningSummaryTextDelta(ResponseReasoningSummaryTextDeltaEvent reasoningSummaryTextDelta)
Emitted when a delta is added to a reasoning summary text.
-
visitReasoningSummaryTextDone
abstract T visitReasoningSummaryTextDone(ResponseReasoningSummaryTextDoneEvent reasoningSummaryTextDone)
Emitted when a reasoning summary text is completed.
-
visitRefusalDelta
abstract T visitRefusalDelta(ResponseRefusalDeltaEvent refusalDelta)
Emitted when there is a partial refusal text.
-
visitRefusalDone
abstract T visitRefusalDone(ResponseRefusalDoneEvent refusalDone)
Emitted when refusal text is finalized.
-
visitOutputTextAnnotationAdded
abstract T visitOutputTextAnnotationAdded(ResponseTextAnnotationDeltaEvent outputTextAnnotationAdded)
Emitted when a text annotation is added.
-
visitOutputTextDelta
abstract T visitOutputTextDelta(ResponseTextDeltaEvent outputTextDelta)
Emitted when there is an additional text delta.
-
visitOutputTextDone
abstract T visitOutputTextDone(ResponseTextDoneEvent outputTextDone)
Emitted when text content is finalized.
-
visitWebSearchCallCompleted
abstract T visitWebSearchCallCompleted(ResponseWebSearchCallCompletedEvent webSearchCallCompleted)
Emitted when a web search call is completed.
-
visitWebSearchCallInProgress
abstract T visitWebSearchCallInProgress(ResponseWebSearchCallInProgressEvent webSearchCallInProgress)
Emitted when a web search call is initiated.
-
visitWebSearchCallSearching
abstract T visitWebSearchCallSearching(ResponseWebSearchCallSearchingEvent webSearchCallSearching)
Emitted when a web search call is executing.
-
unknown
T unknown(JsonValue json)
Maps an unknown variant of ResponseStreamEvent to a value of type T.
An instance of ResponseStreamEvent 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.
-
-
-
-