Skip to content
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

Merged
merged 1 commit into from
Feb 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,33 @@ export const selectQueryEntityOptions = (
): FunctionCallingEntityTypeOption[] => {
const plugins = getPlugins(state);

return getActions(state)
.map(({ config }) => ({
id: config.id,
name: config.name,
pluginId: config.pluginId,
}))
.map((action) => {
const iconSrc = plugins.find(
(plugin) => plugin.id === action.pluginId,
)?.iconLocation;
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",
)
.map(({ config }) => ({
id: config.id,
name: config.name,
pluginId: config.pluginId,
}))
.map((action) => {
const iconSrc = plugins.find(
(plugin) => plugin.id === action.pluginId,
)?.iconLocation;

return {
value: action.id,
label: action.name,
optionGroupType: "Query",
iconSrc,
};
});
return {
value: action.id,
label: action.name,
optionGroupType: "Query",
iconSrc,
};
})
);
};

const selectJsFunctionEntityOptions = (
Expand Down Expand Up @@ -106,8 +115,7 @@ const selectSystemFunctionEntityOptions =

return (
objectKeys(systemFunctions)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore assignRequest doesn't exist in CE repo but added in EE repo
// @ts-expect-error assignRequest doesn't exist in CE repo but added in EE repo
.filter((name) => name !== "assignRequest")
.map((name) => ({
value: name,
Expand Down
Loading