
import sys
import os
sys.path.insert(0, '/app')
from lib.embedding_providers.openrouter_provider import OpenRouterProvider
from config import get_settings

def test_gemini():
    print("Testing Gemini via OpenRouter...")
    settings = get_settings()
    key = settings.openrouter_api_key
    provider = OpenRouterProvider(api_key=key)
    available_models = [
        "google/gemini-2.0-flash-exp:free",
        "google/gemini-2.0-flash-001"
    ]
    
    for m in available_models:
        print(f"\n🧪 Testing {m}...")
        try:
            resp = provider.get_completion(prompt="Hi", model=m)
            print(f"✅ Works! {resp[:20]}")
        except Exception as e:
            print(f"❌ Failed: {e}")

if __name__ == "__main__":
    test_gemini()
