Skip to content

Commit

Permalink
fix: bug fix and small enhance (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wendong-Fan authored Nov 28, 2024
1 parent 15946a4 commit 442040e
Show file tree
Hide file tree
Showing 33 changed files with 290 additions and 251 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ body:
attributes:
label: What version of camel are you using?
description: Run command `python3 -c 'print(__import__("camel").__version__)'` in your shell and paste the output here.
placeholder: E.g., 0.2.9
placeholder: E.g., 0.2.10
validations:
required: true

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ conda create --name camel python=3.10
conda activate camel
# Clone github repo
git clone -b v0.2.9 https://github.com/camel-ai/camel.git
git clone -b v0.2.10 https://github.com/camel-ai/camel.git
# Change directory into project directory
cd camel
Expand Down
2 changes: 1 addition & 1 deletion camel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# limitations under the License.
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========

__version__ = '0.2.9'
__version__ = '0.2.10'

__all__ = [
'__version__',
Expand Down
14 changes: 8 additions & 6 deletions camel/agents/chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def __init__(

self.model_type = self.model_backend.model_type

# tool registration
# Tool registration
external_tools = external_tools or []
tools = tools or []
all_tools = tools + external_tools
Expand All @@ -195,16 +195,18 @@ def __init__(
}
self.tool_dict = {tool.get_function_name(): tool for tool in all_tools}

# If the user hasn't configured tools in `BaseModelBackend`,
# the tools set from `ChatAgent` will be used.
# This design simplifies the interface while retaining tool-running
# capabilities for `BaseModelBackend`.
if all_tools and not self.model_backend.model_config_dict.get("tools"):
# If the user set tools from `ChatAgent`, it will override the
# configured tools in `BaseModelBackend`.
if all_tools:
logger.warning(
"Overriding the configured tools in `BaseModelBackend` with the tools from `ChatAgent`."
)
tool_schema_list = [
tool.get_openai_tool_schema() for tool in all_tools
]
self.model_backend.model_config_dict['tools'] = tool_schema_list
self.tool_schema_list = tool_schema_list

self.model_config_dict = self.model_backend.model_config_dict

self.model_token_limit = token_limit or self.model_backend.token_limit
Expand Down
8 changes: 4 additions & 4 deletions camel/embeddings/openai_compatible_embedding.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
# Licensed under the Apache License, Version 2.0 (the License);
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# 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.
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
from __future__ import annotations

import os
Expand Down
3 changes: 3 additions & 0 deletions camel/types/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ class ModelType(UnifiedModelType, Enum):
QWEN_2_5_72B = "qwen2.5-72b-instruct"
QWEN_2_5_32B = "qwen2.5-32b-instruct"
QWEN_2_5_14B = "qwen2.5-14b-instruct"
QWEN_QWQ_32B = "qwq-32b-preview"

# Yi models (01-ai)
YI_LIGHTNING = "yi-lightning"
Expand Down Expand Up @@ -309,6 +310,7 @@ def is_qwen(self) -> bool:
ModelType.QWEN_2_5_72B,
ModelType.QWEN_2_5_32B,
ModelType.QWEN_2_5_14B,
ModelType.QWEN_QWQ_32B,
}

@property
Expand Down Expand Up @@ -368,6 +370,7 @@ def token_limit(self) -> int:
ModelType.YI_LARGE_FC,
ModelType.QWEN_MAX,
ModelType.QWEN_VL_MAX,
ModelType.QWEN_QWQ_32B,
}:
return 32_768
elif self in {
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
project = 'CAMEL'
copyright = '2024, CAMEL-AI.org'
author = 'CAMEL-AI.org'
release = '0.2.9'
release = '0.2.10'

html_favicon = (
'https://raw.githubusercontent.com/camel-ai/camel/master/misc/favicon.png'
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_message.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai==0.2.9\""
"!pip install \"camel-ai==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_prompting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai==0.2.9\""
"!pip install \"camel-ai==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_society.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai==0.2.9\""
"!pip install \"camel-ai==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_tracking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"outputs": [],
"source": [
"%pip install camel-ai[all]==0.2.9\n",
"%pip install camel-ai[all]==0.2.10\n",
"%pip install agentops==0.3.10"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_with_memory.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai[all]==0.2.9\""
"!pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_with_rag.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai[all]==0.2.9\""
"!pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/agents_with_tools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai[all]==0.2.9\""
"!pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/create_your_first_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
{
"cell_type": "code",
"source": [
"!pip install \"camel-ai[all]==0.2.9\""
"!pip install \"camel-ai[all]==0.2.10\""
],
"metadata": {
"id": "UtcC3c-KVZmU"
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/create_your_first_agents_society.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
{
"cell_type": "code",
"source": [
"!pip install \"camel-ai==0.2.9\""
"!pip install \"camel-ai==0.2.10\""
],
"metadata": {
"id": "RiwfwyyLYYxo"
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/critic_agents_and_tree_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
{
"cell_type": "code",
"source": [
"%pip install \"camel-ai==0.2.9\""
"%pip install \"camel-ai==0.2.10\""
],
"metadata": {
"id": "UtcC3c-KVZmU"
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/embodied_agents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
{
"cell_type": "code",
"source": [
"%pip install \"camel-ai==0.2.9\""
"%pip install \"camel-ai==0.2.10\""
],
"metadata": {
"id": "UtcC3c-KVZmU"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
},
"outputs": [],
"source": [
"pip install \"camel-ai[all]==0.2.9\""
"pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/knowledge_graph.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
},
"outputs": [],
"source": [
"pip install \"camel-ai[all]==0.2.9\""
"pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/model_speed_comparison.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
{
"cell_type": "code",
"source": [
"!pip install \"camel-ai==0.2.9\""
"!pip install \"camel-ai==0.2.10\""
],
"metadata": {
"id": "UtcC3c-KVZmU"
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/roleplaying_scraper.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai[all]==0.2.9\""
"!pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/task_generation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"outputs": [],
"source": [
"!pip install \"camel-ai==0.2.9\""
"!pip install \"camel-ai==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/video_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"outputs": [],
"source": [
"%pip install \"camel-ai[all]==0.2.9\""
"%pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/cookbooks/workforce_judge_committee.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"outputs": [],
"source": [
"%pip install \"camel-ai[all]==0.2.9\""
"%pip install \"camel-ai[all]==0.2.10\""
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/get_started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ conda create --name camel python=3.10
conda activate camel
# Clone github repo
git clone -b v0.2.9 https://github.com/camel-ai/camel.git
git clone -b v0.2.10 https://github.com/camel-ai/camel.git
# Change directory into project directory
cd camel
Expand Down
4 changes: 2 additions & 2 deletions docs/key_modules/loaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,14 +336,14 @@ response = jina_reader.read_content("https://docs.camel-ai.org/")
print(response)
```
```markdown
>>>Welcome to CAMEL’s documentation! — CAMEL 0.2.9 documentation
>>>Welcome to CAMEL’s documentation! — CAMEL 0.2.10 documentation
===============

[Skip to main content](https://docs.camel-ai.org/#main-content)

Back to top Ctrl+K

[![Image 1](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png) ![Image 2](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png)CAMEL 0.2.9](https://docs.camel-ai.org/#)
[![Image 1](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png) ![Image 2](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png)CAMEL 0.2.10](https://docs.camel-ai.org/#)

Search Ctrl+K

Expand Down
1 change: 1 addition & 0 deletions docs/key_modules/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ The following table lists currently supported model platforms by CAMEL.
| Lingyiwanwu | yi-spark | N |
| Lingyiwanwu | yi-large-rag | N |
| Lingyiwanwu | yi-large-fc | N |
| Qwen | qwq-32b-preview | N |
| Qwen | qwen-max | N |
| Qwen | qwen-plus | N |
| Qwen | qwen-turbo | N |
Expand Down
8 changes: 4 additions & 4 deletions examples/embeddings/openai_compatible_embedding_example.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
# Licensed under the Apache License, Version 2.0 (the License);
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an AS IS BASIS,
# 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.
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========

from camel.embeddings import OpenAICompatibleEmbedding

Expand Down
Loading

0 comments on commit 442040e

Please sign in to comment.