You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a lot of my tools I have to run validation before running my actual logic. This might be checking something exists in the DB first for example, or checking a date has been provided in the correct format.
Would love to see a rules method that I can add to my extends Tool classes that gets picked up and run automagically, exactly like Laravel's Form Requests, returns an array of rules that runs against the data.
I think providing a default message back to the models "Invalid arguments provided" would suffice as an error message, which I guess could be configurable like Laravel's messages() method on Form Requests.
🫡
The text was updated successfully, but these errors were encountered:
Nice. Yeah my only thought on that is how do you introduce more complex rules like new Exists() for example.
The JSON schema limits us a little. For dates there is a format: 'date' support on the params that I've used before, but yeah it comes down to needing to be super sure that we've got the exact data.
IMO it does move to more "complex tool case" which you do separate in the docs to the class format.
In a lot of my tools I have to run validation before running my actual logic. This might be checking something exists in the DB first for example, or checking a date has been provided in the correct format.
Would love to see a
rules
method that I can add to myextends Tool
classes that gets picked up and run automagically, exactly like Laravel's Form Requests, returns an array of rules that runs against the data.I think providing a default message back to the models "Invalid arguments provided" would suffice as an error message, which I guess could be configurable like Laravel's
messages()
method on Form Requests.🫡
The text was updated successfully, but these errors were encountered: