-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtest_echo.py
44 lines (35 loc) · 1.46 KB
/
test_echo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from selenium_interface import SeleniumInterface
import logging
import time
def main():
# Set up logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
# Initialize interface
interface = SeleniumInterface()
try:
# Initialize browser
if not interface.init():
logger.error("Failed to initialize browser")
return
# Test message
test_message = "What are the key principles of recursive algorithms?"
# Send message and get response with echo analysis
response, echo_analysis = interface.send_message(test_message)
if response and echo_analysis:
logger.info("Response received successfully")
logger.info(f"Echo Analysis Results:")
logger.info(f"Total Nodes: {echo_analysis['total_nodes']}")
logger.info(f"Average Echo: {echo_analysis['avg_echo']:.3f}")
logger.info(f"Maximum Echo: {echo_analysis['max_echo']:.3f}")
logger.info(f"Resonant Nodes: {echo_analysis['resonant_nodes']}")
logger.info(f"Tree Depth: {echo_analysis['depth']}")
else:
logger.error("Failed to get response or analyze echoes")
except Exception as e:
logger.error(f"Error in test: {str(e)}")
finally:
# Don't close the browser to keep the session alive
pass
if __name__ == "__main__":
main()