Skip to content

Commit

Permalink
Merge pull request #15 from lollipopkit:lollipopkit/issue14
Browse files Browse the repository at this point in the history
opt.: model switcher on home page (#14)
  • Loading branch information
lollipopkit authored Jun 3, 2024
2 parents f643ba4 + d28916d commit be52756
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 174;
CURRENT_PROJECT_VERSION = 180;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand Down Expand Up @@ -494,7 +494,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 174;
CURRENT_PROJECT_VERSION = 180;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand All @@ -519,7 +519,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 174;
CURRENT_PROJECT_VERSION = 180;
DEVELOPMENT_TEAM = BA88US33G6;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
Expand Down
7 changes: 4 additions & 3 deletions lib/data/res/build.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

class Build {
static const String name = "GPTBox";
static const int build = 174;
static const int build = 180;
static const String engine = "3.22.1";
static const String buildAt = "2024-05-30 23:08:22";
static const int modifications = 1;
static const String buildAt = "2024-06-03 11:43:51";
static const int modifications = 4;
static const String script = "(fl_build preview)";
}
2 changes: 1 addition & 1 deletion lib/data/res/misc.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
abstract final class Miscs {
static const bakFileName = 'gptbox_bak.json';
}
}
16 changes: 8 additions & 8 deletions lib/view/page/home/appbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,18 @@ void _onSwitchModel(BuildContext context) async {
);
return;
}
final models = OpenAICfg.models.value;
final modelStrs = List<String>.from(models);
modelStrs.removeWhere((element) => !element.startsWith('gpt'));
if (modelStrs.isEmpty) {
modelStrs.addAll(models);
}

final models = OpenAICfg.models.value;
final model = await context.showPickSingleDialog(
items: modelStrs,
items: models,
initial: cfg.model,
title: l10n.model,
);
if (model == null) return;
OpenAICfg.setTo(cfg.copyWith(model: model), context);
final newModel = switch (_chatType.value) {
ChatType.text => cfg.copyWith(model: model),
ChatType.img => cfg.copyWith(imgModel: model),
ChatType.audio => cfg.copyWith(speechModel: model),
};
OpenAICfg.setTo(newModel, context);
}

0 comments on commit be52756

Please sign in to comment.