Interface LLMTool

All Superinterfaces:
Identifiable<String>

@NonNullByDefault public interface LLMTool extends Identifiable<String>
The LLMTool interface represents a programmatic tool designed to be consumed by an LLM.
Author:
Miguel Álvarez Díez - Initial contribution
  • Method Details

    • getUID

      String getUID()
      Returns a simple string that uniquely identifies this service.
      Specified by:
      getUID in interface Identifiable<String>
      Returns:
      an id that identifies this service
    • getLabel

      String getLabel(@Nullable Locale locale)
      Returns a localized human-readable label that can be used within UIs.
      Parameters:
      locale - the locale to provide the label for
      Returns:
      a localized string to be used in UIs
    • getShortDescription

      String getShortDescription(@Nullable Locale locale)
      Returns a short localized human-readable description of the tool.
      Parameters:
      locale - the locale to provide the label for
      Returns:
      a localized string that shortly describes the tool purpose
    • getDescription

      String getDescription(@Nullable Locale locale)
      Returns a localized human-readable description of the tool.
      Parameters:
      locale - the locale to provide the label for
      Returns:
      a localized string to be feed to an LLM
    • getParamDescriptions

      List<LLMToolParam> getParamDescriptions(@Nullable Locale locale)
      Returns a localized LLMToolParam list with human-readable descriptions of the tool parameters.
      Parameters:
      locale - the locale to provide the label for
      Returns:
      localized descriptions of the tool params
    • call

      String call(Map<String,Object> params, @Nullable Locale locale) throws LLMToolException
      Invoke the tool implementation.
      Parameters:
      params - a map of parameter names and values
      Returns:
      the tool result
      Throws:
      LLMToolException - when invocation of the tool implementation failed