blob: 4a65f57047117d134509a793b163287f4dbb26d7 (
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
25
|
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}"
)
|