-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathluxury_concierge.py
More file actions
60 lines (48 loc) · 1.75 KB
/
luxury_concierge.py
File metadata and controls
60 lines (48 loc) · 1.75 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
"""
Assembly Strategy Showcase: Same character, different behaviors.
Demonstrates how strategy="concierge" vs strategy="task_focused"
produces dramatically different agent behavior from the SAME character data.
Requirements: pip install hippodid anthropic
"""
import anthropic
from hippodid import HippoDid
hd = HippoDid(api_key="hd_your_key")
claude = anthropic.Anthropic()
CHAR_ID = "your-character-uuid" # a character with rich profile + memories
USER_MSG = "I need to book a dinner for tomorrow"
def ask_with_strategy(strategy: str) -> str:
"""Ask the same question using different assembly strategies."""
context = hd.assemble_context(
CHAR_ID,
USER_MSG,
strategy=strategy,
max_context_tokens=4000,
)
response = claude.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=512,
system=context.formatted_prompt,
messages=[{"role": "user", "content": USER_MSG}],
)
return response.content[0].text
if __name__ == "__main__":
# Concierge: warm, proactive, preference-heavy
print("=" * 60)
print("CONCIERGE STRATEGY")
print("=" * 60)
print(ask_with_strategy("concierge"))
# Expected: "Based on your love of Italian food and preference for quiet
# restaurants, I'd suggest Osteria Francescana. Shall I book your usual
# corner table for 7:30pm? I remember you prefer the tasting menu."
print()
# Task-focused: direct, rules-heavy, action-oriented
print("=" * 60)
print("TASK-FOCUSED STRATEGY")
print("=" * 60)
print(ask_with_strategy("task_focused"))
# Expected: "To book dinner for tomorrow, I need:
# 1. Number of guests
# 2. Preferred cuisine
# 3. Time
# 4. Budget range
# Please provide these details."