LlmReference

interface LlmReference

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.

Inheritors

Functions

Link copied to clipboard
open fun contribution(): String
Link copied to clipboard
abstract fun notes(): String

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

Link copied to clipboard
open fun toolInstance(): Any

Return the instance of the tool object. Defaults to this

Link copied to clipboard

Create a tool object for this reference.

Link copied to clipboard
open fun toolPrefix(): String

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