chore: enable local chat

This commit is contained in:
Nathan 2025-04-17 16:27:53 +08:00
parent c2339c3522
commit 57e4d269eb
5 changed files with 28 additions and 40 deletions

View File

@ -51,14 +51,14 @@ class AIChatPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (userProfile.authenticator != AuthenticatorPB.AppFlowyCloud) {
return Center(
child: FlowyText(
LocaleKeys.chat_unsupportedCloudPrompt.tr(),
fontSize: 20,
),
);
}
// if (userProfile.authenticator != AuthenticatorPB.AppFlowyCloud) {
// return Center(
// child: FlowyText(
// LocaleKeys.chat_unsupportedCloudPrompt.tr(),
// fontSize: 20,
// ),
// );
// }
return MultiBlocProvider(
providers: [

View File

@ -10,23 +10,6 @@ import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class AIFeatureOnlySupportedWhenUsingAppFlowyCloud extends StatelessWidget {
const AIFeatureOnlySupportedWhenUsingAppFlowyCloud({super.key});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 60, vertical: 30),
child: FlowyText(
LocaleKeys.settings_aiPage_keys_loginToEnableAIFeature.tr(),
maxLines: null,
fontSize: 16,
lineHeight: 1.6,
),
);
}
}
class SettingsAIView extends StatelessWidget {
const SettingsAIView({
super.key,

View File

@ -32,6 +32,7 @@ import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'pages/setting_ai_view/local_settings_ai_view.dart';
import 'widgets/setting_cloud.dart';
@visibleForTesting
@ -147,7 +148,11 @@ class SettingsDialog extends StatelessWidget {
workspaceId: workspaceId,
);
} else {
return const AIFeatureOnlySupportedWhenUsingAppFlowyCloud();
return LocalSettingsAIView(
key: ValueKey(workspaceId),
userProfile: user,
workspaceId: workspaceId,
);
}
case SettingsPage.member:
return WorkspaceMembersPage(

View File

@ -493,7 +493,7 @@ checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f"
[[package]]
name = "app-error"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"bincode",
@ -513,7 +513,7 @@ dependencies = [
[[package]]
name = "appflowy-ai-client"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"bytes",
@ -1159,7 +1159,7 @@ dependencies = [
[[package]]
name = "client-api"
version = "0.2.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"again",
"anyhow",
@ -1214,7 +1214,7 @@ dependencies = [
[[package]]
name = "client-api-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"collab-entity",
"collab-rt-entity",
@ -1227,7 +1227,7 @@ dependencies = [
[[package]]
name = "client-websocket"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"futures-channel",
"futures-util",
@ -1499,7 +1499,7 @@ dependencies = [
[[package]]
name = "collab-rt-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"bincode",
@ -1521,7 +1521,7 @@ dependencies = [
[[package]]
name = "collab-rt-protocol"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"async-trait",
@ -1969,7 +1969,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308"
[[package]]
name = "database-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"bincode",
"bytes",
@ -3427,7 +3427,7 @@ dependencies = [
[[package]]
name = "gotrue"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"getrandom 0.2.10",
@ -3442,7 +3442,7 @@ dependencies = [
[[package]]
name = "gotrue-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"app-error",
"jsonwebtoken",
@ -4066,7 +4066,7 @@ dependencies = [
[[package]]
name = "infra"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"bytes",
@ -6644,7 +6644,7 @@ dependencies = [
[[package]]
name = "shared-entity"
version = "0.1.0"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=3e98e6811f8e5cf1a5ab5a92dc9b35006e254579#3e98e6811f8e5cf1a5ab5a92dc9b35006e254579"
source = "git+https://github.com/AppFlowy-IO/AppFlowy-Cloud?rev=72a71205ebb3ec227b44ed48473abe4f1c7663e8#72a71205ebb3ec227b44ed48473abe4f1c7663e8"
dependencies = [
"anyhow",
"app-error",

View File

@ -107,8 +107,8 @@ af-local-ai = { version = "0.1" }
# Run the script.add_workspace_members:
# scripts/tool/update_client_api_rev.sh new_rev_id
# ⚠️⚠️⚠️️
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "3e98e6811f8e5cf1a5ab5a92dc9b35006e254579" }
client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "3e98e6811f8e5cf1a5ab5a92dc9b35006e254579" }
client-api = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "72a71205ebb3ec227b44ed48473abe4f1c7663e8" }
client-api-entity = { git = "https://github.com/AppFlowy-IO/AppFlowy-Cloud", rev = "72a71205ebb3ec227b44ed48473abe4f1c7663e8" }
[profile.dev]
opt-level = 0