Update app.py
Browse files
app.py
CHANGED
|
@@ -128,7 +128,7 @@ def clear_all(history):
|
|
| 128 |
dic_history = {schluessel: wert for schluessel, wert in history}
|
| 129 |
summary = "\n".join(f'{schluessel}: {wert}' for schluessel, wert in dic_history.items())
|
| 130 |
#schlagwort finden zu dem chatverlauf
|
| 131 |
-
headers, payload = process_chatverlauf(summary)
|
| 132 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
| 133 |
#als json ausgeben
|
| 134 |
data = response.json()
|
|
@@ -136,7 +136,7 @@ def clear_all(history):
|
|
| 136 |
result = data['choices'][0]['message']['content']
|
| 137 |
|
| 138 |
#chat hinzufügen zu den chatverläufen und in GUI anzeigen
|
| 139 |
-
id_neu = len(chats)+1
|
| 140 |
#chats ist ein dictionary
|
| 141 |
chats[id_neu]= summary
|
| 142 |
|
|
|
|
| 128 |
dic_history = {schluessel: wert for schluessel, wert in history}
|
| 129 |
summary = "\n".join(f'{schluessel}: {wert}' for schluessel, wert in dic_history.items())
|
| 130 |
#schlagwort finden zu dem chatverlauf
|
| 131 |
+
headers, payload = process_chatverlauf(summary, MODEL_NAME)
|
| 132 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
| 133 |
#als json ausgeben
|
| 134 |
data = response.json()
|
|
|
|
| 136 |
result = data['choices'][0]['message']['content']
|
| 137 |
|
| 138 |
#chat hinzufügen zu den chatverläufen und in GUI anzeigen
|
| 139 |
+
id_neu = result #len(chats)+1
|
| 140 |
#chats ist ein dictionary
|
| 141 |
chats[id_neu]= summary
|
| 142 |
|