Created
April 13, 2024 05:37
-
-
Save arwankhoiruddin/49383fc226ca42b0a57da3d31deb4e78 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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