LlmEx.Tools.Declarative (LlmEx v0.1.0)
View SourceProvides a declarative API for defining tool schemas.
This module implements macros similar to Phoenix.Component's attr macro, allowing tool developers to define their tools in a more declarative style.
Summary
Functions
Declares a parameter for a tool.
Sets the description of the tool.
Sets the name of the tool.
Functions
Declares a parameter for a tool.
Arguments
name
- an atom or string defining the name of the parametertype
- an atom defining the type of the parameter (":string", ":integer", etc.)opts
- a keyword list of options. Defaults to[]
Options
:required
- marks a parameter as required. Defaults tofalse
:description
- documentation for the parameter:enum
- a list of allowed values for the parameter:default
- the default value for the parameter if not provided
Examples
param :action, :string, required: true, enum: ["increment", "decrement", "reset"],
description: "The action to perform"
Sets the description of the tool.
Examples
tool_description "A stateful counter that increments, decrements, or resets"
Sets the name of the tool.
Examples
tool_name "counter"