addding new kickoff docs

This commit is contained in:
João Moura
2024-06-20 02:46:13 -03:00
parent 25528dbee1
commit 3d5d71f096

View File

@@ -121,4 +121,35 @@ Once your crew is assembled, initiate the workflow with the `kickoff()` method.
# Start the crew's task execution
result = my_crew.kickoff()
print(result)
```
```
### Kicking Off a Crew
Once your crew is assembled, initiate the workflow with the appropriate kickoff method. CrewAI provides several methods for better control over the kickoff process: `kickoff()`, `kickoff_for_each()`, `kickoff_async()`, and `kickoff_for_each_async()`.
`kickoff()`: Starts the execution process according to the defined process flow.
`kickoff_for_each()`: Executes tasks for each agent individually.
`kickoff_async()`: Initiates the workflow asynchronously.
`kickoff_for_each_async()`: Executes tasks for each agent individually in an asynchronous manner.
```python
# Start the crew's task execution
result = my_crew.kickoff()
print(result)
# Example of using kickoff_for_each
results = my_crew.kickoff_for_each()
for result in results:
print(result)
# Example of using kickoff_async
async_result = my_crew.kickoff_async()
print(async_result)
# Example of using kickoff_for_each_async
async_results = my_crew.kickoff_for_each_async()
for async_result in async_results:
print(async_result)
```
These methods provide flexibility in how you manage and execute tasks within your crew, allowing for both synchronous and asynchronous workflows tailored to your needs