camel-ai 0.1.5.2__py3-none-any.whl → 0.1.5.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of camel-ai might be problematic. Click here for more details.
- camel/agents/chat_agent.py +21 -17
- camel/agents/critic_agent.py +6 -9
- camel/agents/deductive_reasoner_agent.py +7 -9
- camel/agents/embodied_agent.py +6 -9
- camel/agents/knowledge_graph_agent.py +12 -10
- camel/agents/role_assignment_agent.py +10 -11
- camel/agents/search_agent.py +5 -5
- camel/agents/task_agent.py +26 -38
- camel/configs/openai_config.py +14 -0
- camel/embeddings/base.py +10 -9
- camel/embeddings/openai_embedding.py +25 -12
- camel/embeddings/sentence_transformers_embeddings.py +28 -14
- camel/functions/open_api_function.py +11 -4
- camel/functions/slack_functions.py +14 -2
- camel/models/__init__.py +4 -0
- camel/models/anthropic_model.py +4 -2
- camel/models/base_model.py +4 -1
- camel/models/model_factory.py +42 -21
- camel/models/nemotron_model.py +71 -0
- camel/models/ollama_model.py +121 -0
- camel/models/open_source_model.py +7 -2
- camel/models/openai_model.py +8 -3
- camel/models/stub_model.py +3 -1
- camel/prompts/__init__.py +4 -0
- camel/prompts/generate_text_embedding_data.py +79 -0
- camel/prompts/task_prompt_template.py +4 -0
- camel/retrievers/auto_retriever.py +2 -2
- camel/societies/role_playing.py +16 -19
- camel/storages/graph_storages/graph_element.py +9 -1
- camel/types/__init__.py +2 -0
- camel/types/enums.py +84 -22
- camel/utils/commons.py +4 -0
- camel/utils/token_counting.py +5 -3
- {camel_ai-0.1.5.2.dist-info → camel_ai-0.1.5.4.dist-info}/METADATA +60 -47
- {camel_ai-0.1.5.2.dist-info → camel_ai-0.1.5.4.dist-info}/RECORD +36 -36
- camel/bots/__init__.py +0 -20
- camel/bots/discord_bot.py +0 -103
- camel/bots/telegram_bot.py +0 -84
- {camel_ai-0.1.5.2.dist-info → camel_ai-0.1.5.4.dist-info}/WHEEL +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.1.5.
|
|
3
|
+
Version: 0.1.5.4
|
|
4
4
|
Summary: Communicative Agents for AI Society Study
|
|
5
5
|
Home-page: https://www.camel-ai.org/
|
|
6
6
|
License: Apache-2.0
|
|
7
7
|
Keywords: communicative-ai,ai-societies,artificial-intelligence,deep-learning,multi-agent-systems,cooperative-ai,natural-language-processing,large-language-models
|
|
8
8
|
Author: CAMEL-AI.org
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.9.0,<3.12
|
|
10
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.9
|
|
@@ -23,7 +23,7 @@ Provides-Extra: tools
|
|
|
23
23
|
Provides-Extra: vector-databases
|
|
24
24
|
Requires-Dist: PyMuPDF (>=1.22.5,<2.0.0) ; extra == "tools" or extra == "all"
|
|
25
25
|
Requires-Dist: accelerate (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
26
|
-
Requires-Dist: anthropic (>=0.
|
|
26
|
+
Requires-Dist: anthropic (>=0.29.0,<0.30.0)
|
|
27
27
|
Requires-Dist: beautifulsoup4 (>=4,<5) ; extra == "tools" or extra == "all"
|
|
28
28
|
Requires-Dist: cohere (>=4.56,<5.0) ; extra == "retrievers" or extra == "all"
|
|
29
29
|
Requires-Dist: colorama (>=0,<1)
|
|
@@ -35,7 +35,7 @@ Requires-Dist: docstring-parser (>=0.15,<0.16)
|
|
|
35
35
|
Requires-Dist: docx2txt (>=0.8,<0.9) ; extra == "tools" or extra == "all"
|
|
36
36
|
Requires-Dist: duckduckgo-search (>=6.1.0,<7.0.0) ; extra == "tools" or extra == "all"
|
|
37
37
|
Requires-Dist: googlemaps (>=4.10.0,<5.0.0) ; extra == "tools" or extra == "all"
|
|
38
|
-
Requires-Dist: imageio (>=2.34.
|
|
38
|
+
Requires-Dist: imageio[pyav] (>=2.34.2,<3.0.0) ; extra == "tools" or extra == "all"
|
|
39
39
|
Requires-Dist: jsonschema (>=4,<5)
|
|
40
40
|
Requires-Dist: litellm (>=1.38.1,<2.0.0) ; extra == "model-platforms" or extra == "all"
|
|
41
41
|
Requires-Dist: mock (>=5,<6) ; extra == "test"
|
|
@@ -60,7 +60,7 @@ Requires-Dist: pytest-asyncio (>=0.23.0,<0.24.0) ; extra == "test"
|
|
|
60
60
|
Requires-Dist: qdrant-client (>=1.9.0,<2.0.0) ; extra == "vector-databases" or extra == "all"
|
|
61
61
|
Requires-Dist: rank-bm25 (>=0.2.2,<0.3.0) ; extra == "retrievers" or extra == "all"
|
|
62
62
|
Requires-Dist: requests_oauthlib (>=1.3.1,<2.0.0) ; extra == "tools" or extra == "all"
|
|
63
|
-
Requires-Dist: sentence-transformers (>=
|
|
63
|
+
Requires-Dist: sentence-transformers (>=3.0.1,<4.0.0) ; extra == "encoders" or extra == "all"
|
|
64
64
|
Requires-Dist: sentencepiece (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
65
65
|
Requires-Dist: slack-sdk (>=3.27.2,<4.0.0) ; extra == "tools" or extra == "all"
|
|
66
66
|
Requires-Dist: soundfile (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
|
|
@@ -180,13 +180,13 @@ exit
|
|
|
180
180
|
Install `CAMEL` from source with conda and pip:
|
|
181
181
|
```sh
|
|
182
182
|
# Create a conda virtual environment
|
|
183
|
-
conda create --name camel python=3.
|
|
183
|
+
conda create --name camel python=3.9
|
|
184
184
|
|
|
185
185
|
# Activate CAMEL conda environment
|
|
186
186
|
conda activate camel
|
|
187
187
|
|
|
188
188
|
# Clone github repo
|
|
189
|
-
git clone -b v0.1.5.
|
|
189
|
+
git clone -b v0.1.5.4 https://github.com/camel-ai/camel.git
|
|
190
190
|
|
|
191
191
|
# Change directory into project directory
|
|
192
192
|
cd camel
|
|
@@ -246,54 +246,67 @@ python examples/ai_society/role_playing.py
|
|
|
246
246
|
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.
|
|
247
247
|
|
|
248
248
|
|
|
249
|
-
## Use Open-Source Models as Backends
|
|
249
|
+
## Use Open-Source Models as Backends (ex. using Ollama to set Llama 3 locally)
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
```sh
|
|
260
|
-
# Launch the controller
|
|
261
|
-
python -m fastchat.serve.controller
|
|
262
|
-
|
|
263
|
-
# Launch the model worker(s)
|
|
264
|
-
python3 -m fastchat.serve.model_worker --model-path meta-llama/Llama-2-7b-chat-hf
|
|
265
|
-
|
|
266
|
-
# Launch the RESTful API server
|
|
267
|
-
python3 -m fastchat.serve.openai_api_server --host localhost --port 8000
|
|
268
|
-
```
|
|
251
|
+
- Download [Ollama](https://ollama.com/download).
|
|
252
|
+
- After setting up Ollama, pull the Llama3 model by typing the following command into the terminal:
|
|
253
|
+
```bash
|
|
254
|
+
ollama pull llama3
|
|
255
|
+
```
|
|
256
|
+
- Create a ModelFile similar the one below in your project directory.
|
|
257
|
+
```bash
|
|
258
|
+
FROM llama3
|
|
269
259
|
|
|
270
|
-
|
|
260
|
+
# Set parameters
|
|
261
|
+
PARAMETER temperature 0.8
|
|
262
|
+
PARAMETER stop Result
|
|
271
263
|
|
|
272
|
-
|
|
264
|
+
# Sets a custom system message to specify the behavior of the chat assistant
|
|
273
265
|
|
|
274
|
-
|
|
275
|
-
system_message = # ...
|
|
266
|
+
# Leaving it blank for now.
|
|
276
267
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
),
|
|
283
|
-
)
|
|
268
|
+
SYSTEM """ """
|
|
269
|
+
```
|
|
270
|
+
- Create a script to get the base model (llama3) and create a custom model using the ModelFile above. Save this as a .sh file:
|
|
271
|
+
```bash
|
|
272
|
+
#!/bin/zsh
|
|
284
273
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
)
|
|
289
|
-
```
|
|
274
|
+
# variables
|
|
275
|
+
model_name="llama3"
|
|
276
|
+
custom_model_name="camel-llama3"
|
|
290
277
|
|
|
291
|
-
|
|
278
|
+
#get the base model
|
|
279
|
+
ollama pull $model_name
|
|
292
280
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
281
|
+
#create the model file
|
|
282
|
+
ollama create $custom_model_name -f ./Llama3ModelFile
|
|
283
|
+
```
|
|
284
|
+
- Navigate to the directory where the script and ModelFile are located and run the script. Enjoy your Llama3 model, enhanced by CAMEL's excellent agents.
|
|
285
|
+
```python
|
|
286
|
+
from camel.agents import ChatAgent
|
|
287
|
+
from camel.messages import BaseMessage
|
|
288
|
+
from camel.models import ModelFactory
|
|
289
|
+
from camel.types import ModelPlatformType
|
|
290
|
+
|
|
291
|
+
ollama_model = ModelFactory.create(
|
|
292
|
+
model_platform=ModelPlatformType.OLLAMA,
|
|
293
|
+
model_type="llama3",
|
|
294
|
+
url="http://localhost:11434/v1",
|
|
295
|
+
model_config_dict={"temperature": 0.4},
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
assistant_sys_msg = BaseMessage.make_assistant_message(
|
|
299
|
+
role_name="Assistant",
|
|
300
|
+
content="You are a helpful assistant.",
|
|
301
|
+
)
|
|
302
|
+
agent = ChatAgent(assistant_sys_msg, model=ollama_model, token_limit=4096)
|
|
303
|
+
|
|
304
|
+
user_msg = BaseMessage.make_user_message(
|
|
305
|
+
role_name="User", content="Say hi to CAMEL"
|
|
306
|
+
)
|
|
307
|
+
assistant_response = agent.step(user_msg)
|
|
308
|
+
print(assistant_response.msg.content)
|
|
309
|
+
```
|
|
297
310
|
|
|
298
311
|
## Data (Hosted on Hugging Face)
|
|
299
312
|
| Dataset | Chat format | Instruction format | Chat format (translated) |
|
|
@@ -1,34 +1,31 @@
|
|
|
1
1
|
camel/__init__.py,sha256=9lSkzCVy_evUPseFTI7wD_oMEn6wRo9aRZna06ygz5I,778
|
|
2
2
|
camel/agents/__init__.py,sha256=SSU1wbhZXWwQnE0rRxkpyN57kEu72KklsZNcdLkXfTs,1551
|
|
3
3
|
camel/agents/base.py,sha256=X39qWSiT1WnDqaJ9k3gQrTpOQSwUKzNEVpp5AY6fDH8,1130
|
|
4
|
-
camel/agents/chat_agent.py,sha256
|
|
5
|
-
camel/agents/critic_agent.py,sha256=
|
|
6
|
-
camel/agents/deductive_reasoner_agent.py,sha256=
|
|
7
|
-
camel/agents/embodied_agent.py,sha256=
|
|
8
|
-
camel/agents/knowledge_graph_agent.py,sha256=
|
|
9
|
-
camel/agents/role_assignment_agent.py,sha256=
|
|
10
|
-
camel/agents/search_agent.py,sha256=
|
|
11
|
-
camel/agents/task_agent.py,sha256=
|
|
4
|
+
camel/agents/chat_agent.py,sha256=yeSSVTnKbRmA7DUFv2waaPz3rMM6z-Gevi0DoYQ8-Uo,27687
|
|
5
|
+
camel/agents/critic_agent.py,sha256=M3XNxRS0wAs5URjc_0kvtXqUlD-KpXq3L5ADz-KCKGU,7199
|
|
6
|
+
camel/agents/deductive_reasoner_agent.py,sha256=8R9hY_yCr_guq_ySuIE3eaYbiPeHVrsh6HKqIWrR0zY,13180
|
|
7
|
+
camel/agents/embodied_agent.py,sha256=Mm2-wvcpduXOvsHMBcavroACyvK06Mxe6QYTf80tdfI,7160
|
|
8
|
+
camel/agents/knowledge_graph_agent.py,sha256=h3LdqqX0KPPyq5v9O4WXZTdcyS2Exz5cMGZPei38ZNo,8818
|
|
9
|
+
camel/agents/role_assignment_agent.py,sha256=IWfu5b2RW1gYziffskErhdmybJOusVvhb9gqLF9_5mw,4800
|
|
10
|
+
camel/agents/search_agent.py,sha256=TMyV2LoBVB0hMnSex6q7xbyLRGsF_EMKxCZ8xbZBX9o,4404
|
|
11
|
+
camel/agents/task_agent.py,sha256=aNpn8bYoe2VlVSlWfbV6ynI5zG9pXq6V5NcppqJGVlU,14253
|
|
12
12
|
camel/agents/tool_agents/__init__.py,sha256=ulTNWU2qoFGe3pvVmCq_sdfeSX3NKZ0due66TYvsL-M,862
|
|
13
13
|
camel/agents/tool_agents/base.py,sha256=nQAhfWi8a_bCgzlf5-G-tmj1fKm6AjpRc89NQkWwpnc,1399
|
|
14
14
|
camel/agents/tool_agents/hugging_face_tool_agent.py,sha256=1Z5tG6f_86eL0vmtRZ-BJvoLDFFLhoHt8JtDvgat1xU,8723
|
|
15
|
-
camel/bots/__init__.py,sha256=DGgIhb7Gr_ShnAldq-4wAXucOdSvKtiV3m6e9G10rbA,834
|
|
16
|
-
camel/bots/discord_bot.py,sha256=y4rUyKgeowBpkMkhK29UKyE-DPfJhoouh7onqh7NzXE,3595
|
|
17
|
-
camel/bots/telegram_bot.py,sha256=bekO5vQcd62UcyUmEbdiSMJao9CWDsu3Okb6bXXQFUg,2890
|
|
18
15
|
camel/configs/__init__.py,sha256=9yc5rMGH_FHYCRyC89vmtozNi7RGhN8XHLXxtnIzRh4,1170
|
|
19
16
|
camel/configs/anthropic_config.py,sha256=zD7VMFUw4s7wmBlr64oSXxpEUkhp7wj9mvAd0WK2zFc,3308
|
|
20
17
|
camel/configs/base_config.py,sha256=CEF8ryl_dkH6LgOhwuP5_EgjaWCUCB-E3GcMWR-2YFE,870
|
|
21
18
|
camel/configs/litellm_config.py,sha256=6nghqAD1G7nsvW6W56LHpSKEnJyRiCLEcLgtzpPr-ac,5542
|
|
22
|
-
camel/configs/openai_config.py,sha256=
|
|
19
|
+
camel/configs/openai_config.py,sha256=tFEiPDQ8Cdvkfds83T7_5osNikwA3NuRGbpjV0wq4Ao,7593
|
|
23
20
|
camel/embeddings/__init__.py,sha256=9TI7392iYxrlYYerPoboDBOFvpEmP_nSSgtEjks1vJQ,1034
|
|
24
|
-
camel/embeddings/base.py,sha256=
|
|
25
|
-
camel/embeddings/openai_embedding.py,sha256=
|
|
26
|
-
camel/embeddings/sentence_transformers_embeddings.py,sha256=
|
|
21
|
+
camel/embeddings/base.py,sha256=deX70VXGmWGRAPal3HheXvMaarymRR5I1i90KPWGWXs,2196
|
|
22
|
+
camel/embeddings/openai_embedding.py,sha256=o16yl8uULjOoPB5DFuNGd6JDIIaQyGCrkj2LBaDEj6g,3324
|
|
23
|
+
camel/embeddings/sentence_transformers_embeddings.py,sha256=ayYIBOADdmmhlmo1iZS8tI_mZ-rX0sxjljyQpkuftcw,2730
|
|
27
24
|
camel/embeddings/vlm_embedding.py,sha256=VvD_b737snNrZTRE4ejFvWLjd_YT1DCTKl8yKIgRM-g,5436
|
|
28
25
|
camel/functions/__init__.py,sha256=3d1ZI3xx67DvHeBQhQQAu7IwTohC6Sa-_EPZeDE8_50,1737
|
|
29
26
|
camel/functions/google_maps_function.py,sha256=AmhlIyqkrkZF6Vb4O-wdtEKTQjRh5mMjHjS56ciGgjk,12468
|
|
30
27
|
camel/functions/math_functions.py,sha256=sPHSEOdHOmL38wZWcdyiBj0VEmf7mhQ0MBzya1SFNL0,1703
|
|
31
|
-
camel/functions/open_api_function.py,sha256=
|
|
28
|
+
camel/functions/open_api_function.py,sha256=QW0zTIGxXT1h-JWIK1iAKsqvDXXX5FrIwHBJg8i6N4g,20518
|
|
32
29
|
camel/functions/open_api_specs/biztoc/__init__.py,sha256=f3LXNDzN2XWWoF2D0nesG8VuEA6Zd14i2aiTDbCm5bA,708
|
|
33
30
|
camel/functions/open_api_specs/biztoc/ai-plugin.json,sha256=IJinQbLv5MFPGFwdN7PbOhwArFVExSEZdJspe-mOBIo,866
|
|
34
31
|
camel/functions/open_api_specs/biztoc/openapi.yaml,sha256=SQ2bYIWb1nVBtkBeFaOihiWQ71oZ2bzz0fCgu6igM8A,610
|
|
@@ -57,7 +54,7 @@ camel/functions/open_api_specs/web_scraper/paths/scraper.py,sha256=SQGbFkshLN4xm
|
|
|
57
54
|
camel/functions/openai_function.py,sha256=NyN8LBKdNeWizR7SnOp6VwEQhq29OJgskFfXq8EzIFg,14948
|
|
58
55
|
camel/functions/retrieval_functions.py,sha256=ZBwQhBeun86k6AnMDCpf0U-JYNaU0alDJAS1hdnumAQ,2281
|
|
59
56
|
camel/functions/search_functions.py,sha256=tj2eM7Jc70a5tsZhKr3mWczUbK9saUAJxXTrlWKBAv8,11151
|
|
60
|
-
camel/functions/slack_functions.py,sha256=
|
|
57
|
+
camel/functions/slack_functions.py,sha256=nQ9qzaswzQ1wEFVapWzgZ2-zF2oVXNMJQ50zxBPaz_g,9100
|
|
61
58
|
camel/functions/twitter_function.py,sha256=xL-GKU69WrcTUm3lQl1yPgJFxtBJKRmWN3zx9AfGNKI,17254
|
|
62
59
|
camel/functions/weather_functions.py,sha256=W2jMFqxq5M7Dan7cgEpnvzBk0SV_MduMbCuvHBsgo-c,5881
|
|
63
60
|
camel/generators.py,sha256=tcYDoHwSKN0rBiu7u4rWN9pb61O8OaclrNaasCqHSJM,10437
|
|
@@ -82,44 +79,47 @@ camel/memories/records.py,sha256=zmZsYHVuq6fYqJDkzhNXF02uWLzdBemaEZeG0Ls90pU,361
|
|
|
82
79
|
camel/messages/__init__.py,sha256=djLvpz6AmjeLzuUSQl7J6T2O4x8MwSdcH0l9fbj_3yg,1468
|
|
83
80
|
camel/messages/base.py,sha256=1cyYITXxBsp2UCdOjF1Ky4W_PgRegEfitqbrF9PjUPs,13721
|
|
84
81
|
camel/messages/func_message.py,sha256=CCVkbz-2pdxXV0vBETI0xt7d7uiN8zACpRI7lCnfTFQ,3841
|
|
85
|
-
camel/models/__init__.py,sha256=
|
|
86
|
-
camel/models/anthropic_model.py,sha256=
|
|
87
|
-
camel/models/base_model.py,sha256=
|
|
82
|
+
camel/models/__init__.py,sha256=RfAHcSSaBUAilObQIU07uICxaujjeO5EwLv4Pg0vrPc,1408
|
|
83
|
+
camel/models/anthropic_model.py,sha256=Gaf3xVcUa3OqFHWOyi3qhiG9LIbqozhdtmJNHDGomQY,5412
|
|
84
|
+
camel/models/base_model.py,sha256=TMbS44Fn-6m0OlrxYCtvwKqGUM_4Jz2y6kX-P28nOeI,4030
|
|
88
85
|
camel/models/litellm_model.py,sha256=_f61yTPFNMrdAAKuDokLoohjuhECcwjdOjLmDoxgNJk,3942
|
|
89
|
-
camel/models/model_factory.py,sha256=
|
|
90
|
-
camel/models/
|
|
86
|
+
camel/models/model_factory.py,sha256=786bR7cCdqK4V5i4wUJ20PC6cKPyX9AQN7zE8PBeW0s,3878
|
|
87
|
+
camel/models/nemotron_model.py,sha256=qaRbqEPFYR2Chp4SqdiNOOZvPjFfbLKZiQdGMEg74bc,2443
|
|
88
|
+
camel/models/ollama_model.py,sha256=Z65KZ4R_GPV3ezAORzNQIZmu28fCF13Lb01nGwQYuMk,4488
|
|
89
|
+
camel/models/open_source_model.py,sha256=r8TGq-9xAwOANZ5s_y3fJUGAvS0zDg03RmbZ8X2ga-E,6156
|
|
91
90
|
camel/models/openai_audio_models.py,sha256=Jpd_B-5R8d8s3qYo_0x-Ahw5icMCysGEjaDtssV34dg,9799
|
|
92
|
-
camel/models/openai_model.py,sha256
|
|
93
|
-
camel/models/stub_model.py,sha256=
|
|
91
|
+
camel/models/openai_model.py,sha256=-pW1dtDkP1WemGIzgxkYeEZ6kzGpgsFsGuF069HIeIo,4356
|
|
92
|
+
camel/models/stub_model.py,sha256=kyFXy9WyHgjnXDFO8Sag4q023lHGu4D0vyzfkGTSi9w,3704
|
|
94
93
|
camel/models/zhipuai_model.py,sha256=DMpmwn6eCXwof1ASvih3NTfGxTlt5YstGEC6qrQqRJE,4484
|
|
95
|
-
camel/prompts/__init__.py,sha256=
|
|
94
|
+
camel/prompts/__init__.py,sha256=tvN1pz132rgjV_C4MoVrSMTqgtOP0SzdfzAPX8rjpaQ,2049
|
|
96
95
|
camel/prompts/ai_society.py,sha256=ApgvIED1Z_mdsWDNc2_u35Ktp7pEKksMrOIQKo_q5cI,6306
|
|
97
96
|
camel/prompts/base.py,sha256=VMde6w97zHPP03OA628wGwXhtJweoccOK1B1f3aESDo,8464
|
|
98
97
|
camel/prompts/code.py,sha256=vrv2mPjlakPlqVLQt_rA1veP79EN1t3iM41bkACrc9I,5865
|
|
99
98
|
camel/prompts/descripte_video_prompt.py,sha256=lyJlVN1wjrY77Cv8U3NdDpmtlyIXs1wHYRhsrgLPcuY,1295
|
|
100
99
|
camel/prompts/evaluation.py,sha256=4zm5ZVy3CSb2NdFWnS43ejK8Cu_pU8iUIj06ofpuZpg,1596
|
|
100
|
+
camel/prompts/generate_text_embedding_data.py,sha256=S0D0S99OAixDh_jp3sfFbeRJjffLutmyUd-vryqV7ho,4246
|
|
101
101
|
camel/prompts/misalignment.py,sha256=aL3W5WvTJBfF-1vWQse_tn3zAOaezHGU510HLs0AlQo,4537
|
|
102
102
|
camel/prompts/object_recognition.py,sha256=L_YM_c8AxwO6MvwuUdeuluwhBPXedNxNIzOv5yF9Dag,1422
|
|
103
103
|
camel/prompts/prompt_templates.py,sha256=PeOp_eUgyZyJ7BCwA2cvSx8O3QPu9ftjgaZ6Al8zlJQ,4134
|
|
104
104
|
camel/prompts/role_description_prompt_template.py,sha256=k9p3NlxY1MWKzhoRpeQeuz0oHDQYo63WoPdWcUmHr_A,2544
|
|
105
105
|
camel/prompts/solution_extraction.py,sha256=5vTSaeQoBSvaur3cKgqQ9kLxSA5QIOBI4OPQzXWbQFg,2109
|
|
106
|
-
camel/prompts/task_prompt_template.py,sha256=
|
|
106
|
+
camel/prompts/task_prompt_template.py,sha256=2Z4kMoT1IiMqcXKIEl8Tro-5pbQJqDmLaXi8hqkxPOk,3040
|
|
107
107
|
camel/prompts/translation.py,sha256=V_40Ko2is5dAOCZ8DzsHo6DO7l8_jnEV9KjCKH7GxtY,1902
|
|
108
108
|
camel/responses/__init__.py,sha256=edtTQskOgq5obyITziRFL62HTJP9sAikAtP9vrFacEQ,795
|
|
109
109
|
camel/responses/agent_responses.py,sha256=UsTZHi4jPs2wfChPQWttVNyHneoGdQtdrRouatywE4w,1714
|
|
110
110
|
camel/retrievers/__init__.py,sha256=CuP3B77zl2PoF-W2y9xSkTGRzoK2J4TlUHdCtuJD8dg,1059
|
|
111
|
-
camel/retrievers/auto_retriever.py,sha256=
|
|
111
|
+
camel/retrievers/auto_retriever.py,sha256=3UPGsGXIkEclg75Fj-EbW0Y8_jrBK8Li2lA0NBn-O-8,13467
|
|
112
112
|
camel/retrievers/base.py,sha256=sgqaJDwIkWluEgPBlukFN7RYZJnrp0imCAOEWm6bZ40,2646
|
|
113
113
|
camel/retrievers/bm25_retriever.py,sha256=-aWMZBF_WqSeyk_0Gcf9x4B12ywSBwHScSzxQmFZkXw,5199
|
|
114
114
|
camel/retrievers/cohere_rerank_retriever.py,sha256=jDAo5OxAWZBQhgH9cSo0_3h057AN4z6_oDMIy6HZvik,4142
|
|
115
115
|
camel/retrievers/vector_retriever.py,sha256=PhPIUyjffOojwYiATEY1lsCQO9yDmpc8k-R4sAt5IvY,7316
|
|
116
116
|
camel/societies/__init__.py,sha256=JhGwUHjht4CewzC3shKuxmgB3oS7FIxIxmiKyhNsfIs,832
|
|
117
117
|
camel/societies/babyagi_playing.py,sha256=0sDe65XbGGWQOe4I758sH-sAk1Hf82Y_qawjaEbbBXE,11791
|
|
118
|
-
camel/societies/role_playing.py,sha256=
|
|
118
|
+
camel/societies/role_playing.py,sha256=C5hQIPH8gwP7_dkh65nOPplsw50lYQiYXk-aapODqMY,21983
|
|
119
119
|
camel/storages/__init__.py,sha256=crRaZKmgvs8RCzfffREYIVo09J4q_HVu44JGb4CJMfo,1480
|
|
120
120
|
camel/storages/graph_storages/__init__.py,sha256=vsJZkedaCS-cLQ-KgMqio8cxXvbousBWVqzZJvlimT8,897
|
|
121
121
|
camel/storages/graph_storages/base.py,sha256=-Ys1BIuz4H5FvYMZTBIjg8Cfv40CPQ-OsovwMzygEgU,2858
|
|
122
|
-
camel/storages/graph_storages/graph_element.py,sha256=
|
|
122
|
+
camel/storages/graph_storages/graph_element.py,sha256=cz3eQdSockPsJwEVo6R_X_QeuS81_x5XrZjpzK1Q7cw,2599
|
|
123
123
|
camel/storages/graph_storages/neo4j_graph.py,sha256=wvOiHLsMPN5dTIBk97oOyyAhwU7TJHxFRaMsBimt25k,22077
|
|
124
124
|
camel/storages/key_value_storages/__init__.py,sha256=lZOFtqj1iTQ9pRB4DkCYSMyPwEwaJDVzU06kM5jxFd4,916
|
|
125
125
|
camel/storages/key_value_storages/base.py,sha256=knxni8WiyTXJ2emZQO-JIsbxw6Ei7EO6dj-bU2YCoSY,2183
|
|
@@ -136,13 +136,13 @@ camel/terminators/token_limit_terminator.py,sha256=mK30wVUnoqNAvIo-wxkqY5gUSNay2
|
|
|
136
136
|
camel/toolkits/__init__.py,sha256=2-z9eGt53U6_1uwMtiu0-GgU7k5iFkS3HEMXuB3Qs2A,836
|
|
137
137
|
camel/toolkits/base.py,sha256=znjnZtgxA5gbT7OMnrKQF_a9FK3A7Xk5s_lP94u76vI,923
|
|
138
138
|
camel/toolkits/github_toolkit.py,sha256=ZBShnR7Vc3xQhQiTHsiF2esyBn7JEJxldvlgg-Cnsgk,11631
|
|
139
|
-
camel/types/__init__.py,sha256=
|
|
140
|
-
camel/types/enums.py,sha256=
|
|
139
|
+
camel/types/__init__.py,sha256=ArKXATj3z_Vv4ISmROVeo6Mv3tj5kE1dTkqfgwyxVY4,1975
|
|
140
|
+
camel/types/enums.py,sha256=nGxWYhGuZkbNfampLcmKrRIlHXuDD085CZXuajAn1KA,10858
|
|
141
141
|
camel/types/openai_types.py,sha256=BNQ6iCzKTjSvgcXFsAFIgrUS_YUFZBU6bDoyAp387hI,2045
|
|
142
142
|
camel/utils/__init__.py,sha256=qFRBTiHE_QXYDSQoNecobtJYSFuNHEULx7nr00Q1S6Y,1827
|
|
143
|
-
camel/utils/commons.py,sha256=
|
|
143
|
+
camel/utils/commons.py,sha256=1p50ci5bnX1sQdJG_bewGbG6WKwR220YrCr3yoJmtu0,12110
|
|
144
144
|
camel/utils/constants.py,sha256=ZIw5ILfOyJFyjEAYrbJMANeg1_EZI-zMK_xVrkwALbM,1105
|
|
145
|
-
camel/utils/token_counting.py,sha256=
|
|
146
|
-
camel_ai-0.1.5.
|
|
147
|
-
camel_ai-0.1.5.
|
|
148
|
-
camel_ai-0.1.5.
|
|
145
|
+
camel/utils/token_counting.py,sha256=_eX314B0ikffz76bUwnN7xbLGnHJ3rezvesxwPNwfQ0,14410
|
|
146
|
+
camel_ai-0.1.5.4.dist-info/METADATA,sha256=WYQIg_PPHVlLYtw61If3DhtVye-75emt2B5dpcz0_Wk,21613
|
|
147
|
+
camel_ai-0.1.5.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
148
|
+
camel_ai-0.1.5.4.dist-info/RECORD,,
|
camel/bots/__init__.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the “License”);
|
|
3
|
-
# you may not use this file except in compliance with the License.
|
|
4
|
-
# You may obtain a copy of the License at
|
|
5
|
-
#
|
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
#
|
|
8
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
# distributed under the License is distributed on an “AS IS” BASIS,
|
|
10
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
# See the License for the specific language governing permissions and
|
|
12
|
-
# limitations under the License.
|
|
13
|
-
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
14
|
-
from .discord_bot import DiscordBot
|
|
15
|
-
from .telegram_bot import TelegramBot
|
|
16
|
-
|
|
17
|
-
__all__ = [
|
|
18
|
-
'DiscordBot',
|
|
19
|
-
'TelegramBot',
|
|
20
|
-
]
|
camel/bots/discord_bot.py
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the “License”);
|
|
3
|
-
# you may not use this file except in compliance with the License.
|
|
4
|
-
# You may obtain a copy of the License at
|
|
5
|
-
#
|
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
#
|
|
8
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
# distributed under the License is distributed on an “AS IS” BASIS,
|
|
10
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
# See the License for the specific language governing permissions and
|
|
12
|
-
# limitations under the License.
|
|
13
|
-
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
14
|
-
import os
|
|
15
|
-
from typing import TYPE_CHECKING, List, Optional
|
|
16
|
-
|
|
17
|
-
from camel.agents import ChatAgent
|
|
18
|
-
from camel.messages import BaseMessage
|
|
19
|
-
|
|
20
|
-
if TYPE_CHECKING:
|
|
21
|
-
from discord import Message
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class DiscordBot:
|
|
25
|
-
r"""Represents a Discord bot that is powered by an agent.
|
|
26
|
-
|
|
27
|
-
Attributes:
|
|
28
|
-
chat_agent (ChatAgent): Chat agent that will power the bot.
|
|
29
|
-
channel_ids (List[int], optional): The channel IDs that the bot will
|
|
30
|
-
listen to.
|
|
31
|
-
discord_token (str, optional): The bot token.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
def __init__(
|
|
35
|
-
self,
|
|
36
|
-
chat_agent: ChatAgent,
|
|
37
|
-
channel_ids: Optional[List[int]] = None,
|
|
38
|
-
discord_token: Optional[str] = None,
|
|
39
|
-
) -> None:
|
|
40
|
-
self.chat_agent = chat_agent
|
|
41
|
-
self.token = discord_token or os.getenv('DISCORD_TOKEN')
|
|
42
|
-
self.channel_ids = channel_ids
|
|
43
|
-
|
|
44
|
-
if not self.token:
|
|
45
|
-
raise ValueError(
|
|
46
|
-
"`DISCORD_TOKEN` not found in environment variables. Get it"
|
|
47
|
-
" here: `https://discord.com/developers/applications`."
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
try:
|
|
51
|
-
import discord
|
|
52
|
-
except ImportError:
|
|
53
|
-
raise ImportError(
|
|
54
|
-
"Please install `discord` first. You can install it by running"
|
|
55
|
-
" `python3 -m pip install -U discord.py`."
|
|
56
|
-
)
|
|
57
|
-
intents = discord.Intents.default()
|
|
58
|
-
intents.message_content = True
|
|
59
|
-
self.client = discord.Client(intents=intents)
|
|
60
|
-
|
|
61
|
-
# Register event handlers
|
|
62
|
-
self.client.event(self.on_ready)
|
|
63
|
-
self.client.event(self.on_message)
|
|
64
|
-
|
|
65
|
-
def run(self) -> None:
|
|
66
|
-
r"""Start the Discord bot using its token.
|
|
67
|
-
|
|
68
|
-
This method starts the Discord bot by running the client with the
|
|
69
|
-
provided token.
|
|
70
|
-
"""
|
|
71
|
-
self.client.run(self.token) # type: ignore[arg-type]
|
|
72
|
-
|
|
73
|
-
async def on_ready(self) -> None:
|
|
74
|
-
r"""This method is called when the bot has successfully connected to
|
|
75
|
-
the Discord server.
|
|
76
|
-
|
|
77
|
-
It prints a message indicating that the bot has logged in and displays
|
|
78
|
-
the username of the bot.
|
|
79
|
-
"""
|
|
80
|
-
print(f'We have logged in as {self.client.user}')
|
|
81
|
-
|
|
82
|
-
async def on_message(self, message: 'Message') -> None:
|
|
83
|
-
r"""Event handler for when a message is received.
|
|
84
|
-
|
|
85
|
-
Args:
|
|
86
|
-
message (discord.Message): The message object received.
|
|
87
|
-
"""
|
|
88
|
-
if message.author == self.client.user:
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
if self.channel_ids and message.channel.id not in self.channel_ids:
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
if not self.client.user or not self.client.user.mentioned_in(message):
|
|
95
|
-
return
|
|
96
|
-
|
|
97
|
-
self.chat_agent.reset()
|
|
98
|
-
|
|
99
|
-
user_msg = BaseMessage.make_user_message(
|
|
100
|
-
role_name="User", content=message.content
|
|
101
|
-
)
|
|
102
|
-
assistant_response = self.chat_agent.step(user_msg)
|
|
103
|
-
await message.channel.send(assistant_response.msg.content)
|
camel/bots/telegram_bot.py
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
2
|
-
# Licensed under the Apache License, Version 2.0 (the “License”);
|
|
3
|
-
# you may not use this file except in compliance with the License.
|
|
4
|
-
# You may obtain a copy of the License at
|
|
5
|
-
#
|
|
6
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
#
|
|
8
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
# distributed under the License is distributed on an “AS IS” BASIS,
|
|
10
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
# See the License for the specific language governing permissions and
|
|
12
|
-
# limitations under the License.
|
|
13
|
-
# =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
|
|
14
|
-
import os
|
|
15
|
-
from typing import TYPE_CHECKING, Optional
|
|
16
|
-
|
|
17
|
-
from camel.agents import ChatAgent
|
|
18
|
-
from camel.messages import BaseMessage
|
|
19
|
-
|
|
20
|
-
# Conditionally import telebot types only for type checking
|
|
21
|
-
if TYPE_CHECKING:
|
|
22
|
-
from telebot.types import Message # type: ignore[import-untyped]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class TelegramBot:
|
|
26
|
-
r"""Represents a Telegram bot that is powered by an agent.
|
|
27
|
-
|
|
28
|
-
Attributes:
|
|
29
|
-
chat_agent (ChatAgent): Chat agent that will power the bot.
|
|
30
|
-
telegram_token (str, optional): The bot token.
|
|
31
|
-
"""
|
|
32
|
-
|
|
33
|
-
def __init__(
|
|
34
|
-
self,
|
|
35
|
-
chat_agent: ChatAgent,
|
|
36
|
-
telegram_token: Optional[str] = None,
|
|
37
|
-
) -> None:
|
|
38
|
-
self.chat_agent = chat_agent
|
|
39
|
-
|
|
40
|
-
if not telegram_token:
|
|
41
|
-
self.token = os.getenv('TELEGRAM_TOKEN')
|
|
42
|
-
if not self.token:
|
|
43
|
-
raise ValueError(
|
|
44
|
-
"`TELEGRAM_TOKEN` not found in environment variables. "
|
|
45
|
-
"Get it from t.me/BotFather."
|
|
46
|
-
)
|
|
47
|
-
else:
|
|
48
|
-
self.token = telegram_token
|
|
49
|
-
|
|
50
|
-
try:
|
|
51
|
-
import telebot # type: ignore[import-untyped]
|
|
52
|
-
except ImportError:
|
|
53
|
-
raise ImportError(
|
|
54
|
-
"Please install `telegram_bot` first. "
|
|
55
|
-
"You can install it by running "
|
|
56
|
-
"`pip install pyTelegramBotAPI`."
|
|
57
|
-
)
|
|
58
|
-
self.bot = telebot.TeleBot(token=self.token)
|
|
59
|
-
|
|
60
|
-
# Register the message handler within the constructor
|
|
61
|
-
self.bot.message_handler(func=lambda message: True)(self.on_message)
|
|
62
|
-
|
|
63
|
-
def run(self) -> None:
|
|
64
|
-
r"""Start the Telegram bot."""
|
|
65
|
-
print("Telegram bot is running...")
|
|
66
|
-
self.bot.infinity_polling()
|
|
67
|
-
|
|
68
|
-
def on_message(self, message: 'Message') -> None:
|
|
69
|
-
r"""Handles incoming messages from the user.
|
|
70
|
-
|
|
71
|
-
Args:
|
|
72
|
-
message (types.Message): The incoming message object.
|
|
73
|
-
"""
|
|
74
|
-
self.chat_agent.reset()
|
|
75
|
-
|
|
76
|
-
if not message.text:
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
user_msg = BaseMessage.make_user_message(
|
|
80
|
-
role_name="User", content=message.text
|
|
81
|
-
)
|
|
82
|
-
assistant_response = self.chat_agent.step(user_msg)
|
|
83
|
-
|
|
84
|
-
self.bot.reply_to(message, assistant_response.msg.content)
|
|
File without changes
|