Installation
π« Welcome to CAMEL! π«
Installation
1. From PyPI
To install the base CAMEL library:
Note: Some features may not work without their required dependencies. Install
camel-ai[all]
to ensure all dependencies are available, or install specific extras based on the features you need.
Available extras:
all
: Includes all features belowmodel_platforms
: OpenAI, Google, Mistral, Anthropic Claude, Cohere etc.huggingface
: Transformers, Diffusers, Accelerate, Datasets, PyTorch etc.rag
: Sentence Transformers, Qdrant, Milvus, TiDB, BM25,OceanBase etc.storage
: Neo4j, Redis, Azure Blob, Google Cloud Storage, AWS S3 etc.web_tools
: DuckDuckGo, Wikipedia, WolframAlpha, Google Maps, Weather API etc.document_tools
: PDF, Word, OpenAPI, BeautifulSoup, Unstructured etc.media_tools
: Image Processing, Audio Processing, YouTube Download, FFmpeg etc.communication_tools
: Slack, Discord, Telegram, GitHub, Reddit, Notion etc.data_tools
: Pandas, TextBlob, DataCommons, OpenBB, Stripe etc.research_tools
: arXiv, Google Scholar etc.dev_tools
: Docker, Jupyter, Tree-sitter, Code Interpreter etc.
Multiple extras can be combined using commas:
2. From Docker
Detailed guidance can be find here
By default, the agent uses the ModelType.DEFAULT
model from the ModelPlatformType.DEFAULT
. You can configure the default model platform and model type using environment variables. If these are not set, the agent will fall back to the default settings:
3. From Source with uv
4. Running Tests
To run tests, make sure you have activated the virtual environment first:
5. Setting Default Model Platform and Model Type (Optional)
You can customize the default model platform and model type by setting the following environment variables:
6. Setting Your Model API Key (Using OpenAI as an Example)
For Bash shell (Linux, macOS, Git Bash on Windows):
For Windows Command Prompt:
For Windows PowerShell:
Replace <insert your OpenAI API key>
with your actual OpenAI API key in each case.
Please note that the environment variable is session-specific. If you open a new terminal window or tab, you will need to set the API key again in that new session.
For .env
File:
To simplify the process of managing API Keys, you can use store information in a .env
file and load them into your application dynamically.
- Modify .env file in the root directory of CAMEL and fill the following lines:
Replace <fill your API KEY here>
with your actual API key.
- Load the .env file in your Python script: Use the load_dotenv() function from the dotenv module to load the variables from the .env file into the environment. Hereβs an example:
For more details about the key names in project and how to apply key, you can refer to here.
[!TIP] By default, the load_dotenv() function does not overwrite existing environment variables that are already set in your system. It only populates variables that are missing. If you need to overwrite existing environment variables with the values from your
.env
file, use theoverride=True
parameter:
After setting the OpenAI API key, you can run the role_playing.py
script. Find tasks for various assistant-user roles here.
Also feel free to run any scripts below that interest you:
For additional feature examples, see the examples
directory.