Skip to content

feat: add LLM tool-calling integration - #14

Draft
sd2k wants to merge 2 commits into
mainfrom
feature/llm-tool-calling
Draft

sd2k wants to merge 2 commits into
mainfrom
feature/llm-tool-calling

Conversation

@sd2k

@sd2k sd2k commented Jan 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add ToolFormat enum (OpenAI, Anthropic, Generic)
  • Add export_tool_schemas() to export callbacks as LLM tool schemas
  • Add execute_tool_call() to execute tool calls from LLM responses
  • New llm module with 655 lines of implementation

Test plan

  • Verify OpenAI format export matches expected schema
  • Verify Anthropic format export matches expected schema
  • Test execute_tool_call with various formats
  • Check error handling for invalid tool calls

🤖 Generated with Claude Code

sd2k added 2 commits January 16, 2026 22:20
Add schema export in standard LLM formats (OpenAI, Anthropic, Generic) for
integrating Eryx callbacks with LLM tool-calling APIs.

New features:
- Add ToolFormat enum for specifying target LLM format
- Add export_tool_schemas() method to Sandbox for exporting callbacks as tools
- Add execute_tool_call() method to Sandbox for executing tool calls from LLM responses
- Add ParsedToolCall struct for parsed tool call data
- Add ToolCallError for tool-related errors
- Add format_tool_result() helper for formatting results

The llm module provides utilities for:
1. Schema Export - Convert Eryx callbacks to LLM-compatible tool definitions
2. Tool Call Execution - Parse and execute tool calls from LLM responses

Supported formats:
- OpenAI: function calling format with type/function/parameters structure
- Anthropic: tool_use format with name/input_schema structure
- Generic: Provider-agnostic JSON Schema format

Closes: eryx-3va
@sd2k
sd2k force-pushed the feature/llm-tool-calling branch from e1f9ac1 to bd7b910 Compare January 16, 2026 22:23
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.

1 participant