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.
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 <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/13457393528> > Commit: 3216f72 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=13457393528&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Anvil` > Spec: > <hr>Fri, 21 Feb 2025 13:30:05 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced the options available during configuration by refining the filtering logic for actions. This update streamlines the selection process, ensuring users see a more focused and relevant list in configuration controls. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Description
Fixes #
Issue Numberor
Fixes
Issue URLWarning
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.AnvilSpec:
Fri, 21 Feb 2025 13:30:05 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit