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
评论列表(0条)