mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Convert AI providers into array instead of object, allow dragging to change their order
This commit is contained in:
27 files changed
+556
-283
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user