camel-ai 0.2.5__py3-none-any.whl → 0.2.7__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.

Files changed (49) hide show
  1. camel/__init__.py +1 -1
  2. camel/agents/chat_agent.py +114 -23
  3. camel/configs/__init__.py +6 -4
  4. camel/configs/base_config.py +21 -0
  5. camel/configs/gemini_config.py +17 -9
  6. camel/configs/qwen_config.py +91 -0
  7. camel/configs/samba_config.py +1 -38
  8. camel/configs/yi_config.py +58 -0
  9. camel/generators.py +93 -0
  10. camel/interpreters/docker_interpreter.py +5 -0
  11. camel/interpreters/ipython_interpreter.py +2 -1
  12. camel/loaders/__init__.py +2 -0
  13. camel/loaders/apify_reader.py +223 -0
  14. camel/memories/agent_memories.py +24 -1
  15. camel/messages/base.py +38 -0
  16. camel/models/__init__.py +4 -0
  17. camel/models/model_factory.py +6 -0
  18. camel/models/qwen_model.py +139 -0
  19. camel/models/samba_model.py +1 -1
  20. camel/models/yi_model.py +138 -0
  21. camel/prompts/image_craft.py +8 -0
  22. camel/prompts/video_description_prompt.py +8 -0
  23. camel/retrievers/vector_retriever.py +5 -1
  24. camel/societies/role_playing.py +29 -18
  25. camel/societies/workforce/base.py +7 -1
  26. camel/societies/workforce/task_channel.py +10 -0
  27. camel/societies/workforce/utils.py +6 -0
  28. camel/societies/workforce/worker.py +2 -0
  29. camel/storages/vectordb_storages/qdrant.py +147 -24
  30. camel/tasks/task.py +15 -0
  31. camel/terminators/base.py +4 -0
  32. camel/terminators/response_terminator.py +1 -0
  33. camel/terminators/token_limit_terminator.py +1 -0
  34. camel/toolkits/__init__.py +4 -1
  35. camel/toolkits/base.py +9 -0
  36. camel/toolkits/data_commons_toolkit.py +360 -0
  37. camel/toolkits/function_tool.py +174 -7
  38. camel/toolkits/github_toolkit.py +175 -176
  39. camel/toolkits/google_scholar_toolkit.py +36 -7
  40. camel/toolkits/notion_toolkit.py +279 -0
  41. camel/toolkits/search_toolkit.py +164 -36
  42. camel/types/enums.py +88 -0
  43. camel/types/unified_model_type.py +10 -0
  44. camel/utils/commons.py +2 -1
  45. camel/utils/constants.py +2 -0
  46. {camel_ai-0.2.5.dist-info → camel_ai-0.2.7.dist-info}/METADATA +129 -79
  47. {camel_ai-0.2.5.dist-info → camel_ai-0.2.7.dist-info}/RECORD +49 -42
  48. {camel_ai-0.2.5.dist-info → camel_ai-0.2.7.dist-info}/LICENSE +0 -0
  49. {camel_ai-0.2.5.dist-info → camel_ai-0.2.7.dist-info}/WHEEL +0 -0
camel/types/enums.py CHANGED
@@ -87,6 +87,28 @@ class ModelType(UnifiedModelType, Enum):
87
87
  REKA_FLASH = "reka-flash"
88
88
  REKA_EDGE = "reka-edge"
89
89
 
90
+ # Qwen models (Aliyun)
91
+ QWEN_MAX = "qwen-max"
92
+ QWEN_PLUS = "qwen-plus"
93
+ QWEN_TURBO = "qwen-turbo"
94
+ QWEN_LONG = "qwen-long"
95
+ QWEN_VL_MAX = "qwen-vl-max"
96
+ QWEN_VL_PLUS = "qwen-vl-plus"
97
+ QWEN_MATH_PLUS = "qwen-math-plus"
98
+ QWEN_MATH_TURBO = "qwen-math-turbo"
99
+ QWEN_CODER_TURBO = "qwen-coder-turbo"
100
+
101
+ # Yi models (01-ai)
102
+ YI_LIGHTNING = "yi-lightning"
103
+ YI_LARGE = "yi-large"
104
+ YI_MEDIUM = "yi-medium"
105
+ YI_LARGE_TURBO = "yi-large-turbo"
106
+ YI_VISION = "yi-vision"
107
+ YI_MEDIUM_200K = "yi-medium-200k"
108
+ YI_SPARK = "yi-spark"
109
+ YI_LARGE_RAG = "yi-large-rag"
110
+ YI_LARGE_FC = "yi-large-fc"
111
+
90
112
  def __str__(self):
