Terry Zhuo commited on
Commit
eaad5be
·
1 Parent(s): 420fd88
Files changed (1) hide show
  1. azure_count_ip_data.py +4 -1
azure_count_ip_data.py CHANGED
@@ -162,9 +162,12 @@ def get_file_data(content: str) -> Tuple[Optional[str], Optional[str], bool]:
162
  lines = [line.strip() for line in content.split('\n') if line.strip()]
163
  try:
164
  user_prompt = json.loads(lines[0])["state"]["messages"][0][1]
 
 
165
  except Exception as e:
166
- log.error(json.loads(lines[0]))
167
  user_prompt = ""
 
168
  if not lines:
169
  return None, None, False, user_prompt
170
 
 
162
  lines = [line.strip() for line in content.split('\n') if line.strip()]
163
  try:
164
  user_prompt = json.loads(lines[0])["state"]["messages"][0][1]
165
+ if isinstance(user_prompt, list):
166
+ user_prompt = user_prompt[0]
167
  except Exception as e:
168
+ log.error(lines[0])
169
  user_prompt = ""
170
+
171
  if not lines:
172
  return None, None, False, user_prompt
173