Class ObservabilityListeners

java.lang.Object
dev.langchain4j.internal.ObservabilityListeners

public final class ObservabilityListeners extends Object
Adds the listeners of the ObservabilityListenersProviders found with ServiceLoader to AI Services and to model calls. The providers are looked up once, in the class loader of LangChain4j. A framework that loads the application with class loaders of its own (for example Quarkus) finds the providers of those class loaders with load(ClassLoader) and passes them to useFrameworkProviders(List). Only providers of LangChain4j itself (classes in dev.langchain4j packages) are used: they receive the content of every model call, so a provider of another library on the classpath is logged and skipped. A provider that cannot be loaded, or whose listeners cannot be obtained, is logged and skipped: it never breaks an AI Service or a model call.