Rulga commited on
Commit
6ea2d23
·
1 Parent(s): 9d8b276

Update get_chat_history to specify repo_type for dataset file listing

Browse files
Files changed (1) hide show
  1. src/analytics/chat_evaluator.py +3 -2
src/analytics/chat_evaluator.py CHANGED
@@ -69,15 +69,16 @@ class ChatEvaluator:
69
  logger.error(f"Error ensuring dataset structure: {e}")
70
  raise
71
 
 
72
  def get_chat_history(self) -> List[Dict[str, Any]]:
73
  """
74
  Get all chat histories from the dataset
75
  """
76
  try:
77
  # Get list of all files in chat history directory
78
- files = self.api.list_repo_files(self.dataset_id)
79
  logger.info(f"All files in dataset:\n" + "\n".join(f" - {f}" for f in files))
80
-
81
  # Filter for chat history files
82
  chat_path = f"{self.chat_history_path}/"
83
  chat_files = [f for f in files if f.startswith(chat_path) and f.endswith('.json')]
 
69
  logger.error(f"Error ensuring dataset structure: {e}")
70
  raise
71
 
72
+
73
  def get_chat_history(self) -> List[Dict[str, Any]]:
74
  """
75
  Get all chat histories from the dataset
76
  """
77
  try:
78
  # Get list of all files in chat history directory
79
+ files = self.api.list_repo_files(self.dataset_id, repo_type="dataset")
80
  logger.info(f"All files in dataset:\n" + "\n".join(f" - {f}" for f in files))
81
+
82
  # Filter for chat history files
83
  chat_path = f"{self.chat_history_path}/"
84
  chat_files = [f for f in files if f.startswith(chat_path) and f.endswith('.json')]