Convert AI providers into array instead of object, allow dragging to change their order

This commit is contained in:
Alex Gleason committed 2025-09-21 13:11:04 -05:00
1 parent 5cf19c61cc
commit 7b5c9a5581
27 files changed
+556 -283

No files matched your search

+6 -5
View File
@@ -1,22 +1,23 @@
import { createContext } from 'react';
export interface AIConnection {
export interface AIProvider {
id: string;
baseURL: string;
apiKey?: string;
nostr?: boolean;
}
export interface AISettings {
providers: Record<string, AIConnection>;
providers: AIProvider[];
recentlyUsedModels: string[];
}
export interface AISettingsContextType {
settings: AISettings;
updateSettings: (settings: Partial<AISettings>) => void;
addProvider: (name: string, connection: AIConnection) => void;
removeProvider: (name: string) => void;
updateProvider: (name: string, connection: Partial<AIConnection>) => void;
setProvider: (provider: AIProvider) => void;
removeProvider: (id: string) => void;
setProviders: (providers: AIProvider[]) => void;
addRecentlyUsedModel: (modelId: string) => void;
isConfigured: boolean;
}