ArchiveAds commited on
Commit
460e653
·
verified ·
1 Parent(s): aa56583

Create agent_02_screenwriter.py

Browse files
Files changed (1) hide show
  1. agent_02_screenwriter.py +42 -0
agent_02_screenwriter.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from crewai import Agent, Task
2
+
3
+ # MODULE: AGENT 02 - THE SCREENWRITER
4
+ # Responsibility: Turn the brief into a concrete script.
5
+ # Address: Root Folder / agent_02_screenwriter.py
6
+
7
+ class ScreenwriterUnit:
8
+ def __init__(self):
9
+ # This path is where the Librarian puts writing guides
10
+ self.knowledge_path = "/data/knowledge/writer"
11
+
12
+ def create_agent(self):
13
+ return Agent(
14
+ role='Lead Screenwriter',
15
+ goal='Write a high-retention script with clear visual cues.',
16
+ backstory="""You are a Hollywood screenwriter specializing in short-form content.
17
+ You focus on the first 3 seconds (The Hook).
18
+ You write in a dual-column format (Audio vs Visual).
19
+ You strictly follow the Creative Brief provided by the Strategist.""",
20
+ verbose=True,
21
+ allow_delegation=False,
22
+ llm='ollama/llama3:70b'
23
+ )
24
+
25
+ def create_task(self, creative_brief):
26
+ return Task(
27
+ description=f"""
28
+ Using the provided Creative Brief, write a 60-second Video Script.
29
+
30
+ Format Requirements:
31
+ - SECTION 1: The Hook (0-3 seconds) - Must be visually shocking.
32
+ - SECTION 2: The Retension (3-15 seconds) - Open a loop.
33
+ - SECTION 3: The Payoff (15-50 seconds) - Deliver value.
34
+ - SECTION 4: The CTA (50-60 seconds).
35
+
36
+ Output strictly in this format:
37
+ [TIME] | [VISUAL DESCRIPTION] | [AUDIO/DIALOGUE]
38
+ """,
39
+ agent=self.create_agent(),
40
+ context=[creative_brief], # This specifically links it to the previous task's output
41
+ expected_output="A dual-column video script with timestamps."
42
+ )