Interface LlmReference

  • All Implemented Interfaces:
    com.embabel.common.ai.prompt.PromptContributor , com.embabel.common.ai.prompt.PromptElement , com.embabel.common.core.types.Described , com.embabel.common.core.types.Named , com.embabel.common.core.types.NamedAndDescribed

    
    public interface LlmReference
     implements NamedAndDescribed, PromptContributor
                        

    An LLmReference exposes tools and is a prompt contributor. The prompt contribution might describe how to use the tools or can include relevant information directly. Consider, for example, a reference to an API which is so small it's included in the prompt, versus a large API which must be accessed via tools. The reference name is used in a strategy for tool naming, so should be fairly short. Description may be more verbose. If you want a custom naming strategy, use a ToolObject directly, and add the PromptContributor separately.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String toolPrefix() A safe prefix for LLM tools associated with this reference.
      ToolObject toolObject() Create a tool object for this reference.
      Object toolInstance() Return the instance of the tool object.
      String contribution()
      abstract String notes() Notes about this reference, such as usage guidance.
      • Methods inherited from class com.embabel.common.ai.prompt.PromptContributor

        promptContribution
      • Methods inherited from class com.embabel.common.core.types.Described

        getDescription
      • Methods inherited from class com.embabel.common.core.types.Named

        getName
      • Methods inherited from class com.embabel.common.ai.prompt.PromptElement

        getPromptContributionLocation, getRole
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • toolPrefix

         String toolPrefix()

        A safe prefix for LLM tools associated with this reference. Defaults to the name lowercased with spaces replaced by underscores. Subclasses can override it

      • toolInstance

         Object toolInstance()

        Return the instance of the tool object. Defaults to this

      • notes

         abstract String notes()

        Notes about this reference, such as usage guidance. Does not need to consider prompt prefix, name or description as they will be added automatically.