Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pyob/prompts_and_memory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import random
import re

from pyob.core_utils import logger
Expand Down Expand Up @@ -55,8 +56,6 @@ def load_prompt(self, filename: str, **kwargs: str) -> str:
path_b = os.path.join(data_dir, f"{base_name}.vB{ext}")

if os.path.exists(path_a) and os.path.exists(path_b):
import random

chosen_version = random.choice(["vA", "vB"])
filepath = path_a if chosen_version == "vA" else path_b
logger.info(f"A/B Testing: Selected {chosen_version} for prompt {filename}")
Expand Down Expand Up @@ -145,6 +144,7 @@ def _get_rich_context(self, query_text: str = "") -> str:
return context

def update_memory(self) -> None:
# type: ignore
session_context: list[str] = getattr(self, "session_context", [])
if not session_context:
return
Expand Down
Loading