mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-26 19:06:11 +01:00
36cbffcc5e
* Initial re-implementation of semantic search * put docker-compose back and make reindex match docs * remove debug code and fix import * fix docs * manually build pysqlite3 as binaries are only available for x86-64 * update comment in build_pysqlite3.sh * only embed objects * better error handling when genai fails * ask ollama to pull requested model at startup * update ollama docs * address some PR review comments * fix lint * use IPC to write description, update docs for reindex * remove gemini-pro-vision from docs as it will be unavailable soon * fix OpenAI doc available models * fix api error in gemini and metadata for embeddings
52 lines
1.1 KiB
Python
52 lines
1.1 KiB
Python
"""Facilitates communication between processes."""
|
|
|
|
from frigate.events.types import EventStateEnum, EventTypeEnum
|
|
|
|
from .zmq_proxy import Publisher, Subscriber
|
|
|
|
|
|
class EventUpdatePublisher(Publisher):
|
|
"""Publishes events (objects, audio, manual)."""
|
|
|
|
topic_base = "event/"
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__("update")
|
|
|
|
def publish(
|
|
self, payload: tuple[EventTypeEnum, EventStateEnum, str, dict[str, any]]
|
|
) -> None:
|
|
super().publish(payload)
|
|
|
|
|
|
class EventUpdateSubscriber(Subscriber):
|
|
"""Receives event updates."""
|
|
|
|
topic_base = "event/"
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__("update")
|
|
|
|
|
|
class EventEndPublisher(Publisher):
|
|
"""Publishes events that have ended."""
|
|
|
|
topic_base = "event/"
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__("finalized")
|
|
|
|
def publish(
|
|
self, payload: tuple[EventTypeEnum, EventStateEnum, str, dict[str, any]]
|
|
) -> None:
|
|
super().publish(payload)
|
|
|
|
|
|
class EventEndSubscriber(Subscriber):
|
|
"""Receives events that have ended."""
|
|
|
|
topic_base = "event/"
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__("finalized")
|