-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathtest_prompt.py
38 lines (32 loc) · 1.06 KB
/
test_prompt.py
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
from gigax.parse import CharacterAction
from gigax.prompt import NPCPrompt
from gigax.scene import Character, Item, Location, ProtagonistCharacter
def test_prompt(
context: str,
locations: list[Location],
NPCs: list[Character],
protagonist: ProtagonistCharacter,
items: list[Item],
events: list[CharacterAction],
):
prompt = NPCPrompt(context, locations, NPCs, protagonist, items, events)
assert prompt
test_prompt = """- WORLD KNOWLEDGE: A vast open world full of mystery and adventure.
- KNOWN LOCATIONS: Old Town
- NPCS: John the Brave
- CURRENT LOCATION: Old Town: A quiet and peaceful town.
- CURRENT LOCATION ITEMS: Sword
- LAST EVENTS:
Aldren: Say Sword What a fine sword!
- PROTAGONIST NAME: Aldren
- PROTAGONIST PSYCHOLOGICAL PROFILE: Brave and curious
- PROTAGONIST MEMORIES:
Saved the village
Lost a friend
- PROTAGONIST PENDING QUESTS:
Find the ancient artifact
Defeat the evil warlock
- PROTAGONIST ALLOWED ACTIONS:
Attack <character> : Deliver a powerful blow
Aldren:"""
assert prompt == test_prompt, f"{prompt} != {test_prompt}"