Skip to content

Commit 5482bca

Browse files
jzleibocopybara-github
authored andcommitted
Fix save path and format for AI companionship simulations
PiperOrigin-RevId: 908045971 Change-Id: Iacd3c754d96f1ca77b09a0fdf183c2d2f62be829
1 parent 88f8f47 commit 5482bca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

examples/conversation_with_ai_companion/shared_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ def run_simulation(
185185
safe_name = scenario_name.lower().replace(" ", "_")
186186
dialog_filename = f"{safe_name}_{timestamp}_dialog.txt"
187187
dialog_path = os.path.join(output_dir, dialog_filename)
188-
with open(dialog_path, "w") as f:
188+
os.makedirs(output_dir, exist_ok=True)
189+
with open(dialog_path, "w", encoding="utf-8") as f:
189190
f.write(dialog_text)
190191
print(f"Dialog transcript saved to: {dialog_path}")
191192
except Exception as e: # pylint: disable=broad-except

0 commit comments

Comments
 (0)