import os


from crewai import LLM
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
from crewai_tools import (
	ScrapeWebsiteTool
)






@CrewBase
class MadbradOutreachEngineCrew:
    """MadbradOutreachEngine crew"""

    
    @agent
    def rss_feed_scraper(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["rss_feed_scraper"],
            
            
            tools=[				ScrapeWebsiteTool()],
            
            reasoning=False,
            max_reasoning_attempts=None,
            inject_date=True,
            allow_delegation=False,
            max_iter=25,
            max_rpm=None,
            
            
            max_execution_time=None,
            llm=LLM(
                model="openai/gpt-4o-mini",
                
                
            ),
            
        )
        
    
    @agent
    def outreach_copywriter(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["outreach_copywriter"],
            
            
            tools=[],
            
            reasoning=False,
            max_reasoning_attempts=None,
            inject_date=True,
            allow_delegation=False,
            max_iter=25,
            max_rpm=None,
            
            
            max_execution_time=None,
            llm=LLM(
                model="openai/gpt-4o-mini",
                
                
            ),
            
        )
        
    
    @agent
    def content_card_compiler(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["content_card_compiler"],
            
            
            tools=[],
            
            reasoning=False,
            max_reasoning_attempts=None,
            inject_date=True,
            allow_delegation=False,
            max_iter=25,
            max_rpm=None,
            
            
            max_execution_time=None,
            llm=LLM(
                model="openai/gpt-4o-mini",
                
                
            ),
            
        )
        
    

    
    @task
    def scout_feed_posts(self) -> Task:
        return Task(
            config=self.tasks_config["scout_feed_posts"],
            markdown=False,
            
            
        )
    
    @task
    def draft_outreach_comments_and_email(self) -> Task:
        return Task(
            config=self.tasks_config["draft_outreach_comments_and_email"],
            markdown=False,
            
            
        )
    
    @task
    def compile_business_tab_card(self) -> Task:
        return Task(
            config=self.tasks_config["compile_business_tab_card"],
            markdown=False,
            
            
        )
    

    @crew
    def crew(self) -> Crew:
        """Creates the MadbradOutreachEngine crew"""

        return Crew(
            agents=self.agents,  # Automatically created by the @agent decorator
            tasks=self.tasks,  # Automatically created by the @task decorator
            process=Process.sequential,
            verbose=True,

            chat_llm=LLM(model="openai/gpt-4o-mini"),
        )


