[TEST][MOAR] Tools with complex request bodies #619
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed solution for API with complex request bodies
Sample interaction in arcade chat: https://chat.arcade.dev/chat/26946170-bab4-403b-996d-0bbd55f80315
Complex API Tools - Execution Flow
Problem: LLMs struggle with complex nested API request bodies that can't be represented as simple tool parameters.
Solution: Dual-mode tools with stringified JSON inputs.
How It Works
Two Modes:
•
GET_REQUEST_SCHEMA
- Returns the OpenAPI schema with instructions•
EXECUTE
- Validates and executes with the JSON inputWorkflow:
{request_body_schema: {...}, instructions: "..."}
Key Prompt Design
Docstring:
Instructions field:
Disclaimer:
Error messages:
Include full schema to guide recovery without requiring another schema call
Result
✅ LLMs fetch schema once, then execute directly - no redundant calls
✅ Works for complex APIs with payment methods, nested objects, conditional fields, etc.
I believe we could implement this into more⚠️ ASAP ⚠️ , so the post functionalities are there as well, while we think in better solutions to solve the issue. APIs toolkits missing those creation/update tools wont be so useful, at least have it there can give the possibility to call those.
:60fps_parrot: PS: I will try to get some evals for this, but the chat interactions already give me better results than having a extra tool to get the scheme.