Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: consoliate ai features under AI Assistant umbrella (#13367)
Tianzhou (天舟)84f488a45424
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.goindex fb774f854d..cfbe29218c 100644--- a/backend/api/v1/actuator_service.go+++ b/backend/api/v1/actuator_service.go@@ -170,7 +170,7 @@ func (s *ActuatorService) getUsedFeatures(ctx context.Context) ([]api.FeatureTypreturn nil, errors.Wrapf(err, "failed to get openai key setting")}if openAIKey != nil && openAIKey.Value != "" {- features = append(features, api.FeaturePluginOpenAI)+ features = append(features, api.FeatureAIAssistant)}setting, err := s.store.GetWorkspaceGeneralSetting(ctx)diff --git a/backend/api/v1/database_service.go b/backend/api/v1/database_service.goindex 0074f99c14..1bad6a94ed 100644--- a/backend/api/v1/database_service.go+++ b/backend/api/v1/database_service.go@@ -1784,7 +1784,7 @@ func isUpperCaseLetter(c rune) bool {// AdviseIndex advises the index of a table.func (s *DatabaseService) AdviseIndex(ctx context.Context, request *v1pb.AdviseIndexRequest) (*v1pb.AdviseIndexResponse, error) {- if err := s.licenseService.IsFeatureEnabled(api.FeaturePluginOpenAI); err != nil {+ if err := s.licenseService.IsFeatureEnabled(api.FeatureAIAssistant); err != nil {return nil, status.Errorf(codes.PermissionDenied, err.Error())}instanceID, databaseName, err := common.GetInstanceDatabaseID(request.Parent)diff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.goindex ce58c2ab74..de9bc6b123 100644--- a/backend/api/v1/setting_service.go+++ b/backend/api/v1/setting_service.go@@ -580,7 +580,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update}storeSettingValue = request.Setting.Value.GetStringValue()case api.SettingPluginOpenAIKey:- if err := s.licenseService.IsFeatureEnabled(api.FeaturePluginOpenAI); err != nil {+ if err := s.licenseService.IsFeatureEnabled(api.FeatureAIAssistant); err != nil {return nil, status.Errorf(codes.PermissionDenied, err.Error())}storeSettingValue = request.Setting.Value.GetStringValue()diff --git a/backend/legacyapi/plan.go b/backend/legacyapi/plan.goindex 4076943906..6306a96a92 100644--- a/backend/legacyapi/plan.go+++ b/backend/legacyapi/plan.go@@ -166,10 +166,10 @@ const (// FeatureSharedSQLScript enables sharing sql script.FeatureSharedSQLScript FeatureType = "bb.feature.shared-sql-script"- // Plugins.+ // AI Assistant.- // FeaturePluginOpenAI enables AI features powered by OpenAI.- FeaturePluginOpenAI FeatureType = "bb.feature.plugin.openai"+ // FeatureAIAssistant enables AI features powered by OpenAI.+ FeatureAIAssistant FeatureType = "bb.feature.ai-assistant")func (e FeatureType) String() string {@@ -253,7 +253,7 @@ func (e FeatureType) Name() string {case FeatureSharedSQLScript:return "Shared SQL script"// Plugins- case FeaturePluginOpenAI:+ case FeatureAIAssistant:return "OpenAI"}return ""@@ -320,7 +320,7 @@ var FeatureMatrix = map[FeatureType][3]bool{// CollaborationFeatureSharedSQLScript: {false, true, true},// Plugins- FeaturePluginOpenAI: {true, true, true},+ FeatureAIAssistant: {true, true, true},}// InstanceLimitFeature is the map for instance feature. Only allowed to access these feature for activate instance.diff --git a/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue b/frontend/src/components/GeneralSetting/AIAugmentationSetting.vueindex b1f0875882..810000853b 100644--- a/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue+++ b/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue@@ -3,9 +3,9 @@<div class="text-left lg:w-1/4"><div class="flex items-center space-x-2"><h1 class="text-2xl font-bold">- {{ $t("settings.general.workspace.plugin.openai.ai-augmentation") }}+ {{ $t("settings.general.workspace.ai-assistant.self") }}</h1>- <FeatureBadge feature="bb.feature.plugin.openai" />+ <FeatureBadge feature="bb.feature.ai-assistant" /></div><span v-if="!allowEdit" class="text-sm text-gray-400">{{ $t("settings.general.workspace.only-admin-can-edit") }}@@ -13,14 +13,22 @@</div><div class="flex-1 lg:px-4"><div class="mb-7 mt-4 lg:mt-0">+ <p class="mb-2 textinfolabel">+ {{ $t("settings.general.workspace.ai-assistant.description") }}+ <LearnMoreLink+ url="https://www.bytebase.com/docs/ai-assistant?source=console"+ class="ml-1 text-sm"+ />+ </p>+<label class="flex items-center gap-x-2"><span class="font-medium">{{- $t("settings.general.workspace.plugin.openai.openai-key.self")+ $t("settings.general.workspace.ai-assistant.openai-key.self")}}</span></label><div class="mb-3 text-sm text-gray-400"><i18n-t- keypath="settings.general.workspace.plugin.openai.openai-key.description"+ keypath="settings.general.workspace.ai-assistant.openai-key.description"><template #viewDoc><a@@ -29,7 +37,7 @@target="_blank">{{$t(- "settings.general.workspace.plugin.openai.openai-key.find-my-key"+ "settings.general.workspace.ai-assistant.openai-key.find-my-key")}}</a>@@ -44,7 +52,7 @@:disabled="!allowEdit":placeholder="$t(- 'settings.general.workspace.plugin.openai.openai-key.placeholder'+ 'settings.general.workspace.ai-assistant.openai-key.placeholder')"/>@@ -56,13 +64,13 @@<label class="flex items-center gap-x-2"><span class="font-medium">{{- $t("settings.general.workspace.plugin.openai.openai-endpoint.self")+ $t("settings.general.workspace.ai-assistant.openai-endpoint.self")}}</span></label><div class="mb-3 text-sm text-gray-400">{{$t(- "settings.general.workspace.plugin.openai.openai-endpoint.description"+ "settings.general.workspace.ai-assistant.openai-endpoint.description")}}</div>@@ -86,7 +94,7 @@@click.prevent="updateOpenAIKeyEndpoint"><FeatureBadge- feature="bb.feature.plugin.openai"+ feature="bb.feature.ai-assistant"custom-class="mr-1 text-white pointer-events-none"/>{{ $t("common.update") }}@@ -96,7 +104,7 @@</div><FeatureModal- feature="bb.feature.plugin.openai"+ feature="bb.feature.ai-assistant":open="state.showFeatureModal"@cancel="state.showFeatureModal = false"/>@@ -161,7 +169,7 @@ function maskKey(key: string | undefined): string {const updateOpenAIKeyEndpoint = async () => {// Always allow to unset the key.const isUnset = state.openAIKey === "" && state.openAIEndpoint === "";- if (!isUnset && !hasFeature("bb.feature.plugin.openai")) {+ if (!isUnset && !hasFeature("bb.feature.ai-assistant")) {state.showFeatureModal = true;return;}@@ -193,7 +201,7 @@ const updateOpenAIKeyEndpoint = async () => {};onMounted(() => {- if (location.hash === "#ai-augmentation") {+ if (location.hash === "#ai-assistant") {const container = containerRef.value;if (!container) return;scrollIntoView(container, {diff --git a/frontend/src/components/SlowQuery/Panel/IndexAdvisor.vue b/frontend/src/components/SlowQuery/Panel/IndexAdvisor.vueindex fb0bbc6b21..38f41c54b7 100644--- a/frontend/src/components/SlowQuery/Panel/IndexAdvisor.vue+++ b/frontend/src/components/SlowQuery/Panel/IndexAdvisor.vue@@ -147,7 +147,7 @@ const generateIssueName = () => {watch(() => props.slowQueryLog,async () => {- if (hasFeature("bb.feature.plugin.openai") && hasOpenAIKeySetup.value) {+ if (hasFeature("bb.feature.ai-assistant") && hasOpenAIKeySetup.value) {state.isLoading = true;try {const response = await databaseServiceClient.adviseIndex({diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex c7ca66abf0..5cf561fcec 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -695,19 +695,18 @@}},"config-updated": "Configuration is updated.",- "plugin": {- "openai": {- "ai-augmentation": "AI Augmentation",- "openai-key": {- "self": "OpenAI API Key",- "description": "Supply OpenAI API Key to enable ChatSQL capability in SQL Editor. {viewDoc}",- "find-my-key": "Find my key",- "placeholder": "An OpenAI API Key usually starts with sk-*****"- },- "openai-endpoint": {- "self": "OpenAI API Endpoint",- "description": "Supply private deployment of OpenAI API Endpoint."- }+ "ai-assistant": {+ "self": "AI Assistant",+ "description": "Use OpenAPI to assist the database development tasks.",+ "openai-key": {+ "self": "OpenAI API Key",+ "description": "Supply OpenAI API Key. {viewDoc}",+ "find-my-key": "Find my key",+ "placeholder": "An OpenAI API Key usually starts with sk-*****"+ },+ "openai-endpoint": {+ "self": "OpenAI API Endpoint",+ "description": "Supply private deployment of OpenAI API Endpoint."}},"announcement": {@@ -3096,7 +3095,7 @@"ai": {"examples": "Examples","text-to-sql-placeholder": "Use natural language and Bytebase will convert it into SQL",- "text-to-sql-disabled-placeholder": "Enable ChatSQL capability by supplying an OpenAI API Key.",+ "text-to-sql-disabled-placeholder": "Enable AI Assistant by supplying an OpenAI API Key.","run-automatically": "Run automatically","conversation": {"conversations": "Conversations",@@ -3122,9 +3121,9 @@},"statement-copied": "Statement copied to clipboard","dont-show-again": "Don't show again",- "chat-sql": "ChatSQL",- "disable-chat-sql": "Disable ChatSQL",- "enable-chat-sql": "Enable ChatSQL"+ "text2sql": "Text2SQL",+ "disable-text2sql": "Disable Text2SQL",+ "enable-text2sql": "Enable Text2SQL"}},"custom-approval": {diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 6fd1c1ccfb..005f6031df 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -695,19 +695,18 @@}},"config-updated": "La configuración se ha actualizado.",- "plugin": {- "openai": {- "ai-augmentation": "Mejora IA",- "openai-key": {- "self": "Clave de API de OpenAI",- "description": "Proporcione una clave de API de OpenAI para habilitar la capacidad ChatSQL en el Editor de SQL. {viewDoc}",- "find-my-key": "Encuentra mi llave",- "placeholder": "Una clave de API de OpenAI generalmente comienza con sk-*****"- },- "openai-endpoint": {- "self": "Punto de conexión de API de OpenAI",- "description": "Proporcione una implementación privada del Punto de conexión de API de OpenAI."- }+ "ai-assistant": {+ "self": "Asistente de AI",+ "description": "Utilice OpenAPI para ayudar en las tareas de desarrollo de bases de datos.",+ "openai-key": {+ "self": "Clave de API de OpenAI",+ "description": "Proporcione una clave de API de OpenAI para habilitar la capacidad Text2SQL en el Editor de SQL. {viewDoc}",+ "find-my-key": "Encuentra mi llave",+ "placeholder": "Una clave de API de OpenAI generalmente comienza con sk-*****"+ },+ "openai-endpoint": {+ "self": "Punto de conexión de API de OpenAI",+ "description": "Proporcione una implementación privada del Punto de conexión de API de OpenAI."}},"announcement": {@@ -3096,7 +3095,7 @@"ai": {"examples": "Ejemplos","text-to-sql-placeholder": "Utilice lenguaje natural y Bytebase lo convertirá en SQL",- "text-to-sql-disabled-placeholder": "Habilite la capacidad de ChatSQL suministrando una clave de API de OpenAI.",+ "text-to-sql-disabled-placeholder": "Habilite la capacidad de Text2SQL suministrando una clave de API de OpenAI.","run-automatically": "Ejecutar automáticamente","conversation": {"conversations": "Conversaciones",@@ -3122,9 +3121,9 @@},"statement-copied": "Declaración copiada al portapapeles","dont-show-again": "No mostrar de nuevo",- "chat-sql": "ChatSQL",- "disable-chat-sql": "Deshabilitar ChatSQL",- "enable-chat-sql": "Habilitar ChatSQL"+ "text2sql": "Text2SQL",+ "disable-text2sql": "Deshabilitar Text2SQL",+ "enable-text2sql": "Habilitar Text2SQL"}},"custom-approval": {diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex dbd56c39b9..c2d15f4ddf 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -695,19 +695,18 @@}},"config-updated": "構成が更新されました。",- "plugin": {- "openai": {- "ai-augmentation": "AIの強化",- "openai-key": {- "self": "OpenAI APIキー",- "description": "SQL エディターで ChatSQL を開く機能を有効にする OpenAI API キーを提供します。 {viewDoc}",- "find-my-key": "鍵を探す",- "placeholder": "OpenAI API キーは通常 sk-***** で始まります"- },- "openai-endpoint": {- "self": "OpenAI API エンドポイント",- "description": "プライベート展開用の OpenAI API エンドポイントを提供します。"- }+ "ai-assistant": {+ "self": "AI助手",+ "description": "OpenAPI を使用してデータベース開発タスクを支援します。",+ "openai-key": {+ "self": "OpenAI APIキー",+ "description": "SQL エディターで Text2SQL を開く機能を有効にする OpenAI API キーを提供します。 {viewDoc}",+ "find-my-key": "鍵を探す",+ "placeholder": "OpenAI API キーは通常 sk-***** で始まります"+ },+ "openai-endpoint": {+ "self": "OpenAI API エンドポイント",+ "description": "プライベート展開用の OpenAI API エンドポイントを提供します。"}},"announcement": {@@ -3096,7 +3095,7 @@"ai": {"examples": "例","text-to-sql-placeholder": "ここに自然言語を入力すると、Bytebase はすぐにそれを SQL ステートメントに変換します。",- "text-to-sql-disabled-placeholder": "OpenAI API キーを指定して、ChatSQL 機能を有効にします。",+ "text-to-sql-disabled-placeholder": "OpenAI API キーを指定して、Text2SQL 機能を有効にします。","run-automatically": "自動運転","conversation": {"conversations": "セッション",@@ -3122,9 +3121,9 @@},"statement-copied": "ステートメントがクリップボードにコピーされました","dont-show-again": "再び表示しない",- "chat-sql": "チャットSQL",- "disable-chat-sql": "ChatSQLを閉じる",- "enable-chat-sql": "ChatSQLを開く"+ "text2sql": "Text2SQL",+ "disable-text2sql": "Text2SQLを閉じる",+ "enable-text2sql": "Text2SQLを開く"}},"custom-approval": {diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex c38d5a0b9b..69e0f6409f 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -695,19 +695,18 @@}},"config-updated": "配置已更新。",- "plugin": {- "openai": {- "ai-augmentation": "AI 增强",- "openai-key": {- "self": "OpenAI API Key",- "description": "提供 OpenAI API Key 以在 SQL 编辑器中开启 ChatSQL 的能力。{viewDoc}",- "find-my-key": "找到我的 Key",- "placeholder": "OpenAI API Key 通常以 sk-***** 开头"- },- "openai-endpoint": {- "self": "OpenAI API Endpoint",- "description": "提供私有化部署的 OpenAI API Endpoint。"- }+ "ai-assistant": {+ "self": "AI 助手",+ "description": "使用 OpenAPI 来辅助数据库开发任务。",+ "openai-key": {+ "self": "OpenAI API Key",+ "description": "提供 OpenAI API Key 以开启 AI 助手。{viewDoc}",+ "find-my-key": "找到我的 Key",+ "placeholder": "OpenAI API Key 通常以 sk-***** 开头"+ },+ "openai-endpoint": {+ "self": "OpenAI API Endpoint",+ "description": "提供私有化部署的 OpenAI API Endpoint。"}},"announcement": {@@ -3096,7 +3095,7 @@"ai": {"examples": "例子","text-to-sql-placeholder": "在此输入自然语言后,Bytebase 会马上转换成 SQL 语句",- "text-to-sql-disabled-placeholder": "提供 OpenAI API 密钥以开启 ChatSQL 能力。",+ "text-to-sql-disabled-placeholder": "提供 OpenAI API 密钥以开启 Text2SQL 能力。","run-automatically": "自动运行","conversation": {"conversations": "会话",@@ -3122,9 +3121,9 @@},"statement-copied": "语句已复制到剪贴板","dont-show-again": "不再显示",- "chat-sql": "ChatSQL",- "disable-chat-sql": "关闭 ChatSQL",- "enable-chat-sql": "开启 ChatSQL"+ "text2sql": "Text2SQL",+ "disable-text2sql": "关闭 Text2SQL",+ "enable-text2sql": "开启 Text2SQL"}},"custom-approval": {diff --git a/frontend/src/plugins/ai/components/MockInputPlaceholder.vue b/frontend/src/plugins/ai/components/MockInputPlaceholder.vueindex 240e8f0ab5..35087ca81e 100644--- a/frontend/src/plugins/ai/components/MockInputPlaceholder.vue+++ b/frontend/src/plugins/ai/components/MockInputPlaceholder.vue@@ -44,7 +44,7 @@ const router = useRouter();const handleClick = () => {router.push({name: SETTING_ROUTE_WORKSPACE_GENERAL,- hash: "#ai-augmentation",+ hash: "#ai-assistant",});};diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.tsindex 61fef58ea3..bdabf7c1a2 100644--- a/frontend/src/types/plan.ts+++ b/frontend/src/types/plan.ts@@ -49,7 +49,7 @@ export type FeatureType =// Collaboration| "bb.feature.shared-sql-script"// Plugins- | "bb.feature.plugin.openai"+ | "bb.feature.ai-assistant"// Instance count limit| "bb.feature.instance-count"// User count limitdiff --git a/frontend/src/views/sql-editor/AsidePanel/GutterBar/OpenAIButton.vue b/frontend/src/views/sql-editor/AsidePanel/GutterBar/OpenAIButton.vueindex 423889529f..bffb459fbf 100644--- a/frontend/src/views/sql-editor/AsidePanel/GutterBar/OpenAIButton.vue+++ b/frontend/src/views/sql-editor/AsidePanel/GutterBar/OpenAIButton.vue@@ -24,8 +24,8 @@<template #default>{{showAIChatBox- ? $t("plugin.ai.disable-chat-sql")- : $t("plugin.ai.enable-chat-sql")+ ? $t("plugin.ai.disable-text2sql")+ : $t("plugin.ai.enable-text2sql")}}</template></NTooltip>diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vueindex 61e4214dc7..967cab3acf 100644--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/SingleResultViewV1.vue@@ -84,7 +84,7 @@</NButton></template><template #default>- {{ $t("plugin.ai.chat-sql") }}+ {{ $t("plugin.ai.text2sql") }}</template></NTooltip><template v-if="!disallowExportQueryData">