Interface ChatResponseHandler.Visitor
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default voidvisitChunk(ChatChunkEvent event) Invoked when aChatChunkEventis encountered.default voidvisitDefault(ChatEventStream event) A required "else" or "default" block, invoked when no other more-specific "visit" method is appropriate.default voidvisitError(ChatErrorEvent event) Invoked when aChatErrorEventis encountered.default voidvisitResponse(ChatResponseEvent event) Invoked when aChatResponseEventis encountered.default voidvisitToolCall(ChatToolCallEvent event) Invoked when aChatToolCallEventis encountered.
-
Method Details
-
builder
- Returns:
- A new
ChatResponseHandler.Visitor.Builder.
-
visitDefault
A required "else" or "default" block, invoked when no other more-specific "visit" method is appropriate. This is invoked under two circumstances:- The event encountered is newer than the current version of the SDK, so no other more-specific "visit"
method could be called. In this case, the provided event will be a generic
ChatEventStream. These events can be processed by upgrading the SDK. - The event is known by the SDK, but the "visit" was not overridden above. In this case, the provided event
will be a specific type of
ChatEventStream.
- Parameters:
event- The event that was not handled by a more-specific "visit" method.
- The event encountered is newer than the current version of the SDK, so no other more-specific "visit"
method could be called. In this case, the provided event will be a generic
-
visitChunk
Invoked when aChatChunkEventis encountered. If this is not overridden, the event will be given tovisitDefault(ChatEventStream).- Parameters:
event- Event being visited
-
visitToolCall
Invoked when aChatToolCallEventis encountered. If this is not overridden, the event will be given tovisitDefault(ChatEventStream).- Parameters:
event- Event being visited
-
visitResponse
Invoked when aChatResponseEventis encountered. If this is not overridden, the event will be given tovisitDefault(ChatEventStream).- Parameters:
event- Event being visited
-
visitError
Invoked when aChatErrorEventis encountered. If this is not overridden, the event will be given tovisitDefault(ChatEventStream).- Parameters:
event- Event being visited
-