Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -87,7 +87,7 @@ def generate_summary(transcript_text: str) -> str:
|
|
87 |
def get_chat_response(transcript_text: str, conversation_history: list, user_query: str) -> str:
|
88 |
"""Generate a chat response using the transcript as context."""
|
89 |
messages = conversation_history + [
|
90 |
-
{"role": "user", "content": f"Based on the
|
91 |
]
|
92 |
completion = client.chat.completions.create(model="gpt-4o-mini", messages=messages)
|
93 |
return completion.choices[0].message.content.strip()
|
|
|
87 |
def get_chat_response(transcript_text: str, conversation_history: list, user_query: str) -> str:
|
88 |
"""Generate a chat response using the transcript as context."""
|
89 |
messages = conversation_history + [
|
90 |
+
{"role": "user", "content": f"Based on the video transcript:\n\n{transcript_text}\n\nQuestion: {user_query}"}
|
91 |
]
|
92 |
completion = client.chat.completions.create(model="gpt-4o-mini", messages=messages)
|
93 |
return completion.choices[0].message.content.strip()
|