toolRegistry
llms: toolRegistry
A toolRegistry object for tool-calling capable models.
toolRegistry is a scalar class object, which acts as a custom
dictionary for toolFunction objects. It is useful for defining
a list of uniquely identifiable functions that can be made available to
a tool-capable LLM during a chat session.
Source Code: toolRegistry
toolRegistry: reg = toolRegistry (tool)
toolRegistry: reg = toolRegistry (tool1, …, toolN)
reg = toolRegistry (tool1, …, toolN)
creates a tool registry, reg, which comprises a list of
toolFunction objects specified by the input arguments
(tool1, …, toolN), which must be uniquely
identifiable by their function names.
toolFunction: tool_output = evalFunction (reg, tool_call)
tool_output = evalFunction (reg, tool_call)
evaluates the function handle of each toolFunction object
specified by tool available in the tool registry reg
according to the corresponding input arguments described by the LLM’s
tool calling response specified in tool_call, which can be a
character vector containing the appropriate JSON string message or its
equivalent to a scalar structure. The returned tool_output is an
cell array of character vectors, in which the first column
contains the output of each evaluated toolFunction object and the
second column contains the corresponding function names.