- Added MAX_NUMBER_OF_SLIDES constant to limit slide generation. - Updated GeneratePresentationRequest model to allow optional slide count and language detection. - Implemented language resolution in edit_slide and generate_presentation_outlines utilities. - Enhanced user prompts to include optional parameters for slide count and table of contents. - Introduced outline utilities for managing table of contents and slide outlines. - Improved image and icon processing in slides to utilize outline image URLs. - Updated frontend components to resolve backend asset URLs for icons and images. - Refactored upload components to handle optional slide count and language selection. - Enhanced API utility functions to resolve backend asset URLs correctly.
46 lines
1.8 KiB
Python
46 lines
1.8 KiB
Python
from typing import List, Literal, Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
from enums.tone import Tone
|
|
from enums.verbosity import Verbosity
|
|
|
|
|
|
class GeneratePresentationRequest(BaseModel):
|
|
content: str = Field(..., description="The content for generating the presentation")
|
|
slides_markdown: Optional[List[str]] = Field(
|
|
default=None, description="The markdown for the slides"
|
|
)
|
|
instructions: Optional[str] = Field(
|
|
default=None, description="The instruction for generating the presentation"
|
|
)
|
|
tone: Tone = Field(default=Tone.DEFAULT, description="The tone to use for the text")
|
|
verbosity: Verbosity = Field(
|
|
default=Verbosity.STANDARD, description="How verbose the presentation should be"
|
|
)
|
|
web_search: bool = Field(default=False, description="Whether to enable web search")
|
|
n_slides: Optional[int] = Field(
|
|
default=None,
|
|
description="Number of slides to generate. If omitted, model auto-detects slide count.",
|
|
)
|
|
language: Optional[str] = Field(
|
|
default=None,
|
|
description="Language for the presentation. If omitted, model auto-detects language.",
|
|
)
|
|
template: str = Field(
|
|
default="general", description="Template to use for the presentation"
|
|
)
|
|
include_table_of_contents: bool = Field(
|
|
default=False, description="Whether to include a table of contents"
|
|
)
|
|
include_title_slide: bool = Field(
|
|
default=True, description="Whether to include a title slide"
|
|
)
|
|
files: Optional[List[str]] = Field(
|
|
default=None, description="Files to use for the presentation"
|
|
)
|
|
export_as: Literal["pptx", "pdf"] = Field(
|
|
default="pptx", description="Export format"
|
|
)
|
|
trigger_webhook: bool = Field(
|
|
default=False, description="Whether to trigger subscribed webhooks"
|
|
)
|