from crewai import LLM
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task


@CrewBase
class PredictivePotentialEngineCrew:
    """PredictivePotentialEngine crew"""

    @agent
    def behavioral_extractor(self) -> Agent:
        return Agent(
            config=self.agents_config["behavioral_extractor"],
            llm=LLM(model="openai/gpt-4o-mini"),
        )

    @agent
    def archetype_mapper(self) -> Agent:
        return Agent(
            config=self.agents_config["archetype_mapper"],
            llm=LLM(model="openai/gpt-4o-mini"),
        )

    @agent
    def career_forecaster(self) -> Agent:
        return Agent(
            config=self.agents_config["career_forecaster"],
            llm=LLM(model="openai/gpt-4o-mini"),
        )

    @agent
    def blueprint_writer(self) -> Agent:
        return Agent(
            config=self.agents_config["blueprint_writer"],
            llm=LLM(model="openai/gpt-4o-mini"),
        )

    @task
    def extract_behavioral_patterns(self) -> Task:
        return Task(config=self.tasks_config["extract_behavioral_patterns"])

    @task
    def map_archetypes(self) -> Task:
        return Task(config=self.tasks_config["map_archetypes"])

    @task
    def forecast_careers(self) -> Task:
        return Task(config=self.tasks_config["forecast_careers"])

    @task
    def write_blueprint(self) -> Task:
        return Task(config=self.tasks_config["write_blueprint"])

    @crew
    def crew(self) -> Crew:
        return Crew(
            agents=self.agents,
            tasks=self.tasks,
            process=Process.sequential,
            verbose=True,
        )
