iamrobotbear commited on
Commit
a57d622
·
verified ·
1 Parent(s): 23d19f4

Update query.py

Browse files
Files changed (1) hide show
  1. query.py +2 -0
query.py CHANGED
@@ -70,6 +70,7 @@ class VectaraQuery():
70
  for line in response.iter_lines():
71
  if line: # filter out keep-alive new lines
72
  data = json.loads(line.decode('utf-8'))
 
73
 
74
  if 'result' not in data:
75
  continue
@@ -85,6 +86,7 @@ class VectaraQuery():
85
  if 'text' not in result:
86
  continue
87
  text = result['text']
 
88
  # Extract relevant information from the text
89
  reason_match = re.search(r"Reason Why it Can't be Used: (.*?)\n", text)
90
  alternative_match = re.search(r"Alternative: (.*?)\n", text)
 
70
  for line in response.iter_lines():
71
  if line: # filter out keep-alive new lines
72
  data = json.loads(line.decode('utf-8'))
73
+ print(f"Received data chunk: {json.dumps(data, indent=2)}") # Debugging line
74
 
75
  if 'result' not in data:
76
  continue
 
86
  if 'text' not in result:
87
  continue
88
  text = result['text']
89
+ print(f"Processing text: {text}") # Debugging line
90
  # Extract relevant information from the text
91
  reason_match = re.search(r"Reason Why it Can't be Used: (.*?)\n", text)
92
  alternative_match = re.search(r"Alternative: (.*?)\n", text)