- Add Journal.AI project with LLamaSharp-based AI service (Phi-3 model) - Implement coach sessions (daily check-in, evening review, weekly review) - Add conversation CRUD with SQLCipher persistence - AI chat with full conversation history for context-aware replies - Frontend: CoachPanel, AI stores, conversation stores, side panel UI - Conversation list with create, rename, and delete support - Fix Phi-3 output quality (system prompt leaking, token cleanup, JSON filtering) - Fix CREATEDRAFT kind override in coach sessions Co-Authored-By: Oz <oz-agent@warp.dev>
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
namespace Journal.Core.Models;
|
|
|
|
public class ConversationMessage
|
|
{
|
|
public Guid Id { get; }
|
|
public Guid ConversationId { get; }
|
|
public string Role { get; set; }
|
|
public string Text { get; set; }
|
|
public DateTimeOffset CreatedAt { get; set; }
|
|
|
|
public ConversationMessage(Guid conversationId, string role, string text)
|
|
{
|
|
if (conversationId == Guid.Empty)
|
|
throw new ArgumentException("ConversationId is required", nameof(conversationId));
|
|
if (string.IsNullOrWhiteSpace(role))
|
|
throw new ArgumentException("Role is required", nameof(role));
|
|
if (string.IsNullOrWhiteSpace(text))
|
|
throw new ArgumentException("Text is required", nameof(text));
|
|
|
|
Id = Guid.NewGuid();
|
|
ConversationId = conversationId;
|
|
Role = role.Trim();
|
|
Text = text;
|
|
CreatedAt = DateTimeOffset.Now;
|
|
}
|
|
|
|
public ConversationMessage(Guid id, Guid conversationId, string role, string text, DateTimeOffset createdAt)
|
|
{
|
|
if (id == Guid.Empty)
|
|
throw new ArgumentException("Id is required", nameof(id));
|
|
|
|
Id = id;
|
|
ConversationId = conversationId;
|
|
Role = role;
|
|
Text = text;
|
|
CreatedAt = createdAt;
|
|
}
|
|
}
|