-
Notifications
You must be signed in to change notification settings - Fork 28.4k
feat(editor): Improve manual description in nodes as tools #15373
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
feat(editor): Improve manual description in nodes as tools #15373
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 2 issues across 5 files. Review them in mrge.io
packages/core/src/execution-engine/node-execution-context/utils/create-node-as-tool.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mrge found 3 issues across 7 files. Review them in mrge.io
...core/src/execution-engine/node-execution-context/utils/__tests__/create-node-as-tool.test.ts
Show resolved
Hide resolved
packages/core/src/execution-engine/node-execution-context/utils/create-node-as-tool.ts
Outdated
Show resolved
Hide resolved
@@ -547,6 +548,18 @@ const valueChanged = (parameterData: IUpdateInformation) => { | |||
nodeType, | |||
); | |||
|
|||
if (isToolNode.value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rule violated: Ensure every PR has unit tests for Vue files
Missing unit tests for the modified NodeSettings.vue component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Happy to merge as is, I did leave a note on Slack to suggest that we should also update if the description is an empty string (after .trim()
) so that users have a way of getting the automated description back if they mess with it
✅ All Cypress E2E specs passed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
✅ All Cypress E2E specs passed |
Got released with |
Summary
This PR enhances the way manual descriptions are generated for nodes used as AI tools. It introduces a more descriptive and context-aware approach for generating tool descriptions that better reflect the actual functionality of nodes.
What's Changed
Behavior Details
New Helper Functions
Added two new utility functions in
NodeHelpers.ts
:makeDescription()
: Generates human-readable descriptions for nodes based on their parameters and type definition{action} in {displayName}
- when operation has a defined action (e.g., "Create a new user in HTTP Request"){operation} {resource} in {displayName}
- when resource and operation exist but action is missing (e.g., "create user in HTTP Request")Node's default description - as fallback when resource or operation is missing
getToolDescription()
: Determines when tool descriptions should be updated and calculates the new descriptionUpdates to Node Settings Component
NodeSettings.vue
to automatically update the tool description when parameters changeDemo
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/ADO-3097/spike-better-set-manually-defaults-for-nodes-as-tools
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)