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
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. abstract T
visitImageGenerationCallCompleted(ResponseImageGenCallCompletedEvent imageGenerationCallCompleted)
Emitted when an image generation tool call has completed and the final image is available. abstract T
visitImageGenerationCallGenerating(ResponseImageGenCallGeneratingEvent imageGenerationCallGenerating)
Emitted when an image generation tool call is actively generating an image (intermediate state). abstract T
visitImageGenerationCallInProgress(ResponseImageGenCallInProgressEvent imageGenerationCallInProgress)
Emitted when an image generation tool call is in progress. abstract T
visitImageGenerationCallPartialImage(ResponseImageGenCallPartialImageEvent imageGenerationCallPartialImage)
Emitted when a partial image is available during image generation streaming. abstract T
visitMcpCallArgumentsDelta(ResponseMcpCallArgumentsDeltaEvent mcpCallArgumentsDelta)
Emitted when there is a delta (partial update) to the arguments of an MCP tool call. abstract T
visitMcpCallArgumentsDone(ResponseMcpCallArgumentsDoneEvent mcpCallArgumentsDone)
Emitted when the arguments for an MCP tool call are finalized. abstract T
visitMcpCallCompleted(ResponseMcpCallCompletedEvent mcpCallCompleted)
Emitted when an MCP tool call has completed successfully. abstract T
visitMcpCallFailed(ResponseMcpCallFailedEvent mcpCallFailed)
Emitted when an MCP tool call has failed. abstract T
visitMcpCallInProgress(ResponseMcpCallInProgressEvent mcpCallInProgress)
Emitted when an MCP tool call is in progress. abstract T
visitMcpListToolsCompleted(ResponseMcpListToolsCompletedEvent mcpListToolsCompleted)
Emitted when the list of available MCP tools has been successfully retrieved. abstract T
visitMcpListToolsFailed(ResponseMcpListToolsFailedEvent mcpListToolsFailed)
Emitted when the attempt to list available MCP tools has failed. abstract T
visitMcpListToolsInProgress(ResponseMcpListToolsInProgressEvent mcpListToolsInProgress)
Emitted when the system is in the process of retrieving the list of available MCP tools. abstract T
visitOutputTextAnnotationAdded(ResponseOutputTextAnnotationAddedEvent outputTextAnnotationAdded)
Emitted when an annotation is added to output text content. abstract T
visitQueued(ResponseQueuedEvent queued)
Emitted when a response is queued and waiting to be processed. abstract T
visitReasoningDelta(ResponseReasoningDeltaEvent reasoningDelta)
Emitted when there is a delta (partial update) to the reasoning content. abstract T
visitReasoningDone(ResponseReasoningDoneEvent reasoningDone)
Emitted when the reasoning content is finalized for an item. abstract T
visitReasoningSummaryDelta(ResponseReasoningSummaryDeltaEvent reasoningSummaryDelta)
Emitted when there is a delta (partial update) to the reasoning summary content. abstract T
visitReasoningSummaryDone(ResponseReasoningSummaryDoneEvent reasoningSummaryDone)
Emitted when the reasoning summary content is finalized for an item. 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.
-
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.
-
visitReasoningDelta
abstract T visitReasoningDelta(ResponseReasoningDeltaEvent reasoningDelta)
Emitted when there is a delta (partial update) to the reasoning content.
-
visitReasoningDone
abstract T visitReasoningDone(ResponseReasoningDoneEvent reasoningDone)
Emitted when the reasoning content is finalized for an item.
-
visitReasoningSummaryDelta
abstract T visitReasoningSummaryDelta(ResponseReasoningSummaryDeltaEvent reasoningSummaryDelta)
Emitted when there is a delta (partial update) to the reasoning summary content.
-
visitReasoningSummaryDone
abstract T visitReasoningSummaryDone(ResponseReasoningSummaryDoneEvent reasoningSummaryDone)
Emitted when the reasoning summary content is finalized for an item.
-
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.
-
-
-
-