6ede33ccdb
Build and Push Docker Images / create_manifest (web, surfsense-web, , cpu) (push) Has been cancelled
Build and Push Docker Images / finalize_release (push) Has been cancelled
Obsidian Plugin Lint / lint (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-24.04-arm, linux/arm64, arm64, , runner, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_web, cpu, ./surfsense_web/Dockerfile, web, surfsense-web, ubuntu-latest, linux/amd64, amd64, , runner, false, cpu) (push) Has been cancelled
Build and Push Docker Images / compute_version (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, , production, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cpu, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, , production, false, cpu) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda126, production, true, cuda126) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu126, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda126, production, true, cuda126) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-24.04-arm, linux/arm64, arm64, -cuda, production, true, cuda) (push) Has been cancelled
Build and Push Docker Images / build (./surfsense_backend, cu128, ./surfsense_backend/Dockerfile, backend, surfsense-backend, ubuntu-latest, linux/amd64, amd64, -cuda, production, true, cuda) (push) Has been cancelled
Build and Push Docker Images / verify_digests (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, , cpu) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda, cuda) (push) Has been cancelled
Build and Push Docker Images / create_manifest (backend, surfsense-backend, -cuda126, cuda126) (push) Has been cancelled
74 lines
2.3 KiB
Python
74 lines
2.3 KiB
Python
"""Define the state structures for the video presentation agent."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
from pydantic import BaseModel, Field
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
|
|
class SlideContent(BaseModel):
|
|
"""Represents a single parsed slide from content analysis."""
|
|
|
|
slide_number: int = Field(..., description="1-based slide number")
|
|
title: str = Field(..., description="Concise slide title")
|
|
subtitle: str = Field(..., description="One-line subtitle or tagline")
|
|
content_in_markdown: str = Field(
|
|
..., description="Slide body content formatted as markdown"
|
|
)
|
|
speaker_transcripts: list[str] = Field(
|
|
...,
|
|
description="2-4 short sentences a presenter would say while this slide is shown",
|
|
)
|
|
background_explanation: str = Field(
|
|
...,
|
|
description="Emotional mood and color direction for this slide",
|
|
)
|
|
|
|
|
|
class PresentationSlides(BaseModel):
|
|
"""Represents the full set of parsed slides from the LLM."""
|
|
|
|
slides: list[SlideContent] = Field(
|
|
..., description="Ordered array of presentation slides"
|
|
)
|
|
|
|
|
|
class SlideAudioResult(BaseModel):
|
|
"""Audio generation result for a single slide."""
|
|
|
|
slide_number: int
|
|
audio_file: str = Field(..., description="Path to the per-slide audio file")
|
|
duration_seconds: float = Field(..., description="Audio duration in seconds")
|
|
duration_in_frames: int = Field(
|
|
..., description="Audio duration in frames (at 30fps)"
|
|
)
|
|
|
|
|
|
class SlideSceneCode(BaseModel):
|
|
"""Generated Remotion component code for a single slide."""
|
|
|
|
slide_number: int
|
|
code: str = Field(
|
|
..., description="Raw Remotion React component source code for this slide"
|
|
)
|
|
title: str = Field(..., description="Short title for the composition")
|
|
|
|
|
|
@dataclass
|
|
class State:
|
|
"""State for the video presentation agent graph.
|
|
|
|
Pipeline: parse slides → (TTS audio ∥ theme assignment) → generate Remotion code
|
|
The frontend receives the slides + code + audio and handles compilation/rendering.
|
|
"""
|
|
|
|
db_session: AsyncSession
|
|
source_content: str
|
|
|
|
slides: list[SlideContent] | None = None
|
|
slide_audio_results: list[SlideAudioResult] | None = None
|
|
slide_theme_assignments: dict[int, tuple[str, str]] | None = None
|
|
slide_scene_codes: list[SlideSceneCode] | None = None
|