Skip to content

Commit

Permalink
Merge branch 'main' into devin/1737479945-fix-conditional-index
Browse files Browse the repository at this point in the history
  • Loading branch information
bhancockio committed Jan 22, 2025
2 parents 200ecff + e27a150 commit 83ceacb
Show file tree
Hide file tree
Showing 16 changed files with 1,052 additions and 139 deletions.
34 changes: 17 additions & 17 deletions docs/concepts/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ The CrewAI CLI provides a set of commands to interact with CrewAI, allowing you

To use the CrewAI CLI, make sure you have CrewAI installed:

```shell
```shell Terminal
pip install crewai
```

## Basic Usage

The basic structure of a CrewAI CLI command is:

```shell
```shell Terminal
crewai [COMMAND] [OPTIONS] [ARGUMENTS]
```

Expand All @@ -30,15 +30,15 @@ crewai [COMMAND] [OPTIONS] [ARGUMENTS]

Create a new crew or flow.

```shell
```shell Terminal
crewai create [OPTIONS] TYPE NAME
```

- `TYPE`: Choose between "crew" or "flow"
- `NAME`: Name of the crew or flow

Example:
```shell
```shell Terminal
crewai create crew my_new_crew
crewai create flow my_new_flow
```
Expand All @@ -47,14 +47,14 @@ crewai create flow my_new_flow

Show the installed version of CrewAI.

```shell
```shell Terminal
crewai version [OPTIONS]
```

- `--tools`: (Optional) Show the installed version of CrewAI tools

Example:
```shell
```shell Terminal
crewai version
crewai version --tools
```
Expand All @@ -63,46 +63,46 @@ crewai version --tools

Train the crew for a specified number of iterations.

```shell
```shell Terminal
crewai train [OPTIONS]
```

- `-n, --n_iterations INTEGER`: Number of iterations to train the crew (default: 5)
- `-f, --filename TEXT`: Path to a custom file for training (default: "trained_agents_data.pkl")

Example:
```shell
```shell Terminal
crewai train -n 10 -f my_training_data.pkl
```

### 4. Replay

Replay the crew execution from a specific task.

```shell
```shell Terminal
crewai replay [OPTIONS]
```

- `-t, --task_id TEXT`: Replay the crew from this task ID, including all subsequent tasks

Example:
```shell
```shell Terminal
crewai replay -t task_123456
```

### 5. Log-tasks-outputs

Retrieve your latest crew.kickoff() task outputs.

```shell
```shell Terminal
crewai log-tasks-outputs
```

### 6. Reset-memories

Reset the crew memories (long, short, entity, latest_crew_kickoff_outputs).

```shell
```shell Terminal
crewai reset-memories [OPTIONS]
```

Expand All @@ -113,7 +113,7 @@ crewai reset-memories [OPTIONS]
- `-a, --all`: Reset ALL memories

Example:
```shell
```shell Terminal
crewai reset-memories --long --short
crewai reset-memories --all
```
Expand All @@ -122,23 +122,23 @@ crewai reset-memories --all

Test the crew and evaluate the results.

```shell
```shell Terminal
crewai test [OPTIONS]
```

- `-n, --n_iterations INTEGER`: Number of iterations to test the crew (default: 3)
- `-m, --model TEXT`: LLM Model to run the tests on the Crew (default: "gpt-4o-mini")

Example:
```shell
```shell Terminal
crewai test -n 5 -m gpt-3.5-turbo
```

### 8. Run

Run the crew.

```shell
```shell Terminal
crewai run
```
<Note>
Expand All @@ -153,7 +153,7 @@ Starting in version `0.98.0`, when you run the `crewai chat` command, you start

After receiving the results, you can continue interacting with the assistant for further instructions or questions.

```shell
```shell Terminal
crewai chat
```
<Note>
Expand Down
18 changes: 18 additions & 0 deletions docs/concepts/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ There are three ways to configure LLMs in CrewAI. Choose the method that best fi
# llm: bedrock/amazon.titan-text-express-v1
# llm: bedrock/meta.llama2-70b-chat-v1

# Amazon SageMaker Models - Enterprise-grade
# llm: sagemaker/<my-endpoint>

# Mistral Models - Open source alternative
# llm: mistral/mistral-large-latest
# llm: mistral/mistral-medium-latest
Expand Down Expand Up @@ -506,6 +509,21 @@ Learn how to get the most out of your LLM configuration:
)
```
</Accordion>

