diff --git a/frigate/genai/__init__.py b/frigate/genai/__init__.py index ce0034670d..5c97fd34a3 100644 --- a/frigate/genai/__init__.py +++ b/frigate/genai/__init__.py @@ -457,8 +457,8 @@ Guidelines: def load_providers() -> None: - package_dir = os.path.dirname(__file__) - for filename in os.listdir(package_dir): + plugins_dir = os.path.join(os.path.dirname(__file__), "plugins") + for filename in os.listdir(plugins_dir): if filename.endswith(".py") and filename != "__init__.py": - module_name = f"frigate.genai.{filename[:-3]}" + module_name = f"frigate.genai.plugins.{filename[:-3]}" importlib.import_module(module_name) diff --git a/frigate/genai/plugins/__init__.py b/frigate/genai/plugins/__init__.py new file mode 100644 index 0000000000..e6d66077d3 --- /dev/null +++ b/frigate/genai/plugins/__init__.py @@ -0,0 +1 @@ +"""GenAI provider plugins.""" diff --git a/frigate/genai/azure-openai.py b/frigate/genai/plugins/azure-openai.py similarity index 99% rename from frigate/genai/azure-openai.py rename to frigate/genai/plugins/azure-openai.py index c671bca7db..6330e539df 100644 --- a/frigate/genai/azure-openai.py +++ b/frigate/genai/plugins/azure-openai.py @@ -10,7 +10,7 @@ from openai import AzureOpenAI from frigate.config import GenAIProviderEnum from frigate.genai import GenAIClient, register_genai_provider -from frigate.genai.openai import _stats_from_openai_usage +from frigate.genai.plugins.openai import _stats_from_openai_usage logger = logging.getLogger(__name__) diff --git a/frigate/genai/gemini.py b/frigate/genai/plugins/gemini.py similarity index 100% rename from frigate/genai/gemini.py rename to frigate/genai/plugins/gemini.py diff --git a/frigate/genai/llama_cpp.py b/frigate/genai/plugins/llama_cpp.py similarity index 100% rename from frigate/genai/llama_cpp.py rename to frigate/genai/plugins/llama_cpp.py diff --git a/frigate/genai/ollama.py b/frigate/genai/plugins/ollama.py similarity index 100% rename from frigate/genai/ollama.py rename to frigate/genai/plugins/ollama.py diff --git a/frigate/genai/openai.py b/frigate/genai/plugins/openai.py similarity index 100% rename from frigate/genai/openai.py rename to frigate/genai/plugins/openai.py