Class AgentRegistry

java.lang.Object
io.micronaut.langchain4j.agentic.AgentRegistry

@Singleton @Internal public final class AgentRegistry extends Object
Registry caching built agent proxies per agent interface. Internal utility; not intended for extension.
  • Constructor Details

    • AgentRegistry

      public AgentRegistry()
  • Method Details

    • getOrCreateAgent

      public Object getOrCreateAgent(@NonNull @NonNull Class<?> beanType, @NonNull @NonNull Supplier<Object> agentSupplier)
      Retrieve a cached agent proxy by agent interface type, building and caching it atomically when absent.
      Parameters:
      beanType - the agent interface type
      agentSupplier - the agent proxy supplier
      Returns:
      the cached or newly created agent proxy instance