Spaces:
Runtime error
Runtime error
Update utils/helpers.py
Browse files- utils/helpers.py +13 -2
utils/helpers.py
CHANGED
|
@@ -5,18 +5,29 @@ Clean, modular implementation with specialized agents and memory
|
|
| 5 |
|
| 6 |
from agents import route_to_agent, get_agent, AgentCoordinator
|
| 7 |
import logging
|
|
|
|
| 8 |
|
| 9 |
-
# Setup logging
|
| 10 |
logger = logging.getLogger(__name__)
|
| 11 |
logging.basicConfig(
|
| 12 |
level=logging.DEBUG,
|
| 13 |
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 14 |
handlers=[
|
| 15 |
-
logging.FileHandler('logs/chat_debug.log'),
|
| 16 |
logging.StreamHandler()
|
| 17 |
]
|
| 18 |
)
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Constants
|
| 21 |
MAX_MESSAGE_LENGTH = 2000
|
| 22 |
MIN_MESSAGE_LENGTH = 2
|
|
|
|
| 5 |
|
| 6 |
from agents import route_to_agent, get_agent, AgentCoordinator
|
| 7 |
import logging
|
| 8 |
+
import os
|
| 9 |
|
|
|
|
| 10 |
logger = logging.getLogger(__name__)
|
| 11 |
logging.basicConfig(
|
| 12 |
level=logging.DEBUG,
|
| 13 |
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 14 |
handlers=[
|
| 15 |
+
logging.FileHandler('logs/chat_debug.log', mode='a', encoding='utf-8'),
|
| 16 |
logging.StreamHandler()
|
| 17 |
]
|
| 18 |
)
|
| 19 |
|
| 20 |
+
# Setup logging
|
| 21 |
+
# logger = logging.getLogger(__name__)
|
| 22 |
+
# logging.basicConfig(
|
| 23 |
+
# level=logging.DEBUG,
|
| 24 |
+
# format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
| 25 |
+
# handlers=[
|
| 26 |
+
# logging.FileHandler('logs/chat_debug.log'),
|
| 27 |
+
# logging.StreamHandler()
|
| 28 |
+
# ]
|
| 29 |
+
# )
|
| 30 |
+
|
| 31 |
# Constants
|
| 32 |
MAX_MESSAGE_LENGTH = 2000
|
| 33 |
MIN_MESSAGE_LENGTH = 2
|