mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-21 03:41:55 +03:00
Move GenAI plugins to dedicated directory
This commit is contained in:
parent
875dade158
commit
9fafcdd6cd
@ -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)
|
||||
|
||||
1
frigate/genai/plugins/__init__.py
Normal file
1
frigate/genai/plugins/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
"""GenAI provider plugins."""
|
||||
@ -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__)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user