Class ToolRegistry

java.lang.Object
io.micronaut.langchain4j.tools.ToolRegistry
All Implemented Interfaces:
io.micronaut.context.processor.AnnotationProcessor<dev.langchain4j.agent.tool.Tool,io.micronaut.inject.ExecutableMethod<?,?>>, io.micronaut.context.processor.ExecutableMethodProcessor<dev.langchain4j.agent.tool.Tool>

@Singleton public class ToolRegistry extends Object implements io.micronaut.context.processor.ExecutableMethodProcessor<dev.langchain4j.agent.tool.Tool>
Register of tools.
  • Constructor Details

    • ToolRegistry

      public ToolRegistry(io.micronaut.context.BeanContext beanContext)
  • Method Details

    • process

      public void process(io.micronaut.inject.BeanDefinition<?> beanDefinition, io.micronaut.inject.ExecutableMethod<?,?> method)
      Specified by:
      process in interface io.micronaut.context.processor.AnnotationProcessor<dev.langchain4j.agent.tool.Tool,io.micronaut.inject.ExecutableMethod<?,?>>
      Specified by:
      process in interface io.micronaut.context.processor.ExecutableMethodProcessor<dev.langchain4j.agent.tool.Tool>
    • getAllTools

      public List<Object> getAllTools()
      Get all available tools.
      Returns:
      The tools
    • getToolsTyped

      public List<Object> getToolsTyped(Set<?> toolTypes)
      Get tools for the given types.
      Parameters:
      toolTypes - The tool types.
      Returns:
      A list of types