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 (
	FileReadTool,
	ScrapeWebsiteTool
)






@CrewBase
class FoundersDayCrew:
    """FoundersDay crew"""

    
    @agent
    def code_sharder_copyright_formatter(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["code_sharder_copyright_formatter"],
            
            
            tools=[				FileReadTool()],
            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 provisional_patent_specification_writer(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["provisional_patent_specification_writer"],
            
            
            tools=[				FileReadTool()],
            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 submission_briefing_agent(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["submission_briefing_agent"],
            
            
            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 ip_filing_package_compiler(self) -> Agent:
        
        
        return Agent(
            config=self.agents_config["ip_filing_package_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 scan_and_format_code_for_copyright_deposit(self) -> Task:
        return Task(
            config=self.tasks_config["scan_and_format_code_for_copyright_deposit"],
            markdown=False,
            
            
        )
    
    @task
    def draft_provisional_patent_specification(self) -> Task:
        return Task(
            config=self.tasks_config["draft_provisional_patent_specification"],
            markdown=False,
            
            
        )
    
    @task
    def generate_pre_filled_submission_guide(self) -> Task:
        return Task(
            config=self.tasks_config["generate_pre_filled_submission_guide"],
            markdown=False,
            
            
        )
    
    @task
    def compile_final_ip_filing_package(self) -> Task:
        return Task(
            config=self.tasks_config["compile_final_ip_filing_package"],
            markdown=False,
            
            
        )
    

    @crew
    def crew(self) -> Crew:
        """Creates the FoundersDay 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"),
        )


