mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-18 14:18:21 +03:00
Fix import issues
This commit is contained in:
parent
d150b44d36
commit
b6e17b032a
@ -10,7 +10,6 @@ from typing import TYPE_CHECKING, Optional
|
|||||||
|
|
||||||
from frigate.config import FrigateConfig
|
from frigate.config import FrigateConfig
|
||||||
from frigate.config.camera.genai import GenAIRoleEnum
|
from frigate.config.camera.genai import GenAIRoleEnum
|
||||||
from frigate.genai import PROVIDERS, load_providers
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from frigate.genai import GenAIClient
|
from frigate.genai import GenAIClient
|
||||||
@ -35,6 +34,7 @@ class GenAIClientManager:
|
|||||||
Each role (tools, vision, embeddings) gets the client for the provider
|
Each role (tools, vision, embeddings) gets the client for the provider
|
||||||
that has that role in its roles list.
|
that has that role in its roles list.
|
||||||
"""
|
"""
|
||||||
|
from frigate.genai import PROVIDERS, load_providers
|
||||||
|
|
||||||
self._tool_client = None
|
self._tool_client = None
|
||||||
self._vision_client = None
|
self._vision_client = None
|
||||||
|
|||||||
@ -8,7 +8,6 @@ from typing import Any, Optional, Union
|
|||||||
|
|
||||||
from ruamel.yaml import YAML
|
from ruamel.yaml import YAML
|
||||||
|
|
||||||
from frigate.config.camera.genai import GenAIRoleEnum
|
|
||||||
from frigate.const import CONFIG_DIR, EXPORT_DIR
|
from frigate.const import CONFIG_DIR, EXPORT_DIR
|
||||||
from frigate.util.services import get_video_properties
|
from frigate.util.services import get_video_properties
|
||||||
|
|
||||||
@ -443,11 +442,7 @@ def migrate_018_0(config: dict[str, dict[str, Any]]) -> dict[str, dict[str, Any]
|
|||||||
genai = new_config.get("genai")
|
genai = new_config.get("genai")
|
||||||
|
|
||||||
if genai and genai.get("provider"):
|
if genai and genai.get("provider"):
|
||||||
genai["roles"] = [
|
genai["roles"] = ["embeddings", "vision", "tools"]
|
||||||
GenAIRoleEnum.embeddings,
|
|
||||||
GenAIRoleEnum.vision,
|
|
||||||
GenAIRoleEnum.tools,
|
|
||||||
]
|
|
||||||
new_config["genai"] = {"default": genai}
|
new_config["genai"] = {"default": genai}
|
||||||
|
|
||||||
# Remove deprecated sync_recordings from global record config
|
# Remove deprecated sync_recordings from global record config
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user