Skip to content

Commit

Permalink
default user
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Aug 24, 2024
1 parent 46918aa commit 2cf6e8f
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 10 deletions.
Binary file added assets/defaultAssistant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/defaultUser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions assets/default_assistant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"spec": "mcf_v1",
"name":"Assistant",
"description": "The {{char}} is a chatbot that acts as a personal assistant to the user.",
"personality": "",
"scenario": "A chat between a curious user and an artificial intelligence {{char}}.",
"greetings": [
"Hello, I am the {{char}}. How can I help you today?",
"Hello, what would you like to talk about today?"
],
"examples":[
{
"role": "user",
"content": "Hello how are you today"
},
{
"role": "assistant",
"content": "Hello, I am doing wonderful today. How are you?"
}
],
"system_prompt": ""
}
File renamed without changes
12 changes: 6 additions & 6 deletions lib/classes/providers/character.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Character extends ChangeNotifier {
File? _profile;

bool _useSystem = true;
String _name = "Maid";
String _name = "Assistant";
String _description = "";
String _personality = "";
String _scenario = "";
Expand Down Expand Up @@ -89,8 +89,8 @@ class Character extends ChangeNotifier {
if (inputJson["profile"] != null) {
_profile = File(inputJson["profile"]);
}
else if (_profile == null || _profile!.path.contains("defaultCharacter")) {
_profile = await Utilities.fileFromAssetImage("defaultCharacter.png");
else if (_profile == null || _profile!.path.contains("defaultAssistant")) {
_profile = await Utilities.fileFromAssetImage("defaultAssistant.png");
}

if (inputJson["spec"] == "mcf_v1") {
Expand Down Expand Up @@ -304,7 +304,7 @@ class Character extends ChangeNotifier {
}

Future<File> get profile async {
return _profile ??= await Utilities.fileFromAssetImage("defaultCharacter.png");
return _profile ??= await Utilities.fileFromAssetImage("defaultAssistant.png");
}

Key get key => _key;
Expand Down Expand Up @@ -358,9 +358,9 @@ class Character extends ChangeNotifier {
List<Map<String, dynamic>> get examples => _examples;

Future<void> reset() async {
_profile = await Utilities.fileFromAssetImage("defaultCharacter.png");
_profile = await Utilities.fileFromAssetImage("defaultAssistant.png");

final jsonString = await rootBundle.loadString('assets/default_character.json');
final jsonString = await rootBundle.loadString('assets/default_assistant.json');

Map<String, dynamic> jsonCharacter = json.decode(jsonString);

Expand Down
6 changes: 3 additions & 3 deletions lib/classes/providers/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class User extends ChangeNotifier {
}

Future<File> get profile async {
return _profile ?? await Utilities.fileFromAssetImage("chadUser.png");
return _profile ?? await Utilities.fileFromAssetImage("defaultUser.png");
}

File? get profileFile => _profile;
Expand Down Expand Up @@ -87,7 +87,7 @@ class User extends ChangeNotifier {
if (inputMap["profile"] != null) {
_profile = File(inputMap["profile"]);
} else {
_profile = await Utilities.fileFromAssetImage("chadUser.png");
_profile = await Utilities.fileFromAssetImage("defaultUser.png");
}

_name = inputMap["name"];
Expand All @@ -104,7 +104,7 @@ class User extends ChangeNotifier {

void reset() async {
_customImage = await Utilities.fileFromAssetImage("blankCustomUser.png");
_profile = await Utilities.fileFromAssetImage("chadUser.png");
_profile = await Utilities.fileFromAssetImage("defaultUser.png");
_name = "User";
notifyListeners();
}
Expand Down
5 changes: 5 additions & 0 deletions lib/ui/desktop/settings_panels/user_panel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ class UserPanel extends StatelessWidget {
childAspectRatio: 1
),
children: [
GridTile(
child: ImageSelectorTile(
image: Utilities.fileFromAssetImage("defaultUser.png"),
),
),
GridTile(
child: ImageSelectorTile(
image: Utilities.fileFromAssetImage("chadUser.png"),
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/mobile/dialogs/user_image_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ class UserImageDialog extends StatelessWidget {
),
shrinkWrap: true,
children: [
ImageSelectorTile(
image: Utilities.fileFromAssetImage("defaultUser.png"),
),
ImageSelectorTile(
image: Utilities.fileFromAssetImage("chadUser.png"),
),
Expand Down
5 changes: 4 additions & 1 deletion media/defaultAssistant.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2cf6e8f

Please sign in to comment.