Prompting Cookbook
You can also check this cookbook in colab here.
⭐ Star us on GitHub, join our Discord, or follow us on X
This notebook demonstrates how to set up and leverage CAMEL’s ability to use Prompt module.
In this notebook, you’ll explore:
-
CAMEL: A powerful multi-agent framework that enables Retrieval-Augmented Generation and multi-agent role-playing scenarios, allowing for sophisticated AI-driven tasks.
-
Prompt: Interface to communicate with models with various templates, create custom prompts, and leverage different prompt dictionaries for tasks ranging from role-playing to code generation, evaluation, and more. By mastering the Prompt module, you can significantly enhance your AI agents’ capabilities and tailor them to specific tasks.
📦 Installation
Ensure you have CAMEL AI installed in your Python environment:
🔑 Setting Up API Keys
You’ll need to set up your API keys for OpenAI.
Alternatively, if running on Colab, you could save your API keys and tokens as Colab Secrets,
and use them across notebooks.
To do so, comment out the above manual API key prompt code block(s),
and uncomment the following codeblock.
⚠️ Don’t forget granting access to the API key you would be using to the current notebook.
Getting Started with Prompt Templates
CAMEL offers a wide range of pre-defined prompt templates that you can use to quickly create specialized AI agents. Let’s start with a basic example using the TaskSpecifyAgent with the AI_SOCIETY task type.
Creating Custom Prompts
CAMEL also allows you to create your own custom prompts. Here’s an example of how to create and use a custom prompt template:
Advanced Prompt Usage
CAMEL provides various prompt dictionaries for different purposes. Let’s explore some advanced uses of these prompt templates:
1. Code Generation with CodePromptTemplateDict
2. Evaluation with EvaluationPromptTemplateDict
3. Object Recognition with ObjectRecognitionPromptTemplateDict
4. Translation with TranslationPromptTemplateDict
🌟 Highlights
This notebook has guided you through setting up and use Prompt module. The CAMEL Prompt module provides a powerful and flexible way to guide AI models in producing desired outputs. By using pre-defined prompt templates, creating custom prompts, and leveraging different prompt dictionaries, you can create highly specialized AI agents tailored to your specific needs.
Key tools utilized in this notebook include:
- CAMEL: A powerful multi-agent framework that enables Retrieval-Augmented Generation and multi-agent role-playing scenarios, allowing for sophisticated AI-driven tasks.
- Prompt: Interface to communicate with models with various templates, create custom prompts, and leverage different prompt dictionaries for tasks ranging from role-playing to code generation, evaluation, and more. By mastering the Prompt module, you can significantly enhance your AI agents’ capabilities and tailor them to specific tasks.
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:
-
🐫 Creating Your First CAMEL Agent free Colab
-
Graph RAG Cookbook free Colab
-
🧑⚖️ Create A Hackathon Judge Committee with Workforce free Colab
-
🔥 3 ways to ingest data from websites with Firecrawl & CAMEL free Colab
-
🦥 Agentic SFT Data Generation with CAMEL and Mistral Models, Fine-Tuned with Unsloth free Colab
Thanks from everyone at 🐫 CAMEL-AI
⭐ Star us on GitHub, join our Discord, or follow us on X