Alloy.Tool.Registry (alloy v0.7.4)

Copy Markdown View Source

Builds tool schemas and function maps from tool modules.

Takes a list of modules implementing Alloy.Tool and produces:

  1. Tool definitions (JSON Schema format for providers)
  2. A dispatch map from tool name → module for execution

Summary

Functions

Build tool definitions and dispatch map from a list of tool modules.

Functions

build(tool_modules)

@spec build([module()]) :: {[map()], %{required(String.t()) => module()}}

Build tool definitions and dispatch map from a list of tool modules.

Returns {tool_defs, tool_fns} where:

  • tool_defs is a list of maps suitable for provider APIs
  • tool_fns maps tool name strings to their implementing module