Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
def _create_researcher(self):
return Agent(
role='Data Researcher',
goal='Gather comprehensive information about the target profile',
backstory="""You are an expert in data gathering, specializing in finding comprehensive information online.
You know how to craft precise search queries to find specific professional profiles and validate connections.""",
verbose=True,
tools=[getSerperTool()],
allow_delegation=False,
llm=self.agents_llm
)
```
self.set_llm(openai_api_key)
self.crew = self._create_crew()
inputs = {
'profile': fullname,
'company': company,
'language': language
}
result = self.crew.kickoff(inputs=inputs)
### Expected behavior
i expect that the token usage return the proper token consume by the crew
### Screenshots/Code snippets
This is how i setup the crew
// this is how I create the agent
def _create_researcher(self):
return Agent(
role='Data Researcher',
goal='Gather comprehensive information about the target profile',
backstory="""You are an expert in data gathering, specializing in finding comprehensive information online.
You know how to craft precise search queries to find specific professional profiles and validate connections.""",
verbose=True,
tools=[getSerperTool()],
allow_delegation=False,
llm=self.agents_llm
)
Description
crew result token usage always 0
total_tokens=0 prompt_tokens=0 cached_prompt_tokens=0 completion_tokens=0 successful_requests=0
Steps to Reproduce
This is how i setup the crew
// this is how I create the agent
// this is how I create the crew
//this is how I create the LLM
def _create_researcher(self): return Agent( role='Data Researcher', goal='Gather comprehensive information about the target profile', backstory="""You are an expert in data gathering, specializing in finding comprehensive information online. You know how to craft precise search queries to find specific professional profiles and validate connections.""", verbose=True, tools=[getSerperTool()], allow_delegation=False, llm=self.agents_llm )
def _create_crew(self): agents = [self._create_researcher(), self._create_info_gatherer()] tasks = [self._create_research_task(), self._create_gather_info_task()]
def create_llm(api_key: str): return LLM(model=os.getenv("OPENAI_MODEL_NAME"), api_key=api_key, temperature=0.0)