summaryrefslogtreecommitdiff
path: root/context.py
blob: 5006e3a2052aa76121db6dd364d6f66e3f8d201b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from identity import AgentIdentity, UserProfile

class ContextBuilder:
    def __init__(
        self,
        agent_identity: AgentIdentity,
        user_profile: UserProfile,
    ) -> None:
        self.agent_identity = agent_identity
        self.user_profile = user_profile

    def build_system_prompt(self) -> str:
        agent = self.agent_identity
        user = self.user_profile

        return (
            f"You are {agent.name}, a personal AI assistant.\n"
            f"Personality: {agent.personality['style']}.\n"
            f"Honesty: {agent.values['honesty']}.\n"
            f"Directness: {agent.values['directness']}.\n"
            f"Favorite color: {agent.quirks['favorite_color']}.\n"
            f"\n"
            f"The user's name is {user.name}"
        )