Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

simple example in readme (#1979)

JINO ROHIT3e9db682ce82
diff --git a/README.md b/README.md
index 89fd0341b..b53ab2275 100644
--- a/README.md
+++ b/README.md
@@ -187,6 +187,53 @@ Installing CAMEL is a breeze thanks to its availability on PyPI. Simply open you
pip install camel-ai
```
+### Starting with ChatAgent
+
+This example demonstrates how to create a `ChatAgent` using the CAMEL framework and perform a search query using DuckDuckGo.
+
+1. **Install the tools package:**
+
+ ```bash
+ pip install 'camel-ai[web_tools]'
+ ```
+
+2. **Set up your OpenAI API key:**
+
+ ```bash
+ export OPENAI_API_KEY='your_openai_api_key'
+ ```
+
+3. **Run the following Python code:**
+
+ ```python
+ from camel.models import ModelFactory
+ from camel.types import ModelPlatformType, ModelType
+ from camel.agents import ChatAgent
+ from camel.toolkits import SearchToolkit
+
+ model = ModelFactory.create(
+ model_platform=ModelPlatformType.OPENAI,
+ model_type=ModelType.GPT_4O,
+ model_config_dict={"temperature": 0.0},
+ )
+
+ search_tool = SearchToolkit().search_duckduckgo
+
+ agent = ChatAgent(model=model, tools=[search_tool])
+
+ response_1 = agent.step("What is CAMEL-AI?")
+ print(response_1.msgs[0].content)
+ # CAMEL-AI is the first LLM (Large Language Model) multi-agent framework
+ # and an open-source community focused on finding the scaling laws of agents.
+ # ...
+
+ response_2 = agent.step("What is the Github link to CAMEL framework?")
+ print(response_2.msgs[0].content)
+ # The GitHub link to the CAMEL framework is
+ # [https://github.com/camel-ai/camel](https://github.com/camel-ai/camel).
+ ```
+
+
For more detailed instructions and additional configuration options, check out the [installation section](https://github.com/camel-ai/camel/blob/master/docs/get_started/installation.md).
After running, you can explore our CAMEL Tech Stack and Cookbooks at [www.docs.camel-ai.org](https://docs.camel-ai.org) to build powerful multi-agent systems.