rwayz commited on
Commit
e3f25fd
·
verified ·
1 Parent(s): 4995be9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -213,11 +213,12 @@ builder.add_edge("execute_sql", "refine")
213
  builder.add_edge("refine", END)
214
 
215
  memory = SqliteSaver("graph_checkpoint")
216
- graph = builder.compile(checkpointer=memory, config={"configurable": {"question"}})
217
 
218
  async def async_chatbot_response(question, model_name):
219
  inputs = {"question": question}
220
- result = await graph.ainvoke(inputs)
 
221
  return result["result"]
222
 
223
  def toggle_history():
 
213
  builder.add_edge("refine", END)
214
 
215
  memory = SqliteSaver("graph_checkpoint")
216
+ graph = builder.compile(checkpointer=memory)
217
 
218
  async def async_chatbot_response(question, model_name):
219
  inputs = {"question": question}
220
+ thread_id = str(uuid4()) # ← ID único da sessão para o checkpoint funcionar
221
+ result = await graph.ainvoke(inputs, {"configurable": {"thread_id": thread_id}})
222
  return result["result"]
223
 
224
  def toggle_history():