csharpdeeb25a2 | 1 | using OutWit.Common.Abstract; |
| 2 | using OutWit.Common.Values; |
| 3 | |
| 4 | namespace CascadeIDE.Models; |
| 5 | |
| 6 | /// <summary>API-ключи для облачных провайдеров (файл <c>ai-keys.toml</c>, не в <c>settings.toml</c>).</summary> |
| 7 | public sealed class AiKeys : ModelBase |
| 8 | { |
| 9 | public string? AnthropicApiKey { get; set; } |
| 10 | public string? OpenAiApiKey { get; set; } |
| 11 | public string? DeepSeekApiKey { get; set; } |
| 12 | |
| 13 | public override bool Is(ModelBase modelBase, double tolerance = DEFAULT_TOLERANCE) |
| 14 | { |
| 15 | if (modelBase is not AiKeys o) |
| 16 | return false; |
| 17 | return AnthropicApiKey.Is(o.AnthropicApiKey) |
| 18 | && OpenAiApiKey.Is(o.OpenAiApiKey) |
| 19 | && DeepSeekApiKey.Is(o.DeepSeekApiKey); |
| 20 | } |
| 21 | |
| 22 | public override ModelBase Clone() |
| 23 | { |
| 24 | return new AiKeys |
| 25 | { |
| 26 | AnthropicApiKey = AnthropicApiKey, |
| 27 | OpenAiApiKey = OpenAiApiKey, |
| 28 | DeepSeekApiKey = DeepSeekApiKey |
| 29 | }; |
| 30 | } |
| 31 | } |
| 32 | |
View only · write via MCP/CIDE