91
113
  return self.value
92
114
 
@@ -220,6 +242,39 @@ class ModelType(UnifiedModelType, Enum):
220
242
  ModelType.REKA_FLASH,
221
243
  }
222
244
 
245
+ @property
246
+ def is_yi(self) -> bool:
247
+ r"""Returns whether this type of models is Yi model.
248
+
249
+ Returns:
250
+ bool: Whether this type of models is Yi.
251
+ """
252
+ return self in {
253
+ ModelType.YI_LIGHTNING,
254
+ ModelType.YI_LARGE,
255
+ ModelType.YI_MEDIUM,
256
+ ModelType.YI_LARGE_TURBO,
257
+ ModelType.YI_VISION,
258
+ ModelType.YI_MEDIUM_200K,
259
+ ModelType.YI_SPARK,
260
+ ModelType.YI_LARGE_RAG,
261
+ ModelType.YI_LARGE_FC,
262
+ }
263
+
264
+ @property
265
+ def is_qwen(self) -> bool:
266
+ return self in {
267
+ ModelType.QWEN_MAX,
268
+ ModelType.QWEN_PLUS,
269
+ ModelType.QWEN_TURBO,
270
+ ModelType.QWEN_LONG,
271
+ ModelType.QWEN_VL_MAX,
272
+ ModelType.QWEN_VL_PLUS,
273
+ ModelType.QWEN_MATH_PLUS,
274
+ ModelType.QWEN_MATH_TURBO,
275
+ ModelType.QWEN_CODER_TURBO,
276
+ }
277
+
223
278
  @property
224
279
  def token_limit(self) -> int:
