Using crewai framework, I am running a couple of tasks by a single secretary agent which should be executed by looking up the internet.
I am trying to use SerperDevTool
and WebsiteSearchTool but my outputs still get “latest date” as of cut date of the LLM model.
So these are my tasks:
lecture_task:
description: >
Conduct a thorough list of advises for {company} CEO on strategy, and suggested daily public actions or practices.
Focus on the most relevant information and the CEO zodiac sign.
expected_output: >
A list with 3 current possible mood and feelings of the CEO, and 5 advises for the CEO.
agent: astrologist
profile_task:
description: >
Look up the {company} CEO date of birth and given that the zodiac sign.
Research latest events and news relevant to the CEO in particular, focus on the public image.
expected_output: >
CEO date of birth and zodiac sign and a concise list his or her recent relevant actions or epics.
agent: secretary
reporting_task:
description: >
Look up for recent news of the week about {company} and stock market day status, look up in the internet for news.
expected_output: >
A concise report indicating today's date and a list of latest 3-5 main events from the news about {company} indicating the exact date for each.
The price of the stock during last 3 days.
agent: secretary
I am noticing 2 issues:
- The zodiac of Andy Jassy is not always Capricorn, sometimes for some weird reason is reported as Leo/Scorpio etc
- The stock price and news get reported as “random yada yada” and the price gets listed as we’re in October 2023
This is my crew.py file:
from crewai import Agent, Crew, Process, Task, LLM
from crewai.project import CrewBase, agent, crew, task
from crewai_tools import SerperDevTool, WebsiteSearchTool
# If you want to run a snippet of code before or after the crew starts,
# you can use the @before_kickoff and @after_kickoff decorators
# https://docs.crewai.com/concepts/crews#example-crew-class-with-decorators
@CrewBase
class FourthTransformation():
"""FourthTransformation crew"""
# Learn more about YAML configuration files here:
# Agents: https://docs.crewai.com/concepts/agents#yaml-configuration-recommended
# Tasks: https://docs.crewai.com/concepts/tasks#yaml-configuration-recommended
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
# If you would like to add tools to your agents, you can learn more about it here:
# https://docs.crewai.com/concepts/agents#agent-tools
@agent
def astrologist(self) -> Agent:
return Agent(
config=self.agents_config['astrologist'],
verbose=True,
)
@agent
def secretary(self) -> Agent:
return Agent(
config=self.agents_config['secretary'],
verbose=True,
)
# To learn more about structured task outputs,
# task dependencies, and task callbacks, check out the documentation:
# https://docs.crewai.com/concepts/tasks#overview-of-a-task
@task
def profile_task(self) -> Task:
return Task(
config=self.tasks_config['profile_task'],
tools=[SerperDevTool()]
)
@task
def reporting_task(self) -> Task:
return Task(
config=self.tasks_config['reporting_task'],
tools=[SerperDevTool(), WebsiteSearchTool()],
output_file='report.md'
)
@task
def lecture_task(self) -> Task:
return Task(
config=self.tasks_config['lecture_task'],
output_file='lecture.md',
context=[self.profile_task(), self.reporting_task()]
)
@crew
def crew(self) -> Crew:
"""Creates the FourthTransformation crew"""
# To learn how to add knowledge sources to your crew, check out the documentation:
# https://docs.crewai.com/concepts/knowledge#what-is-knowledge
return Crew(
agents=self.agents, # Automatically created by the @agent decorator
tasks=self.tasks, # Automatically created by the @task decorator
process=Process.hierarchical,
verbose=True,
execution_logs=True
# process=Process.hierarchical, # In case you wanna use that instead https://docs.crewai.com/how-to/Hierarchical/
)