Skip to content

Instantly share code, notes, and snippets.

@arwankhoiruddin
Created April 13, 2024 05:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arwankhoiruddin/49383fc226ca42b0a57da3d31deb4e78 to your computer and use it in GitHub Desktop.
Save arwankhoiruddin/49383fc226ca42b0a57da3d31deb4e78 to your computer and use it in GitHub Desktop.
path_keyword_researcher = 'agents/keyword_researcher'
def read_string(path):
with open(path, 'r') as file:
content = file.read()
return content
backstory = read_string(f'{path_keyword_researcher}/backstory.txt')
task_description = read_string(f'{path_keyword_researcher}/task_description.txt')
task_output = read_string(f'{path_keyword_researcher}/task_output.txt')
keyword_researcher = Agent(
role='Keyword Researcher',
goal='Identify relevant keywords for {topic}',
verbose=True,
backstory=backstory,
tools=[search_tool],
llm=llm,
allow_delegation=True
)
keyword_research_task = Task(
description=task_description,
expected_output=task_output,
tools=[search_tool],
llm=llm,
output_file='keywords.csv',
agent=keyword_researcher
)
crew = Crew(
agents=[
keyword_researcher],
tasks=[
keyword_research_task,
])
# Example execution
result = crew.kickoff(inputs={'topic': 'Male supplement'})
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment