- Added environment variables for Vertex AI and Azure OpenAI configurations in docker-compose and user configuration models. - Updated the application logic to handle Vertex and Azure as new LLM providers, including validation and API key management. - Enhanced the UI components to support model selection and API key input for Vertex and Azure. - Updated relevant utility functions and constants to accommodate the new providers. - Ensured proper error handling for configuration requirements specific to Vertex and Azure.
201 lines
No EOL
5.9 KiB
TypeScript
201 lines
No EOL
5.9 KiB
TypeScript
export interface ModelOption {
|
|
value: string;
|
|
label: string;
|
|
description?: string;
|
|
icon?: string;
|
|
size: string;
|
|
}
|
|
|
|
export interface ImageProviderOption {
|
|
value: string;
|
|
label: string;
|
|
description?: string;
|
|
icon?: string;
|
|
requiresApiKey?: boolean;
|
|
apiKeyField?: string;
|
|
apiKeyFieldLabel?: string;
|
|
getApiKeyUrl?: string;
|
|
}
|
|
|
|
export interface LLMProviderOption {
|
|
value: string;
|
|
label: string;
|
|
description?: string;
|
|
model_value?: string;
|
|
model_label?: string;
|
|
url?: string;
|
|
icon?: string;
|
|
getApiKeyUrl?: string;
|
|
}
|
|
|
|
export const IMAGE_PROVIDERS: Record<string, ImageProviderOption> = {
|
|
pexels: {
|
|
value: "pexels",
|
|
label: "Pexels",
|
|
description: "Free stock photo and video platform",
|
|
icon: "/providers/pexel.png",
|
|
requiresApiKey: true,
|
|
apiKeyField: "PEXELS_API_KEY",
|
|
apiKeyFieldLabel: "Pexels API Key",
|
|
getApiKeyUrl: "https://docs.presenton.ai/help/get-api-keys/get-pexels-api-key",
|
|
},
|
|
pixabay: {
|
|
value: "pixabay",
|
|
label: "Pixabay",
|
|
description: "Free images and videos",
|
|
icon: "/providers/pixabay.png",
|
|
requiresApiKey: true,
|
|
apiKeyField: "PIXABAY_API_KEY",
|
|
apiKeyFieldLabel: "Pixabay API Key",
|
|
getApiKeyUrl: "https://docs.presenton.ai/help/get-api-keys/get-pixabay-api-keyhttps://www.google.com/search?q=how+to+get+openai+api+key&ie=UTF-8",
|
|
},
|
|
"dall-e-3": {
|
|
value: "dall-e-3",
|
|
label: "DALL-E 3",
|
|
description: "OpenAI's image generation model",
|
|
icon: "/providers/openai.png",
|
|
requiresApiKey: true,
|
|
apiKeyField: "OPENAI_API_KEY",
|
|
apiKeyFieldLabel: "OpenAI API Key",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+openai+api+key&ie=UTF-8",
|
|
},
|
|
"gpt-image-1.5": {
|
|
value: "gpt-image-1.5",
|
|
label: "GPT Image 1.5",
|
|
description: "OpenAI's image generation model",
|
|
icon: "/providers/openai.png",
|
|
requiresApiKey: true,
|
|
apiKeyField: "OPENAI_API_KEY",
|
|
apiKeyFieldLabel: "OpenAI API Key",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+openai+api+key&ie=UTF-8",
|
|
},
|
|
gemini_flash: {
|
|
value: "gemini_flash",
|
|
label: "Gemini Flash",
|
|
description: "Google's fast image generation model",
|
|
icon: "/providers/gemini-color.svg",
|
|
requiresApiKey: true,
|
|
apiKeyField: "GOOGLE_API_KEY",
|
|
apiKeyFieldLabel: "Google API Key",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+google+AI+studio+api+key&sxsrf=ANbL-n5_hUGaEiG9v6k9VxZWyv0mqO0Jew%3A1776339625724",
|
|
},
|
|
nanobanana_pro: {
|
|
value: "nanobanana_pro",
|
|
label: "NanoBanana Pro",
|
|
description: "Google's advanced image generation model",
|
|
icon: "/providers/gemini-color.svg",
|
|
requiresApiKey: true,
|
|
apiKeyField: "GOOGLE_API_KEY",
|
|
apiKeyFieldLabel: "Google API Key",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+google+AI+studio+api+key&sxsrf=ANbL-n5_hUGaEiG9v6k9VxZWyv0mqO0Jew%3A1776339625724",
|
|
},
|
|
comfyui: {
|
|
value: "comfyui",
|
|
label: "ComfyUI",
|
|
description: "Use your local ComfyUI server with custom workflows",
|
|
icon: "/providers/comfyui-color.svg",
|
|
requiresApiKey: false,
|
|
apiKeyField: "COMFYUI_URL",
|
|
apiKeyFieldLabel: "ComfyUI Server URL",
|
|
},
|
|
open_webui: {
|
|
value: "open_webui",
|
|
label: "Open WebUI",
|
|
description: "Use your Open WebUI server for image generation",
|
|
icon: "/icons/open-webui.png",
|
|
requiresApiKey: false,
|
|
apiKeyField: "OPEN_WEBUI_IMAGE_URL",
|
|
apiKeyFieldLabel: "Open WebUI URL",
|
|
},
|
|
};
|
|
|
|
export const LLM_PROVIDERS: Record<string, LLMProviderOption> = {
|
|
codex: {
|
|
value: "codex",
|
|
label: "ChatGPT",
|
|
description: "ChatGPT Plus/Pro via OAuth",
|
|
icon: "/providers/openai.png",
|
|
},
|
|
openai: {
|
|
value: "openai",
|
|
label: "OpenAI",
|
|
description: "OpenAI's latest text generation model",
|
|
url: "https://api.openai.com/v1",
|
|
icon: "/providers/openai.png",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+openai+api+key&ie=UTF-8",
|
|
},
|
|
google: {
|
|
value: "google",
|
|
label: "Google",
|
|
description: "Google's primary text generation model",
|
|
url: "https://api.google.com/v1",
|
|
icon: "/providers/gemini-color.svg",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+google+AI+studio+api+key&sxsrf=ANbL-n5_hUGaEiG9v6k9VxZWyv0mqO0Jew%3A1776339625724",
|
|
},
|
|
vertex: {
|
|
value: "vertex",
|
|
label: "Vertex AI",
|
|
description: "Google Vertex AI models",
|
|
icon: "/providers/gemini-color.svg",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+vertex+ai+api+key",
|
|
},
|
|
azure: {
|
|
value: "azure",
|
|
label: "Azure OpenAI",
|
|
description: "Azure-hosted OpenAI deployments",
|
|
icon: "/providers/openai.png",
|
|
getApiKeyUrl: "https://www.google.com/search?q=azure+openai+api+key",
|
|
},
|
|
anthropic: {
|
|
value: "anthropic",
|
|
label: "Anthropic",
|
|
description: "Anthropic's Claude models",
|
|
url: "https://api.anthropic.com/v1",
|
|
icon: "/providers/claude-color.svg",
|
|
getApiKeyUrl: "https://www.google.com/search?q=how+to+get+anthropic+api+key&sxsrf=ANbL-n7lsueZQ88L56HhqC1ch2PGD0rbNQ%3A1776339632265",
|
|
},
|
|
ollama: {
|
|
value: "ollama",
|
|
label: "Ollama",
|
|
description: "Ollama's primary text generation model",
|
|
icon: "/providers/ollama.svg",
|
|
},
|
|
custom: {
|
|
value: "custom",
|
|
label: "Custom",
|
|
description: "OpenAI-compatible LLM",
|
|
icon: "/providers/custom.svg",
|
|
},
|
|
|
|
};
|
|
|
|
export const DALLE_3_QUALITY_OPTIONS = [
|
|
{
|
|
label: "Standard",
|
|
value: "standard",
|
|
description: "Faster generation with lower cost",
|
|
},
|
|
{
|
|
label: "HD",
|
|
value: "hd",
|
|
description: "Higher quality images with increased cost",
|
|
},
|
|
];
|
|
|
|
export const GPT_IMAGE_1_5_QUALITY_OPTIONS = [
|
|
{
|
|
label: "Low",
|
|
value: "low",
|
|
description: "Fastest and most cost-effective",
|
|
},
|
|
{
|
|
label: "Medium",
|
|
value: "medium",
|
|
description: "Balanced quality and speed",
|
|
},
|
|
{
|
|
label: "High",
|
|
value: "high",
|
|
description: "Best quality with longer generation time",
|
|
},
|
|
]; |