File size: 1,568 Bytes
2dfc473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""Showrunner agent - Orchestrator for content generation."""
from typing import Any, Dict
from base_agent import BaseAgent


class ShowrunnerAgent(BaseAgent):
    """Orchestrator agent that translates briefs into actionable directives."""

    def __init__(self):
        """Initialize the Showrunner agent."""
        system_prompt = (
            "You are the Showrunner. Given a brief, produce a tight episode directive: "
            "premise, tone, which characters are featured, and the emotional core. "
            "Keep it under 200 words. Output only the directive as a JSON object with keys: "
            "episode_directive, story_premise, tone_brief, character_focus_notes."
        )
        super().__init__(
            agent_id="showrunner",
            agent_name="Showrunner",
            system_prompt=system_prompt,
        )

    def generate_directive(self, inputs: Dict[str, Any]) -> Dict[str, Any]:
        """Generate episode directive from user brief.

        Args:
            inputs: Dictionary with keys:
                - user_brief: The initial brief
                - season_arc_document: Season context
                - character_bible: Character definitions

        Returns:
            Dictionary with generated directive and related outputs
        """
        outputs = self.process(inputs)
        
        # Save state
        self.save_state(
            {
                "inputs": inputs,
                "outputs": outputs,
            },
            filename="directive.json",
        )
        
        return outputs