from app import app
from models.ai import AIModel
from config import db

with app.app_context():
    best_models = [
        {"provider": "AnyProvider", "model": "gpt-4", "name": "GPT-4 (Best General)", "status": "active", "is_free": True},
        {"provider": "Perplexity", "model": "gpt45", "name": "GPT-4.5 (Perplexity)", "status": "active", "is_free": True},
        {"provider": "Qwen", "model": "qwq-32b", "name": "Qwen QWQ-32b", "status": "active", "is_free": True},
        {"provider": "Perplexity", "model": "claude45sonnetthinking", "name": "Claude 3.5 Sonnet (Perplexity)", "status": "active", "is_free": True},
    ]

    for m in best_models:
        existing = AIModel.query.filter_by(model=m['model'], provider=m['provider']).first()
        if not existing:
            new_model = AIModel(
                name=m['name'],
                model=m['model'],
                provider=m['provider'],
                status=m['status'],
                is_free=m['is_free'],
                description=f"Added from modeks_working_list.txt"
            )
            db.session.add(new_model)
    
    db.session.commit()
    print("Seed complete.")
