Skip to content

Commit

Permalink
validation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Gregg committed Dec 31, 2024
1 parent 3a5659a commit 0ff1dc2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/logs/
/.venv/
/__pycache__/
**/__pycache__/
config.yaml
4 changes: 2 additions & 2 deletions config_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ logging:
max_keep: 10 # number of log files to keep

ai:
enabled: true # enable AI processing with Google Vision API
enabled: true # enable AI processing with Google Gemini API
api_key: your-api-key-here
model: gemini-1.5-flash
ai_model: gemini-1.5-flash
prompt: >
Very briefly describe what you see in this image from my security camera. Your
message needs to be short to fit in a phone notification. Don't describe
Expand Down
6 changes: 5 additions & 1 deletion src/frigate_event_processor/google_vision_processor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""Module to process images using Google Vision API."""

import logging
import base64
import google.generativeai as genai
import httpx
import logging

from .app_configuration import AIConfig

logger = logging.getLogger(__name__)
Expand All @@ -14,6 +17,7 @@ def __init__(self, ai_config: AIConfig):
logger.debug("Initializing Google AI with API_KEY: %s", ai_config.api_key)
genai.configure(api_key=ai_config.api_key)
ai_model = ai_config.ai_model
logger.debug("Specified model: %s", ai_model)
self.model = genai.GenerativeModel(model_name=ai_model)
logger.info("Google AI model initialized: %s", ai_model)

Expand Down

0 comments on commit 0ff1dc2

Please sign in to comment.