Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -356,7 +356,7 @@ class Educational_Agent:
|
|
| 356 |
logger.error(f"Error in tool processing: {e}")
|
| 357 |
return f"I apologize, but I encountered an error while processing your request: {str(e)}"
|
| 358 |
|
| 359 |
-
def process_without_tools(self, query: str) -> str:
|
| 360 |
"""Process query without tools"""
|
| 361 |
try:
|
| 362 |
# Include recent conversation in prompt
|
|
@@ -529,7 +529,7 @@ def clear_chat():
|
|
| 529 |
"""Clear the chat history."""
|
| 530 |
global agent
|
| 531 |
if agent is not None:
|
| 532 |
-
agent.
|
| 533 |
return [], ""
|
| 534 |
|
| 535 |
def warmup_agent():
|
|
@@ -542,8 +542,8 @@ def warmup_agent():
|
|
| 542 |
test_response = current_agent.chat("Hello, this is a warmup test.")
|
| 543 |
logger.info(f"Agent warmup completed successfully! Test response length: {len(test_response)} chars")
|
| 544 |
|
| 545 |
-
# Clear any test data from
|
| 546 |
-
current_agent.
|
| 547 |
|
| 548 |
except Exception as e:
|
| 549 |
logger.error(f"Agent warmup failed: {e}")
|
|
|
|
| 356 |
logger.error(f"Error in tool processing: {e}")
|
| 357 |
return f"I apologize, but I encountered an error while processing your request: {str(e)}"
|
| 358 |
|
| 359 |
+
def process_without_tools(self, query: str) -> str:
|
| 360 |
"""Process query without tools"""
|
| 361 |
try:
|
| 362 |
# Include recent conversation in prompt
|
|
|
|
| 529 |
"""Clear the chat history."""
|
| 530 |
global agent
|
| 531 |
if agent is not None:
|
| 532 |
+
agent.conversation_history.clear()
|
| 533 |
return [], ""
|
| 534 |
|
| 535 |
def warmup_agent():
|
|
|
|
| 542 |
test_response = current_agent.chat("Hello, this is a warmup test.")
|
| 543 |
logger.info(f"Agent warmup completed successfully! Test response length: {len(test_response)} chars")
|
| 544 |
|
| 545 |
+
# Clear any test data from conversation history
|
| 546 |
+
current_agent.conversation_history.clear()
|
| 547 |
|
| 548 |
except Exception as e:
|
| 549 |
logger.error(f"Agent warmup failed: {e}")
|