You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to have a simple usecase in which I have a crew with two tasks, one to get an HTML webpage and the second to explain how the webpage works.
I have built the following crew:
@CrewBaseclassResearchCrew:
"""Research crew"""@agentdefweb_page_expert(self) ->Agent:
returnAgent(
role="Best Web Page Expert",
goal="Get web page html",
backstory="You are the best web page expert in the world. You are an expert in getting HTML pages.",
tools=[http_get_tool],
)
@agentdefweb_page_expert_no_tools(self) ->Agent:
returnAgent(
role="Best Web Page Expert No Tools",
goal="Explain web page html",
backstory="You are the best web page expert in the world. You don't have any tools but your magnificent brain. You think about HTML web pages and explain them. You are an expert in explainaining HTML pages.",
)
@taskdefget_webpage(self) ->Task:
returnTask(
description="Get the html for the web page {web_application}."expected_output="The html for {web_application}",
agent=self.web_page_expert(),
async_execution=True,
)
@taskdefexplain_webpage(self) ->Task:
returnTask(
description="Study the HTML web page thoroughly to figure out how to use it and what are its key components."expected_output="Detailed analysis of the html key components",
agent=self.web_page_expert_no_tools(),
context=[self.get_webpage()],
)
What I am expecting to see is that the explain_webpage receives the HTML from the get_webpage task and explains it. Simple.
However, I run into multiple issues:
The explain_webpage doesn't seem to have the HTML web page I am giving it, instead, it gives some generic explanation about HTML web pages but nothing specific to what I want.
I am forced to use two agents, one with tools and one without, since when I use the web_page_expert alone, since it has the http_get_tool tool, in the explain_webpage it tries to access some random web page (like example.com), gets its HTML and explains it, which is not the expected results.
I have tried CrewAI versions: 0.63.6 and 0.65.2 with similar output,
for version 0.64.0 I got a weird error:
pydantic_core._pydantic_core.ValidationError: 1 validation error for Crew
Value error, Task 'Study the HTML web page thoroughly to figure out how to use it and what are its key components.' has a context dependency on a future task 'Get the html for the web page {web_application}.', which is not allowed.
I also noticed several other questions on context and transferring information between tasks, so if someone can provide me with a detailed answer, including an explanation about how context works, what have I done wrong, and how I can concatenate tasks in a managed way it would be very helpful.
Bonus question:
I would also like to do some more advanced use cases, for example:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am trying to have a simple usecase in which I have a crew with two tasks, one to get an HTML webpage and the second to explain how the webpage works.
I have built the following crew:
What I am expecting to see is that the explain_webpage receives the HTML from the get_webpage task and explains it. Simple.
However, I run into multiple issues:
I have tried CrewAI versions: 0.63.6 and 0.65.2 with similar output,
for version 0.64.0 I got a weird error:
pydantic_core._pydantic_core.ValidationError: 1 validation error for Crew
Value error, Task 'Study the HTML web page thoroughly to figure out how to use it and what are its key components.' has a context dependency on a future task 'Get the html for the web page {web_application}.', which is not allowed.
I also noticed several other questions on context and transferring information between tasks, so if someone can provide me with a detailed answer, including an explanation about how context works, what have I done wrong, and how I can concatenate tasks in a managed way it would be very helpful.
Bonus question:
I would also like to do some more advanced use cases, for example:
How does context work in such cases where I have multiple tasks from different stages?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions