All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.langchain4j.service.OnError Maven / Gradle / Ivy

Go to download

Java implementation of LangChain: Integrate your Java application with countless AI tools and services smoothly

There is a newer version: 0.36.2
Show newest version
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();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy