Using crewAI to create a game builder AI agent. Instead of kicking off the agents as expected, my code is returning an object <crewai.project.crew_base.CrewBase..WrappedClass object at 0x1012252d0>.
I’m expecting output like this:
**DEBUG]: == Working Agent: Financial Researcher
[INFO]: == Starting Task: You will create a game using python, these are the instructions:
Instructions
————
{game}
Your Final answer must be the full python code, only the python code and nothing else.
Entering new CrewAgentExecutor chain…**
In main.py I have tried converting the result using str() and added print statement to identify where the stops working:
import os
from dotenv import load_dotenv
load_dotenv()
from crewai.project import CrewBase, crew
from crewai import Crew, Process
from .tasks import GameTasks
from .agents import GameAgents
@CrewBase
class GameBuildCrew():
tasks = GameTasks()
agents = GameAgents()
def __init__(self):
print("## Welcome to the Game Crew")
print('-------------------------------')
self.game = input("What is the game you would like to build? What will be the mechanics?n")
@crew
def crew(self) -> Crew:
print("crew called")
return Crew(
agents=[
self.agents.senior_engineer_agent(),
self.agents.qa_engineer_agent(),
self.agents.chief_qa_engineer_agent()
],
tasks=[
self.tasks.code_task(self.senior_engineer_agent),
self.tasks.review_task(self.qa_engineer_agent),
self.tasks.evaluate_task(self.chief_qa_engineer_agent)
],
process=Process.sequential,
verbose=2,
)
def run(self):
print("run called")
crew_instance = self.crew()
result = crew_instance.kickoff()
print("nn########################")
print("## Here is the result")
print("########################n")
print("final code for the game:")
print(result)
if __name__ == '__main__':
game_build_crew = GameBuildCrew()
game_build_crew.run()