gufett0 commited on
Commit
07ea5ca
·
1 Parent(s): 96e470d

added introductory prompt

Browse files
Files changed (1) hide show
  1. backend.py +5 -5
backend.py CHANGED
@@ -137,21 +137,21 @@ def handle_query(query_str: str,
137
  #response = chat_engine.chat(query_str)
138
 
139
  for token in response.response_gen:
140
- if not token.startswith("system:") and not token.startswith("user:"):
141
- if token.startswith("file_path:"):
142
- sources.append(token)
143
 
144
  outputs.append(token)
145
  print(f"Generated token: {token}")
146
  yield "".join(outputs)
147
 
148
- if sources:
149
  sources_str = ", ".join(sources)
150
  outputs.append(f"Fonti utilizzate: {sources_str}")
151
  else:
152
  outputs.append("Nessuna fonte specifica utilizzata.")
153
 
154
- yield "".join(outputs)
155
 
156
 
157
  except Exception as e:
 
137
  #response = chat_engine.chat(query_str)
138
 
139
  for token in response.response_gen:
140
+ #if not token.startswith("system:") and not token.startswith("user:"):
141
+ #if token.startswith("file_path:"):
142
+ #sources.append(token)
143
 
144
  outputs.append(token)
145
  print(f"Generated token: {token}")
146
  yield "".join(outputs)
147
 
148
+ """if sources:
149
  sources_str = ", ".join(sources)
150
  outputs.append(f"Fonti utilizzate: {sources_str}")
151
  else:
152
  outputs.append("Nessuna fonte specifica utilizzata.")
153
 
154
+ yield "".join(outputs)"""
155
 
156
 
157
  except Exception as e: