- Updated LLMConfig interface to include IMAGE_PROVIDER and PIXABAY_API_KEY. - Enhanced handleSaveLLMConfig to log the saving process and validate IMAGE_PROVIDER. - Implemented image provider validation logic in hasValidLLMConfig to check for required API keys based on the selected provider. - Modified start.js to read IMAGE_PROVIDER and PIXABAY_API_KEY from environment variables and include them in the user configuration setup.
63 lines
No EOL
1.1 KiB
Python
63 lines
No EOL
1.1 KiB
Python
import os
|
|
|
|
|
|
def get_can_change_keys_env():
|
|
return os.getenv("CAN_CHANGE_KEYS")
|
|
|
|
|
|
def get_database_url_env():
|
|
return os.getenv("DATABASE_URL")
|
|
|
|
|
|
def get_app_data_directory_env():
|
|
return os.getenv("APP_DATA_DIRECTORY")
|
|
|
|
|
|
def get_temp_directory_env():
|
|
return os.getenv("TEMP_DIRECTORY")
|
|
|
|
|
|
def get_user_config_path_env():
|
|
return os.getenv("USER_CONFIG_PATH")
|
|
|
|
|
|
def get_llm_provider_env():
|
|
return os.getenv("LLM")
|
|
|
|
|
|
def get_ollama_url_env():
|
|
return os.getenv("OLLAMA_URL")
|
|
|
|
|
|
def get_custom_llm_url_env():
|
|
return os.getenv("CUSTOM_URL")
|
|
|
|
|
|
def get_openai_api_key_env():
|
|
return os.getenv("OPENAI_API_KEY")
|
|
|
|
|
|
def get_google_api_key_env():
|
|
return os.getenv("GOOGLE_API_KEY")
|
|
|
|
|
|
def get_custom_llm_api_key_env():
|
|
return os.getenv("CUSTOM_LLM_API_KEY")
|
|
|
|
|
|
def get_ollama_model_env():
|
|
return os.getenv("OLLAMA_MODEL")
|
|
|
|
|
|
def get_custom_model_env():
|
|
return os.getenv("CUSTOM_MODEL")
|
|
|
|
|
|
def get_pexels_api_key_env():
|
|
return os.getenv("PEXELS_API_KEY")
|
|
|
|
def get_image_provider_env():
|
|
return os.getenv("IMAGE_PROVIDER")
|
|
|
|
def get_pixabay_api_key_env():
|
|
return os.getenv("PIXABAY_API_KEY") |