<Accordion title="Amazon SageMaker">
```python Code
AWS_ACCESS_KEY_ID=<your-access-key>
AWS_SECRET_ACCESS_KEY=<your-secret-key>
AWS_DEFAULT_REGION=<your-region>
```

Example usage:
```python Code
llm = LLM(
model="sagemaker/<my-endpoint>"
)
```
</Accordion>

<Accordion title="Mistral">
```python Code
Expand Down
60 changes: 55 additions & 5 deletions docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,48 @@ icon: wrench
If you need to update Python, visit [python.org/downloads](https://python.org/downloads)
</Note>

# Setting Up Your Environment

Before installing CrewAI, it's recommended to set up a virtual environment. This helps isolate your project dependencies and avoid conflicts.

<Steps>
<Step title="Create a Virtual Environment">
Choose your preferred method to create a virtual environment:

**Using venv (Python's built-in tool):**
```shell Terminal
python3 -m venv .venv
```

**Using conda:**
```shell Terminal
conda create -n crewai-env python=3.12
```
</Step>

<Step title="Activate the Virtual Environment">
Activate your virtual environment based on your platform:

**On macOS/Linux (venv):**
```shell Terminal
source .venv/bin/activate
```

**On Windows (venv):**
```shell Terminal
.venv\Scripts\activate
```

**Using conda (all platforms):**
```shell Terminal
conda activate crewai-env
```
</Step>
</Steps>

# Installing CrewAI

CrewAI is a flexible and powerful AI framework that enables you to create and manage AI agents, tools, and tasks efficiently.
Let's get you set up! 🚀
Now let's get you set up! 🚀

<Steps>
<Step title="Install CrewAI">
Expand Down Expand Up @@ -72,9 +110,9 @@ Let's get you set up! 🚀

# Creating a New Project

<Info>
<Tip>
We recommend using the YAML Template scaffolding for a structured approach to defining agents and tasks.
</Info>
</Tip>

<Steps>
<Step title="Generate Project Structure">
Expand All @@ -101,10 +139,22 @@ Let's get you set up! 🚀
│ └── __init__.py
└── config/
├── agents.yaml
├── config.yaml
└── tasks.yaml
```
</Frame>
</Step>
</Step>

<Step title="Install Additional Tools">
You can install additional tools using UV:
```shell Terminal
uv add <tool-name>
```

<Tip>
UV is our preferred package manager as it's significantly faster than pip and provides better dependency resolution.
</Tip>
</Step>

<Step title="Customize Your Project">
Your project will contain these essential files:
Expand Down
5 changes: 3 additions & 2 deletions docs/tools/composiotool.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Composio
title: Composio Tool
description: Composio provides 250+ production-ready tools for AI agents with flexible authentication management.
icon: gear-code
---
Expand Down Expand Up @@ -75,7 +75,8 @@ filtered_action_enums = toolset.find_actions_by_use_case(
)

tools = toolset.get_tools(actions=filtered_action_enums)
```<Tip>Set `advanced` to True to get actions for complex use cases</Tip>
```
<Tip>Set `advanced` to True to get actions for complex use cases</Tip>

- Using specific tools:

Expand Down
4 changes: 4 additions & 0 deletions src/crewai/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import subprocess
from typing import Any, Dict, List, Literal, Optional, Union

from litellm import AuthenticationError as LiteLLMAuthenticationError
from pydantic import Field, InstanceOf, PrivateAttr, model_validator

from crewai.agents import CacheHandler
Expand Down Expand Up @@ -261,6 +262,9 @@ def execute_task(
}
)["output"]
except Exception as e:
if isinstance(e, LiteLLMAuthenticationError):
# Do not retry on authentication errors
raise e
self._times_executed += 1
if self._times_executed > self.max_retry_limit:
raise e
Expand Down
Loading

0 comments on commit 83ceacb

Please sign in to comment.