Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: remove local ai

Nathan654e18aacfba
diff --git a/frontend/appflowy_flutter/lib/workspace/application/settings/plan/settings_plan_bloc.dart b/frontend/appflowy_flutter/lib/workspace/application/settings/plan/settings_plan_bloc.dart
index f7512a834e..dcc5156937 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/settings/plan/settings_plan_bloc.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/settings/plan/settings_plan_bloc.dart
@@ -148,7 +148,7 @@ class SettingsPlanBloc extends Bloc<SettingsPlanEvent, SettingsPlanState> {
usage.freeze();
final newUsage = usage.rebuild((value) {
- if (!newInfo.hasAIMax && !newInfo.hasAIOnDevice) {
+ if (!newInfo.hasAIMax) {
value.aiResponsesUnlimited = false;
}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart
index 7e795306fb..dab07773d1 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/setting_ai_view/settings_ai_view.dart
@@ -1,5 +1,4 @@
import 'package:appflowy/generated/locale_keys.g.dart';
-import 'package:appflowy/shared/af_role_pb_extension.dart';
import 'package:appflowy/shared/feature_flags.dart';
import 'package:appflowy/workspace/application/settings/ai/local_ai_on_boarding_bloc.dart';
import 'package:appflowy/workspace/application/settings/ai/settings_ai_bloc.dart';
@@ -10,9 +9,7 @@ import 'package:appflowy/workspace/presentation/settings/widgets/setting_appflow
import 'package:appflowy/workspace/presentation/widgets/toggle/toggle.dart';
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
import 'package:easy_localization/easy_localization.dart';
-import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
-import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -148,23 +145,7 @@ class _LocalAIOnBoarding extends StatelessWidget {
)..add(const LocalAIOnBoardingEvent.started()),
child: BlocBuilder<LocalAIOnBoardingBloc, LocalAIOnBoardingState>(
builder: (context, state) {
- // Show the local AI settings if the user has purchased the AI Local plan
- if (state.isPurchaseAILocal) {
- return const LocalAISetting();
- } else if (currentWorkspaceMemberRole?.isOwner ?? false) {
- // Show the upgrade to AI Local plan button if the user has not purchased the AI Local plan
- return _UpgradeToAILocalPlan(
- onTap: () {
- context.read<LocalAIOnBoardingBloc>().add(
- const LocalAIOnBoardingEvent.addSubscription(
- SubscriptionPlanPB.AiLocal,
- ),
- );
- },
- );
- } else {
- return const _AskOwnerUpgradeToLocalAI();
- }
+ return const LocalAISetting();
},
),
);
@@ -175,68 +156,3 @@ class _LocalAIOnBoarding extends StatelessWidget {
}
}
}
-
-class _AskOwnerUpgradeToLocalAI extends StatelessWidget {
- const _AskOwnerUpgradeToLocalAI();
-
- @override
- Widget build(BuildContext context) {
- return FlowyText(
- LocaleKeys.sideBar_askOwnerToUpgradeToLocalAI.tr(),
- color: AFThemeExtension.of(context).strongText,
- );
- }
-}
-
-class _UpgradeToAILocalPlan extends StatefulWidget {
- const _UpgradeToAILocalPlan({required this.onTap});
-
- final VoidCallback onTap;
-
- @override
- State<_UpgradeToAILocalPlan> createState() => _UpgradeToAILocalPlanState();
-}
-
-class _UpgradeToAILocalPlanState extends State<_UpgradeToAILocalPlan> {
- @override
- Widget build(BuildContext context) {
- return Row(
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- FlowyText.medium(
- LocaleKeys.sideBar_upgradeToAILocal.tr(),
- maxLines: 10,
- lineHeight: 1.5,
- ),
- const VSpace(4),
- Opacity(
- opacity: 0.6,
- child: FlowyText(
- LocaleKeys.sideBar_upgradeToAILocalDesc.tr(),
- fontSize: 12,
- maxLines: 10,
- lineHeight: 1.5,
- ),
- ),
- ],
- ),
- ),
- BlocBuilder<LocalAIOnBoardingBloc, LocalAIOnBoardingState>(
- builder: (context, state) {
- if (state.isLoading) {
- return const CircularProgressIndicator.adaptive();
- } else {
- return Toggle(
- value: false,
- onChanged: (_) => widget.onTap(),
- );
- }
- },
- ),
- ],
- );
- }
-}
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_billing_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_billing_view.dart
index 450f2167de..77c1116319 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_billing_view.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_billing_view.dart
@@ -1,5 +1,3 @@
-import 'dart:io';
-
import 'package:appflowy/shared/flowy_error_page.dart';
import 'package:appflowy/shared/loading.dart';
import 'package:appflowy/util/int64_extension.dart';
@@ -211,26 +209,6 @@ class _SettingsBillingViewState extends State<SettingsBillingView> {
),
),
const SettingsDashedDivider(),
-
- // Currently, the AI Local tile is only available on macOS
- // TODO(nathan): enable windows and linux
- if (Platform.isMacOS)
- _AITile(
- plan: SubscriptionPlanPB.AiLocal,
- label: LocaleKeys
- .settings_billingPage_addons_aiOnDevice_label
- .tr(),
- description: LocaleKeys
- .settings_billingPage_addons_aiOnDevice_description,
- activeDescription: LocaleKeys
- .settings_billingPage_addons_aiOnDevice_activeDescription,
- canceledDescription: LocaleKeys
- .settings_billingPage_addons_aiOnDevice_canceledDescription,
- subscriptionInfo:
- state.subscriptionInfo.addOns.firstWhereOrNull(
- (a) => a.type == WorkspaceAddOnPBType.AddOnAiLocal,
- ),
- ),
],
),
],
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_plan_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_plan_view.dart
index bf1e479226..2606a42ab1 100644
--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_plan_view.dart
+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_plan_view.dart
@@ -134,46 +134,6 @@ class _SettingsPlanViewState extends State<SettingsPlanView> {
),
),
const HSpace(8),
-
- // Currently, the AI Local tile is only available on macOS
- // TODO(nathan): enable windows and linux
- if (Platform.isMacOS)
- Flexible(
- child: _AddOnBox(
- title: LocaleKeys
- .settings_planPage_planUsage_addons_aiOnDevice_title
- .tr(),
- description: LocaleKeys
- .settings_planPage_planUsage_addons_aiOnDevice_description
- .tr(),
- price: LocaleKeys
- .settings_planPage_planUsage_addons_aiOnDevice_price
- .tr(
- args: [
- SubscriptionPlanPB.AiLocal.priceAnnualBilling,
- ],
- ),
- priceInfo: LocaleKeys
- .settings_planPage_planUsage_addons_aiOnDevice_priceInfo
- .tr(),
- recommend: LocaleKeys
- .settings_planPage_planUsage_addons_aiOnDevice_recommend
- .tr(
- args: [
- SubscriptionPlanPB.AiLocal.priceMonthBilling,
- ],
- ),
- buttonText: state.subscriptionInfo.hasAIOnDevice
- ? LocaleKeys
- .settings_planPage_planUsage_addons_activeLabel
- .tr()
- : LocaleKeys
- .settings_planPage_planUsage_addons_addLabel
- .tr(),
- isActive: state.subscriptionInfo.hasAIOnDevice,
- plan: SubscriptionPlanPB.AiLocal,
- ),
- ),
],
),
],
@@ -438,23 +398,6 @@ class _PlanUsageSummary extends StatelessWidget {
},
),
],
- if (!subscriptionInfo.hasAIOnDevice) ...[
- _ToggleMore(
- value: false,
- label: LocaleKeys.settings_planPage_planUsage_aiOnDeviceToggle
- .tr(),
- badgeLabel:
- LocaleKeys.settings_planPage_planUsage_aiOnDeviceBadge.tr(),
- onTap: () async {
- context.read<SettingsPlanBloc>().add(
- const SettingsPlanEvent.addSubscription(
- SubscriptionPlanPB.AiLocal,
- ),
- );
- await Future.delayed(const Duration(seconds: 2), () {});
- },
- ),
- ],
],
),
],
diff --git a/frontend/appflowy_flutter/macos/Podfile.lock b/frontend/appflowy_flutter/macos/Podfile.lock
index 30ee626f09..b4a1a3d20d 100644
--- a/frontend/appflowy_flutter/macos/Podfile.lock
+++ b/frontend/appflowy_flutter/macos/Podfile.lock
@@ -144,34 +144,34 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
SPEC CHECKSUMS:
- app_links: 9028728e32c83a0831d9db8cf91c526d16cc5468
- appflowy_backend: 464aeb3e5c6966a41641a2111e5ead72ce2695f7
- auto_updater_macos: 3a42f1a06be6981f1a18be37e6e7bf86aa732118
- bitsdojo_window_macos: 7959fb0ca65a3ccda30095c181ecb856fae48ea9
- connectivity_plus: e74b9f74717d2d99d45751750e266e55912baeb5
- desktop_drop: e0b672a7d84c0a6cbc378595e82cdb15f2970a43
- device_info_plus: a56e6e74dbbd2bb92f2da12c64ddd4f67a749041
- file_selector_macos: 6280b52b459ae6c590af5d78fc35c7267a3c4b31
- flowy_infra_ui: 8760ff42a789de40bf5007a5f176b454722a341e
+ app_links: 10e0a0ab602ffaf34d142cd4862f29d34b303b2a
+ appflowy_backend: 865496343de667fc8c600e04b9fd05234e130cf9
+ auto_updater_macos: 3e3462c418fe4e731917eacd8d28eef7af84086d
+ bitsdojo_window_macos: 44e3b8fe3dd463820e0321f6256c5b1c16bb6a00
+ connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747
+ desktop_drop: 69eeff437544aa619c8db7f4481b3a65f7696898
+ device_info_plus: ce1b7762849d3ec103d0e0517299f2db7ad60720
+ file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d
+ flowy_infra_ui: 03301a39ad118771adbf051a664265c61c507f38
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
HotKey: 400beb7caa29054ea8d864c96f5ba7e5b4852277
- hotkey_manager: b443f35f4d772162937aa73fd8995e579f8ac4e2
- irondash_engine_context: 893c7d96d20ce361d7e996f39d360c4c2f9869ba
- local_notifier: ebf072651e35ae5e47280ad52e2707375cb2ae4e
- package_info_plus: f0052d280d17aa382b932f399edf32507174e870
- path_provider_foundation: 080d55be775b7414fd5a5ef3ac137b97b097e564
+ hotkey_manager: c32bf0bfe8f934b7bc17ab4ad5c4c142960b023c
+ irondash_engine_context: da62996ee25616d2f01bbeb85dc115d813359478
+ local_notifier: e9506bc66fc70311e8bc7291fb70f743c081e4ff
+ package_info_plus: 12f1c5c2cfe8727ca46cbd0b26677728972d9a5b
+ path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
ReachabilitySwift: 32793e867593cfc1177f5d16491e3a197d2fccda
- screen_retriever_macos: 452e51764a9e1cdb74b3c541238795849f21557f
+ screen_retriever_macos: 776e0fa5d42c6163d2bf772d22478df4b302b161
Sentry: 1fe34e9c2cbba1e347623610d26db121dcb569f1
- sentry_flutter: e24b397f9a61fa5bbefd8279c3b2242ca86faa90
- share_plus: 510bf0af1a42cd602274b4629920c9649c52f4cc
- shared_preferences_foundation: 9e1978ff2562383bd5676f64ec4e9aa8fa06a6f7
+ sentry_flutter: a39c2a2d67d5e5b9cb0b94a4985c76dd5b3fc737
+ share_plus: 1fa619de8392a4398bfaf176d441853922614e89
+ shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
Sparkle: 5f8960a7a119aa7d45dacc0d5837017170bc5675
- sqflite_darwin: 20b2a3a3b70e43edae938624ce550a3cbf66a3d0
- super_native_extensions: c2795d6d9aedf4a79fae25cb6160b71b50549189
- url_launcher_macos: 0fba8ddabfc33ce0a9afe7c5fef5aab3d8d2d673
- webview_flutter_wkwebview: 44d4dee7d7056d5ad185d25b38404436d56c547c
- window_manager: 1d01fa7ac65a6e6f83b965471b1a7fdd3f06166c
+ sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d
+ super_native_extensions: 85efee3a7495b46b04befcfc86ed12069264ebf3
+ url_launcher_macos: c82c93949963e55b228a30115bd219499a6fe404
+ webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4
+ window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
PODFILE CHECKSUM: 0532f3f001ca3110b8be345d6491fff690e95823
diff --git a/frontend/rust-lib/Cargo.lock b/frontend/rust-lib/Cargo.lock
index efa77e3c86..31caa5ce69 100644
--- a/frontend/rust-lib/Cargo.lock
+++ b/frontend/rust-lib/Cargo.lock
@@ -198,7 +198,7 @@ dependencies = [
[[package]]
name = "appflowy-local-ai"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-LocalAI?rev=a76364694d696767488c8b12e210eefa58453c89#a76364694d696767488c8b12e210eefa58453c89"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-LocalAI?rev=8fea7ed2375eb54c8dfb8af6db6e32a61854fb2e#8fea7ed2375eb54c8dfb8af6db6e32a61854fb2e"
dependencies = [
"anyhow",
"appflowy-plugin",
@@ -218,7 +218,7 @@ dependencies = [
[[package]]
name = "appflowy-plugin"
version = "0.1.0"
-source = "git+https://github.com/AppFlowy-IO/AppFlowy-LocalAI?rev=a76364694d696767488c8b12e210eefa58453c89#a76364694d696767488c8b12e210eefa58453c89"
+source = "git+https://github.com/AppFlowy-IO/AppFlowy-LocalAI?rev=8fea7ed2375eb54c8dfb8af6db6e32a61854fb2e#8fea7ed2375eb54c8dfb8af6db6e32a61854fb2e"
dependencies = [
"anyhow",
"cfg-if",
@@ -232,6 +232,7 @@ dependencies = [
"tokio",
"tokio-stream",
"tracing",
+ "winreg 0.55.0",
"xattr",
]
diff --git a/frontend/rust-lib/Cargo.toml b/frontend/rust-lib/Cargo.toml
index 89ffbc938e..662703340b 100644
--- a/frontend/rust-lib/Cargo.toml
+++ b/frontend/rust-lib/Cargo.toml
@@ -152,5 +152,5 @@ collab-importer = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFl
# To update the commit ID, run:
# scripts/tool/update_local_ai_rev.sh new_rev_id
# ⚠️⚠️⚠️️
-appflowy-local-ai = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-LocalAI", rev = "a76364694d696767488c8b12e210eefa58453c89" }
-appflowy-plugin = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-LocalAI", rev = "a76364694d696767488c8b12e210eefa58453c89" }
+appflowy-local-ai = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-LocalAI", rev = "8fea7ed2375eb54c8dfb8af6db6e32a61854fb2e" }
+appflowy-plugin = { version = "0.1", git = "https://github.com/AppFlowy-IO/AppFlowy-LocalAI", rev = "8fea7ed2375eb54c8dfb8af6db6e32a61854fb2e" }
diff --git a/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs b/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs
index dd296158e4..730888d7c5 100644
--- a/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs
+++ b/frontend/rust-lib/flowy-ai/src/local_ai/controller.rs
@@ -431,9 +431,10 @@ impl LocalAIController {
}
let _ = rx.await;
} else {
- if let Err(err) = self.ai_plugin.destroy_chat_plugin().await {
+ if let Err(err) = self.ai_plugin.destroy_plugin().await {
error!("[AI Plugin] failed to destroy plugin: {:?}", err);
}
+
chat_notification_builder(
APPFLOWY_AI_NOTIFICATION_KEY,
ChatNotification::UpdateLocalAIState,