225
280
  r"""Returns the maximum token limit for a given model.
@@ -235,6 +290,8 @@ class ModelType(UnifiedModelType, Enum):
235
290
  ModelType.REKA_CORE,
236
291
  ModelType.REKA_EDGE,
237
292
  ModelType.REKA_FLASH,
293
+ ModelType.QWEN_MATH_PLUS,
294
+ ModelType.QWEN_MATH_TURBO,
238
295
  }:
239
296
  return 4_096
240
297
  elif self in {
@@ -245,10 +302,17 @@ class ModelType(UnifiedModelType, Enum):
245
302
  ModelType.GROQ_GEMMA_2_9B_IT,
246
303
  ModelType.GLM_3_TURBO,
247
304
  ModelType.GLM_4,
305
+ ModelType.QWEN_VL_PLUS,
248
306
  }:
249
307
  return 8_192
250
308
  elif self in {
251
309
  ModelType.GPT_3_5_TURBO,
310
+ ModelType.YI_LIGHTNING,
311
+ ModelType.YI_MEDIUM,
312
+ ModelType.YI_LARGE_TURBO,
313
+ ModelType.YI_VISION,
314
+ ModelType.YI_SPARK,
315
+ ModelType.YI_LARGE_RAG,
252
316
  }:
253
317
  return 16_384
254
318
  elif self in {
@@ -256,6 +320,10 @@ class ModelType(UnifiedModelType, Enum):
256
320
  ModelType.MISTRAL_7B,
257
321
  ModelType.MISTRAL_MIXTRAL_8x7B,
258
322
  ModelType.GROQ_MIXTRAL_8_7B,
323
+ ModelType.YI_LARGE,
324
+ ModelType.YI_LARGE_FC,
325
+ ModelType.QWEN_MAX,
326
+ ModelType.QWEN_VL_MAX,
259
327
  }:
260
328
  return 32_768
261
329
  elif self in {ModelType.MISTRAL_MIXTRAL_8x22B}:
@@ -282,6 +350,9 @@ class ModelType(UnifiedModelType, Enum):
282
350
  ModelType.GROQ_LLAMA_3_1_8B,
283
351
  ModelType.GROQ_LLAMA_3_1_70B,
284
352
  ModelType.GROQ_LLAMA_3_1_405B,
353
+ ModelType.QWEN_PLUS,
354
+ ModelType.QWEN_TURBO,
355
+ ModelType.QWEN_CODER_TURBO,
285
356
  }:
286
357
  return 131_072
287
358
  elif self in {
@@ -290,6 +361,7 @@ class ModelType(UnifiedModelType, Enum):
290
361
  ModelType.CLAUDE_3_SONNET,
291
362
  ModelType.CLAUDE_3_HAIKU,
292
363
  ModelType.CLAUDE_3_5_SONNET,
364
+ ModelType.YI_MEDIUM_200K,
293
365
  }:
294
366
  return 200_000
295
367
  elif self in {
@@ -301,6 +373,10 @@ class ModelType(UnifiedModelType, Enum):
301
373
  ModelType.GEMINI_1_5_PRO,
302
374
  }:
303
375
  return 1_048_576
376
+ elif self in {
377
+ ModelType.QWEN_LONG,
378
+ }:
379
+ return 10_000_000
304
380
  else:
305
381
  raise ValueError("Unknown model type")
306
382
 
@@ -445,6 +521,8 @@ class ModelPlatformType(Enum):
445
521
  TOGETHER = "together"
446
522
  OPENAI_COMPATIBLE_MODEL = "openai-compatible-model"
447
523
  SAMBA = "samba-nova"
524
+ YI = "lingyiwanwu"
525
+ QWEN = "tongyi-qianwen"
448
526
 
449
527
  @property
450
528
  def is_openai(self) -> bool:
@@ -517,6 +595,16 @@ class ModelPlatformType(Enum):
517
595
  r"""Returns whether this platform is Samba Nova."""
518
596
  return self is ModelPlatformType.SAMBA
519
597
 
598
+ @property
599
+ def is_yi(self) -> bool:
600
+ r"""Returns whether this platform is Yi."""
601
+ return self is ModelPlatformType.YI
602
+
603
+ @property
604
+ def is_qwen(self) -> bool:
605
+ r"""Returns whether this platform is Qwen."""
606
+ return self is ModelPlatformType.QWEN
607
+
520
608
 
521
609
  class AudioModelType(Enum):
522
610
  TTS_1 = "tts-1"
@@ -98,6 +98,16 @@ class UnifiedModelType(str):
98
98
  r"""Returns whether the model is a Reka model."""
99
99
  return True
100
100
 
101
+ @property
102
+ def is_yi(self) -> bool:
103
+ r"""Returns whether the model is a Yi model."""
104
+ return True
105
+
106
+ @property
107
+ def is_qwen(self) -> bool:
108
+ r"""Returns whether the model is a Qwen model."""
109
+ return True
110
+
101
111
  @property
102
112
  def support_native_tool_calling(self) -> bool:
103
113
  r"""Returns whether the model supports native tool calling."""
camel/utils/commons.py CHANGED
@@ -550,8 +550,9 @@ class AgentOpsMeta(type):
550
550
  return super().__new__(cls, name, bases, dct)
551
551
 
552
552
 
553
- # Mock trak agent decorator for AgentOps
554
553
  def track_agent(*args, **kwargs):
554
+ r"""Mock track agent decorator for AgentOps."""
555
+
555
556
  def noop(f):
556
557
  return f
557
558
 
camel/utils/constants.py CHANGED
@@ -14,6 +14,8 @@
14
14
 
15
15
 
16
16
  class Constants:
17
+ r"""A class containing constants used in CAMEL."""
18
+
17
19
  # This value defines the default size (both width and height) for images
18
20
  # extracted from a video.
19
21
  VIDEO_DEFAULT_IMAGE_SIZE = 768
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: camel-ai
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Communicative Agents for AI Society Study
5
5
  Home-page: https://www.camel-ai.org/
6
6
  License: Apache-2.0
@@ -29,6 +29,7 @@ Requires-Dist: PyMuPDF (>=1.22.5,<2.0.0) ; extra == "tools" or extra == "all"
29
29
  Requires-Dist: accelerate (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
30
30
  Requires-Dist: agentops (>=0.3.6,<0.4.0) ; extra == "tools" or extra == "all"
31
31
  Requires-Dist: anthropic (>=0.29.0,<0.30.0) ; extra == "model-platforms" or extra == "all"
32
+ Requires-Dist: apify_client (>=1.8.1,<2.0.0) ; extra == "tools" or extra == "all"
32
33
  Requires-Dist: arxiv (>=2.1.3,<3.0.0) ; extra == "tools" or extra == "all"
33
34
  Requires-Dist: arxiv2text (>=0.1.14,<0.2.0) ; extra == "tools" or extra == "all"
34
35
  Requires-Dist: asknews (>=0.7.43,<0.8.0) ; extra == "tools" or extra == "all"
@@ -38,6 +39,8 @@ Requires-Dist: botocore (>=1.35.3,<2.0.0) ; extra == "object-storages" or extra
38
39
  Requires-Dist: cohere (>=4.56,<5.0) ; extra == "rag" or extra == "retrievers" or extra == "all"
39
40
  Requires-Dist: colorama (>=0,<1)
40
41
  Requires-Dist: curl_cffi (==0.6.2)
42
+ Requires-Dist: datacommons (>=1.4.3,<2.0.0) ; extra == "tools" or extra == "all"
43
+ Requires-Dist: datacommons_pandas (>=0.0.3,<0.0.4) ; extra == "tools" or extra == "all"
41
44
  Requires-Dist: datasets (>=2,<3) ; extra == "huggingface-agent" or extra == "all"
42
45
  Requires-Dist: diffusers (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
43
46
  Requires-Dist: discord.py (>=2.3.2,<3.0.0) ; extra == "tools" or extra == "all"
@@ -61,6 +64,7 @@ Requires-Dist: nebula3-python (==3.8.2) ; extra == "rag" or extra == "graph-stor
61
64
  Requires-Dist: neo4j (>=5.18.0,<6.0.0) ; extra == "rag" or extra == "graph-storages" or extra == "all"
62
65
  Requires-Dist: newspaper3k (>=0.2.8,<0.3.0) ; extra == "tools" or extra == "all"
63
66
  Requires-Dist: nltk (==3.8.1) ; extra == "tools" or extra == "all"
67
+ Requires-Dist: notion-client (>=2.2.1,<3.0.0) ; extra == "tools" or extra == "all"
64
68
  Requires-Dist: numpy (>=1,<2)
65
69
  Requires-Dist: openai (>=1.45.0,<2.0.0)
66
70
  Requires-Dist: openapi-spec-validator (>=0.7.1,<0.8.0) ; extra == "tools" or extra == "all"
@@ -91,6 +95,7 @@ Requires-Dist: sentencepiece (>=0,<1) ; extra == "huggingface-agent" or extra ==
91
95
  Requires-Dist: slack-bolt (>=1.20.1,<2.0.0) ; extra == "tools" or extra == "all"
92
96
  Requires-Dist: slack-sdk (>=3.27.2,<4.0.0) ; extra == "tools" or extra == "all"
93
97
  Requires-Dist: soundfile (>=0,<1) ; extra == "huggingface-agent" or extra == "all"
98
+ Requires-Dist: tavily-python (>=0.5.0,<0.6.0) ; extra == "search-tools" or extra == "all"
94
99
  Requires-Dist: textblob (>=0.18.0.post0,<0.19.0) ; extra == "tools" or extra == "all"
95
100
  Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
96
101
  Requires-Dist: torch (==2.1.0) ; (platform_system == "Darwin" and platform_machine != "arm64") and (extra == "huggingface-agent" or extra == "all")
@@ -141,7 +146,37 @@ ______________________________________________________________________
141
146
 
142
147
  Join us ([*Discord*](https://discord.camel-ai.org/), [*WeChat*](https://ghli.org/camel/wechat.png) or [*Slack*](https://join.slack.com/t/camel-ai/shared_invite/zt-2g7xc41gy-_7rcrNNAArIP6sLQqldkqQ)) in pushing the boundaries of finding the scaling laws of agents.
143
148
 
144
- ## Try it yourself
149
+ ## What Can You Build With CAMEL?
150
+
151
+ ### 🤖 Customize Agents
152
+ - Customizable agents are the fundamental entities of the CAMEL architecture. CAMEL empowers you to customize agents using our modular components for specific tasks.
153
+
154
+ ### ⚙️ Build Multi-Agent Systems
155
+ - We propose a multi-agent framework to address agents' autonomous cooperation challenges, guiding agents toward task completion while maintaining human intentions.
156
+
157
+ ### 💻 Practical Applications
158
+ - The CAMEL framework serves as a generic infrastructure for a wide range of multi-agent applications, including task automation, data generation, and world simulations.
159
+
160
+
161
+ ## Why Should You Use CAMEL?
162
+
163
+ 1. Comprehensive Customization and Collaboration:
164
+
165
+ - Integrates over 20 advanced model platforms (e.g., commercial models like OpenAI, open-source models such as Llama3, and self-deployment frameworks like Ollama.).
166
+
167
+ - Supports extensive external tools (e.g., Search, Twitter, Github, Google Maps, Reddit, Slack utilities).
168
+ - Includes memory and prompt components for deep customization.
169
+ - Facilitates complex multi-agent systems with advanced collaboration features.
170
+
171
+
172
+ 2. User-Friendly with Transparent Internal Structure:
173
+ - Designed for transparency and consistency in internal structure.
174
+
175
+ - Offers comprehensive [tutorials and detailed docstrings](https://docs.camel-ai.org/) for all functions.
176
+ - Ensures an approachable learning curve for newcomers.
177
+
178
+
179
+ ## Try It Yourself
145
180
  We provide a [![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing) demo showcasing a conversation between two ChatGPT agents playing roles as a python programmer and a stock trader collaborating on developing a trading bot for stock market.
146
181
 
147
182
  <p align="center">
@@ -210,8 +245,6 @@ exit
210
245
  > ```
211
246
 
212
247
 
213
-
214
-
215
248
  Install `CAMEL` from source with conda and pip:
216
249
  ```sh
217
250
  # Create a conda virtual environment
@@ -221,7 +254,7 @@ conda create --name camel python=3.10
221
254
  conda activate camel
222
255
 
223
256
  # Clone github repo
224
- git clone -b v0.2.5 https://github.com/camel-ai/camel.git
257
+ git clone -b v0.2.7 https://github.com/camel-ai/camel.git
225
258
 
226
259
  # Change directory into project directory
227
260
  cd camel
@@ -239,13 +272,58 @@ Detailed guidance can be find [here](https://github.com/camel-ai/camel/blob/mast
239
272
 
240
273
  ## Documentation
241
274
 
242
- [CAMEL package documentation pages](https://camel-ai.github.io/camel/).
243
-
244
- ## Example
245
-
246
- You can find a list of tasks for different sets of assistant and user role pairs [here](https://drive.google.com/file/d/194PPaSTBR07m-PzjS-Ty6KlPLdFIPQDd/view?usp=share_link).
247
-
248
- As an example, to run the `role_playing.py` script:
275
+ The [complete documentation](https://camel-ai.github.io/camel/) pages for the CAMEL package. Also, detailed tutorials for each part are provided below:
276
+
277
+ ### Agents
278
+ Explore different types of agents, their roles, and their applications.
279
+
280
+ - **[Creating Your First Agent](https://docs.camel-ai.org/cookbooks/create_your_first_agent.html)**
281
+ - **[Creating Your First Agent Society](https://docs.camel-ai.org/cookbooks/create_your_first_agents_society.html)**
282
+ - **[Embodied Agents](https://docs.camel-ai.org/cookbooks/embodied_agents.html)**
283
+ - **[Critic Agents](https://docs.camel-ai.org/cookbooks/critic_agents_and_tree_search.html)**
284
+
285
+ ---
286
+
287
+ ### Key Modules
288
+ Core components and utilities to build, operate, and enhance CAMEL-AI agents and societies.
289
+
290
+ | Module | Description |
291
+ |:---|:---|
292
+ | **[Models](https://docs.camel-ai.org/key_modules/models.html)** | Model architectures and customization options for agent intelligence. |
293
+ | **[Messages](https://docs.camel-ai.org/key_modules/messages.html)** | Messaging protocols for agent communication. |
294
+ | **[Memory](https://docs.camel-ai.org/key_modules/memory.html)** | Memory storage and retrieval mechanisms. |
295
+ | **[Tools](https://docs.camel-ai.org/key_modules/tools.html)** | Tools integration for specialized agent tasks. |
296
+ | **[Prompts](https://docs.camel-ai.org/key_modules/prompts.html)** | Prompt engineering and customization. |
297
+ | **[Tasks](https://docs.camel-ai.org/key_modules/tasks.html)** | Task creation and management for agent workflows. |
298
+ | **[Loaders](https://docs.camel-ai.org/key_modules/loaders.html)** | Data loading tools for agent operation. |
299
+ | **[Storages](https://docs.camel-ai.org/key_modules/storages.html)** | Storage solutions for agent. |
300
+ | **[Society](https://docs.camel-ai.org/key_modules/society.html)** | Components for building agent societies and inter-agent collaboration. |
301
+ | **[Embeddings](https://docs.camel-ai.org/key_modules/embeddings.html)** | Embedding models for RAG. |
302
+ | **[Retrievers](https://docs.camel-ai.org/key_modules/retrievers.html)** | Retrieval methods for knowledge access. |
303
+ ---
304
+
305
+ ### Cookbooks
306
+ Practical guides and tutorials for implementing specific functionalities in CAMEL-AI agents and societies.
307
+
308
+ | Cookbook | Description |
309
+ |:---|:---|
310
+ | **[Creating Your First Agent](https://docs.camel-ai.org/cookbooks/create_your_first_agent.html)** | A step-by-step guide to building your first agent. |
311
+ | **[Creating Your First Agent Society](https://docs.camel-ai.org/cookbooks/create_your_first_agents_society.html)** | Learn to build a collaborative society of agents. |
312
+ | **[Society Cookbook](https://docs.camel-ai.org/cookbooks/agents_society.html)** | Advanced configurations for agent societies. |
313
+ | **[Model Speed Comparison Cookbook](https://docs.camel-ai.org/cookbooks/model_speed_comparison.html)** | Benchmarking models for performance. |
314
+ | **[Message Cookbook](https://docs.camel-ai.org/cookbooks/agents_message.html)** | Best practices for message handling in agents. |
315
+ | **[Tools Cookbook](https://docs.camel-ai.org/cookbooks/agents_with_tools.html)** | Integrating tools for enhanced functionality. |
316
+ | **[Memory Cookbook](https://docs.camel-ai.org/cookbooks/agents_with_memory.html)** | Implementing memory systems in agents. |
317
+ | **[RAG Cookbook](https://docs.camel-ai.org/cookbooks/agents_with_rag.html)** | Recipes for Retrieval-Augmented Generation. |
318
+ | **[Prompting Cookbook](https://docs.camel-ai.org/cookbooks/agents_prompting.html)** | Techniques for effective prompt creation. |
319
+ | **[Task Generation Cookbook](https://docs.camel-ai.org/cookbooks/task_generation.html)** | Automating task generation for agents. |
320
+ | **[Graph RAG Cookbook](https://docs.camel-ai.org/cookbooks/knowledge_graph.html)** | Leveraging knowledge graphs with RAG. |
321
+ | **[Role-Playing Scraper for Report & Knowledge Graph Generation](https://docs.camel-ai.org/cookbooks/roleplaying_scraper.html)** | Create role-playing agents for data scraping and reporting. |
322
+ | **[Video Analysis](https://docs.camel-ai.org/cookbooks/video_analysis.html)** | Techniques for agents in video data analysis. |
323
+ | **[Track CAMEL Agents with AgentOps](https://docs.camel-ai.org/cookbooks/agents_tracking.html)** | Tools for tracking and managing agents in operations. |
324
+ | **[Create A Hackathon Judge Committee with Workforce](https://docs.camel-ai.org/cookbooks/workforce_judge_committee.html)** | Building a team of agents for collaborative judging. |
325
+
326
+ ## Examples
249
327
 
250
328
  First, you need to add your OpenAI API key to system environment variables. The method to do this depends on your operating system and the shell you're using.
251
329
 
@@ -275,83 +353,41 @@ $env:OPENAI_API_BASE_URL="<inert your OpenAI API BASE URL>" #(Should you utiliz
275
353
 
276
354
  Replace `<insert your OpenAI API key>` with your actual OpenAI API key in each case. Make sure there are no spaces around the `=` sign.
277
355
 
278
- After setting the OpenAI API key, you can run the script:
356
+
357
+ 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.
358
+
359
+ After setting the OpenAI API key, you can run the `role_playing.py` script. Find tasks for various assistant-user roles [here](https://drive.google.com/file/d/194PPaSTBR07m-PzjS-Ty6KlPLdFIPQDd/view?usp=share_link).
279
360
 
280
361
  ```bash
281
362
  # You can change the role pair and initial prompt in role_playing.py
282
363
  python examples/ai_society/role_playing.py
283
364
  ```
284
365
 
285
- 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.
366
+ Also feel free to run any scripts below that interest you:
286
367
 
368
+ ```bash
369
+ # You can change the role pair and initial prompt in these python files
287
370
 
288
- ## Use Open-Source Models as Backends (ex. using Ollama to set Llama 3 locally)
371
+ # Examples of two agents role-playing
372
+ python examples/ai_society/role_playing.py
289
373
 
290
- - Download [Ollama](https://ollama.com/download).
291
- - After setting up Ollama, pull the Llama3 model by typing the following command into the terminal:
292
- ```bash
293
- ollama pull llama3
294
- ```
295
- - Run the script. Enjoy your Llama3 model, enhanced by CAMEL's excellent agents.
296
- ```python
297
- from camel.agents import ChatAgent
298
- from camel.messages import BaseMessage
299
- from camel.models import ModelFactory
300
- from camel.types import ModelPlatformType
301
-
302
- ollama_model = ModelFactory.create(
303
- model_platform=ModelPlatformType.OLLAMA,
304
- model_type="llama3",
305
- model_config_dict={"temperature": 0.4},
306
- )
307
-
308
- assistant_sys_msg = BaseMessage.make_assistant_message(
309
- role_name="Assistant",
310
- content="You are a helpful assistant.",
311
- )
312
- agent = ChatAgent(assistant_sys_msg, model=ollama_model, token_limit=4096)
313
-
314
- user_msg = BaseMessage.make_user_message(
315
- role_name="User", content="Say hi to CAMEL"
316
- )
317
- assistant_response = agent.step(user_msg)
318
- print(assistant_response.msg.content)
319
- ```
374
+ # The agent answers questions by utilizing code execution tools.
375
+ python examples/toolkits/code_execution_toolkit.py
320
376
 
321
- ## Use Open-Source Models as Backends (ex. using vLLM to set Phi-3 locally)
322
- - [Install vLLM](https://docs.vllm.ai/en/latest/getting_started/installation.html)
323
- - After setting up vLLM, start an OpenAI compatible server for example by
324
- ```bash
325
- python -m vllm.entrypoints.openai.api_server --model microsoft/Phi-3-mini-4k-instruct --api-key vllm --dtype bfloat16
326
- ```
327
- - Create and run following script (more details please refer to this [example](https://github.com/camel-ai/camel/blob/master/examples/models/vllm_model_example.py))
328
- ```python
329
- from camel.agents import ChatAgent
330
- from camel.messages import BaseMessage
331
- from camel.models import ModelFactory
332
- from camel.types import ModelPlatformType
333
-
334
- vllm_model = ModelFactory.create(
335
- model_platform=ModelPlatformType.VLLM,
336
- model_type="microsoft/Phi-3-mini-4k-instruct",
337
- url="http://localhost:8000/v1",
338
- model_config_dict={"temperature": 0.0},
339
- api_key="vllm",
340
- )
341
-
342
- assistant_sys_msg = BaseMessage.make_assistant_message(
343
- role_name="Assistant",
344
- content="You are a helpful assistant.",
345
- )
346
- agent = ChatAgent(assistant_sys_msg, model=vllm_model, token_limit=4096)
347
-
348
- user_msg = BaseMessage.make_user_message(
349
- role_name="User",
350
- content="Say hi to CAMEL AI",
351
- )
352
- assistant_response = agent.step(user_msg)
353
- print(assistant_response.msg.content)
354
- ```
377
+ # Generating a knowledge graph with an agent
378
+ python examples/knowledge_graph/knowledge_graph_agent_example.py
379
+
380
+ # Multiple agents collaborating to decompose and solve tasks
381
+ python examples/workforce/multiple_single_agents.py
382
+
383
+ # Use agent to generate creative image
384
+ python examples/vision/image_crafting.py
385
+ ```
386
+ For additional feature examples, see the [`examples`](https://github.com/camel-ai/camel/tree/master/examples) directory.
387
+
388
+ ## Utilize Various LLMs as Backends
389
+
390
+ For more details, please see our [`Models Documentation`](https://docs.camel-ai.org/key_modules/models.html#).
355
391
 
356
392
  ## Data (Hosted on Hugging Face)
357
393
  | Dataset | Chat format | Instruction format | Chat format (translated) |
@@ -375,7 +411,21 @@ Please note that the environment variable is session-specific. If you open a new
375
411
  We implemented amazing research ideas from other works for you to build, compare and customize your agents. If you use any of these modules, please kindly cite the original works:
376
412
  - `TaskCreationAgent`, `TaskPrioritizationAgent` and `BabyAGI` from *Nakajima et al.*: [Task-Driven Autonomous Agent](https://yoheinakajima.com/task-driven-autonomous-agent-utilizing-gpt-4-pinecone-and-langchain-for-diverse-applications/). [[Example](https://github.com/camel-ai/camel/blob/master/examples/ai_society/babyagi_playing.py)]
377
413
 
414
+ ## Other Research Works Based on Camel
415
+ - [Agent Trust](http://agent-trust.camel-ai.org/): Can Large Language Model Agents Simulate Human Trust Behavior?
416
+
417
+ - [CRAB](https://crab.camel-ai.org/): Cross-environment Agent Benchmark for Multimodal Language Model Agents.
418
+
419
+ - OASIS: Open Agents Social Interaction Simulations on a Large Scale.
420
+
421
+ We warmly invite you to use CAMEL for your impactful research.
422
+
378
423
  ## News
424
+ 📢 Added the Workforce module to the 🐫 CAMEL framework! For more details, see the [post](https://x.com/CamelAIOrg/status/1851682063830720912). (Oct 31, 2024)
425
+ - Added subprocess support for Ollama and vLLM models. (Oct, 29, 2024)
426
+ - Integrated Firecrawl's Map into the 🐫 CAMEL framework. (Oct, 22, 2024)
427
+ - Integrated Nvidia's Llama-3.1-Nemotron-70b-Instruct! (Oct, 17, 2024)
428
+ - ...
379
429
  - Released AI Society and Code dataset (April 2, 2023)
380
430
  - Initial release of `CAMEL` python library (March 21, 2023)
381
431