-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
55 lines (44 loc) · 1.43 KB
/
Copy pathmain.py
File metadata and controls
55 lines (44 loc) · 1.43 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
"""
Main entry point for the multi-agent system.
"""
import os
import logging
from dotenv import load_dotenv
from app.orchestration.orchestrator import Orchestrator
# Configure logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
handlers=[
logging.StreamHandler(),
logging.FileHandler("agent_activity.log", mode='w')
]
)
def main():
"""
Initializes and runs the agent orchestration system.
"""
load_dotenv()
api_key = os.getenv("OPENAI_API_KEY")
if not api_key:
logging.error("FATAL: OPENAI_API_KEY environment variable not set.")
return
model = "gpt-4o-mini"
print("--- Multi-Agent System Initialized ---")
print("Enter your request. Type 'exit' to close.")
orchestrator = Orchestrator(api_key=api_key, model=model)
try:
while True:
user_query = input("\033[94mYou > \033[0m")
if user_query.lower() in ['exit', 'quit']:
print("Shutting down...")
break
if not user_query.strip():
continue
# The orchestrator handles the entire process
final_result = orchestrator.run(user_query)
print(f"\033[92mFinal Answer >\033[0m {final_result}")
except (KeyboardInterrupt, EOFError):
print("\nShutting down...")
if __name__ == "__main__":
main()