Skip to content
Closed
Show file tree
Hide file tree
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
15 changes: 0 additions & 15 deletions app/client/src/ce/components/editorComponents/GPT/AskAIButton.tsx

This file was deleted.

44 changes: 0 additions & 44 deletions app/client/src/ce/components/editorComponents/GPT/index.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions app/client/src/ce/components/editorComponents/GPT/trigger.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions app/client/src/ce/constants/ReduxActionConstants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1257,11 +1257,6 @@ const OneClickBindingActionTypes = {
"SET_ONE_CLICK_BINDING_OPTIONS_VISIBILITY",
};

const AIActionTypes = {
UPDATE_AI_CONTEXT: "UPDATE_AI_CONTEXT",
UPDATE_AI_TRIGGERED: "UPDATE_AI_TRIGGERED",
};

const PlatformActionErrorTypes = {
API_ERROR: "API_ERROR",
};
Expand All @@ -1270,7 +1265,6 @@ export const ReduxActionTypes = {
...ActionActionTypes,
...AdminSettingsActionTypes,
...AnalyticsActionTypes,
...AIActionTypes,
...AppCollabActionTypes,
...ApplicationActionTypes,
...AppThemeActionsTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export function TextView(props: TextViewProps) {
<InputText
additionalAutocomplete={props.additionalAutoComplete}
dataTreePath={props.dataTreePath}
enableAI={false}
evaluatedValue={value}
expected={{
type: "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import type {
EntityNavigationData,
NavigationData,
} from "selectors/navigationSelectors";
import { getAIContext } from "ee/components/editorComponents/GPT/trigger";
import type { Plugin } from "api/PluginApi";

export const getShowHintOptions = (
Expand Down Expand Up @@ -128,7 +127,6 @@ export const slashCommandHintHelper: HintHelper = (
entityInfo: FieldEntityInformation,
{
datasources,
enableAIAssistance,
executeCommand,
featureFlags,
focusEditor,
Expand All @@ -141,7 +139,6 @@ export const slashCommandHintHelper: HintHelper = (
recentEntities: string[];
entityId: string;
featureFlags: FeatureFlags;
enableAIAssistance: boolean;
focusEditor: (focusOnLine?: number, chOffset?: number) => void;
},
): boolean => {
Expand All @@ -168,28 +165,16 @@ export const slashCommandHintHelper: HintHelper = (

if (!shouldShowBinding) return false;

const aiContext = getAIContext({
currentLineValue,
cursorPosition,
editor,
slashIndex,
entityType,
});

if (!aiContext) return false;

const list = generateQuickCommands(
filteredEntitiesForSuggestions,
currentEntityType,
searchText,
{
aiContext,
datasources,
executeCommand,
pluginIdToPlugin,
recentEntities,
featureFlags,
enableAIAssistance,
},
editor,
focusEditor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import { EntityIcon, JsFileIconV2 } from "pages/Editor/Explorer/ExplorerIcons";
import { getAssetUrl } from "ee/utils/airgapHelpers";
import type { FeatureFlags } from "ee/entities/FeatureFlag";
import { Button, Icon } from "@appsmith/ads";
import { APPSMITH_AI } from "ee/components/editorComponents/GPT/trigger";
import { DatasourceCreateEntryPoints } from "constants/Datasource";
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
import BetaCard from "../BetaCard";
import type { NavigationData } from "selectors/navigationSelectors";
import type { AIEditorContext } from "ee/components/editorComponents/GPT";
import type { EntityTypeValue } from "ee/entities/DataTree/types";
import history, { NavigationMethod } from "utils/history";
import type { Plugin } from "api/PluginApi";
Expand All @@ -26,7 +24,6 @@ export enum Shortcuts {
PLUS = "PLUS",
BINDING = "BINDING",
FUNCTION = "FUNCTION",
ASK_AI = "ASK_AI",
SHOW_MORE = "SHOW_MORE",
}

Expand Down Expand Up @@ -133,7 +130,6 @@ export const iconsByType = {
[Shortcuts.FUNCTION]: (
<Icon className="snippet-icon" name="snippet" size="md" />
),
[Shortcuts.ASK_AI]: <Icon className="magic" name="magic-line" size="md" />,
[Shortcuts.SHOW_MORE]: (
<Icon className="show-more-icon" name="more-horizontal-control" size="md" />
),
Expand Down Expand Up @@ -269,19 +265,15 @@ export const generateQuickCommands = (
currentEntityType: EntityTypeValue,
searchText: string,
{
aiContext,
datasources,
enableAIAssistance,
executeCommand,
pluginIdToPlugin,
}: {
aiContext: AIEditorContext;
datasources: Datasource[];
executeCommand: (payload: SlashCommandPayload) => void;
pluginIdToPlugin: Record<string, Plugin>;
recentEntities: string[];
featureFlags: FeatureFlags;
enableAIAssistance: boolean;
},
editor: CodeMirror.Editor,
focusEditor: (focusOnLine?: number, chOffset?: number) => void,
Expand Down Expand Up @@ -394,24 +386,6 @@ export const generateQuickCommands = (
});
const commonCommands: CommandsCompletion[] = [];

if (enableAIAssistance) {
const askGPT: CommandsCompletion = generateCreateNewCommand({
text: "",
displayText: APPSMITH_AI,
shortcut: Shortcuts.ASK_AI,
triggerCompletionsPostPick: true,
isBeta: true,
action: () => {
executeCommand({
actionType: SlashCommand.ASK_AI,
args: aiContext,
});
},
});

commonCommands.unshift(askGPT);
}

if (currentEntityType !== ENTITY_TYPE.JSACTION) {
// New binding command is not applicable in JS Objects
commonCommands.push(newBinding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
filterCompletions,
getHintDetailsFromClassName,
} from "./utils/sqlHint";
import { isAISlashCommand } from "ee/components/editorComponents/GPT/trigger";

export const bindingHintHelper: HintHelper = (editor: CodeMirror.Editor) => {
editor.setOption("extraKeys", {
Expand Down Expand Up @@ -48,11 +47,7 @@ export const bindingHintHelper: HintHelper = (editor: CodeMirror.Editor) => {
let shouldShow = false;

if (additionalData?.isJsEditor) {
if (additionalData?.enableAIAssistance) {
shouldShow = !isAISlashCommand(editor);
} else {
shouldShow = true;
}
shouldShow = true;
} else {
shouldShow = checkIfCursorInsideBinding(editor);
}
Expand Down
Loading