Interface AiToolRegistry

All Known Implementing Classes:
AiToolRegistryImpl

public interface AiToolRegistry
Central registry of all AI tools available in the application.

The registry is built once at application startup from every Spring bean implementing JmixAiTool. For each such bean the registry collects @Tool-annotated methods, applies @ToolOverride resolution and produces a flat list of ResolvedAiTool entries.

  • Method Details

    • getAll

      List<ResolvedAiTool> getAll()
      Returns all resolved tools in registration order.
      Returns:
      all resolved tools
    • findByName

      Optional<ResolvedAiTool> findByName(String name)
      Returns a resolved tool by its name (the value passed to @Tool(name=...) or derived from the method name), or empty when no such tool is registered.
      Parameters:
      name - tool name to look up
      Returns:
      the matching tool, or empty when none is registered under that name
    • findByMarker

      List<ResolvedAiTool> findByMarker(Class<? extends JmixAiTool> marker)
      Returns all resolved tools produced by beans implementing the given marker sub-interface of JmixAiTool (e.g. DataLoadAiTool.class).
      Parameters:
      marker - marker sub-interface to filter by
      Returns:
      resolved tools whose source bean implements the marker
    • getAllCallbacks

      List<org.springframework.ai.tool.ToolCallback> getAllCallbacks()
      Shortcut returning ToolCallbacks of all resolved tools in the same order as getAll().
      Returns:
      callbacks of all resolved tools