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, 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()
|
@@ -363,7 +363,7 @@ def generate_text_zu_bild(file, prompt, k, rag_option, chatbot, history, db):
|
|
363 |
#als reiner prompt:
|
364 |
prompt_neu = generate_prompt_with_history(neu_text_mit_chunks, history)
|
365 |
|
366 |
-
headers, payload = process_image(file, prompt_neu, MODEL_NAME_IMAGE)
|
367 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
368 |
#als json ausgeben
|
369 |
data = response.json()
|
|
|
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, OAI_API_KEY)
|
132 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
133 |
#als json ausgeben
|
134 |
data = response.json()
|
|
|
363 |
#als reiner prompt:
|
364 |
prompt_neu = generate_prompt_with_history(neu_text_mit_chunks, history)
|
365 |
|
366 |
+
headers, payload = process_image(file, prompt_neu, MODEL_NAME_IMAGE, OAI_API_KEY)
|
367 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
368 |
#als json ausgeben
|
369 |
data = response.json()
|