| | |
| | | public required string Id { get; init; } |
| | | public required string Label { get; init; } |
| | | public required string Provider { get; init; } |
| | | public required string Endpoint { get; init; } |
| | | public string? BaseUrl { get; init; } |
| | | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] |
| | | public string? Endpoint { get; init; } |
| | | public string? AuthRef { get; init; } |
| | | public required string ApiModel { get; init; } |
| | | public bool SupportsStreaming { get; init; } = true; |
| | | public bool Enabled { get; init; } |
| | | public LlmRequestDefaults RequestDefaults { get; init; } = new(); |
| | | |
| | | public string? GetBaseUrl() => LlmOpenAiUrls.ResolveBaseUrl(BaseUrl, Endpoint); |
| | | |
| | | public string? GetChatCompletionsUrl() => LlmOpenAiUrls.ToChatCompletionsUrl(BaseUrl, Endpoint); |
| | | } |
| | | |
| | | public sealed record LlmRequestDefaults |
| | |
| | | public string Mode { get; init; } = LlmConnectionModes.ProviderDirect; |
| | | public AiChatRuntimeConfig AiChat { get; init; } = new(); |
| | | public string? DefaultModel { get; init; } |
| | | public List<LlmProviderConfig> Providers { get; init; } = []; |
| | | public List<LlmModelConfig> Models { get; init; } = []; |
| | | |
| | | [JsonIgnore] |
| | | public bool IsAiChatMode => string.Equals(Mode, LlmConnectionModes.AiChatApi, StringComparison.OrdinalIgnoreCase); |
| | | |
| | | [JsonIgnore] |
| | | public bool HasAiChatAccount => !string.IsNullOrWhiteSpace(AiChat?.Account?.Email); |
| | | } |
| | | |
| | | public sealed record LlmProviderConfig |
| | | { |
| | | public string Id { get; init; } = ""; |
| | | public string Label { get; init; } = ""; |
| | | public string BaseUrl { get; init; } = ""; |
| | | public string? AuthRef { get; init; } |
| | | public bool Enabled { get; init; } = true; |
| | | public string Protocol { get; init; } = "openai-compatible"; |
| | | } |
| | | |
| | | public sealed record AiChatRuntimeConfig |
| | |
| | | public string MemoryMode { get; init; } = "ISOLATED"; |
| | | } |
| | | |
| | | public sealed record AiChatProjectsResult |
| | | { |
| | | public required string Status { get; init; } |
| | | public string? Message { get; init; } |
| | | public IReadOnlyList<AiChatProjectSummary> Projects { get; init; } = []; |
| | | } |
| | | |
| | | public sealed record AiChatMemoryCapabilities |
| | | { |
| | | public bool CanUseMemory { get; init; } |