Update app.py
Browse files
app.py
CHANGED
@@ -121,7 +121,12 @@ def transcribe(audio, text):
|
|
121 |
)["choices"][0]["message"]
|
122 |
|
123 |
messages.append({"role": "system", "content": str(system_message['content'])})
|
124 |
-
messages_rev.append({"role": "system", "content": str(system_message['content'])})
|
|
|
|
|
|
|
|
|
|
|
125 |
chat_transcript = f"\n\nNumber of tokens used: {num_tokens}\n\n"
|
126 |
|
127 |
# Concatenate the chat history
|
|
|
121 |
)["choices"][0]["message"]
|
122 |
|
123 |
messages.append({"role": "system", "content": str(system_message['content'])})
|
124 |
+
# messages_rev.append({"role": "system", "content": str(system_message['content'])})
|
125 |
+
# Add the system message to the beginning of the messages list
|
126 |
+
messages_rev.insert(0, system_message)
|
127 |
+
# Add the input text to the messages list
|
128 |
+
messages_rev.insert(0, {"role": "user", "content": input_text + transcript["text"]})
|
129 |
+
|
130 |
chat_transcript = f"\n\nNumber of tokens used: {num_tokens}\n\n"
|
131 |
|
132 |
# Concatenate the chat history
|