Interface StreamingResponseHandler
public interface StreamingResponseHandler
Handler interface for processing streaming responses from Vertex AI Anthropic API.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled for each chunk of streaming response data.voidCalled when streaming completes successfully.voidCalled when an error occurs during streaming.default voidonResponse(AnthropicResponse response) Called with the complete response metadata (for token usage, etc.).
-
Method Details
-
onResponse
Called with the complete response metadata (for token usage, etc.).- Parameters:
response- The complete response with metadata
-
onChunk
Called for each chunk of streaming response data.- Parameters:
jsonChunk- The JSON response chunk as a string
-
onComplete
void onComplete()Called when streaming completes successfully. -
onError
Called when an error occurs during streaming.- Parameters:
error- The error that occurred
-