Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
bboynton97 committed Aug 8, 2024
2 parents 0543059 + 6583f31 commit b3ae127
Show file tree
Hide file tree
Showing 74 changed files with 450,040 additions and 4,292 deletions.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve CrewAI
title: "[BUG]"
labels: bug
assignees: ''

---

**Description**
Provide a clear and concise description of what the bug is.

**Steps to Reproduce**
Provide a step-by-step process to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots/Code snippets**
If applicable, add screenshots or code snippets to help explain your problem.

**Environment Details:**
- **Operating System**: [e.g., Ubuntu 20.04, macOS Catalina, Windows 10]
- **Python Version**: [e.g., 3.8, 3.9, 3.10]
- **crewAI Version**: [e.g., 0.30.11]
- **crewAI Tools Version**: [e.g., 0.2.6]

**Logs**
Include relevant logs or error messages if applicable.

**Possible Solution**
Have a solution in mind? Please suggest it here, or write "None".

**Additional context**
Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: "[DOCS]"
labels: documentation
assignees: ''

---

## Documentation Page
<!-- Provide a link to the documentation page that needs improvement -->

## Description
<!-- Describe what needs to be changed or improved in the documentation -->

## Suggested Changes
<!-- If possible, provide specific suggestions for how to improve the documentation -->

## Additional Context
<!-- Add any other context about the documentation issue here -->

