Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/en/learn/conditional-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from crewai_tools import SerperDevTool
# Define a condition function for the conditional task
# If false, the task will be skipped, if true, then execute the task.
def is_data_missing(output: TaskOutput) -> bool:
return len(output.pydantic.events) < 10 # this will skip this task
return len(output.pydantic.events) < 10 # True => execute ConditionalTask (data missing)

# Define the agents
data_fetcher_agent = Agent(
Expand All @@ -39,7 +39,8 @@ data_processor_agent = Agent(
role="Data Processor",
goal="Process fetched data",
backstory="Backstory 2",
verbose=True
verbose=True,
tools=[SerperDevTool()]
)

summary_generator_agent = Agent(
Expand Down Expand Up @@ -87,4 +88,4 @@ crew = Crew(
# Run the crew
result = crew.kickoff()
print("results", result)
```
```
7 changes: 4 additions & 3 deletions docs/ko/learn/conditional-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from crewai_tools import SerperDevTool
# Define a condition function for the conditional task
# If false, the task will be skipped, if true, then execute the task.
def is_data_missing(output: TaskOutput) -> bool:
return len(output.pydantic.events) < 10 # this will skip this task
return len(output.pydantic.events) < 10 # True => execute ConditionalTask (data missing)

# Define the agents
data_fetcher_agent = Agent(
Expand All @@ -39,7 +39,8 @@ data_processor_agent = Agent(
role="Data Processor",
goal="Process fetched data",
backstory="Backstory 2",
verbose=True
verbose=True,
tools=[SerperDevTool()]
)

summary_generator_agent = Agent(
Expand Down Expand Up @@ -87,4 +88,4 @@ crew = Crew(
# Run the crew
result = crew.kickoff()
print("results", result)
```
```
7 changes: 4 additions & 3 deletions docs/pt-BR/learn/conditional-tasks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ from crewai_tools import SerperDevTool
# Define a condition function for the conditional task
# If false, the task will be skipped, if true, then execute the task.
def is_data_missing(output: TaskOutput) -> bool:
return len(output.pydantic.events) < 10 # this will skip this task
return len(output.pydantic.events) < 10 # True => execute ConditionalTask (data missing)

# Define the agents
data_fetcher_agent = Agent(
Expand All @@ -39,7 +39,8 @@ data_processor_agent = Agent(
role="Data Processor",
goal="Process fetched data",
backstory="Backstory 2",
verbose=True
verbose=True,
tools=[SerperDevTool()]
)

summary_generator_agent = Agent(
Expand Down Expand Up @@ -87,4 +88,4 @@ crew = Crew(
# Run the crew
result = crew.kickoff()
print("results", result)
```
```