Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .container/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ GOOGLE_API_KEY=123456789
SEARCH_ENGINE_ID=123456789

# For OpenWeatherMap API
OPENWEATHERMAP_API_KEY=123456789
OPENWEATHERMAP_API_KEY=123456789
46 changes: 23 additions & 23 deletions .container/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ develop on it, with Docker.

## Configure Environment
Before starting the container, you need to navigate into the
[.container](../.container) folder and create a `.env` file **with your own
API
keys**, so that these keys will be present in the environment variables of
the container, which will later be used by CAMEL. The list of API keys that
[.container](../.container) folder and create a `.env` file **with your own
API
keys**, so that these keys will be present in the environment variables of
the container, which will later be used by CAMEL. The list of API keys that
can be found in the `.env.example` file.

```bash
Expand All @@ -25,15 +25,15 @@ cp .env.example .env
```

## Start Container
After configuring the API keys, simply run the following command to start
After configuring the API keys, simply run the following command to start
up the working container. This will automatically set up the environment and
dependencies for CAMEL. It may take some time, please be patient.

```bash
docker compose up -d
```

After the build is completed, you can see the image `camel:localdev` in the
After the build is completed, you can see the image `camel:localdev` in the
list of images, along with a started container, `camel-localdev`.

```bash
Expand All @@ -54,7 +54,7 @@ docker compose exec camel bash
Then you will be in the container environment under the CAMEL directory, with
all the dependencies installed.

Then You can try running the
Then You can try running the
[role_playing.py](../examples/ai_society/role_playing.py)
example.

Expand All @@ -66,43 +66,43 @@ If you see the agents interacting with each other, this means you are all set.
Have fun with CAMEL in Docker!

## Save Your Progress
We support volume mounting in the started container, which means that all
of your changes in the CAMEL directory inside the container will be synced
We support volume mounting in the started container, which means that all
of your changes in the CAMEL directory inside the container will be synced
into the CAMEL repo on your host system. Therefore, you don't need to worry
about losing your progress when you exit the container.

## Exit, Stop and Delete the Container
You can simply press `Ctrl + D` or use the `exit` command to exit the
container.

After exiting the container, under normal cases the container will still be
running in the background. If you don't need the container anymore, you can
After exiting the container, under normal cases the container will still be
running in the background. If you don't need the container anymore, you can
stop and delete the container with the following command.

```bash
docker compose down
```

## Online Images
For users who only want to have a quick tryout on CAMEL, we also provide the
For users who only want to have a quick tryout on CAMEL, we also provide the
pre-built images on
[our GitHub Container Registry](https://github.com/camel-ai/camel/pkgs/container/camel).
Considering the size of the image, we only offer the image with the basic
Considering the size of the image, we only offer the image with the basic
dependencies.

Note that there are some key differences between the local development
Note that there are some key differences between the local development
image and the pre-built image that you should be aware of.
1. The pre-built image is built upon the source code of each release of CAMEL.
This means that they are not suitable for development, as they don't
contain the git support. If you want to develop on CAMEL, please build
1. The pre-built image is built upon the source code of each release of CAMEL.
This means that they are not suitable for development, as they don't
contain the git support. If you want to develop on CAMEL, please build
the image by yourself according to the instructions above.
2. The pre-built image only contains the basic dependencies for running the
examples. If you want to run the examples that require additional
dependencies, you need to install them according to the
2. The pre-built image only contains the basic dependencies for running the
examples. If you want to run the examples that require additional
dependencies, you need to install them according to the
installation guide in CAMEL's [README](../README.md).
3. The pre-built image doesn't contain the API keys. You need to set up the
3. The pre-built image doesn't contain the API keys. You need to set up the
API keys by yourself in the container environment.
4. The pre-built image does not support volume mounting. This means that all
4. The pre-built image does not support volume mounting. This means that all
of your changes in the container will be lost when you delete the container.

To quickly start a container with the pre-built image, you can use the
Expand All @@ -123,4 +123,4 @@ command.

```bash
python examples/ai_society/role_playing.py
```
```
2 changes: 0 additions & 2 deletions .container/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ services:
- .env
user: "${UID:-1000}:${GID:-1000}"
command: ["tail", "-f", "/dev/null"]


2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,4 @@

# Grok API key
# XAI_API_KEY="Fill your Grok API Key here"
# XAI_API_BASE_URL="Fill your Grok API Base URL here"
# XAI_API_BASE_URL="Fill your Grok API Base URL here"
4 changes: 2 additions & 2 deletions .github/actions/camel_install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runs:
name: Restore caches for the virtual environment based on uv.lock
with:
path: ./.venv
key: venv-${{ hashFiles('uv.lock') }}
key: venv-${{ hashFiles('uv.lock', 'pyproject.toml') }}
- name: Validate cached virtual environment
id: validate-venv
if: steps.cache-restore.outputs.cache-hit == 'true'
Expand Down Expand Up @@ -49,4 +49,4 @@ runs:
if: steps.cache-restore.outputs.cache-hit != 'true' || steps.validate-venv.outputs.cache-valid == 'false'
with:
path: ./.venv
key: venv-${{ hashFiles('uv.lock') }}
key: venv-${{ hashFiles('uv.lock', 'pyproject.toml') }}
117 changes: 71 additions & 46 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,95 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: "CodeQL Advanced"

