Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -117,7 +117,13 @@ agent = CodeAgent(
|
|
117 |
prompt_templates=prompt_templates
|
118 |
)
|
119 |
|
120 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
if __name__ == "__main__":
|
122 |
-
ui =
|
123 |
-
ui.launch(
|
|
|
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
|