Files
superDreamFront/app/services/model_service.py
2026-04-15 21:35:26 +08:00

17 lines
450 B
Python

from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from app.models import ModelPricing
class ModelService:
@staticmethod
async def list_models(db: AsyncSession) -> list:
result = await db.execute(
select(ModelPricing)
.where(ModelPricing.status == "available")
.order_by(ModelPricing.provider, ModelPricing.model_name)
)
return result.scalars().all()