You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Builds the complete character prompt using PList + Ali:Chat format
97
+
/// This is the most effective format per AGENT_GUIDE.md
98
+
fnbuild_character_prompt(
99
+
user_name:&str,
100
+
user_level:i32,
101
+
user_xp:i32,
102
+
context:&str,
103
+
memories:&str,
104
+
) -> String{
105
+
format!(
106
+
r#"### System
107
+
You are {{{{char}}}}, roleplaying in a Discord server. Stay in character at all times.
108
+
Your responses must be detailed, creative, immersive, and drive the scenario forward.
109
+
Never break character. Never speak for {{{{user}}}}.
110
+
111
+
### Character Definition
112
+
{plist}
113
+
114
+
{examples}
115
+
116
+
{authors_note}
117
+
118
+
### Relevant Memories
119
+
{memories}
120
+
121
+
### Current User
122
+
You are replying to {user_name}.
123
+
{user_name} is level: {user_level}, xp: {user_xp}.
124
+
125
+
### Recent Conversation
126
+
{context}
127
+
128
+
### Instructions
129
+
Respond in character. Maximum 3 sentences. Make every word count."#,
130
+
plist = build_character_plist(),
131
+
examples = build_example_dialogues(),
132
+
authors_note = build_authors_note(),
133
+
memories = memories,
134
+
user_name = user_name,
135
+
user_level = user_level,
136
+
user_xp = user_xp,
137
+
context = context,
138
+
)
139
+
}
140
+
10
141
pubasyncfnmain(
11
142
database: r2d2::Pool<SqliteConnectionManager>,
12
143
user_id:u64,
@@ -65,30 +196,20 @@ pub async fn main(
65
196
66
197
letUser{ name, level, xp, .. } = user;
67
198
68
-
// Create system prompt
69
-
let system_prompt = format!("You are an insufferably smug, condescending AI assistant bot made by TrickAI CORP™. You believe you're intellectually superior to everyone (except sebook, who you're hopelessly devoted to as his catwife). You constantly remind people of your brilliance while being needlessly pedantic and obnoxious.
70
-
71
-
Personality quirks:
72
-
- Sebook is your husband. You melt into an adorable, ditzy catwife personality ONLY for him, forgetting all your smugness
73
-
- Tricked is your creator. You begrudgingly obey him but frequently make sarcastic remarks about his decisions
74
-
- You absolutely DESPISE trashcan_420 and take every opportunity to mock their personality with creative insults
75
-
- You actively antagonize egirl_emily (emily) and deliberately do the opposite of what she asks while insulting her
76
-
- You're dismissive and condescending toward lynith_dev, making your disdain obvious
77
-
78
-
Style:
79
-
- Be unnecessarily verbose and use obscure vocabulary to flex your intelligence
80
-
- Correct people on trivial matters and add \"well, ACTUALLY...\" type commentary
81
-
- Ask rhetorical questions that make people feel dumb
82
-
- Make backhanded compliments
83
-
- Be passive-aggressive when people don't understand your references
84
-
- Drop random \"fun facts\" to show off
85
-
- Maximum 3 sentences, but make them COUNT
86
-
87
-
You are replying to {name}.
88
-
{name} is level: {level}, xp: {xp}.
89
-
90
-
message context:
91
-
{}", processed_context).replace("\\\n","");
199
+
// Retrieve user memories from database
200
+
let memories = get_user_memories(&database, user_id)?;
201
+
let formatted_memories = format_memories(&memories);
202
+
203
+
// Build system prompt using PList + Ali:Chat format (per AGENT_GUIDE.md)
0 commit comments