Phase 1 (Foundation): - Project restructure (presenton-main → backend/ + frontend/) - Database schema (8 new models, Alembic config, seed script) - Auth (Azure AD SSO + dev bypass, JWT sessions, AuthMiddleware) - RBAC (access_service, rbac_middleware, admin routers) - Audit logging (fire-and-forget, AuditMiddleware, admin router) - i18n (react-i18next with 5 namespace files) Phase 2 (Admin Panel & Client Management): - Admin panel shell (sidebar layout, role guard, 12 pages) - Redux admin slice with 18 async thunks - User management (role changes, deactivation) - Client management (CRUD, brand config, team management) - Brand config editor (colors, fonts, logos, voice rules) - Master deck upload & parser (PPTX → HTML → React pipeline) - Audit log viewer with filters and CSV/JSON export Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
21 lines
758 B
Python
21 lines
758 B
Python
from anthropic import AsyncAnthropic
|
|
from openai import AsyncOpenAI
|
|
from google import genai
|
|
|
|
|
|
async def list_available_openai_compatible_models(url: str, api_key: str) -> list[str]:
|
|
client = AsyncOpenAI(api_key=api_key, base_url=url)
|
|
models = (await client.models.list()).data
|
|
if models:
|
|
return list(map(lambda x: x.id, models))
|
|
return []
|
|
|
|
|
|
async def list_available_anthropic_models(api_key: str) -> list[str]:
|
|
client = AsyncAnthropic(api_key=api_key)
|
|
return list(map(lambda x: x.id, (await client.models.list(limit=50)).data))
|
|
|
|
|
|
async def list_available_google_models(api_key: str) -> list[str]:
|
|
client = genai.Client(api_key=api_key)
|
|
return list(map(lambda x: x.name, client.models.list(config={"page_size": 50})))
|