CrewAI agent not able to initialize and giving error - Stack Overflow

I am using CrewAI to create an agent. Doing everything as mentioned in documentation. See below for the

I am using CrewAI to create an agent. Doing everything as mentioned in documentation. See below for the CrewBase class:

@CrewBase
class EnergyAssitt():
    """EnergyAssitt crew"""

    # Learn more about YAML configuration files here:
    # Agents: 
    # Tasks: 
    agents_config = 'config/agents.yaml'
    tasks_config = 'config/tasks.yaml'

    def __init__(self):
        logger.info(f"__init__")


    # If you would like to add tools to your agents, you can learn more about it here:
    # 
    @agent
    def assistant(self) -> Agent:
        logger.info(f"assistant")
        return Agent(
            config=self.agents_config['mechanical_assistant'],
            memory=True,
            memory_config=memory_config,
            verbose=True
        )


    # To learn more about structured task outputs,
    # task dependencies, and task callbacks, check out the documentation:
    # 
    @task
    def chat_task(self) -> Task:
        logger.info(f"chat_task")
        return Task(
            config=self.tasks_config['chat_task'],
            agent=self.assistant()
        )


    @crew
    def crew(self) -> Crew:
        """Creates the Energy Assisstant crew"""
        # To learn how to add knowledge sources to your crew, check out the documentation:
        # 

        logger.info(f"crew")
        return Crew(
            agents=self.agents, # Automatically created by the @agent decorator
            tasks=self.tasks, # Automatically created by the @task decorator
            process=Process.sequential,
            knowledge_sources=[pdf_source],
            verbose=True,
            # process=Process.hierarchical, # In case you wanna use that instead /
        )

However, everytime I give a task request, I get following error:

2025-03-19 16:46:10,270 - app.services.services - INFO - Task 5a3a8b3a-573f-4b18-9a11-43d079df87fb failed with error: 'mechanical_assistant'

Any suggestions what is going wrong or how to troubleshoot.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744371323a4570967.html

相关推荐

  • CrewAI agent not able to initialize and giving error - Stack Overflow

    I am using CrewAI to create an agent. Doing everything as mentioned in documentation. See below for the

    7天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信