Skip to content

Commit

Permalink
Merge pull request #468 from danemadsen/main
Browse files Browse the repository at this point in the history
sys
  • Loading branch information
danemadsen authored Apr 5, 2024
2 parents 48f2206 + 0c9a5ef commit f86cabf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/providers/session.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class Session extends ChangeNotifier {
final scenario = Utilities.formatPlaceholders(character.scenario, user.name, character.name);
final system = Utilities.formatPlaceholders(character.system, user.name, character.name);

final preprompt = '$description\n\n$personality\n\n$scenario\n\n$system';
final preprompt = 'Description: $description\nPersonality: $personality\nScenario: $scenario\nSystem: $system';

List<Map<String, dynamic>> messages = [
{
Expand All @@ -158,13 +158,11 @@ class Session extends ChangeNotifier {
switch (message['role']) {
case "user":
chatMessages.add(ChatMessage.humanText(message['content']));
chatMessages.add(ChatMessage.system(Utilities.formatPlaceholders(
character.system, user.name, character.name)));
break;
case "assistant":
chatMessages.add(ChatMessage.ai(message['content']));
break;
case "system": // Under normal circumstances, this should never be called
case "system": // Under normal circumstances, this should only be used for preprompt
chatMessages.add(ChatMessage.system(message['content']));
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion packages/maid_llm
Submodule maid_llm updated 1 files
+2 −8 src/maid_llm.cpp

0 comments on commit f86cabf

Please sign in to comment.