dev.langchain4j.service.OnError Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of langchain4j Show documentation
Show all versions of langchain4j Show documentation
Java implementation of LangChain: Integrate your Java application with countless AI tools and services
smoothly
package dev.langchain4j.service;
import java.util.function.Consumer;
public interface OnError {
/**
* The provided Consumer will be invoked when an error occurs during streaming.
*
* @param errorHandler lambda that will be invoked when an error occurs
* @return the next step of the step-builder
*/
OnStart onError(Consumer errorHandler);
/**
* All errors during streaming will be ignored (but will be logged with a WARN log level).
*
* @return the next step of the step-builder
*/
OnStart ignoreErrors();
}