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 TvisitAudioDelta(ResponseAudioDeltaEvent audioDelta)Emitted when there is a partial audio response. abstract TvisitAudioDone(ResponseAudioDoneEvent audioDone)Emitted when the audio response is complete. abstract TvisitAudioTranscriptDelta(ResponseAudioTranscriptDeltaEvent audioTranscriptDelta)Emitted when there is a partial transcript of audio. abstract TvisitAudioTranscriptDone(ResponseAudioTranscriptDoneEvent audioTranscriptDone)Emitted when the full audio transcript is completed. abstract TvisitCodeInterpreterCallCodeDelta(ResponseCodeInterpreterCallCodeDeltaEvent codeInterpreterCallCodeDelta)Emitted when a partial code snippet is streamed by the code interpreter. abstract TvisitCodeInterpreterCallCodeDone(ResponseCodeInterpreterCallCodeDoneEvent codeInterpreterCallCodeDone)Emitted when the code snippet is finalized by the code interpreter. abstract TvisitCodeInterpreterCallCompleted(ResponseCodeInterpreterCallCompletedEvent codeInterpreterCallCompleted)Emitted when the code interpreter call is completed. abstract TvisitCodeInterpreterCallInProgress(ResponseCodeInterpreterCallInProgressEvent codeInterpreterCallInProgress)Emitted when a code interpreter call is in progress. abstract TvisitCodeInterpreterCallInterpreting(ResponseCodeInterpreterCallInterpretingEvent codeInterpreterCallInterpreting)Emitted when the code interpreter is actively interpreting the code snippet. abstract TvisitCompleted(ResponseCompletedEvent completed)Emitted when the model response is complete. abstract TvisitContentPartAdded(ResponseContentPartAddedEvent contentPartAdded)Emitted when a new content part is added. abstract TvisitContentPartDone(ResponseContentPartDoneEvent contentPartDone)Emitted when a content part is done. abstract TvisitCreated(ResponseCreatedEvent created)An event that is emitted when a response is created. abstract TvisitError(ResponseErrorEvent error)Emitted when an error occurs. abstract TvisitFileSearchCallCompleted(ResponseFileSearchCallCompletedEvent fileSearchCallCompleted)Emitted when a file search call is completed (results found). abstract TvisitFileSearchCallInProgress(ResponseFileSearchCallInProgressEvent fileSearchCallInProgress)Emitted when a file search call is initiated. abstract TvisitFileSearchCallSearching(ResponseFileSearchCallSearchingEvent fileSearchCallSearching)Emitted when a file search is currently searching. abstract TvisitFunctionCallArgumentsDelta(ResponseFunctionCallArgumentsDeltaEvent functionCallArgumentsDelta)Emitted when there is a partial function-call arguments delta. abstract TvisitFunctionCallArgumentsDone(ResponseFunctionCallArgumentsDoneEvent functionCallArgumentsDone)Emitted when function-call arguments are finalized. abstract TvisitInProgress(ResponseInProgressEvent inProgress)Emitted when the response is in progress. abstract TvisitFailed(ResponseFailedEvent failed)An event that is emitted when a response fails. abstract TvisitIncomplete(ResponseIncompleteEvent incomplete)An event that is emitted when a response finishes as incomplete. abstract TvisitOutputItemAdded(ResponseOutputItemAddedEvent outputItemAdded)Emitted when a new output item is added. abstract TvisitOutputItemDone(ResponseOutputItemDoneEvent outputItemDone)Emitted when an output item is marked done. abstract TvisitReasoningSummaryPartAdded(ResponseReasoningSummaryPartAddedEvent reasoningSummaryPartAdded)Emitted when a new reasoning summary part is added. abstract TvisitReasoningSummaryPartDone(ResponseReasoningSummaryPartDoneEvent reasoningSummaryPartDone)Emitted when a reasoning summary part is completed. abstract TvisitReasoningSummaryTextDelta(ResponseReasoningSummaryTextDeltaEvent reasoningSummaryTextDelta)Emitted when a delta is added to a reasoning summary text. abstract TvisitReasoningSummaryTextDone(ResponseReasoningSummaryTextDoneEvent reasoningSummaryTextDone)Emitted when a reasoning summary text is completed. abstract TvisitReasoningTextDelta(ResponseReasoningTextDeltaEvent reasoningTextDelta)Emitted when a delta is added to a reasoning text. abstract TvisitReasoningTextDone(ResponseReasoningTextDoneEvent reasoningTextDone)Emitted when a reasoning text is completed. abstract TvisitRefusalDelta(ResponseRefusalDeltaEvent refusalDelta)Emitted when there is a partial refusal text. abstract TvisitRefusalDone(ResponseRefusalDoneEvent refusalDone)Emitted when refusal text is finalized. abstract TvisitOutputTextDelta(ResponseTextDeltaEvent outputTextDelta)Emitted when there is an additional text delta. abstract TvisitOutputTextDone(ResponseTextDoneEvent outputTextDone)Emitted when text content is finalized. abstract TvisitWebSearchCallCompleted(ResponseWebSearchCallCompletedEvent webSearchCallCompleted)Emitted when a web search call is completed. abstract TvisitWebSearchCallInProgress(ResponseWebSearchCallInProgressEvent webSearchCallInProgress)Emitted when a web search call is initiated. abstract TvisitWebSearchCallSearching(ResponseWebSearchCallSearchingEvent webSearchCallSearching)Emitted when a web search call is executing. abstract TvisitImageGenerationCallCompleted(ResponseImageGenCallCompletedEvent imageGenerationCallCompleted)Emitted when an image generation tool call has completed and the final image is available. abstract TvisitImageGenerationCallGenerating(ResponseImageGenCallGeneratingEvent imageGenerationCallGenerating)Emitted when an image generation tool call is actively generating an image (intermediate state). abstract TvisitImageGenerationCallInProgress(ResponseImageGenCallInProgressEvent imageGenerationCallInProgress)Emitted when an image generation tool call is in progress. abstract TvisitImageGenerationCallPartialImage(ResponseImageGenCallPartialImageEvent imageGenerationCallPartialImage)Emitted when a partial image is available during image generation streaming. abstract TvisitMcpCallArgumentsDelta(ResponseMcpCallArgumentsDeltaEvent mcpCallArgumentsDelta)Emitted when there is a delta (partial update) to the arguments of an MCP tool call. abstract TvisitMcpCallArgumentsDone(ResponseMcpCallArgumentsDoneEvent mcpCallArgumentsDone)Emitted when the arguments for an MCP tool call are finalized. abstract TvisitMcpCallCompleted(ResponseMcpCallCompletedEvent mcpCallCompleted)Emitted when an MCP tool call has completed successfully. abstract TvisitMcpCallFailed(ResponseMcpCallFailedEvent mcpCallFailed)Emitted when an MCP tool call has failed. abstract TvisitMcpCallInProgress(ResponseMcpCallInProgressEvent mcpCallInProgress)Emitted when an MCP tool call is in progress. abstract TvisitMcpListToolsCompleted(ResponseMcpListToolsCompletedEvent mcpListToolsCompleted)Emitted when the list of available MCP tools has been successfully retrieved. abstract TvisitMcpListToolsFailed(ResponseMcpListToolsFailedEvent mcpListToolsFailed)Emitted when the attempt to list available MCP tools has failed. abstract TvisitMcpListToolsInProgress(ResponseMcpListToolsInProgressEvent mcpListToolsInProgress)Emitted when the system is in the process of retrieving the list of available MCP tools. abstract TvisitOutputTextAnnotationAdded(ResponseOutputTextAnnotationAddedEvent outputTextAnnotationAdded)Emitted when an annotation is added to output text content. abstract TvisitQueued(ResponseQueuedEvent queued)Emitted when a response is queued and waiting to be processed. abstract TvisitCustomToolCallInputDelta(ResponseCustomToolCallInputDeltaEvent customToolCallInputDelta)Event representing a delta (partial update) to the input of a custom tool call. abstract TvisitCustomToolCallInputDone(ResponseCustomToolCallInputDoneEvent customToolCallInputDone)Event indicating that input for a custom tool call is complete. Tunknown(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 streamed by the code interpreter.
-
visitCodeInterpreterCallCodeDone
abstract T visitCodeInterpreterCallCodeDone(ResponseCodeInterpreterCallCodeDoneEvent codeInterpreterCallCodeDone)
Emitted when the code snippet 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.
-
visitReasoningTextDelta
abstract T visitReasoningTextDelta(ResponseReasoningTextDeltaEvent reasoningTextDelta)
Emitted when a delta is added to a reasoning text.
-
visitReasoningTextDone
abstract T visitReasoningTextDone(ResponseReasoningTextDoneEvent reasoningTextDone)
Emitted when a reasoning 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.
-
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.
-
visitImageGenerationCallCompleted
abstract T visitImageGenerationCallCompleted(ResponseImageGenCallCompletedEvent imageGenerationCallCompleted)
Emitted when an image generation tool call has completed and the final image is available.
-
visitImageGenerationCallGenerating
abstract T visitImageGenerationCallGenerating(ResponseImageGenCallGeneratingEvent imageGenerationCallGenerating)
Emitted when an image generation tool call is actively generating an image (intermediate state).
-
visitImageGenerationCallInProgress
abstract T visitImageGenerationCallInProgress(ResponseImageGenCallInProgressEvent imageGenerationCallInProgress)
Emitted when an image generation tool call is in progress.
-
visitImageGenerationCallPartialImage
abstract T visitImageGenerationCallPartialImage(ResponseImageGenCallPartialImageEvent imageGenerationCallPartialImage)
Emitted when a partial image is available during image generation streaming.
-
visitMcpCallArgumentsDelta
abstract T visitMcpCallArgumentsDelta(ResponseMcpCallArgumentsDeltaEvent mcpCallArgumentsDelta)
Emitted when there is a delta (partial update) to the arguments of an MCP tool call.
-
visitMcpCallArgumentsDone
abstract T visitMcpCallArgumentsDone(ResponseMcpCallArgumentsDoneEvent mcpCallArgumentsDone)
Emitted when the arguments for an MCP tool call are finalized.
-
visitMcpCallCompleted
abstract T visitMcpCallCompleted(ResponseMcpCallCompletedEvent mcpCallCompleted)
Emitted when an MCP tool call has completed successfully.
-
visitMcpCallFailed
abstract T visitMcpCallFailed(ResponseMcpCallFailedEvent mcpCallFailed)
Emitted when an MCP tool call has failed.
-
visitMcpCallInProgress
abstract T visitMcpCallInProgress(ResponseMcpCallInProgressEvent mcpCallInProgress)
Emitted when an MCP tool call is in progress.
-
visitMcpListToolsCompleted
abstract T visitMcpListToolsCompleted(ResponseMcpListToolsCompletedEvent mcpListToolsCompleted)
Emitted when the list of available MCP tools has been successfully retrieved.
-
visitMcpListToolsFailed
abstract T visitMcpListToolsFailed(ResponseMcpListToolsFailedEvent mcpListToolsFailed)
Emitted when the attempt to list available MCP tools has failed.
-
visitMcpListToolsInProgress
abstract T visitMcpListToolsInProgress(ResponseMcpListToolsInProgressEvent mcpListToolsInProgress)
Emitted when the system is in the process of retrieving the list of available MCP tools.
-
visitOutputTextAnnotationAdded
abstract T visitOutputTextAnnotationAdded(ResponseOutputTextAnnotationAddedEvent outputTextAnnotationAdded)
Emitted when an annotation is added to output text content.
-
visitQueued
abstract T visitQueued(ResponseQueuedEvent queued)
Emitted when a response is queued and waiting to be processed.
-
visitCustomToolCallInputDelta
abstract T visitCustomToolCallInputDelta(ResponseCustomToolCallInputDeltaEvent customToolCallInputDelta)
Event representing a delta (partial update) to the input of a custom tool call.
-
visitCustomToolCallInputDone
abstract T visitCustomToolCallInputDone(ResponseCustomToolCallInputDoneEvent customToolCallInputDone)
Event indicating that input for a custom tool call is complete.
-
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.
-
-
-
-