ALwrity Facebook Writer CopilotKit Implementation Plan
This commit is contained in:
@@ -30,10 +30,27 @@ class StoryTone(str, Enum):
|
||||
|
||||
class StoryVisualOptions(BaseModel):
|
||||
"""Visual options for story."""
|
||||
background_type: str = Field(default="Solid color", description="Background type")
|
||||
# Background layer
|
||||
background_type: str = Field(default="Solid color", description="Background type (Solid color, Gradient, Image, Video)")
|
||||
background_image_prompt: Optional[str] = Field(None, description="If background_type is Image/Video, describe desired visual")
|
||||
gradient_style: Optional[str] = Field(None, description="Gradient style if gradient background is chosen")
|
||||
|
||||
# Text overlay styling
|
||||
text_overlay: bool = Field(default=True, description="Include text overlay")
|
||||
text_style: Optional[str] = Field(None, description="Headline/Subtext style, e.g., Bold, Minimal, Handwritten")
|
||||
text_color: Optional[str] = Field(None, description="Preferred text color or palette")
|
||||
text_position: Optional[str] = Field(None, description="Top/Center/Bottom; Left/Center/Right")
|
||||
|
||||
# Embellishments and interactivity
|
||||
stickers: bool = Field(default=True, description="Use stickers/emojis")
|
||||
interactive_elements: bool = Field(default=True, description="Include polls/questions")
|
||||
interactive_types: Optional[List[str]] = Field(
|
||||
default=None,
|
||||
description="List of interactive types like ['poll','quiz','slider','countdown']"
|
||||
)
|
||||
|
||||
# CTA overlay
|
||||
call_to_action: Optional[str] = Field(None, description="Optional CTA copy to place on story")
|
||||
|
||||
|
||||
class FacebookStoryRequest(BaseModel):
|
||||
@@ -47,12 +64,20 @@ class FacebookStoryRequest(BaseModel):
|
||||
include: Optional[str] = Field(None, description="Elements to include in the story")
|
||||
avoid: Optional[str] = Field(None, description="Elements to avoid in the story")
|
||||
visual_options: StoryVisualOptions = Field(default_factory=StoryVisualOptions, description="Visual customization options")
|
||||
# Advanced text generation options (parity with original Streamlit module)
|
||||
use_hook: bool = Field(default=True, description="Start with a hook to grab attention")
|
||||
use_story: bool = Field(default=True, description="Use a short narrative arc")
|
||||
use_cta: bool = Field(default=True, description="Include a call to action")
|
||||
use_question: bool = Field(default=True, description="Ask a question to spur interaction")
|
||||
use_emoji: bool = Field(default=True, description="Use emojis where appropriate")
|
||||
use_hashtags: bool = Field(default=True, description="Include relevant hashtags in copy")
|
||||
|
||||
|
||||
class FacebookStoryResponse(BaseModel):
|
||||
"""Response model for Facebook story generation."""
|
||||
success: bool = Field(..., description="Whether the generation was successful")
|
||||
content: Optional[str] = Field(None, description="Generated story content")
|
||||
images_base64: Optional[List[str]] = Field(None, description="List of base64-encoded story images (PNG)")
|
||||
visual_suggestions: Optional[List[str]] = Field(None, description="Visual element suggestions")
|
||||
engagement_tips: Optional[List[str]] = Field(None, description="Engagement optimization tips")
|
||||
error: Optional[str] = Field(None, description="Error message if generation failed")
|
||||
|
||||
Reference in New Issue
Block a user