Update app.py
Browse files
app.py
CHANGED
@@ -255,8 +255,9 @@ def parse_vectorstore_response(response_text):
|
|
255 |
# Konvertiere metadata in ein Dictionary
|
256 |
metadata = {}
|
257 |
for item in metadata_str.split(', '):
|
258 |
-
|
259 |
-
|
|
|
260 |
|
261 |
parsed_entries.append({
|
262 |
"page_content": page_content,
|
@@ -321,7 +322,7 @@ def generate_auswahl(prompt_in, file, file_history, chatbot, history, anzahl_doc
|
|
321 |
print("text..............."+str(text))
|
322 |
entry = create_history_entry(text['page_content'], text['metadata'])
|
323 |
print("hier...........................")
|
324 |
-
history = history + [[
|
325 |
|
326 |
return chatbot, history, None, file_history, ""
|
327 |
|
|
|
255 |
# Konvertiere metadata in ein Dictionary
|
256 |
metadata = {}
|
257 |
for item in metadata_str.split(', '):
|
258 |
+
if ': ' in item:
|
259 |
+
key, value = item.split(': ', 1)
|
260 |
+
metadata[key.strip("'")] = value.strip("'")
|
261 |
|
262 |
parsed_entries.append({
|
263 |
"page_content": page_content,
|
|
|
322 |
print("text..............."+str(text))
|
323 |
entry = create_history_entry(text['page_content'], text['metadata'])
|
324 |
print("hier...........................")
|
325 |
+
history = history + [[prompt_in, entry]]
|
326 |
|
327 |
return chatbot, history, None, file_history, ""
|
328 |
|