-
Notifications
You must be signed in to change notification settings - Fork 641
feature(client): tool parameters raw input mode, togglegroup component #618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi @jjjuk , I want to make sure I understand the reason behind adding these changes. It sounds like you're saying that empty strings aren't being handled correctly in some cases? I'd prefer not to add more complexity to the form unless its really necessary. |
…better prop naming
Hi, @olaservo! I fully understand your conserns, here is my explanation! I believe that raw mode is a useful feature for debugging tool calls. For example, Postman has a simillar feature. In my case there is no other reasonable way to specify an empty string. An empty textarea without default value in schema returns Here is {
"type": "object",
"properties": {
"data": {
"title": "Data",
"type": "string"
},
"graph_model_file": {
"default": null, <----
"title": "Graph Model File",
"type": "string"
},
"graph_model_name": {
"default": null, <----
"title": "Graph Model Name",
"type": "string"
}
},
"required": [
"data"
],
"title": "cognifyArguments"
} But from the users perspective they don't look like null ![]() If I call the tool with this values:
If I call the tool with raw mode and explicitly specify empty strings: So generally speaking, this is a tool for developers, sometimes more control is a good thing! In this case it gives more information and let me pass exact value. In other case you may want to paste your parameters from IDE, I don't see it as redundant thing. If you want something to be cahnged in my implementation, or add tests, I will be happy to do so. |
Actually, if you type something in the Btw, Is this an expected behavior? |
Tool parameters raw input mode, togglegroup ui component
Hi guys! Needed this one for myself, created a PR)
Form/Raw switch for tool parameters input.
Raw mode uses
DynamicJsonForm
.Added
forceSimpleJson
property toDynamicJsonForm
to hide it's own form/json switch.New ui component
togglegroup
with similar styling as tabs used for switch, might be useful for other features.Written as simple as possible, in the project's codestyle.
Motivation and Context
In some tools, empty string instead null is required. But input form converts empty strings to nulls.
So the quick solution is to add DynamicJsonForm as the option to edit tool parameters.
This is usefull if you want more contorl over parameters value, bypass schema, use empty strings, etc.
How Has This Been Tested?
Manually, feature is very basic.
Breaking Changes
Nothing
Types of changes
Checklist
Additional context
Need advice for necessary docs and tests for this feature.