Skip to content

Commit fec907e

Browse files
committed
fix action prompt and prompt event actions
1 parent 6431609 commit fec907e

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

taleweave/models/event.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class PromptEvent(BaseModel):
6060
A prompt for a character to take an action.
6161
"""
6262

63-
actions: Dict[str, Any]
63+
actions: List[Dict[str, Any]]
6464
prompt: str
6565
room: Room
6666
character: Character

taleweave/player.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def __call__(self, prompt: str, toolbox: Toolbox | None = None, **kwargs) -> str
197197
Ask the player for input.
198198
"""
199199

200-
actions = {}
200+
actions = []
201201
formatted_prompt = prompt.format(**kwargs)
202202
if toolbox:
203203
actions = toolbox.list_definitions()

taleweave/simulate.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -132,19 +132,19 @@ def result_parser(value, **kwargs):
132132
logger.info("starting turn for character: %s", character.name)
133133
result = loop_retry(
134134
agent,
135-
get_prompt("world_simulate_character_action"),
136-
context={
137-
"actions": action_names,
138-
"character_items": character_items,
139-
"attributes": character_attributes,
140-
"directions": room_directions,
141-
"room_name": room.name,
142-
"room_description": describe_entity(room),
143-
"visible_characters": room_characters,
144-
"visible_items": room_items,
145-
"notes_prompt": notes_prompt,
146-
"events_prompt": events_prompt,
147-
},
135+
format_prompt(
136+
"world_simulate_character_action",
137+
actions=action_names,
138+
character_items=character_items,
139+
attributes=character_attributes,
140+
directions=room_directions,
141+
room_name=room.name,
142+
room_description=describe_entity(room),
143+
visible_characters=room_characters,
144+
visible_items=room_items,
145+
notes_prompt=notes_prompt,
146+
events_prompt=events_prompt,
147+
),
148148
result_parser=result_parser,
149149
toolbox=action_toolbox,
150150
)

0 commit comments

Comments
 (0)