-
-
Notifications
You must be signed in to change notification settings - Fork 329
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Basic checks
- I searched existing issues - this hasn't been reported
- I can reproduce this consistently
- This is a RubyLLM bug, not my application code
What's broken?
Tool.call() does not perform any sort of parameter validation:
result = execute(**args.transform_keys(&:to_sym))
Our team has run into an issue where the LLM will call tools with unsupported parameters, resulting in unknown keyword error.
How to reproduce
- Define a tool with some set of parameters
- Add the tool to a chat, and prompt the LLM to use the tool with a parameter you did not define.
- Sometimes it will mention that the parameter is not accepted, but other times it will attempt to call the tool with fake parameters.
Expected behavior
Tool.call handles hallucinated parameters before a keyword error is triggered.
What actually happened
from tool_call table:
--clients--update_client
"{""last_name"": ""Brown"", ""first_name"": ""Goose"", ""new_advisor_code"": ""AWM-2000-106""}"
new_advisor_code is not a supported parameter for UpdateClient, so application throws an error, Failed to send message: unknown keyword: :new_advisor_code"
Environment
- Ruby: 3.4.2
- RubyLLM: 1.9.1
- Provider: AWS Bedrock -- Anthropic Sonnet
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working