Skip to content

Conversation

@mikehostetler
Copy link
Contributor

Adds two helper functions to ToolCall module:

  • to_map/1: Convert ToolCall struct to flat map with decoded arguments
  • from_map/1: Normalize map or ToolCall to standard %{id, name, arguments} format

These are used by jido_ai for consistent tool call processing across providers.

Changes

  • Added ToolCall.to_map/1 function
  • Added ToolCall.from_map/1 function
  • Added tests for both functions

…andling

Adds two helper functions to ToolCall module:
- to_map/1: Convert ToolCall struct to flat map with decoded arguments
- from_map/1: Normalize map or ToolCall to standard %{id, name, arguments} format

These are used by jido_ai for consistent tool call processing across providers.

Amp-Thread-ID: https://ampcode.com/threads/T-019c1692-7ccb-732c-b146-db36ab4ec368
Co-authored-by: Amp <[email protected]>
@mikehostetler mikehostetler merged commit 7c9d70c into main Feb 1, 2026
6 checks passed
@mikehostetler mikehostetler deleted the feat/tool-call-from-map branch February 1, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants