Pipeline.Tools.Tool behaviour (pipeline v0.0.1)
View SourceBase behavior for pipeline tools that can be called by LLMs.
Tools define functions that can be executed by AI models during conversations. Each tool should implement this behavior to provide consistent interface.
Summary
Callbacks
Executes the tool with the given arguments. Returns {:ok, result} on success or {:error, reason} on failure.
Returns the tool definition including name, description, and parameters schema. This is used by LLM adapters to register the tool with the AI service.
Returns the platforms/configurations this tool supports. Used for tool discovery and validation.
Validates that the tool can run in the current environment. Returns :ok if valid, {:error, reason} if not.
Callbacks
Executes the tool with the given arguments. Returns {:ok, result} on success or {:error, reason} on failure.
Returns the tool definition including name, description, and parameters schema. This is used by LLM adapters to register the tool with the AI service.
@callback supported_platforms() :: [String.t()]
Returns the platforms/configurations this tool supports. Used for tool discovery and validation.
@callback validate_environment() :: :ok | {:error, String.t()}
Validates that the tool can run in the current environment. Returns :ok if valid, {:error, reason} if not.