Using Tools from ACI#

You can also check this cookbook in colab here

ACI.dev is the open source platform that connects your AI agents to 600+ tool integrations. Integrate ACI.dev with CAMEL agents to let them seamlessly interact with these external apps.

⭐ Star us on Github, join our Discord or follow our X

Goal: Star a repository on GitHub with natural language & CAMEL Agent

Install Packages & Connect a Tool#

Integrate ACI with CAMEL agents to let them seamlessly interact with external apps.

Ensure you have the necessary packages installed and connect your GitHub account to allow your CAMEL-AI agents to utilize GitHub functionalities on ACI.dev.

[ ]:
# Run command
%pip install "camel-ai[all]==0.2.59"

Prepare your environment by initializing necessary imports from CAMEL.#

[ ]:
from camel.agents import ChatAgent
from camel.models import ModelFactory
from camel.toolkits import ACIToolkit
from camel.types import ModelPlatformType, ModelType

Provide the API key and the LINKED_ACCOUNT_OWNER from ACI.dev to the SDK.#

[ ]:
import os
from getpass import getpass

# Prompt for the API key securely
openai_api_key = getpass('Enter your API key: ')
os.environ["OPENAI_API_KEY"] = openai_api_key
# Prompt for the ACI key securely
aci_api_key = getpass('Enter your ACI API key: ')
os.environ["ACI_API_KEY"] = aci_api_key
# Prompt for your linked account owner id securely
linked_account_owner_id = getpass('Enter your linked account owner id: ')
os.environ["LINKED_ACCOUNT_OWNER"] = linked_account_owner_id

Let’s run CAMEL agents with tools from ACI!#

[ ]:
# Get the value of the environment variable "LINKED_ACCOUNT_OWNER"
LINKED_ACCOUNT_OWNER = os.getenv("LINKED_ACCOUNT_OWNER")

# Check if the environment variable was set
if LINKED_ACCOUNT_OWNER is None:
    raise ValueError("LINKED_ACCOUNT_owner environment variable is not set.")
[ ]:
# Initialize ACI Toolkit with GitHub integration
aci_toolkit = ACIToolkit(linked_account_owner_id=LINKED_ACCOUNT_OWNER)

# Create default model instance
model = ModelFactory.create(
    model_platform=ModelPlatformType.DEFAULT,
    model_type=ModelType.DEFAULT,
)

# Set up chat agent with GitHub tools
chat_agent = ChatAgent(
    model=model,
    tools=aci_toolkit.get_tools(),  # GitHub tools enabled
)
[ ]:
# Execute GitHub star command
response = chat_agent.step("star the repo camel-ai/camel")
print(response)
msgs=[BaseMessage(role_name='assistant', role_type=<RoleType.ASSISTANT: 'assistant'>, meta_dict={}, content='The repository **camel-ai/camel** has been successfully starred!', video_bytes=None, image_list=None, image_detail='auto', video_detail='low', parsed=None)] terminated=False info={'id': 'chatcmpl-BXS3BEiBjdRUJx2Ucu5ZdRadsE7s7', 'usage': {'prompt_tokens': 7713, 'completion_tokens': 41, 'total_tokens': 7754}, 'termination_reasons': ['stop'], 'num_tokens': 71, 'tool_calls': [ToolCallingRecord(tool_name='GITHUB__STAR_REPOSITORY', args={'path': {'repo': 'camel', 'owner': 'camel-ai'}}, result={'success': True, 'data': {}}, tool_call_id='call_tW60m9BWrXGmRMd5AbwASRdx')], 'external_tool_call_requests': None}

That’s everything: Got questions about 🐫 CAMEL-AI? Join us on Discord! Whether you want to share feedback, explore the latest in multi-agent systems, get support, or connect with others on exciting projects, we’d love to have you in the community! 🤝

Check out some of our other work:

  1. 🐫 Creating Your First CAMEL Agent free Colab

  2. Graph RAG Cookbook free Colab

  3. 🧑‍⚖️ Create A Hackathon Judge Committee with Workforce free Colab

  4. 🔥 3 ways to ingest data from websites with Firecrawl & CAMEL free Colab

  5. 🦥 Agentic SFT Data Generation with CAMEL and Mistral Models, Fine-Tuned with Unsloth free Colab

Thanks from everyone at 🐫 CAMEL-AI

5281f316310e41e49f37858404ffd2d6 b19f9ceb73194472b077fc534659923a

⭐ Star us on Github, join our Discord or follow our X