agy تنها ارائه‌دهندهٔ مدل؛ حذف بخش ارائه‌دهنده‌ها و افزودن زنجیرهٔ انتخاب مدل

- حذف کامل providerهای mock و openai_compatible: دامنه، آداپوترها، رجیستری، کانفیگ، seed و رابطٔ مدیریت
- بخش «ارائه‌دهنده‌ها» از کنسول حذف شد؛ ورود اکانت‌ها فقط از صفحهٔ اکانت‌های agy
- صفحهٔ مدل‌ها بازطراحی شد: ارائه‌دهنده → اکانت → مدل (کاتالوگ لحظه‌ای و زندهٔ همان اکانت از Google) → افورت استدلال؛ بدون هیچ ورود دستی نام مدل
- مدل‌ها ستون reasoning_effort گرفتند؛ آداپتور آن را به thinkingConfig (بودجهٔ ۱۰۲۴ تا ۳۲۷۶۸) ترجمه می‌کند و فقط به مدل‌های استدلالی می‌فرستد
- مهاجرت c2d3e4f5b6a7: افزودن reasoning_effort و حذف ردیف‌های providerهای قدیمی
- تست‌ها: ۲۴۶ تست بک‌اند و ۵۱ تست فرانت سبز؛ ruff و mypy و tsc و eslint تمیز
This commit is contained in:
mjalmoudy94
2026-10-13 10:01:11 +03:30
parent a2284db4f4
commit da5a2a5d1a
29 changed files with 906 additions and 995 deletions
@@ -33,8 +33,14 @@ from app.infrastructure.db.models import (
def _provider_to_domain(row: AiProviderRow) -> Provider:
# agy is the only provider kind; a legacy row (mock / openai_compatible,
# deleted by migration) still maps to the one enum member rather than
# raising, so a half-migrated database reads cleanly.
provider_type = (
ProviderType(row.type) if row.type == ProviderType.AGY.value else ProviderType.AGY
)
return Provider(
id=row.id, name=row.name, type=ProviderType(row.type),
id=row.id, name=row.name, type=provider_type,
base_url=row.base_url, is_active=row.is_active, created_at=row.created_at,
)
@@ -57,6 +63,7 @@ def _model_to_domain(row: AiModelRow) -> AiModel:
capabilities=list(row.capabilities or []),
input_price_per_1m=row.input_price_per_1m,
output_price_per_1m=row.output_price_per_1m,
reasoning_effort=row.reasoning_effort or "",
is_active=row.is_active, created_at=row.created_at,
)
@@ -267,6 +274,7 @@ class AiModelRepository:
capabilities=list(model.capabilities),
input_price_per_1m=model.input_price_per_1m,
output_price_per_1m=model.output_price_per_1m,
reasoning_effort=model.reasoning_effort,
is_active=model.is_active, created_at=model.created_at,
)
self.session.add(row)