-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (36 loc) · 1.6 KB
/
main.py
File metadata and controls
44 lines (36 loc) · 1.6 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
# main.py
"""This is the main entry point for the PromptOps application.
It initializes the necessary components, including the model, agents, and controller,
and executes the user-provided prompt through a series of steps.
"""
from config import MODEL_PROVIDER
from interfaces.user_input import get_user_prompt
from core.controller import Controller
from agents.planner import PlannerAgent
from agents.evaluator import EvaluatorAgent
from agents.fixer import FixerAgent
from agents.clarifier import ClarifierAgent
from core.memory import Memory
from models.base import LLMModel
from agents.vision import VisionAgent
if __name__ == "__main__":
print("[START] PromptOps run initiated.")
user_prompt = get_user_prompt()
print(f"[INPUT] User Prompt: {user_prompt}")
model = LLMModel.get(MODEL_PROVIDER)
print(f"[MODEL] Loaded model from provider: {MODEL_PROVIDER}")
planner = PlannerAgent(model) # returns steps in a dictionary format
evaluator = EvaluatorAgent(model)
fixer = FixerAgent(model)
clarifier = ClarifierAgent(model)
memory = Memory()
vision= VisionAgent(model)
print("[AGENTS] Planner, Evaluator, Fixer, Clarifier, and Memory initialized.")
controller = Controller(planner, evaluator, fixer, clarifier, memory, vision)
print("[CONTROLLER] Controller initialized with all agents.")
print("[PLANNING] Generating task plan...")
task_plan = planner.plan(user_prompt)
print(f"[PLAN] Task Plan: {task_plan}")
print("[EXECUTION] Starting plan execution...")
controller.execute_plan(task_plan, user_prompt)
print("[DONE] Execution complete.")