first commit
This commit is contained in:
16
app/services/model_service.py
Normal file
16
app/services/model_service.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user