journal/Journal.Core/Services/Ai/DisabledAiService.cs
Jacob Schmidt 192e6e3891 feat: add AI coaching, conversation persistence, and LLamaSharp integration
- 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>
2026-03-01 16:07:59 -06:00

29 lines
1.5 KiB
C#

using Journal.Core.Dtos;
namespace Journal.Core.Services.Ai;
public sealed class DisabledAiService(string provider, string message = "AI provider disabled.", bool healthy = true) : IAiService
{
private readonly string _provider = string.IsNullOrWhiteSpace(provider) ? "none" : provider.Trim();
private readonly string _message = string.IsNullOrWhiteSpace(message) ? "AI provider disabled." : message.Trim();
private readonly bool _healthy = healthy;
public Task<AiHealthDto> HealthAsync(CancellationToken cancellationToken = default) =>
Task.FromResult(new AiHealthDto(_provider, Enabled: false, Healthy: _healthy, Message: _message));
public Task<string> SummarizeEntryAsync(string content, string? fileStem = null, CancellationToken cancellationToken = default) =>
Task.FromResult(_message);
public Task<string> SummarizeAllAsync(IReadOnlyList<string> entries, CancellationToken cancellationToken = default) =>
Task.FromResult(_message);
public Task<string> ChatAsync(string prompt, CancellationToken cancellationToken = default) =>
Task.FromResult(_message);
public Task<string> ChatWithHistoryAsync(IReadOnlyList<(string Role, string Text)> history, string prompt, CancellationToken cancellationToken = default) =>
Task.FromResult(_message);
public Task<IReadOnlyList<double>> EmbedAsync(string content, CancellationToken cancellationToken = default) =>
Task.FromResult<IReadOnlyList<double>>([]);
}