fdaudens HF Staff commited on
Commit
bbe3a90
·
verified ·
1 Parent(s): 7904884

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -117,7 +117,13 @@ agent = CodeAgent(
117
  prompt_templates=prompt_templates
118
  )
119
 
120
- # Launch the Gradio interface
 
 
 
 
 
 
121
  if __name__ == "__main__":
122
- ui = GradioUI(agent)
123
- ui.launch(reset_agent_memory=True) # This will reset the conversation for each new query
 
117
  prompt_templates=prompt_templates
118
  )
119
 
120
+ # Create a modified version of GradioUI that always resets the conversation
121
+ class ResetGradioUI(GradioUI):
122
+ def interact_with_agent(self, prompt):
123
+ # Override the interact_with_agent method to always reset
124
+ return super().interact_with_agent(prompt, reset_agent_memory=True)
125
+
126
+ # Launch the modified Gradio interface
127
  if __name__ == "__main__":
128
+ ui = ResetGradioUI(agent)
129
+ ui.launch(debug=True, share=True) # Remove reset_agent_memory from launch parameters