Skip to content

Commit f9e23e1

Browse files
committed
add externalVectorStores feature flag to useAiAssetVectorStoresEnabled, add externalVectorStores & custom endpoints flags to PluginStoreContextProvider, update extensions.ts
1 parent e19bea6 commit f9e23e1

3 files changed

Lines changed: 23 additions & 16 deletions

File tree

packages/gen-ai/frontend/src/app/hooks/useAiAssetVectorStoresEnabled.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useFeatureFlag } from '@openshift/dynamic-plugin-sdk';
2+
import { EXTERNAL_VECTOR_STORES } from '~/odh/extensions';
23

34
const useAiAssetVectorStoresEnabled = (): boolean => {
4-
const [aiAssetVectorStoresEnabled] = useFeatureFlag('ai-asset-vector-stores');
5+
const [aiAssetVectorStoresEnabled] = useFeatureFlag(EXTERNAL_VECTOR_STORES);
56
return aiAssetVectorStoresEnabled;
67
};
78

packages/gen-ai/frontend/src/odh/PluginStoreContextProvider.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import * as React from 'react';
22
import { PluginStoreProvider } from '@openshift/dynamic-plugin-sdk';
33
import { PluginStore } from '@odh-dashboard/plugin-core';
4-
import extensions from './extensions';
5-
6-
const PLUGIN_GEN_AI = 'plugin-gen-ai';
7-
const MODEL_AS_SERVICE = 'model-as-service';
8-
const MODEL_AS_SERVICE_CAMEL = 'modelAsService';
9-
const GUARDRAILS = 'guardrails';
10-
const PROMPT_MANAGEMENT = 'promptManagement';
4+
import extensions, {
5+
AI_ASSET_CUSTOM_ENDPOINTS,
6+
EXTERNAL_VECTOR_STORES,
7+
GUARDRAILS,
8+
MODEL_AS_SERVICE,
9+
MODEL_AS_SERVICE_CAMEL,
10+
PLUGIN_GEN_AI,
11+
PROMPT_MANAGEMENT,
12+
} from './extensions';
1113

1214
export const PluginStoreContextProvider: React.FC<React.PropsWithChildren> = ({ children }) => {
1315
const store = React.useMemo(() => {
@@ -18,6 +20,8 @@ export const PluginStoreContextProvider: React.FC<React.PropsWithChildren> = ({
1820
[MODEL_AS_SERVICE_CAMEL]: true,
1921
[GUARDRAILS]: true,
2022
[PROMPT_MANAGEMENT]: true,
23+
[EXTERNAL_VECTOR_STORES]: true,
24+
[AI_ASSET_CUSTOM_ENDPOINTS]: true,
2125
};
2226

2327
const params = new URLSearchParams(window.location.search);

packages/gen-ai/frontend/src/odh/extensions.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ import {
1313
} from '~/app/utilities/routes';
1414
import type { AIAssetsTabExtension } from '~/odh/extension-points';
1515

16-
const PLUGIN_GEN_AI = 'plugin-gen-ai';
17-
const GUARDRAILS = 'guardrails';
18-
const PROMPT_MANAGEMENT = 'promptManagement';
19-
const AI_ASSET_CUSTOM_ENDPOINTS = 'aiAssetCustomEndpoints';
20-
const AI_ASSET_VECTOR_STORES = 'ai-asset-vector-stores';
16+
export const PLUGIN_GEN_AI = 'plugin-gen-ai';
17+
export const MODEL_AS_SERVICE = 'model-as-service';
18+
export const MODEL_AS_SERVICE_CAMEL = 'modelAsService';
19+
export const GUARDRAILS = 'guardrails';
20+
export const PROMPT_MANAGEMENT = 'promptManagement';
21+
export const AI_ASSET_CUSTOM_ENDPOINTS = 'aiAssetCustomEndpoints';
22+
export const EXTERNAL_VECTOR_STORES = 'externalVectorStores';
2123

2224
const extensions: (NavExtension | RouteExtension | AreaExtension | AIAssetsTabExtension)[] = [
2325
{
@@ -55,9 +57,9 @@ const extensions: (NavExtension | RouteExtension | AreaExtension | AIAssetsTabEx
5557
{
5658
type: 'app.area',
5759
properties: {
58-
id: AI_ASSET_VECTOR_STORES,
60+
id: EXTERNAL_VECTOR_STORES,
5961
reliantAreas: [PLUGIN_GEN_AI],
60-
devFlags: [AI_ASSET_VECTOR_STORES],
62+
featureFlags: [EXTERNAL_VECTOR_STORES],
6163
},
6264
},
6365
{
@@ -136,7 +138,7 @@ const extensions: (NavExtension | RouteExtension | AreaExtension | AIAssetsTabEx
136138
{
137139
type: 'gen-ai.ai-assets/tab',
138140
flags: {
139-
required: [PLUGIN_GEN_AI, AI_ASSET_VECTOR_STORES],
141+
required: [PLUGIN_GEN_AI, EXTERNAL_VECTOR_STORES],
140142
},
141143
properties: {
142144
id: 'vectorstores',

0 commit comments

Comments
 (0)