-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add Camel AI integration documentation
Add comprehensive Camel AI integration support: - Add integration page in docs - Update README with Camel AI framework - Add example notebook and verification script - Update mint.json navigation Note: Documentation and examples have been verified for: - Package installation - Import compatibility - Code syntax and structure Testing limitations: - Full execution testing requires API keys - Example notebook execution pending API access Closes #521 Co-Authored-By: Alex Reibman <meta.alex.r@gmail.com>
- Loading branch information
1 parent
232dc20
commit 33c74f9
Showing
6 changed files
with
662 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
--- | ||
title: 'Camel AI' | ||
description: 'Track and analyze CAMEL agents including LLMs and Tools usage with AgentOps' | ||
--- | ||
|
||
import CodeTooltip from '/snippets/add-code-tooltip.mdx' | ||
import EnvTooltip from '/snippets/add-env-tooltip.mdx' | ||
|
||
[CAMEL](https://www.camel-ai.org/) is the first large language model (LLM) multi-agent framework and an open-source community dedicated to finding the scaling law of agents. CAMEL has comprehensive [documentation](https://docs.camel-ai.org/) available as well as a great [quickstart](https://docs.camel-ai.org/getting_started/installation.html) guide. | ||
|
||
## Adding AgentOps to CAMEL agents | ||
|
||
<Steps> | ||
<Step title="Install the AgentOps SDK"> | ||
<CodeGroup> | ||
```bash pip | ||
pip install agentops | ||
``` | ||
```bash poetry | ||
poetry add agentops | ||
``` | ||
</CodeGroup> | ||
</Step> | ||
<Step title="Install CAMEL"> | ||
<CodeGroup> | ||
```bash pip | ||
pip install "camel-ai[all]==0.2.11" | ||
``` | ||
```bash poetry | ||
poetry add "camel-ai[all]==0.2.11" | ||
``` | ||
</CodeGroup> | ||
</Step> | ||
<Step title="Add 3 lines of code"> | ||
<CodeTooltip/> | ||
<CodeGroup> | ||
```python python | ||
import agentops | ||
agentops.init(<INSERT YOUR API KEY HERE>) | ||
... | ||
# MUST END SESSION at end of program | ||
agentops.end_session("Success") # Success|Fail|Indeterminate | ||
``` | ||
</CodeGroup> | ||
<EnvTooltip /> | ||
<CodeGroup> | ||
```python .env | ||
AGENTOPS_API_KEY=<YOUR API KEY> | ||
``` | ||
</CodeGroup> | ||
Read more about environment variables in [Advanced Configuration](/v1/usage/advanced-configuration) | ||
</Step> | ||
<Step title="Run your agent"> | ||
Execute your program and visit [app.agentops.ai/drilldown](https://app.agentops.ai/drilldown) to observe your CAMEL Agent! 🕵️ | ||
<Tip> | ||
After your run, AgentOps prints a clickable url to console linking directly to your session in the Dashboard | ||
</Tip> | ||
<div/>{/* Intentionally blank div for newline */} | ||
<Frame type="glass" caption="Clickable link to session"> | ||
<img height="200" src="https://github.com/AgentOps-AI/agentops/blob/main/docs/images/link-to-session.gif?raw=true" /> | ||
</Frame> | ||
</Step> | ||
</Steps> | ||
|
||
## Single Agent Example with Tools | ||
|
||
Here's a simple example of tracking a CAMEL single agent with tools using AgentOps: | ||
|
||
```python | ||
import agentops | ||
import os | ||
from camel.agents import ChatAgent | ||
from camel.messages import BaseMessage | ||
from camel.models import ModelFactory | ||
from camel.types import ModelPlatformType, ModelType | ||
|
||
# Initialize AgentOps | ||
agentops.init(os.getenv("AGENTOPS_API_KEY")) | ||
|
||
# Import toolkits after AgentOps init for tracking | ||
from camel.toolkits import SearchToolkit | ||
|
||
# Set up the agent with search tools | ||
sys_msg = BaseMessage.make_assistant_message( | ||
role_name='Tools calling operator', | ||
content='You are a helpful assistant' | ||
) | ||
|
||
# Configure tools and model | ||
tools = [*SearchToolkit().get_tools()] | ||
model = ModelFactory.create( | ||
model_platform=ModelPlatformType.OPENAI, | ||
model_type=ModelType.GPT_4O_MINI, | ||
) | ||
|
||
# Create the agent | ||
camel_agent = ChatAgent( | ||
system_message=sys_msg, | ||
model=model, | ||
tools=tools, | ||
) | ||
|
||
# Run the agent | ||
user_msg = 'What is CAMEL-AI.org?' | ||
response = camel_agent.step(user_msg) | ||
print(response) | ||
|
||
# End the session | ||
agentops.end_session("Success") | ||
``` | ||
|
||
## Multi-Agent Example | ||
|
||
For more complex scenarios, CAMEL supports multi-agent interactions. Here's how to track multiple agents: | ||
|
||
```python | ||
import agentops | ||
from typing import List | ||
from camel.agents.chat_agent import FunctionCallingRecord | ||
from camel.societies import RolePlaying | ||
from camel.types import ModelPlatformType, ModelType | ||
|
||
# Initialize AgentOps with multi-agent tag | ||
agentops.start_session(tags=["CAMEL X AgentOps Multi-agent"]) | ||
|
||
# Import toolkits after AgentOps init | ||
from camel.toolkits import SearchToolkit, MathToolkit | ||
|
||
# Set up your task | ||
task_prompt = ( | ||
"Assume now is 2024 in the Gregorian calendar, " | ||
"estimate the current age of University of Oxford " | ||
"and then add 10 more years to this age, " | ||
"and get the current weather of the city where " | ||
"the University is located." | ||
) | ||
|
||
# The rest of your multi-agent implementation... | ||
# See our example notebook for the complete implementation | ||
``` | ||
|
||
For complete examples including multi-agent setups and advanced configurations, check out our [example notebooks](https://github.com/AgentOps-AI/agentops/tree/main/examples/camel_examples). | ||
|
||
<script type="module" src="/scripts/github_stars.js"></script> | ||
<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script> | ||
<script type="module" src="/scripts/button_heartbeat_animation.js"></script> | ||
<script type="css" src="/styles/styles.css"></script> | ||
<script type="module" src="/scripts/adjust_api_dynamically.js"></script> |
Oops, something went wrong.