- Implement tests for database generator to ensure proper session handling. - Create tests for EXIF extraction and conversion functions. - Add tests for image-related endpoints, ensuring proper data retrieval and isolation between clients. - Develop tests for OCR functionality, including language detection and text extraction. - Introduce tests for the image processing pipeline, covering success and failure scenarios. - Validate rate limiting functionality and ensure independent counters for different clients. - Implement scraper tests to verify HTML content fetching and error handling. - Add unit tests for various services, including storage and filename generation. - Establish worker entry point for ARQ to handle background image processing tasks.
24 lines
636 B
Python
24 lines
636 B
Python
import os
|
|
import sys
|
|
from google import genai
|
|
from dotenv import load_dotenv
|
|
|
|
# Load env from the project root
|
|
load_dotenv(r"c:\dev\git\python\imago\imago\.env")
|
|
|
|
api_key = os.getenv("GEMINI_API_KEY")
|
|
if not api_key:
|
|
print("No API Key found in .env")
|
|
sys.exit(1)
|
|
|
|
try:
|
|
client = genai.Client(api_key=api_key)
|
|
print("Listing models...")
|
|
# The SDK might have a different way to list models, checking typical pattern
|
|
# For google-genai v1.0.0
|
|
for m in client.models.list():
|
|
if "gemini" in m.name:
|
|
print(f"Found model: {m.name}")
|
|
except Exception as e:
|
|
print(f"Error listing models: {e}")
|