on:
push:
branches: ["master"]
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: ["master"]
branches: [ "master" ]
schedule:
- cron: "0 0 * * 1"

permissions:
contents: read
- cron: '33 15 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["javascript", "python", "typescript"]
# CodeQL supports [ $supported-codeql-languages ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

include:
- language: actions
build-mode: none
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit

- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
- name: Checkout repository
uses: actions/checkout@v4

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
# or others). This is typically only required for manual builds.
# - name: Setup runtime (example)
# uses: actions/setup-example@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Run manual build steps
if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@cf1bb45a277cb3c205638b2cd5c984db1c46a412 # v4.31.7
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/test_minimal_dependency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
run: |
source .venv/bin/activate
pip install pytest dotenv
pytest test/integration_test/test_minimal_dependency.py
pytest test/integration_test/test_minimal_dependency.py
10 changes: 1 addition & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
hooks:
- id: check-license
name: Check License
entry: python licenses/update_license.py . licenses/license_template.txt
entry: python licenses/update_license.py . licenses/license_template.txt
language: system
types: [python]
exclude: ^(docs/cookbooks/|examples/usecases/) # Ignore files under docs/cookbooks and examples/usecases
Expand All @@ -40,16 +40,8 @@ repos:
rev: v8.16.3
hooks:
- id: gitleaks
- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.38.0
hooks:
- id: eslint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pylint-dev/pylint
rev: v2.17.2
hooks:
- id: pylint
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Thank you for your interest in contributing to the CAMEL project! 🎉 We're exc

## Join Our Community 🌍

### Schedule an Introduction Call 📞
### Schedule an Introduction Call 📞
- English speakers: [here](https://cal.com/wendong-fan-5yu7x5/30min)
- Chinese speakers: [here](https://cal.com/wendong-fan-5yu7x5/30min)

Expand All @@ -21,7 +21,7 @@ Thank you for your interest in contributing to the CAMEL project! 🎉 We're exc

### Contributing to the Code 👨‍💻👩‍💻

If you're eager to contribute to this project, that's fantastic! We're thrilled to have your support.
If you're eager to contribute to this project, that's fantastic! We're thrilled to have your support.

- If you are a contributor from the community:
- Follow the [Fork-and-Pull-Request](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow when opening your pull requests.
Expand All @@ -40,9 +40,9 @@ Ensuring excellent documentation and thorough testing is absolutely crucial. Her
- Update any affected example console scripts in the `examples` directory, Gradio demos in the `apps` directory, and documentation in the `docs` directory.
- Update unit tests when relevant.
- If you add a feature:
- Include unit tests in the `test` directory.
- Include unit tests in the `test` directory.
- Add a demo script in the `examples` directory.

We're a small team focused on building great things. If you have something in mind that you'd like to add or modify, opening a pull request is the ideal way to catch our attention. 🚀

### Contributing to the Cookbook Writing 📚
Expand All @@ -62,9 +62,9 @@ Here’s how you can contribute to writing cookbooks:
- Interactive Elements: Whenever applicable, add interactive code cells in Colab that users can directly run and modify.

##### 1.2. Developing cookbooks for in-progress features
You can install the latest version of CAMEL from the main branch or a topic branch. This allows you to use the latest codebase, or in-progress features in your cookbook.
You can install the latest version of CAMEL from the main branch or a topic branch. This allows you to use the latest codebase, or in-progress features in your cookbook.

`!pip install "git+https://github.com/camel-ai/camel.git@master#egg=camel-ai[all]"`
`!pip install "git+https://github.com/camel-ai/camel.git@master#egg=camel-ai[all]"`

Changing the branch and extras section (e.g. remove `#egg=camel-ai[all]`) will behave as expected.

Expand Down Expand Up @@ -174,10 +174,10 @@ r"""Class for managing conversations of CAMEL Chat Agents.
Example:
```markdown
Args:
system_message (BaseMessage): The system message for initializing
system_message (BaseMessage): The system message for initializing
the agent's conversation context.
model (BaseModelBackend, optional): The model backend to use for
response generation. Defaults to :obj:`OpenAIModel` with
model (BaseModelBackend, optional): The model backend to use for
response generation. Defaults to :obj:`OpenAIModel` with
`GPT_4O_MINI`. (default: :obj:`OpenAIModel` with `GPT_4O_MINI`)
```

Expand Down Expand Up @@ -220,12 +220,12 @@ Avoid using `print` for output. Use Python's `logging` module (`logger`) to ensu

Examples:

- Bad:
- Bad:
```python
print("Process started")
print(f"User input: {user_input}")
```
- Good:
- Good:
```python
Args:
logger.info("Process started")
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Loading
Loading