-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: exclude ai queries from function calling #39399
Conversation
WalkthroughThe changes update the filtering logic within the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
app/client/src/components/formControls/FunctionCallingConfigControl/components/selectors.ts (1)
43-69
: Consider extracting magic strings and improving type safety.The filtering logic could be improved for maintainability and type safety:
- Extract "AI" and "Appsmith AI" as constants
- Consider adding proper type guards instead of using @ts-expect-error
+ const AI_PLUGIN_TYPE = "AI"; + const APPSMITH_AI_PLUGIN_NAME = "Appsmith AI"; + + interface ActionConfig { + pluginType: string; + pluginName: string; + id: string; + name: string; + pluginId: string; + } + + const isNonAIAction = (action: { config: ActionConfig }) => + action.config.pluginType !== AI_PLUGIN_TYPE && + action.config.pluginName !== APPSMITH_AI_PLUGIN_NAME; return getActions(state) // TODO: Remove filtering once AIChat is a separate entity - .filter( - (action) => - action.config.pluginType !== "AI" && - // @ts-expect-error No way to narrow down proper type - action.config.pluginName !== "Appsmith AI", - ) + .filter(isNonAIAction)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/client/src/components/formControls/FunctionCallingConfigControl/components/selectors.ts
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: perform-test / rts-build / build
- GitHub Check: perform-test / server-build / server-unit-tests
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-check-cyclic-deps / check-cyclic-dependencies
- GitHub Check: client-prettier / prettier-check
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
🔇 Additional comments (1)
app/client/src/components/formControls/FunctionCallingConfigControl/components/selectors.ts (1)
118-119
: LGTM! Good use of @ts-expect-error.The change from @ts-ignore to @ts-expect-error is more appropriate here as it explicitly indicates an expected type error and will fail if the error no longer exists.
Description
Fixes #
Issue Number
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.Anvil"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/13457393528
Commit: 3216f72
Cypress dashboard.
Tags:
@tag.Anvil
Spec:
Fri, 21 Feb 2025 13:30:05 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit