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>
66 lines
2 KiB
Python
66 lines
2 KiB
Python
import asyncio
|
|
import json
|
|
from typing import Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
from utils.llm_provider import get_llm_client, get_large_model
|
|
|
|
|
|
class HeadingDescription(BaseModel):
|
|
heading: str = Field(
|
|
description="Heading of the slide", min_length=10, max_length=20
|
|
)
|
|
description: str = Field(
|
|
description="Description of the slide", min_length=40, max_length=200
|
|
)
|
|
|
|
|
|
class SlideContentTest(BaseModel):
|
|
title: str = Field(description="Title of the slide", min_length=10, max_length=20)
|
|
first_content: HeadingDescription = Field(description="First content of the slide")
|
|
second_content: HeadingDescription = Field(
|
|
description="Second content of the slide"
|
|
)
|
|
third_content: HeadingDescription = Field(description="Third content of the slide")
|
|
|
|
|
|
class ColumnContentModel(BaseModel):
|
|
title: str = Field(min_length=3, max_length=100, description="Column title")
|
|
content: str = Field(min_length=10, max_length=800, description="Column content")
|
|
|
|
|
|
class TwoColumnSlideModel(BaseModel):
|
|
title: str = Field(
|
|
min_length=3,
|
|
max_length=100,
|
|
description="Title of the slide",
|
|
)
|
|
subtitle: Optional[str] = Field(
|
|
min_length=3,
|
|
max_length=150,
|
|
description="Optional subtitle or description",
|
|
)
|
|
leftColumn: ColumnContentModel = Field(
|
|
description="Left column content",
|
|
)
|
|
rightColumn: ColumnContentModel = Field(
|
|
description="Right column content",
|
|
)
|
|
backgroundImage: Optional[str] = Field(
|
|
description="URL to background image for the slide"
|
|
)
|
|
|
|
|
|
def test_openai_schema_support():
|
|
response = asyncio.run(
|
|
get_llm_client().beta.chat.completions.parse(
|
|
model=get_large_model(),
|
|
messages=[
|
|
{"role": "system", "content": "You are a helpful assistant."},
|
|
{"role": "user", "content": "Generate a slide for a presentation"},
|
|
],
|
|
response_format=TwoColumnSlideModel,
|
|
)
|
|
)
|
|
print(response.choices[0].message.parsed)
|