Files
gitcommiteditor/Services/IApiKeyProvider.cs
2025-12-28 05:38:14 -05:00

37 lines
1.1 KiB
C#

using MarketAlly.AIPlugin;
using MarketAlly.AIPlugin.Conversation;
namespace MarketAlly.GitCommitEditor.Services;
/// <summary>
/// Provides access to API keys for AI providers.
/// Implement this interface in platform-specific code (e.g., using SecureStorage in MAUI).
/// </summary>
public interface IApiKeyProvider
{
/// <summary>
/// Gets the API key for the specified provider, or null if not configured.
/// </summary>
string? GetApiKey(AIProvider provider);
/// <summary>
/// Checks if an API key is configured for the specified provider.
/// </summary>
bool HasApiKey(AIProvider provider);
/// <summary>
/// Sets the API key for the specified provider.
/// </summary>
Task SetApiKeyAsync(AIProvider provider, string apiKey);
/// <summary>
/// Removes the API key for the specified provider.
/// </summary>
Task RemoveApiKeyAsync(AIProvider provider);
/// <summary>
/// Gets all providers that have API keys configured.
/// </summary>
IReadOnlyList<AIProvider> GetConfiguredProviders();
}