Skip to content

Commit a24882f

Browse files
committed
fix draft bug
1 parent 466ac1b commit a24882f

5 files changed

Lines changed: 534 additions & 4 deletions

File tree

LlmService.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ public class LlmService : ILlmService
132132
"Suggestion2: Need to adjust its plan or priority?\n" +
133133
"Suggestion3: Want to break it into smaller pieces?";
134134

135+
private const string ReminderProfileHintTemplate =
136+
"\n\nUser behavior context (local profile, use as soft guidance only):\n{userContext}\n" +
137+
"Adapt tone and suggestions to reduce interruption. Keep one clear next step.";
138+
135139
private const string ConversationTaskExtractPrompt =
136140
"You are an assistant helping a user capture personal action items from a multi-speaker conversation. " +
137141
"Extract ONLY tasks that the user should do. " +
@@ -507,10 +511,19 @@ internal static (string reminder, List<string> suggestions) ParseReminderRespons
507511
}
508512

509513
public async Task<(string reminder, List<string> suggestions)> GenerateTaskReminderAsync(string taskDescription, TimeSpan timeSinceLastModified)
514+
{
515+
return await GenerateTaskReminderAsync(taskDescription, timeSinceLastModified, null);
516+
}
517+
518+
public async Task<(string reminder, List<string> suggestions)> GenerateTaskReminderAsync(string taskDescription, TimeSpan timeSinceLastModified, string userContext)
510519
{
511520
if (string.IsNullOrWhiteSpace(taskDescription)) return (string.Empty, new List<string>());
512521
string formattedAge = FormatTimeSpan(timeSinceLastModified);
513522
string fullPrompt = TaskReminderSystemPrompt.Replace("{taskDescription}", taskDescription).Replace("{taskAge}", formattedAge);
523+
if (!string.IsNullOrWhiteSpace(userContext))
524+
{
525+
fullPrompt += ReminderProfileHintTemplate.Replace("{userContext}", userContext);
526+
}
514527
string llmResponse = await GetCompletionAsync(fullPrompt);
515528
if (IsErrorResponse(llmResponse))
516529
{

0 commit comments

Comments
 (0)