Uses of Interface
dev.langchain4j.service.TokenStream
-
Uses of TokenStream in dev.langchain4j.service
Modifier and TypeMethodDescriptionAiServiceTokenStream.ignoreErrors()
TokenStream.ignoreErrors()
All errors during streaming will be ignored (but will be logged with a WARN log level).AiServiceTokenStream.onComplete
(Consumer<Response<AiMessage>> completionHandler) TokenStream.onComplete
(Consumer<Response<AiMessage>> completionHandler) The provided consumer will be invoked when a language model finishes streaming a response.The provided consumer will be invoked when an error occurs during streaming.The provided consumer will be invoked every time a new token from a language model is available.AiServiceTokenStream.onRetrieved
(Consumer<List<Content>> contentsHandler) TokenStream.onRetrieved
(Consumer<List<Content>> contentHandler) The provided consumer will be invoked if anyContent
s are retrieved usingRetrievalAugmentor
.AiServiceTokenStream.onToolExecuted
(Consumer<ToolExecution> toolExecutionHandler) TokenStream.onToolExecuted
(Consumer<ToolExecution> toolExecuteHandler) The provided consumer will be invoked if any tool is executed. -
Uses of TokenStream in dev.langchain4j.spi.services