- Move standalone fragment storage from unencrypted SQLite to the existing encrypted SQLCipher database (journal_cache.db) - Add IDatabaseSessionService/DatabaseSessionService for shared encrypted connection management after authentication - Update fragments table schema: nullable entry_id, add guid column - Reorganize flat Services/ directory (28 files) into 9 domain modules: Ai, Config, Database, Entries, Fragments, Logging, Sidecar, Speech, Vault - Update all namespace declarations and using statements across all projects - Update REFACTORING_SUMMARY.md with all changes Co-Authored-By: Warp <agent@warp.dev>
26 lines
1.3 KiB
C#
26 lines
1.3 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<IReadOnlyList<double>> EmbedAsync(string content, CancellationToken cancellationToken = default) =>
|
|
Task.FromResult<IReadOnlyList<double>>([]);
|
|
}
|