(
}
/>
-
diff --git a/frontend/src/component/layout/MainLayout/NavigationSidebar/NewInUnleash/NewInUnleash.tsx b/frontend/src/component/layout/MainLayout/NavigationSidebar/NewInUnleash/NewInUnleash.tsx
index 2872f662d363..b5a5509cac30 100644
--- a/frontend/src/component/layout/MainLayout/NavigationSidebar/NewInUnleash/NewInUnleash.tsx
+++ b/frontend/src/component/layout/MainLayout/NavigationSidebar/NewInUnleash/NewInUnleash.tsx
@@ -21,8 +21,6 @@ import { ReactComponent as SignalsPreview } from 'assets/img/signals.svg';
import LinearScaleIcon from '@mui/icons-material/LinearScale';
import { useNavigate } from 'react-router-dom';
import { ReactComponent as EventTimelinePreview } from 'assets/img/eventTimeline.svg';
-import { ReactComponent as AIIcon } from 'assets/icons/AI.svg';
-import { ReactComponent as AIPreview } from 'assets/img/aiPreview.svg';
import { useHighlightContext } from 'component/common/Highlight/HighlightContext';
const StyledNewInUnleash = styled('div')(({ theme }) => ({
@@ -79,12 +77,6 @@ const StyledLinearScaleIcon = styled(LinearScaleIcon)(({ theme }) => ({
color: theme.palette.primary.main,
}));
-const StyledAIIcon = styled(AIIcon)(({ theme }) => ({
- '& > path': {
- fill: theme.palette.primary.main,
- },
-}));
-
interface INewInUnleashProps {
mode?: NavigationMode;
onMiniModeClick?: () => void;
@@ -101,13 +93,8 @@ export const NewInUnleash = ({
'new-in-unleash-seen:v1',
new Set(),
);
- const {
- isOss,
- isEnterprise,
- uiConfig: { unleashAIAvailable },
- } = useUiConfig();
+ const { isOss, isEnterprise } = useUiConfig();
const signalsEnabled = useUiFlag('signals');
- const unleashAIEnabled = useUiFlag('unleashAI');
const items: NewInUnleashItemDetails[] = [
{
@@ -176,31 +163,6 @@ export const NewInUnleash = ({
>
),
},
- {
- label: 'Unleash AI',
- summary:
- 'Enhance your Unleash experience with the help of the Unleash AI assistant',
- icon: ,
- preview: ,
- onCheckItOut: () => highlight('unleashAI'),
- show: Boolean(unleashAIAvailable) && unleashAIEnabled,
- beta: true,
- longDescription: (
- <>
-
- Meet the Unleash AI assistant, designed to make your
- experience with Unleash easier and more intuitive,
- whether you're handling tasks or looking for guidance.
-
-
-
- Start chatting by using the button in the bottom right
- corner of the page, and discover all the ways the
- Unleash AI assistant can help you.
-
- >
- ),
- },
];
const visibleItems = items.filter(
diff --git a/frontend/src/hooks/api/actions/useAIApi/useAIApi.ts b/frontend/src/hooks/api/actions/useAIApi/useAIApi.ts
deleted file mode 100644
index 1c62bac3ff39..000000000000
--- a/frontend/src/hooks/api/actions/useAIApi/useAIApi.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-import { useState } from 'react';
-import useAPI from '../useApi/useApi';
-
-const ENDPOINT = 'api/admin/ai';
-
-export type ChatMessage = {
- role: 'system' | 'user' | 'assistant';
- content: string;
-};
-
-type Chat = {
- id: string;
- userId: number;
- createdAt: string;
- messages: ChatMessage[];
-};
-
-export const useAIApi = () => {
- const { makeRequest, createRequest, errors, loading } = useAPI({
- propagateErrors: true,
- });
-
- const [chatId, setChatId] = useState();
-
- const chat = async (message: string): Promise => {
- const requestId = 'chat';
-
- const req = createRequest(
- `${ENDPOINT}/chat${chatId ? `/${chatId}` : ''}`,
- {
- method: 'POST',
- body: JSON.stringify({
- message,
- }),
- requestId,
- },
- );
-
- const response = await makeRequest(req.caller, req.id);
- const chat: Chat = await response.json();
- setChatId(chat.id);
- return chat;
- };
-
- const newChat = () => {
- setChatId(undefined);
- };
-
- return {
- chat,
- newChat,
- errors,
- loading,
- };
-};
diff --git a/frontend/src/hooks/usePlausibleTracker.ts b/frontend/src/hooks/usePlausibleTracker.ts
index 95859a114246..b4299af6de90 100644
--- a/frontend/src/hooks/usePlausibleTracker.ts
+++ b/frontend/src/hooks/usePlausibleTracker.ts
@@ -71,7 +71,6 @@ export type CustomEvents =
| 'onboarding'
| 'personal-dashboard'
| 'order-environments'
- | 'unleash-ai-chat'
| 'project-navigation'
| 'productivity-report'
| 'release-plans';
diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts
index e7667b4546b2..a745365d6e86 100644
--- a/frontend/src/interfaces/uiConfig.ts
+++ b/frontend/src/interfaces/uiConfig.ts
@@ -33,7 +33,6 @@ export interface IUiConfig {
resourceLimits: ResourceLimitsSchema;
oidcConfiguredThroughEnv?: boolean;
samlConfiguredThroughEnv?: boolean;
- unleashAIAvailable?: boolean;
maxSessionsCount?: number;
}
@@ -85,7 +84,6 @@ export type UiFlags = {
manyStrategiesPagination?: boolean;
enableLegacyVariants?: boolean;
flagCreator?: boolean;
- unleashAI?: boolean;
releasePlans?: boolean;
'enterprise-payg'?: boolean;
simplifyProjectOverview?: boolean;
diff --git a/src/lib/openapi/spec/ai-chat-message-schema.ts b/src/lib/openapi/spec/ai-chat-message-schema.ts
deleted file mode 100644
index b774c45796c6..000000000000
--- a/src/lib/openapi/spec/ai-chat-message-schema.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import type { FromSchema } from 'json-schema-to-ts';
-
-export const aiChatMessageSchema = {
- $id: '#/components/schemas/aiChatMessageSchema',
- type: 'object',
- description: 'Describes an Unleash AI chat message.',
- additionalProperties: false,
- required: ['role', 'content'],
- properties: {
- role: {
- type: 'string',
- enum: ['system', 'user', 'assistant'],
- description: 'The role of the message sender.',
- example: 'user',
- },
- content: {
- type: 'string',
- description: 'The message content.',
- example: 'What is your purpose?',
- },
- },
- components: {
- schemas: {},
- },
-} as const;
-
-export type AIChatMessageSchema = FromSchema;
diff --git a/src/lib/openapi/spec/ai-chat-new-message-schema.ts b/src/lib/openapi/spec/ai-chat-new-message-schema.ts
deleted file mode 100644
index f60ebe21b587..000000000000
--- a/src/lib/openapi/spec/ai-chat-new-message-schema.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import type { FromSchema } from 'json-schema-to-ts';
-
-export const aiChatNewMessageSchema = {
- $id: '#/components/schemas/aiChatNewMessageSchema',
- type: 'object',
- description: 'Describes a new Unleash AI chat message sent by the user.',
- required: ['message'],
- properties: {
- message: {
- type: 'string',
- description: 'The message content.',
- example: 'What is your purpose?',
- },
- },
- components: {
- schemas: {},
- },
-} as const;
-
-export type AIChatNewMessageSchema = FromSchema;
diff --git a/src/lib/openapi/spec/ai-chat-schema.ts b/src/lib/openapi/spec/ai-chat-schema.ts
deleted file mode 100644
index b195b2973bdc..000000000000
--- a/src/lib/openapi/spec/ai-chat-schema.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import type { FromSchema } from 'json-schema-to-ts';
-import { aiChatMessageSchema } from './ai-chat-message-schema';
-
-export const aiChatSchema = {
- $id: '#/components/schemas/aiChatSchema',
- type: 'object',
- description: 'Describes an Unleash AI chat.',
- additionalProperties: false,
- required: ['id', 'userId', 'createdAt', 'messages'],
- properties: {
- id: {
- type: 'string',
- pattern: '^[0-9]+$', // BigInt
- description:
- "The chat's ID. Chat IDs are incrementing integers. In other words, a more recently created chat will always have a higher ID than an older one. This ID is represented as a string since it is a BigInt.",
- example: '7',
- },
- userId: {
- type: 'integer',
- description: 'The ID of the user that the chat belongs to.',
- example: 7,
- },
- createdAt: {
- type: 'string',
- format: 'date-time',
- description: 'The date and time of when the chat was created.',
- example: '2023-12-27T13:37:00+01:00',
- },
- messages: {
- type: 'array',
- description:
- 'The messages exchanged between the user and the Unleash AI.',
- items: {
- $ref: '#/components/schemas/aiChatMessageSchema',
- },
- },
- },
- components: {
- schemas: {
- aiChatMessageSchema,
- },
- },
-} as const;
-
-export type AIChatSchema = FromSchema;
diff --git a/src/lib/openapi/spec/index.ts b/src/lib/openapi/spec/index.ts
index db6f696b1051..38b878c2c5ee 100644
--- a/src/lib/openapi/spec/index.ts
+++ b/src/lib/openapi/spec/index.ts
@@ -14,9 +14,6 @@ export * from './advanced-playground-environment-feature-schema';
export * from './advanced-playground-feature-schema';
export * from './advanced-playground-request-schema';
export * from './advanced-playground-response-schema';
-export * from './ai-chat-message-schema';
-export * from './ai-chat-new-message-schema';
-export * from './ai-chat-schema';
export * from './api-token-schema';
export * from './api-tokens-schema';
export * from './application-environment-instances-schema';
diff --git a/src/lib/types/experimental.ts b/src/lib/types/experimental.ts
index 00caa7cdbe87..1f045d26c766 100644
--- a/src/lib/types/experimental.ts
+++ b/src/lib/types/experimental.ts
@@ -48,7 +48,6 @@ export type IFlagKey =
| 'removeUnsafeInlineStyleSrc'
| 'projectRoleAssignment'
| 'originMiddlewareRequestLogging'
- | 'unleashAI'
| 'webhookDomainLogging'
| 'releasePlans'
| 'productivityReportEmail'
@@ -243,10 +242,6 @@ const flags: IFlags = {
process.env.UNLEASH_ORIGIN_MIDDLEWARE_REQUEST_LOGGING,
false,
),
- unleashAI: parseEnvVarBoolean(
- process.env.UNLEASH_EXPERIMENTAL_UNLEASH_AI,
- false,
- ),
webhookDomainLogging: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENT_WEBHOOK_DOMAIN_LOGGING,
false,
diff --git a/src/migrations/20241220102327-drop-ai-chats.js b/src/migrations/20241220102327-drop-ai-chats.js
new file mode 100644
index 000000000000..25c1ce7ebabd
--- /dev/null
+++ b/src/migrations/20241220102327-drop-ai-chats.js
@@ -0,0 +1,26 @@
+exports.up = function (db, cb) {
+ db.runSql(
+ `
+ DROP INDEX IF EXISTS idx_ai_chats_user_id;
+ DROP TABLE IF EXISTS ai_chats;
+ `,
+ cb,
+ );
+};
+
+exports.down = function (db, cb) {
+ db.runSql(
+ `
+ CREATE TABLE IF NOT EXISTS ai_chats
+ (
+ id BIGSERIAL PRIMARY KEY NOT NULL,
+ user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+ created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
+ messages JSONB NOT NULL
+ );
+
+ CREATE INDEX IF NOT EXISTS idx_ai_chats_user_id ON ai_chats(user_id);
+ `,
+ cb,
+ );
+};
diff --git a/src/server-dev.ts b/src/server-dev.ts
index 8b432a7d315b..9b06b4e8dd55 100644
--- a/src/server-dev.ts
+++ b/src/server-dev.ts
@@ -49,7 +49,6 @@ process.nextTick(async () => {
enableLegacyVariants: false,
extendedMetrics: true,
originMiddlewareRequestLogging: true,
- unleashAI: true,
webhookDomainLogging: true,
releasePlans: false,
simplifyProjectOverview: true,