mirror of
https://github.com/JorySeverijnse/ui-fixer-supreme.git
synced 2025-12-06 21:36:57 +00:00
Compare commits
4 Commits
5ed5b2d49b
...
16fdfa48b7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16fdfa48b7 | ||
|
|
7ae11f7c58 | ||
|
|
fa78070bac | ||
|
|
2fb1cd7061 |
@ -11,12 +11,6 @@ export interface AIProviderConfig {
|
|||||||
allowsCustomKey?: boolean;
|
allowsCustomKey?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getGptOssApiKey = (): string | undefined => {
|
|
||||||
return import.meta.env?.VITE_GPT_OSS_API_KEY ||
|
|
||||||
process.env.VITE_GPT_OSS_API_KEY ||
|
|
||||||
process.env.NEXT_PUBLIC_GPT_OSS_API_KEY;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const AI_PROVIDERS: AIProviderConfig[] = [
|
export const AI_PROVIDERS: AIProviderConfig[] = [
|
||||||
{
|
{
|
||||||
id: 'pollinations',
|
id: 'pollinations',
|
||||||
@ -29,12 +23,10 @@ export const AI_PROVIDERS: AIProviderConfig[] = [
|
|||||||
{
|
{
|
||||||
id: 'gpt-oss',
|
id: 'gpt-oss',
|
||||||
name: 'GPT-OSS-20B',
|
name: 'GPT-OSS-20B',
|
||||||
description: 'Alternative model (requires API key)',
|
description: 'Alternative model (IP-locked)',
|
||||||
endpoint: 'https://api.pawan.krd/gpt-oss-20b/v1/chat/completions',
|
endpoint: 'https://api.pawan.krd/gpt-oss-20b/v1/chat/completions',
|
||||||
requiresAuth: true,
|
requiresAuth: true,
|
||||||
get apiKey() {
|
apiKey: 'pk-AvSqFEAjTobfSGEGTnqKVuSwcfcDDMeEZSkeFqnlrGFJNVAC',
|
||||||
return getGptOssApiKey();
|
|
||||||
},
|
|
||||||
model: 'gpt-oss-20b',
|
model: 'gpt-oss-20b',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -49,26 +41,7 @@ export const AI_PROVIDERS: AIProviderConfig[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const getProvider = (id: AIProvider): AIProviderConfig => {
|
export const getProvider = (id: AIProvider): AIProviderConfig => {
|
||||||
const provider = AI_PROVIDERS.find(p => p.id === id) || AI_PROVIDERS[0];
|
return AI_PROVIDERS.find(p => p.id === id) || AI_PROVIDERS[0];
|
||||||
|
|
||||||
if (id === 'custom') {
|
|
||||||
const stored = localStorage.getItem(CUSTOM_API_STORAGE_KEY);
|
|
||||||
if (stored) {
|
|
||||||
try {
|
|
||||||
const customConfig = JSON.parse(stored);
|
|
||||||
return {
|
|
||||||
...provider,
|
|
||||||
endpoint: customConfig.endpoint || '',
|
|
||||||
apiKey: customConfig.apiKey || undefined,
|
|
||||||
model: customConfig.model || '',
|
|
||||||
};
|
|
||||||
} catch {
|
|
||||||
return provider;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return provider;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CUSTOM_API_STORAGE_KEY = 'ai-chat-custom-api';
|
export const CUSTOM_API_STORAGE_KEY = 'ai-chat-custom-api';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user