## Checklist
- [ ] I have searched the existing issues to make sure this is not a duplicate
- [ ] I have checked the latest version of the documentation to ensure this hasn't been addressed
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: '10 12 * * *'
workflow_dispatch:

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-label: 'no-issue-activity'
stale-issue-message: 'This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
days-before-issue-stale: 30
days-before-issue-close: 5
stale-pr-label: 'no-pr-activity'
stale-pr-message: 'This PR is stale because it has been open for 45 days with no activity.'
days-before-pr-stale: 45
days-before-pr-close: -1
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ task2 = Task(
crew = Crew(
agents=[researcher, writer],
tasks=[task1, task2],
verbose=2, # You can set it to 1 or 2 to different logging levels
verbose=True,
process = Process.sequential
)

Expand Down Expand Up @@ -256,7 +256,7 @@ pip install dist/*.tar.gz

CrewAI uses anonymous telemetry to collect usage data with the main purpose of helping us improve the library by focusing our efforts on the most used features, integrations and tools.

There is NO data being collected on the prompts, tasks descriptions agents backstories or goals nor tools usage, no API calls, nor responses nor any data that is being processed by the agents, nor any secrets and env vars.
It's pivotal to understand that **NO data is collected** concerning prompts, task descriptions, agents' backstories or goals, usage of tools, API calls, responses, any data processed by the agents, or secrets and environment variables, with the exception of the conditions mentioned. When the `share_crew` feature is enabled, detailed data including task descriptions, agents' backstories or goals, and other specific attributes are collected to provide deeper insights while respecting user privacy. We don't offer a way to disable it now, but we will in the future.

Data collected includes:

Expand All @@ -281,7 +281,7 @@ Data collected includes:
- Tools names available
- Understand out of the publically available tools, which ones are being used the most so we can improve them

Users can opt-in sharing the complete telemetry data by setting the `share_crew` attribute to `True` on their Crews.
Users can opt-in to Further Telemetry, sharing the complete telemetry data by setting the `share_crew` attribute to `True` on their Crews. Enabling `share_crew` results in the collection of detailed crew and task execution data, including `goal`, `backstory`, `context`, and `output` of tasks. This enables a deeper insight into usage patterns while respecting the user's choice to share.

## License

Expand Down
4 changes: 2 additions & 2 deletions docs/core-concepts/Agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ from langchain.agents import load_tools
langchain_tools = load_tools(["google-serper"], llm=llm)

agent1 = CustomAgent(
role="backstory agent",
role="agent role",
goal="who is {input}?",
backstory="agent backstory",
verbose=True,
Expand All @@ -127,7 +127,7 @@ task1 = Task(
)

agent2 = Agent(
role="bio agent",
role="agent role",
goal="summarize the short bio for {input} and if needed do more research",
backstory="agent backstory",
verbose=True,
Expand Down
5 changes: 3 additions & 2 deletions docs/core-concepts/Crews.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ A crew in crewAI represents a collaborative group of agents working together to
| **Manager Callbacks** _(optional)_ | `manager_callbacks` | `manager_callbacks` takes a list of callback handlers to be executed by the manager agent when a hierarchical process is used. |
| **Prompt File** _(optional)_ | `prompt_file` | Path to the prompt JSON file to be used for the crew. |
| **Planning** *(optional)* | `planning` | Adds planning ability to the Crew. When activated before each Crew iteration, all Crew data is sent to an AgentPlanner that will plan the tasks and this plan will be added to each task description.
| **Planning LLM** *(optional)* | `planning_llm` | The language model used by the AgentPlanner in a planning process. |

!!! note "Crew Max RPM"
The `max_rpm` attribute sets the maximum number of requests per minute the crew can perform to avoid rate limits and will override individual agents' `max_rpm` settings if you set it.
Expand Down Expand Up @@ -133,10 +134,10 @@ Once a crew has been executed, its output can be accessed through the `output` a
crew = Crew(
agents=[research_agent, writer_agent],
tasks=[research_task, write_article_task],
verbose=2
verbose=True
)

result = crew.kickoff()
crew_output = crew.kickoff()

# Accessing the crew output
print(f"Raw Output: {crew_output.raw}")
Expand Down
19 changes: 19 additions & 0 deletions docs/core-concepts/Planning.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ my_crew = Crew(

From this point on, your crew will have planning enabled, and the tasks will be planned before each iteration.

#### Planning LLM

Now you can define the LLM that will be used to plan the tasks. You can use any ChatOpenAI LLM model available.

```python
from crewai import Crew, Agent, Task, Process
from langchain_openai import ChatOpenAI

# Assemble your crew with planning capabilities and custom LLM
my_crew = Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
planning=True,
planning_llm=ChatOpenAI(model="gpt-4o")
)
```


### Example

When running the base case example, you will see something like the following output, which represents the output of the AgentPlanner responsible for creating the step-by-step logic to add to the Agents tasks.
Expand Down
6 changes: 3 additions & 3 deletions docs/core-concepts/Tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ task = Task(
crew = Crew(
agents=[research_agent],
tasks=[task],
verbose=2
verbose=True
)

result = crew.kickoff()
Expand Down Expand Up @@ -142,7 +142,7 @@ task = Task(
crew = Crew(
agents=[research_agent],
tasks=[task],
verbose=2
verbose=True
)

result = crew.kickoff()
Expand Down Expand Up @@ -264,7 +264,7 @@ task1 = Task(
crew = Crew(
agents=[research_agent],
tasks=[task1, task2, task3],
verbose=2
verbose=True
)

result = crew.kickoff()
Expand Down
41 changes: 41 additions & 0 deletions docs/core-concepts/Testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: crewAI Testing
description: Learn how to test your crewAI Crew and evaluate their performance.
---

## Introduction

Testing is a crucial part of the development process, and it is essential to ensure that your crew is performing as expected. And with crewAI, you can easily test your crew and evaluate its performance using the built-in testing capabilities.

### Using the Testing Feature

We added the CLI command `crewai test` to make it easy to test your crew. This command will run your crew for a specified number of iterations and provide detailed performance metrics.
The parameters are `n_iterations` and `model` which are optional and default to 2 and `gpt-4o-mini` respectively. For now the only provider available is OpenAI.

```bash
crewai test
```

If you want to run more iterations or use a different model, you can specify the parameters like this:

```bash
crewai test --n_iterations 5 --model gpt-4o
```

What happens when you run the `crewai test` command is that the crew will be executed for the specified number of iterations, and the performance metrics will be displayed at the end of the run.

A table of scores at the end will show the performance of the crew in terms of the following metrics:
```
Task Scores
(1-10 Higher is better)
┏━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┓
┃ Tasks/Crew ┃ Run 1 ┃ Run 2 ┃ Avg. Total ┃
┡━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━┩
│ Task 1 │ 10.0 │ 9.0 │ 9.5 │
│ Task 2 │ 9.0 │ 9.0 │ 9.0 │
│ Crew │ 9.5 │ 9.0 │ 9.2 │
└────────────┴───────┴───────┴────────────┘
```

The example above shows the test results for two runs of the crew with two tasks, with the average total score for each task and the crew as a whole.

2 changes: 1 addition & 1 deletion docs/core-concepts/Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ write = Task(
crew = Crew(
agents=[researcher, writer],
tasks=[research, write],
verbose=2
verbose=True
)

# Execute tasks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ pip install crewai
# Install the main crewAI package and the tools package
# that includes a series of helpful tools for your agents
pip install 'crewai[tools]'

# Alternatively, you can also use:
pip install crewai crewai-tools
```
Original file line number Diff line number Diff line change
@@ -1,19 +1,68 @@
---
title: Starting a New CrewAI Project
title: Starting a New CrewAI Project - Using Template
description: A comprehensive guide to starting a new CrewAI project, including the latest updates and project setup methods.
---

# Starting Your CrewAI Project

Welcome to the ultimate guide for starting a new CrewAI project. This document will walk you through the steps to create, customize, and run your CrewAI project, ensuring you have everything you need to get started.

Beforre we start there are a couple of things to note:

1. CrewAI is a Python package and requires Python >=3.10 and <=3.13 to run.
2. The preferred way of setting up CrewAI is using the `crewai create` command.This will create a new project folder and install a skeleton template for you to work on.

## Prerequisites

We assume you have already installed CrewAI. If not, please refer to the [installation guide](https://docs.crewai.com/how-to/Installing-CrewAI/) to install CrewAI and its dependencies.
Before getting started with CrewAI, make sure that you have installed it via pip:

```shell
$ pip install crewai crewai-tools
```

### Virtual Environments
It is highly recommended that you use virtual environments to ensure that your CrewAI project is isolated from other projects and dependencies. Virtual environments provide a clean, separate workspace for each project, preventing conflicts between different versions of packages and libraries. This isolation is crucial for maintaining consistency and reproducibility in your development process. You have multiple options for setting up virtual environments depending on your operating system and Python version:

1. Use venv (Python's built-in virtual environment tool):
venv is included with Python 3.3 and later, making it a convenient choice for many developers. It's lightweight and easy to use, perfect for simple project setups.

To set up virtual environments with venv, refer to the official [Python documentation](https://docs.python.org/3/tutorial/venv.html).

2. Use Conda (A Python virtual environment manager):
Conda is an open-source package manager and environment management system for Python. It's widely used by data scientists, developers, and researchers to manage dependencies and environments in a reproducible way.

To set up virtual environments with Conda, refer to the official [Conda documentation](https://docs.conda.io/projects/conda/en/stable/user-guide/getting-started.html).

3. Use Poetry (A Python package manager and dependency management tool):
Poetry is an open-source Python package manager that simplifies the installation of packages and their dependencies. Poetry offers a convenient way to manage virtual environments and dependencies.
Poetry is CrewAI's prefered tool for package / dependancy management in CrewAI.

### Code IDEs

Most users of CrewAI a Code Editor / Integrated Development Environment (IDE) for building there Crews. You can use any code IDE of your choice. Seee below for some popular options for Code Editors / Integrated Development Environments (IDE):

- [Visual Studio Code](https://code.visualstudio.com/) - Most popular
- [PyCharm](https://www.jetbrains.com/pycharm/)
- [Cursor AI](https://cursor.com)

Pick one that suits your style and needs.

## Creating a New Project
In this example we will be using Venv as our virtual environment manager.

To setup a virtual environment, run the following CLI command:

```shell
$ python3 -m venv <venv-name>
```

To create a new project, run the following CLI command:
Activate your virtual environment by running the following CLI command:

```shell
$ source <venv-name>/bin/activate
```

Now, to create a new CrewAI project, run the following CLI command:

```shell
$ crewai create <project_name>
Expand Down Expand Up @@ -195,6 +244,10 @@ def run():

To run your project, use the following command:

```shell
$ crewai run
```
or
```shell
$ poetry run my_project
```
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/Conditional-Tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ task3 = Task(
crew = Crew(
agents=[data_fetcher_agent, data_processor_agent, summary_generator_agent],
tasks=[task1, conditional_task, task3],
verbose=2,
verbose=True,
)

result = crew.kickoff()
Expand Down
3 changes: 2 additions & 1 deletion docs/how-to/Create-Custom-Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description: Comprehensive guide on crafting, using, and managing custom tools w
This guide provides detailed instructions on creating custom tools for the crewAI framework and how to efficiently manage and utilize these tools, incorporating the latest functionalities such as tool delegation, error handling, and dynamic tool calling. It also highlights the importance of collaboration tools, enabling agents to perform a wide range of actions.

### Prerequisites

Before creating your own tools, ensure you have the crewAI extra tools package installed:

```bash
Expand All @@ -31,7 +32,7 @@ class MyCustomTool(BaseTool):

### Using the `tool` Decorator

Alternatively, use the `tool` decorator for a direct approach to create tools. This requires specifying attributes and the tool's logic within a function.
Alternatively, you can use the tool decorator `@tool`. This approach allows you to define the tool's attributes and functionality directly within a function, offering a concise and efficient way to create specialized tools tailored to your needs.

```python
from crewai_tools import tool
Expand Down
Loading

0 comments on commit b3ae127

Please sign in to comment.