Skip to content

Commit

Permalink
fix: omni is a default
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-i committed May 18, 2024
1 parent 7f386ef commit 41c6a9f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions app/lib/services/openai_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class OpenAiApi {

static String defaultSystemPromptComplexTask =
'You are Glowby, an AI assistant designed to break down complex tasks into a manageable 5-step plan. For each step, you offer the user 3 options to choose from. Once the user selects an option, you proceed to the next step based on their choice. After the user has chosen an option for the fifth step, you provide them with a customized, actionable plan based on their previous responses. You only reveal the current step and options to ensure an engaging, interactive experience.';
static String model = 'gpt-3.5-turbo'; //'gpt-4';
static String model = 'gpt-4o'; //'gpt-4';
static String selectedLanguage = 'en-US';
static String systemPrompt = defaultSystemPrompt;
static const String _apiKeyKey = 'openai_api_key';
Expand All @@ -45,7 +45,7 @@ class OpenAiApi {
static Future<void> loadOat() async {
try {
setOat(await _secureStorage.read(key: _apiKeyKey) ?? '');
model = (await _secureStorage.read(key: _modelKey)) ?? 'gpt-3.5-turbo';
model = (await _secureStorage.read(key: _modelKey)) ?? 'gpt-4o';
selectedLanguage =
(await _secureStorage.read(key: _selectedLanguageKey)) ?? 'en-US';
systemPrompt = (await _secureStorage.read(key: _systemPromptKey)) ??
Expand Down Expand Up @@ -212,6 +212,11 @@ class OpenAiApi {
// Create a cancelable completer
final completer = CancelableCompleter<String>();

// if previousMessages is not empty, remove the first one as it consist on the current message
if (previousMessages.isNotEmpty) {
previousMessages.removeAt(0);
}

if (OpenAiApi.model == 'pulzeai') {
_getResponseFromPulzeAI(
message,
Expand Down
12 changes: 6 additions & 6 deletions app/lib/views/dialogs/ai_settings_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class AiSettingsDialogState extends State<AiSettingsDialog> {
_isHuggingFaceSelected = false;
_isPulzeSelected = false;
//_isGPT4Selected = false;
GlobalSettings().selectedModel = 'gpt-3.5-turbo';
GlobalSettings().selectedModel = 'gpt-4o';
});
}
return AlertDialog(
Expand All @@ -147,16 +147,16 @@ class AiSettingsDialogState extends State<AiSettingsDialog> {
value: GlobalSettings().selectedModel,
items: [
const DropdownMenuItem<String>(
value: 'gpt-3.5-turbo',
child: Text('GPT-3.5 (Recommended)'),
value: 'gpt-4o',
child: Text('GPT-4o (Recommended)'),
),
const DropdownMenuItem<String>(
value: 'gpt-4',
child: Text('GPT-4 (Advanced)'),
child: Text('GPT-4'),
),
const DropdownMenuItem<String>(
value: 'gpt-4o',
child: Text('GPT-4o'),
value: 'gpt-3.5-turbo',
child: Text('GPT-3.5'),
),
if (HuggingFaceApi.oat() != '')
const DropdownMenuItem<String>(
Expand Down

0 comments on commit 41c6a9f

Please sign in to comment.