public interface StreamingResponseHandler
Modifier and Type | Method and Description |
---|---|
default void |
onComplete()
This method is invoked once LLM has finished responding.
|
void |
onError(Throwable error)
This method is invoked when an error occurs during streaming.
|
void |
onNext(String token)
This method is invoked each time LLM sends a token.
|
default void |
onToolArguments(String arguments)
This method is invoked each time LLM sends a token.
|
default void |
onToolName(String name)
This method is invoked when LLM decides to execute a tool.
|
void onNext(String token)
token
- single token, part of a complete responsedefault void onToolName(String name)
name
- the name of the tool that LLM has chosen to executedefault void onToolArguments(String arguments)
arguments
- single token, a part of the complete arguments JSON objectdefault void onComplete()
void onError(Throwable error)
error
- the Throwable error that occurredCopyright © 2023. All rights reserved.