Class ServiceRegistryClassInstanceFactory

java.lang.Object
io.helidon.integrations.langchain4j.ServiceRegistryClassInstanceFactory
All Implemented Interfaces:
dev.langchain4j.spi.classloading.ClassInstanceFactory

public class ServiceRegistryClassInstanceFactory extends Object implements dev.langchain4j.spi.classloading.ClassInstanceFactory
LangChain4j ClassInstanceFactory implementation that retrieves instances of classes from Helidon global Services registry.
See Also:
  • Constructor Details

    • ServiceRegistryClassInstanceFactory

      public ServiceRegistryClassInstanceFactory()
      Constructs a new ServiceRegistryClassInstanceFactory.
  • Method Details

    • getInstanceOfClass

      public <T> T getInstanceOfClass(Class<T> clazz)
      Retrieves an instance of the given class from the Helidon Services registry.
      Specified by:
      getInstanceOfClass in interface dev.langchain4j.spi.classloading.ClassInstanceFactory
      Type Parameters:
      T - the type of the class
      Parameters:
      clazz - the class to retrieve an instance of
      Returns:
      an instance of the requested class, or null if not found