michael-agent 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ """
2
+ SmartRecruitAgent - A recruitment automation library
3
+ """
4
+
5
+ # Import key modules for easier access
6
+ from .monitor import main as monitor_main
7
+ from .main import main as agent_main
michael_agent/main.py ADDED
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SmartRecruitAgent - Main Entry Point
4
+ Starts both the LangGraph workflow and Flask dashboard concurrently
5
+ """
6
+
7
+ import os
8
+ import threading
9
+ import time
10
+ import logging
11
+ import traceback
12
+ from datetime import datetime
13
+ from dotenv import load_dotenv
14
+
15
+ # Load environment variables first
16
+ load_dotenv()
17
+
18
+ # Then import settings which may depend on environment variables
19
+ from .config import settings
20
+
21
+ # Import our logging utilities early to set up logging
22
+ from .utils.logging_utils import workflow_logger as logger
23
+
24
+ def ensure_directories():
25
+ """Ensure all required directories exist"""
26
+ required_directories = [
27
+ settings.RESUME_WATCH_DIR,
28
+ settings.OUTPUT_DIR,
29
+ settings.LOG_DIR,
30
+ os.path.join(settings.LOG_DIR, "snapshots"),
31
+ settings.LANGGRAPH_CHECKPOINT_DIR,
32
+ settings.JOB_DESCRIPTIONS_DIR
33
+ ]
34
+
35
+ for directory in required_directories:
36
+ os.makedirs(directory, exist_ok=True)
37
+ logger.info(f"Ensured directory exists: {directory}")
38
+
39
+ # Import node tracer after directories are created
40
+ from .utils import node_tracer
41
+
42
+ def start_langgraph():
43
+ """Start the LangGraph workflow in a separate thread"""
44
+ try:
45
+ from .langgraph_workflow.graph_builder import start_workflow
46
+ logger.info("Starting LangGraph workflow engine...")
47
+ langgraph_app = start_workflow()
48
+
49
+ # Keep the thread alive with a simple loop
50
+ while True:
51
+ time.sleep(10)
52
+ except Exception as e:
53
+ logger.error(f"Error starting LangGraph workflow: {str(e)}")
54
+ logger.error(traceback.format_exc())
55
+
56
+ def start_flask_dashboard():
57
+ """Start the Flask dashboard in a separate thread"""
58
+ try:
59
+ from .dashboard.app import app, socketio
60
+ port = int(os.getenv("FLASK_PORT", 5000))
61
+ logger.info(f"Starting Flask dashboard on port {port}...")
62
+ socketio.run(app, host='0.0.0.0', port=port, debug=False, allow_unsafe_werkzeug=True)
63
+ except Exception as e:
64
+ logger.error(f"Error starting Flask dashboard: {str(e)}")
65
+ logger.error(traceback.format_exc())
66
+
67
+ def main():
68
+ """Main entry point for the application"""
69
+ logger.info("=" * 50)
70
+ logger.info("🚀 Starting SmartRecruitAgent")
71
+ logger.info(f"Date/Time: {datetime.now().isoformat()}")
72
+ logger.info("=" * 50)
73
+
74
+ ensure_directories()
75
+
76
+ port = int(os.getenv("FLASK_PORT", 5000))
77
+ logger.info(f"Dashboard will be available at: http://localhost:{port}")
78
+
79
+ try:
80
+ # Start LangGraph in a separate thread
81
+ langgraph_thread = threading.Thread(target=start_langgraph, name="LangGraphThread")
82
+ langgraph_thread.daemon = True
83
+ langgraph_thread.start()
84
+
85
+ # Give LangGraph more time to initialize
86
+ logger.info("Waiting for LangGraph to initialize...")
87
+ time.sleep(5)
88
+
89
+ logger.info("LangGraph initialization complete")
90
+
91
+ # Start Flask dashboard in the main thread
92
+ logger.info("Starting Flask dashboard in main thread...")
93
+ start_flask_dashboard()
94
+ except KeyboardInterrupt:
95
+ logger.info("Shutdown requested by user (Ctrl+C)")
96
+ except Exception as e:
97
+ logger.error(f"Fatal error in main: {str(e)}")
98
+ logger.error(traceback.format_exc())
99
+ finally:
100
+ logger.info("SmartRecruitAgent shutting down...")
101
+
102
+ if __name__ == "__main__":
103
+ main()
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ SmartRecruitAgent Workflow Monitor CLI
4
+ Command-line utility for monitoring workflow progress
5
+ """
6
+
7
+ import os
8
+ import sys
9
+ import time
10
+ import argparse
11
+ import logging
12
+ from datetime import datetime
13
+
14
+ # Make sure we can import from our project
15
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
16
+
17
+ # Import our utilities
18
+ from utils.monitor_utils import monitor_active_jobs, show_job_details
19
+
20
+ # Configure logging
21
+ logging.basicConfig(level=logging.INFO)
22
+ logger = logging.getLogger(__name__)
23
+
24
+ def parse_args():
25
+ """Parse command-line arguments"""
26
+ parser = argparse.ArgumentParser(description="SmartRecruitAgent Workflow Monitor")
27
+
28
+ # Create subparsers for different commands
29
+ subparsers = parser.add_subparsers(dest="command", help="Command to run")
30
+
31
+ # Monitor command
32
+ monitor_parser = subparsers.add_parser("monitor", help="Monitor active jobs")
33
+ monitor_parser.add_argument(
34
+ "--refresh", "-r",
35
+ type=int,
36
+ default=10,
37
+ help="Refresh interval in seconds (default: 10)"
38
+ )
39
+
40
+ # Job details command
41
+ details_parser = subparsers.add_parser("details", help="Show details for a specific job")
42
+ details_parser.add_argument(
43
+ "job_id",
44
+ help="The ID of the job to show details for"
45
+ )
46
+
47
+ return parser.parse_args()
48
+
49
+ def main():
50
+ """Main entry point"""
51
+ args = parse_args()
52
+
53
+ if args.command == "monitor":
54
+ try:
55
+ # Show initial state
56
+ os.system('clear' if os.name == 'posix' else 'cls')
57
+ monitor_active_jobs()
58
+
59
+ # If refresh interval is provided, keep refreshing
60
+ if args.refresh > 0:
61
+ print(f"\nRefreshing every {args.refresh} seconds. Press Ctrl+C to exit.")
62
+
63
+ while True:
64
+ time.sleep(args.refresh)
65
+ os.system('clear' if os.name == 'posix' else 'cls')
66
+ monitor_active_jobs()
67
+ print(f"\nLast updated: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
68
+ print(f"Refreshing every {args.refresh} seconds. Press Ctrl+C to exit.")
69
+ except KeyboardInterrupt:
70
+ print("\nExiting monitor.")
71
+
72
+ elif args.command == "details":
73
+ show_job_details(args.job_id)
74
+
75
+ else:
76
+ # Default to showing active jobs
77
+ monitor_active_jobs()
78
+
79
+ if __name__ == "__main__":
80
+ main()
@@ -0,0 +1,64 @@
1
+ Metadata-Version: 2.4
2
+ Name: michael_agent
3
+ Version: 1.0.0
4
+ Summary: SmartRecruitAgent - A recruitment automation library
5
+ Home-page: https://github.com/yourusername/agent
6
+ Author: Michael Jone
7
+ Author-email: your_email@example.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.7
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: python-dotenv
14
+ Requires-Dist: langchain
15
+ Requires-Dist: langgraph
16
+ Requires-Dist: langchain-openai
17
+ Requires-Dist: PyPDF2
18
+ Requires-Dist: pymupdf
19
+ Requires-Dist: flask
20
+ Requires-Dist: requests
21
+ Requires-Dist: watchdog
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: home-page
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # Michael Agent
33
+
34
+ SmartRecruitAgent - A recruitment automation library.
35
+
36
+ ## Installation
37
+
38
+ You can install this library using pip:
39
+
40
+ ```bash
41
+ pip install michael_agent
42
+ ```
43
+
44
+ ## Usage
45
+
46
+ Import the library and use its features:
47
+
48
+ ```python
49
+ import michael_agent
50
+
51
+ # Example usage
52
+ michael_agent.agent_main()
53
+ ```
54
+
55
+ ## Features
56
+
57
+ - Recruitment automation
58
+ - Integration with LangChain and OpenAI
59
+ - PDF processing
60
+ - Flask-based dashboard
61
+
62
+ ## License
63
+
64
+ This project is licensed under the MIT License.
@@ -0,0 +1,7 @@
1
+ michael_agent/__init__.py,sha256=prEeI3mdpO8R5QTpniRR_Tl21uqF7pGJHwBidQ9JIKQ,179
2
+ michael_agent/main.py,sha256=j5BXOxg_8YE-bnu3cKrylQCHCssZ6PP4UbGorRVJMd4,3385
3
+ michael_agent/monitor.py,sha256=RThpdPW7lf5zI3ilMShVeDf4Vao5Yq0E4Rao9uuS9XY,2473
4
+ michael_agent-1.0.0.dist-info/METADATA,sha256=KRL2sOmwfc4WDlyLbDWRZX3UMtWSLHoJ20LBofSHsLY,1339
5
+ michael_agent-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ michael_agent-1.0.0.dist-info/top_level.txt,sha256=-r35JOIHnK3RsMhJ77tDKfWtmfGDr_iT2642k-suUDo,14
7
+ michael_agent-1.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ michael_agent