Codex.Tool behaviour (Codex SDK v0.7.2)

Copy Markdown View Source

Behaviour and helper macros for Codex tool modules.

Tools must implement invoke/2, returning either {:ok, map()} or {:error, term()}. Optional metadata is surfaced via metadata/0 and merged with registry attributes on registration.

Summary

Functions

Returns metadata for a tool module, normalising to a map.

Callbacks

invoke(map, map)

@callback invoke(map(), map()) :: {:ok, map()} | {:error, term()}

metadata()

(optional)
@callback metadata() :: map()

Functions

metadata(module)

@spec metadata(module()) :: map()

Returns metadata for a tool module, normalising to a map.