Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -97,8 +97,9 @@ async def run_agent_query(user_query: str, thread_id: str):
|
|
| 97 |
if not thread_id:
|
| 98 |
raise ValueError("thread_id is required and must be provided by the UI.")
|
| 99 |
|
| 100 |
-
|
|
|
|
| 101 |
# ✅ Initialize SQLite session
|
| 102 |
session = SQLiteSession(thread_id, "tmp/conversations.db")
|
| 103 |
|
| 104 |
-
return await Runner.run(agent, user_query, session=session)
|
|
|
|
| 97 |
if not thread_id:
|
| 98 |
raise ValueError("thread_id is required and must be provided by the UI.")
|
| 99 |
|
| 100 |
+
os.makedirs("tmp", exist_ok=True)
|
| 101 |
+
|
| 102 |
# ✅ Initialize SQLite session
|
| 103 |
session = SQLiteSession(thread_id, "tmp/conversations.db")
|
| 104 |
|
| 105 |
+
return await Runner.run(agent, user_query, session=session)
|