-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.py
More file actions
112 lines (83 loc) · 3.4 KB
/
examples.py
File metadata and controls
112 lines (83 loc) · 3.4 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/usr/bin/env python3
"""
Example usage of the Job Agent system.
Demonstrates typical workflows.
"""
from main import create_orchestrator
from rich.console import Console
import time
console = Console()
def example_1_manual_workflow():
"""Example: Step-by-step manual control"""
console.print("\n[bold]Example 1: Manual Workflow[/bold]\n")
orchestrator = create_orchestrator()
# 1. Create profile
profile = {
"user_id": "demo_user",
"name": "Demo User",
"skills": ["Python", "Docker", "AWS"],
"experience_level": "Mid",
"preferred_roles": ["Backend Engineer"],
"preferred_locations": ["Remote"],
"job_goal": "interviews",
"resume_text": "Experienced backend engineer with 5 years in Python..."
}
orchestrator.create_user_profile(profile)
console.print("✓ Profile created")
# 2. Discover jobs
discovery_result = orchestrator.run_discovery("demo_user", max_jobs=20)
console.print(f"✓ Found {discovery_result['jobs_discovered']} jobs")
# 3. Apply to top matches
app_result = orchestrator.run_applications(
"demo_user",
min_score=0.75,
auto_mode=True,
max_applications=5
)
console.print(f"✓ Submitted {app_result['applications_submitted']} applications")
# 4. Check status
status = orchestrator.get_status("demo_user")
console.print(f"✓ Total applications: {status['applications']['total']}")
def example_2_autonomous_mode():
"""Example: Fully autonomous operation"""
console.print("\n[bold]Example 2: Autonomous Mode[/bold]\n")
orchestrator = create_orchestrator()
# Run complete cycle
results = orchestrator.run_full_cycle(
user_id="demo_user",
discovery_max=50,
apply_min_score=0.7,
auto_apply=True
)
console.print(f"✓ Jobs: {results['discovery'].get('jobs_discovered', 0)}")
console.print(f"✓ Applications: {results['applications'].get('applications_submitted', 0)}")
console.print(f"✓ Follow-ups: {results['followups'].get('followups_sent', 0)}")
# Show suggestions
if results.get('suggestions'):
console.print("\n[yellow]Suggestions:[/yellow]")
for s in results['suggestions']:
console.print(f" • {s}")
def example_3_scheduled_operation():
"""Example: Scheduled background operation"""
console.print("\n[bold]Example 3: Scheduled Operation[/bold]\n")
console.print("This would run on a schedule (e.g., cron job)\n")
orchestrator = create_orchestrator()
# Morning: Discover new jobs
console.print("[cyan]9:00 AM - Discovering jobs...[/cyan]")
orchestrator.run_discovery("demo_user", max_jobs=30)
# Afternoon: Apply to matches
console.print("[cyan]2:00 PM - Applying to matches...[/cyan]")
orchestrator.run_applications("demo_user", min_score=0.7, auto_mode=True)
# Evening: Send follow-ups
console.print("[cyan]6:00 PM - Sending follow-ups...[/cyan]")
orchestrator.run_followups()
console.print("\n✓ Daily cycle complete")
if __name__ == "__main__":
console.print("[bold cyan]Job Agent Examples[/bold cyan]")
# Run examples
example_1_manual_workflow()
time.sleep(1)
example_2_autonomous_mode()
time.sleep(1)
example_3_scheduled_operation()
console.print("\n[green]All examples complete![/green]")