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.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: local ai toggle (#5968)
Nathan.fooo7eb8ea347d5a
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.dartindex 48319e1b4a..0c3965c731 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@@ -6,6 +6,7 @@ import 'package:appflowy/workspace/presentation/settings/pages/setting_ai_view/mimport 'package:appflowy/workspace/presentation/settings/widgets/setting_appflowy_cloud.dart';import 'package:flowy_infra/theme_extension.dart';import 'package:flowy_infra_ui/widget/spacing.dart';+import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';import 'package:appflowy/generated/locale_keys.g.dart';@@ -147,7 +148,7 @@ class _LocalAIOnBoarding extends StatelessWidget {child: BlocBuilder<LocalAIOnBoardingBloc, LocalAIOnBoardingState>(builder: (context, state) {// Show the local AI settings if the user has purchased the AI Local plan- if (state.isPurchaseAILocal) {+ if (kDebugMode || state.isPurchaseAILocal) {return const LocalAISetting();} else {if (member.role.isOwner) {diff --git a/frontend/rust-lib/flowy-ai/src/local_ai/local_llm_chat.rs b/frontend/rust-lib/flowy-ai/src/local_ai/local_llm_chat.rsindex 2ab15b94dc..af1d67b913 100644--- a/frontend/rust-lib/flowy-ai/src/local_ai/local_llm_chat.rs+++ b/frontend/rust-lib/flowy-ai/src/local_ai/local_llm_chat.rs@@ -326,9 +326,12 @@ impl LocalAIController {.store_preferences.get_bool(APPFLOWY_LOCAL_AI_CHAT_ENABLED).unwrap_or(true);- self.enable_chat_plugin(chat_enabled).await?;++ if self.local_ai_resource.is_resource_ready() {+ self.enable_chat_plugin(chat_enabled).await?;+ }} else {- self.enable_chat_plugin(false).await?;+ let _ = self.enable_chat_plugin(false).await;}Ok(enabled)}@@ -361,6 +364,10 @@ impl LocalAIController {metadata_list: &[ChatMessageMetadata],index_process_sink: &mut (impl Sink<String> + Unpin),) -> FlowyResult<()> {+ if !self.is_enabled() {+ return Ok(());+ }+for metadata in metadata_list {if let Err(err) = metadata.data.validate() {error!(