jebin2 commited on
Commit
af2a248
·
1 Parent(s): fccc73c

feat: Add error handling for b-roll video title generation to log failures and return None.

Browse files
Files changed (1) hide show
  1. src/pipelines/base.py +10 -6
src/pipelines/base.py CHANGED
@@ -104,12 +104,16 @@ class ContentAutomationBase(ABC):
104
  Generate a safe filename based on the provided prompt using Gemini.
105
  Returns a string suitable for use as a filename (lowercase, underscores, no special chars).
106
  """
107
- user_prompt = """Generate one unique luxury b-roll video title (2-4 words) that matches this tone:
108
- "Golden Hour Aesthetic", "Luxury Lifestyle Vibes", "Rich Life Moments", "Elite Daily Routine", "Opulent Living"
109
- Style: Aspirational, elegant, visually evocative. Use words like: golden, elite, lavish, premium, refined, curated, timeless + aesthetic, vibes, moments, living, lifestyle, routine, dreams, essence.
110
- Patterns: [Adjective + Noun], [Time/Place + Vibe], [Quality + Element]
111
- Output only the title, nothing else."""
112
- return generate(user_prompt)
 
 
 
 
113
 
114
  async def run_pipeline(self):
115
  await self.workflow_pre_config()
 
104
  Generate a safe filename based on the provided prompt using Gemini.
105
  Returns a string suitable for use as a filename (lowercase, underscores, no special chars).
106
  """
107
+ try:
108
+ user_prompt = """Generate one unique luxury b-roll video title (2-4 words) that matches this tone:
109
+ "Golden Hour Aesthetic", "Luxury Lifestyle Vibes", "Rich Life Moments", "Elite Daily Routine", "Opulent Living"
110
+ Style: Aspirational, elegant, visually evocative. Use words like: golden, elite, lavish, premium, refined, curated, timeless + aesthetic, vibes, moments, living, lifestyle, routine, dreams, essence.
111
+ Patterns: [Adjective + Noun], [Time/Place + Vibe], [Quality + Element]
112
+ Output only the title, nothing else."""
113
+ return generate(user_prompt)
114
+ except Exception as e:
115
+ logger.error("Failed to generate b-roll filename: %s", e)
116
+ return None
117
 
118
  async def run_pipeline(self):
119
  await self.workflow_pre_config()