Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1837,8 +1837,17 @@ def create_interface():
|
|
| 1837 |
gr.Markdown("## Your Personalized Learning Assistant")
|
| 1838 |
gr.Markdown("Ask me anything about studying, your courses, grades, or learning strategies.")
|
| 1839 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1840 |
chatbot = gr.ChatInterface(
|
| 1841 |
-
fn=
|
| 1842 |
examples=[
|
| 1843 |
"How should I study for my next math test?",
|
| 1844 |
"What's my current GPA?",
|
|
|
|
| 1837 |
gr.Markdown("## Your Personalized Learning Assistant")
|
| 1838 |
gr.Markdown("Ask me anything about studying, your courses, grades, or learning strategies.")
|
| 1839 |
|
| 1840 |
+
# Create a wrapper function that properly awaits the async function
|
| 1841 |
+
async def chat_wrapper(message: str, history: List[List[str]]):
|
| 1842 |
+
response = await teaching_assistant.generate_response(
|
| 1843 |
+
message,
|
| 1844 |
+
history,
|
| 1845 |
+
session_token.value
|
| 1846 |
+
)
|
| 1847 |
+
return response
|
| 1848 |
+
|
| 1849 |
chatbot = gr.ChatInterface(
|
| 1850 |
+
fn=chat_wrapper,
|
| 1851 |
examples=[
|
| 1852 |
"How should I study for my next math test?",
|
| 1853 |
"What's my current GPA?",
|