🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org
Python agentai-societiesartificial-intelligencecommunicative-aicooperative-aideep-learninglarge-language-modelsmulti-agent-systemsnatural-language-processing
fix: update rag cookbook and tool getting
Wendongb43ee6f332bd
diff --git a/camel/agents/chat_agent.py b/camel/agents/chat_agent.pyindex c45be8efb..8621a9448 100644--- a/camel/agents/chat_agent.py+++ b/camel/agents/chat_agent.py@@ -188,7 +188,7 @@ class ChatAgent(BaseAgent):# the tools set from `ChatAgent` will be used.# This design simplifies the interface while retaining tool-running# capabilities for `BaseModelBackend`.- if all_tools and not self.model_backend.model_config_dict['tools']:+ if all_tools and not self.model_backend.model_config_dict.get("tools"):tool_schema_list = [tool.get_openai_tool_schema() for tool in all_tools]diff --git a/docs/cookbooks/agents_with_rag.ipynb b/docs/cookbooks/agents_with_rag.ipynbindex ae4bd7b66..7d72afa87 100644--- a/docs/cookbooks/agents_with_rag.ipynb+++ b/docs/cookbooks/agents_with_rag.ipynb@@ -1,858 +1,855 @@{- "cells": [- {- "attachments": {},- "cell_type": "markdown",- "metadata": {- "id": "SQMBlxsBv1cH"- },- "source": [- "# RAG Cookbook\n"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "XFyl4eJue3Sm"- },- "source": [- "You can also check this cookbook in colab [here](https://colab.research.google.com/drive/1sTJ0x_MYRGA76KCg_3I00wj4RL3D2Twp?usp=sharing)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "-nCRZU5sInDK"- },- "source": [- "## Overview"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "AwnfLQvMvtXo"- },- "source": [- "In this notebook, we show the useage of CAMEL Retrieve Module in both customized way and auto way. We will also show how to combine `AutoRetriever` with `ChatAgent`, and further combine `AutoRetriever` with `RolePlaying` by using `Function Calling`.\n",- "\n",- "4 main parts included:\n",- "- Customized RAG\n",- "- Auto RAG\n",- "- Single Agent with Auto RAG\n",- "- Role-playing with Auto RAG"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "XuZwbB1IIuUi"- },- "source": [- "### Installation"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "gIJK4Lu5Iwm0"- },- "source": [- "Ensure you have CAMEL AI installed in your Python environment:"- ]- },- {- "cell_type": "code",- "execution_count": null,- "metadata": {- "collapsed": true,- "id": "HTKnWg9Xv_y4"- },- "outputs": [],- "source": [- "%pip install \"camel-ai[all]==0.2.1\""- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "LUpFBEB9vrIz"- },- "source": [- "## Load Data\n",- "Let's first load the CAMEL paper from https://arxiv.org/pdf/2303.17760.pdf. This will be our local example data.\n",- "\n"- ]- },- {- "cell_type": "code",- "execution_count": 2,- "metadata": {- "id": "dUVE7z9hwEV7"- },- "outputs": [],- "source": [- "import os\n",- "import requests\n",- "\n",- "os.makedirs('local_data', exist_ok=True)\n",- "\n",- "url = \"https://arxiv.org/pdf/2303.17760.pdf\"\n",- "response = requests.get(url)\n",- "with open('local_data/camel_paper.pdf', 'wb') as file:\n",- " file.write(response.content)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "HCqghaGiwkdv"- },- "source": [- "## 1. Customized RAG\n",- "In this section we will set our customized RAG pipeline, we will take `VectorRetriever` as an example.\n",- "Set embedding model, we will use `OpenAIEmbedding` as the embedding model, so we need to set the `OPENAI_API_KEY` in below."- ]- },- {- "cell_type": "code",- "execution_count": 3,- "metadata": {- "colab": {- "base_uri": "https://localhost:8080/"+ "cells": [+ {+ "attachments": {},+ "cell_type": "markdown",+ "metadata": {+ "id": "SQMBlxsBv1cH"+ },+ "source": [+ "# RAG Cookbook\n"+ ]},- "id": "RxG99FkYwm_p",- "outputId": "f6b63906-f356-481d-d0c1-1416299c92ac"- },- "outputs": [{- "name": "stdout",- "output_type": "stream",- "text": [- "Enter your API key: ··········\n"- ]- }- ],- "source": [- "from getpass import getpass\n",- "# Prompt for the OpenAI API key securely\n",- "openai_api_key = getpass('Enter your API key: ')\n",- "os.environ[\"OPENAI_API_KEY\"] = openai_api_key"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "NACsmaa0wple"- },- "source": [- "Import and set the embedding instance:"- ]- },- {- "cell_type": "code",- "execution_count": 4,- "metadata": {- "id": "NCT5ygT-wrku"- },- "outputs": [],- "source": [- "from camel.embeddings import OpenAIEmbedding\n",- "from camel.types import EmbeddingModelType\n",- "\n",- "embedding_instance = OpenAIEmbedding(model_type=EmbeddingModelType.TEXT_EMBEDDING_3_LARGE)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "q4nVmsm0w5lH"- },- "source": [- "Import and set the vector storage instance:"- ]- },- {- "cell_type": "code",- "execution_count": 5,- "metadata": {- "id": "IQ30ih1_w6p3"- },- "outputs": [],- "source": [- "from camel.storages import QdrantStorage\n",- "\n",- "storage_instance = QdrantStorage(\n",- " vector_dim=embedding_instance.get_output_dim(),\n",- " path=\"local_data\",\n",- " collection_name=\"camel_paper\",\n",- ")"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "W9KccfRDw9F4"- },- "source": [- "Import and set the retriever instance:"- ]- },- {- "cell_type": "code",- "execution_count": 6,- "metadata": {- "id": "d8S6VjAQHnai"- },- "outputs": [],- "source": [- "from camel.retrievers import VectorRetriever\n",- "\n",- "vector_retriever = VectorRetriever(embedding_model=embedding_instance,\n",- " storage=storage_instance)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "PdezllM6Hp83"- },- "source": [- "We use integrated `Unstructured Module` to splite the content into small chunks, the content will be splited automacitlly with its `chunk_by_title` function, the max character for each chunk is 500 characters, which is a suitable length for `OpenAIEmbedding`. All the text in the chunks will be embed and stored to the vector storage instance, it will take some time, please wait.."- ]- },- {- "cell_type": "code",- "execution_count": 7,- "metadata": {- "colab": {- "base_uri": "https://localhost:8080/"+ "cell_type": "markdown",+ "metadata": {+ "id": "XFyl4eJue3Sm"+ },+ "source": [+ "You can also check this cookbook in colab [here](https://colab.research.google.com/drive/1sTJ0x_MYRGA76KCg_3I00wj4RL3D2Twp?usp=sharing)"+ ]},- "id": "QTFvD3_SHv3m",- "outputId": "19ecfa22-4b2c-4c6b-e3a8-a2c36c5f1830"- },- "outputs": [{- "name": "stderr",- "output_type": "stream",- "text": [- "2024-09-15 09:21:56.121527: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered\n",- "2024-09-15 09:21:56.159963: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:8454] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered\n",- "2024-09-15 09:21:56.171381: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered\n",- "2024-09-15 09:21:56.206432: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",- "To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",- "2024-09-15 09:21:58.042937: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",- "[nltk_data] Downloading package punkt to /root/nltk_data...\n",- "[nltk_data] Unzipping tokenizers/punkt.zip.\n",- "[nltk_data] Downloading package averaged_perceptron_tagger to\n",- "[nltk_data] /root/nltk_data...\n",- "[nltk_data] Unzipping taggers/averaged_perceptron_tagger.zip.\n"- ]- }- ],- "source": [- "vector_retriever.process(\n",- " content=\"local_data/camel_paper.pdf\",\n",- ")"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "0nhIo1wUHyvl"- },- "source": [- "\n",- "Now we can retrieve information from the vector storage by giving a query. By default it will give you back the text content from top 1 chunk with highest Cosine similarity score, and the similarity score should be higher than 0.75 to ensure the retrieved content is relevant to the query. You can also change the `top_k` value and `similarity_threshold` value with your needs.\n",- "\n",- "The returned dictionary list includes:\n",- "- similarity score\n",- "- content path\n",- "- metadata\n",- "- text"- ]- },- {- "cell_type": "code",- "execution_count": 8,- "metadata": {- "colab": {- "base_uri": "https://localhost:8080/"+ "cell_type": "markdown",+ "metadata": {+ "id": "-nCRZU5sInDK"+ },+ "source": [+ "## Overview"+ ]},- "id": "uDu43Hb3GVrs",- "outputId": "f0b45174-29c6-49bd-c4fb-60713131c099"- },- "outputs": [{- "name": "stdout",- "output_type": "stream",- "text": [- "[{'similarity score': '0.8732095800224018', 'content path': 'local_data/camel_paper.pdf', 'metadata': {'last_modified': '2024-09-15T09:21:03', 'filetype': 'application/pdf', 'page_number': 10}, 'text': '6 Conclusion In this paper, we explore the potential of autonomous cooperation among communicative agents and propose a novel cooperative agent framework named role-playing . Our approach enables communicative agents to collaborate autonomously toward completing tasks while requiring minimal human intervention, leading to better solutions are per our thorough evaluations. Through our analysis, we show that achieving autonomous cooperation is challenging due to issues like conversation deviation,'}]\n"- ]- }- ],- "source": [- "retrieved_info = vector_retriever.query(\n",- " query=\"To address the challenges of achieving autonomous cooperation, we propose a novel communicative agent framework named role-playing .\",\n",- " top_k=1\n",- ")\n",- "print(retrieved_info)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "48G3USMzH6Hd"- },- "source": [- "Let's try an irrelevant query:"- ]- },- {- "cell_type": "code",- "execution_count": 9,- "metadata": {- "colab": {- "base_uri": "https://localhost:8080/"+ "cell_type": "markdown",+ "metadata": {+ "id": "AwnfLQvMvtXo"+ },+ "source": [+ "In this notebook, we show the useage of CAMEL Retrieve Module in both customized way and auto way. We will also show how to combine `AutoRetriever` with `ChatAgent`, and further combine `AutoRetriever` with `RolePlaying` by using `Function Calling`.\n",+ "\n",+ "4 main parts included:\n",+ "- Customized RAG\n",+ "- Auto RAG\n",+ "- Single Agent with Auto RAG\n",+ "- Role-playing with Auto RAG"+ ]},- "id": "UNh3tjCOH7d0",- "outputId": "190e176c-7c60-452a-87cd-f85cb8cb4e28"- },- "outputs": [{- "name": "stdout",- "output_type": "stream",- "text": [- "[{'text': 'No suitable information retrieved from local_data/camel_paper.pdf with similarity_threshold = 0.7.'}]\n"- ]- }- ],- "source": [- "retrieved_info_irrevelant = vector_retriever.query(\n",- " query=\"Compared with dumpling and rice, which should I take for dinner?\",\n",- " top_k=1,\n",- ")\n",- "\n",- "print(retrieved_info_irrevelant)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "mHdEsIzSH_AD"- },- "source": [- "## 2. Auto RAG\n",- "In this section we will run the `AutoRetriever` with default settings. It uses `OpenAIEmbedding` as default embedding model and `Milvus` as default vector storage.\n",- "\n",- "What you need to do is:\n",- "- Set content input paths, which can be local paths or remote urls\n",- "- Set remote url and api key for Milvus\n",- "- Give a query\n",- "\n",- "The Auto RAG pipeline would create collections for given content input paths, the collection name will be set automaticlly based on the content input path name, if the collection exists, it will do the retrieve directly."- ]- },- {- "cell_type": "code",- "execution_count": 10,- "metadata": {- "colab": {- "base_uri": "https://localhost:8080/"+ "cell_type": "markdown",+ "metadata": {+ "id": "XuZwbB1IIuUi"+ },+ "source": [+ "### Installation"+ ]},- "id": "D_-zAOJ7GjVm",- "outputId": "9b1d63f3-078c-4d19-ebff-4d8c1afefc6e"- },- "outputs": [{- "name": "stdout",- "output_type": "stream",- "text": [- "{'Original Query': \"If I'm interest in contributing to the CAMEL projec, what should I do?\", 'Retrieved Context': [{'similarity score': '0.7054803289665507', 'content path': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'metadata': {'filetype': 'text/html', 'languages': ['eng'], 'page_number': 1, 'url': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'link_urls': ['https://join.slack.com/t/camel-kwr1314/shared_invite/zt-1vy8u9lbo-ZQmhIAyWSEfSwLCl2r2eKA'], 'link_texts': ['slack']}, 'text': \"Thank you for your interest in contributing to the CAMEL project! 🎉 We're excited to have your support. As an open-source initiative in a rapidly evolving and open-ended field, we wholeheartedly welcome contributions of all kinds. Whether you want to introduce new features, enhance the infrastructure, improve documentation, asking issues, add more examples, implement state-of-the-art research ideas, or fix bugs, we appreciate your enthusiasm and efforts. 🙌 You are welcome to join our slack for \"}]}\n"- ]- }- ],- "source": [- "from camel.retrievers import AutoRetriever\n",- "from camel.types import StorageType\n",- "\n",- "auto_retriever = AutoRetriever(\n",- " vector_storage_local_path=\"local_data2/\",\n",- " storage_type=StorageType.QDRANT,\n",- " embedding_model=embedding_instance)\n",- "\n",- "retrieved_info = auto_retriever.run_vector_retriever(\n",- " query=\"If I'm interest in contributing to the CAMEL projec, what should I do?\",\n",- " contents=[\n",- " \"local_data/camel_paper.pdf\", # example local path\n",- " \"https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\", # example remote url\n",- " ],\n",- " top_k=1,\n",- " return_detailed_info=True,\n",- " similarity_threshold=0.5\n",- ")\n",- "\n",- "print(retrieved_info)"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "hMgCWKG4IQYF"- },- "source": [- "## 3. Single Agent with Auto RAG\n",- "In this section we will show how to combine the `AutoRetriever` with one `ChatAgent`.\n",- "\n",- "Let's set an agent function, in this function we can get the response by providing a query to this agent."- ]- },- {- "cell_type": "code",- "execution_count": 11,- "metadata": {- "colab": {- "base_uri": "https://localhost:8080/"+ "cell_type": "markdown",+ "metadata": {+ "id": "gIJK4Lu5Iwm0"+ },+ "source": [+ "Ensure you have CAMEL AI installed in your Python environment:"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": null,+ "metadata": {+ "collapsed": true,+ "id": "HTKnWg9Xv_y4"+ },+ "outputs": [],+ "source": [+ "!pip install \"camel-ai[all]==0.2.1\""+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "LUpFBEB9vrIz"+ },+ "source": [+ "## Load Data\n",+ "Let's first load the CAMEL paper from https://arxiv.org/pdf/2303.17760.pdf. This will be our local example data.\n",+ "\n"+ ]},- "id": "YTE_mUwGIok-",- "outputId": "442ecc82-58a2-419f-a067-cd0281d2e194"- },- "outputs": [{- "name": "stdout",- "output_type": "stream",- "text": [- "If you're interested in contributing to the CAMEL project, you can introduce new features, enhance the infrastructure, improve documentation, ask about issues, add more examples, implement state-of-the-art research ideas, or fix bugs. Additionally, you are welcome to join their Slack for further engagement.\n"- ]+ "cell_type": "code",+ "execution_count": 2,+ "metadata": {+ "id": "dUVE7z9hwEV7"+ },+ "outputs": [],+ "source": [+ "import os\n",+ "import requests\n",+ "\n",+ "os.makedirs('local_data', exist_ok=True)\n",+ "\n",+ "url = \"https://arxiv.org/pdf/2303.17760.pdf\"\n",+ "response = requests.get(url)\n",+ "with open('local_data/camel_paper.pdf', 'wb') as file:\n",+ " file.write(response.content)"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "HCqghaGiwkdv"+ },+ "source": [+ "## 1. Customized RAG\n",+ "In this section we will set our customized RAG pipeline, we will take `VectorRetriever` as an example.\n",+ "Set embedding model, we will use `OpenAIEmbedding` as the embedding model, so we need to set the `OPENAI_API_KEY` in below."+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 3,+ "metadata": {+ "colab": {+ "base_uri": "https://localhost:8080/"+ },+ "id": "RxG99FkYwm_p",+ "outputId": "fc85f6d4-ea08-4d30-b198-3a4573868673"+ },+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "Enter your API key: ··········\n"+ ]+ }+ ],+ "source": [+ "from getpass import getpass\n",+ "# Prompt for the OpenAI API key securely\n",+ "openai_api_key = getpass('Enter your API key: ')\n",+ "os.environ[\"OPENAI_API_KEY\"] = openai_api_key"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "NACsmaa0wple"+ },+ "source": [+ "Import and set the embedding instance:"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 4,+ "metadata": {+ "id": "NCT5ygT-wrku"+ },+ "outputs": [],+ "source": [+ "from camel.embeddings import OpenAIEmbedding\n",+ "from camel.types import EmbeddingModelType\n",+ "\n",+ "embedding_instance = OpenAIEmbedding(model_type=EmbeddingModelType.TEXT_EMBEDDING_3_LARGE)"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "q4nVmsm0w5lH"+ },+ "source": [+ "Import and set the vector storage instance:"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 5,+ "metadata": {+ "id": "IQ30ih1_w6p3"+ },+ "outputs": [],+ "source": [+ "from camel.storages import QdrantStorage\n",+ "\n",+ "storage_instance = QdrantStorage(\n",+ " vector_dim=embedding_instance.get_output_dim(),\n",+ " path=\"local_data\",\n",+ " collection_name=\"camel_paper\",\n",+ ")"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "W9KccfRDw9F4"+ },+ "source": [+ "Import and set the retriever instance:"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 6,+ "metadata": {+ "id": "d8S6VjAQHnai"+ },+ "outputs": [],+ "source": [+ "from camel.retrievers import VectorRetriever\n",+ "\n",+ "vector_retriever = VectorRetriever(embedding_model=embedding_instance,\n",+ " storage=storage_instance)"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "PdezllM6Hp83"+ },+ "source": [+ "We use integrated `Unstructured Module` to splite the content into small chunks, the content will be splited automacitlly with its `chunk_by_title` function, the max character for each chunk is 500 characters, which is a suitable length for `OpenAIEmbedding`. All the text in the chunks will be embed and stored to the vector storage instance, it will take some time, please wait.."+ ]+ },+ {+ "cell_type": "code",+ "execution_count": null,+ "metadata": {+ "id": "QTFvD3_SHv3m"+ },+ "outputs": [],+ "source": [+ "vector_retriever.process(\n",+ " content=\"local_data/camel_paper.pdf\",\n",+ ")"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "0nhIo1wUHyvl"+ },+ "source": [+ "\n",+ "Now we can retrieve information from the vector storage by giving a query. By default it will give you back the text content from top 1 chunk with highest Cosine similarity score, and the similarity score should be higher than 0.75 to ensure the retrieved content is relevant to the query. You can also change the `top_k` value and `similarity_threshold` value with your needs.\n",+ "\n",+ "The returned dictionary list includes:\n",+ "- similarity score\n",+ "- content path\n",+ "- metadata\n",+ "- text"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 8,+ "metadata": {+ "colab": {+ "base_uri": "https://localhost:8080/"+ },+ "id": "uDu43Hb3GVrs",+ "outputId": "035fedf9-e469-4e32-990b-f360c2cdcb96"+ },+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "[{'similarity score': '0.8733044970215764', 'content path': 'local_data/camel_paper.pdf', 'metadata': {'last_modified': '2024-09-28T03:37:11', 'filetype': 'application/pdf', 'page_number': 10}, 'text': '6 Conclusion In this paper, we explore the potential of autonomous cooperation among communicative agents and propose a novel cooperative agent framework named role-playing . Our approach enables communicative agents to collaborate autonomously toward completing tasks while requiring minimal human intervention, leading to better solutions are per our thorough evaluations. Through our analysis, we show that achieving autonomous cooperation is challenging due to issues like conversation deviation,'}]\n"+ ]+ }+ ],+ "source": [+ "retrieved_info = vector_retriever.query(\n",+ " query=\"To address the challenges of achieving autonomous cooperation, we propose a novel communicative agent framework named role-playing .\",\n",+ " top_k=1\n",+ ")\n",+ "print(retrieved_info)"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "48G3USMzH6Hd"+ },+ "source": [+ "Let's try an irrelevant query:"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 9,+ "metadata": {+ "colab": {+ "base_uri": "https://localhost:8080/"+ },+ "id": "UNh3tjCOH7d0",+ "outputId": "05f4196a-c9dd-4ddd-d970-beec129086d6"+ },+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "[{'text': 'No suitable information retrieved from local_data/camel_paper.pdf with similarity_threshold = 0.7.'}]\n"+ ]+ }+ ],+ "source": [+ "retrieved_info_irrevelant = vector_retriever.query(\n",+ " query=\"Compared with dumpling and rice, which should I take for dinner?\",\n",+ " top_k=1,\n",+ ")\n",+ "\n",+ "print(retrieved_info_irrevelant)"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "mHdEsIzSH_AD"+ },+ "source": [+ "## 2. Auto RAG\n",+ "In this section we will run the `AutoRetriever` with default settings. It uses `OpenAIEmbedding` as default embedding model and `Milvus` as default vector storage.\n",+ "\n",+ "What you need to do is:\n",+ "- Set content input paths, which can be local paths or remote urls\n",+ "- Set remote url and api key for Milvus\n",+ "- Give a query\n",+ "\n",+ "The Auto RAG pipeline would create collections for given content input paths, the collection name will be set automaticlly based on the content input path name, if the collection exists, it will do the retrieve directly."+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 10,+ "metadata": {+ "colab": {+ "base_uri": "https://localhost:8080/"+ },+ "id": "D_-zAOJ7GjVm",+ "outputId": "8da4f3ef-3bb4-47e0-a994-d9c0fb87dfb7"+ },+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "{'Original Query': \"If I'm interest in contributing to the CAMEL projec, what should I do?\", 'Retrieved Context': [{'similarity score': '0.7054343316726102', 'content path': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'metadata': {'filetype': 'text/html', 'languages': ['eng'], 'page_number': 1, 'url': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'link_urls': ['https://join.slack.com/t/camel-kwr1314/shared_invite/zt-1vy8u9lbo-ZQmhIAyWSEfSwLCl2r2eKA'], 'link_texts': ['slack']}, 'text': \"Thank you for your interest in contributing to the CAMEL project! 🎉 We're excited to have your support. As an open-source initiative in a rapidly evolving and open-ended field, we wholeheartedly welcome contributions of all kinds. Whether you want to introduce new features, enhance the infrastructure, improve documentation, asking issues, add more examples, implement state-of-the-art research ideas, or fix bugs, we appreciate your enthusiasm and efforts. 🙌 You are welcome to join our slack for \"}]}\n"+ ]+ }+ ],+ "source": [+ "from camel.retrievers import AutoRetriever\n",+ "from camel.types import StorageType\n",+ "\n",+ "auto_retriever = AutoRetriever(\n",+ " vector_storage_local_path=\"local_data2/\",\n",+ " storage_type=StorageType.QDRANT,\n",+ " embedding_model=embedding_instance)\n",+ "\n",+ "retrieved_info = auto_retriever.run_vector_retriever(\n",+ " query=\"If I'm interest in contributing to the CAMEL projec, what should I do?\",\n",+ " contents=[\n",+ " \"local_data/camel_paper.pdf\", # example local path\n",+ " \"https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\", # example remote url\n",+ " ],\n",+ " top_k=1,\n",+ " return_detailed_info=True,\n",+ " similarity_threshold=0.5\n",+ ")\n",+ "\n",+ "print(retrieved_info)"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "hMgCWKG4IQYF"+ },+ "source": [+ "## 3. Single Agent with Auto RAG\n",+ "In this section we will show how to combine the `AutoRetriever` with one `ChatAgent`.\n",+ "\n",+ "Let's set an agent function, in this function we can get the response by providing a query to this agent."+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 11,+ "metadata": {+ "colab": {+ "base_uri": "https://localhost:8080/"+ },+ "id": "YTE_mUwGIok-",+ "outputId": "0b2b53eb-eb4c-4bc5-feda-981f027b1e6e"+ },+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "If you're interested in contributing to the CAMEL project, you can introduce new features, enhance the infrastructure, improve documentation, address issues, add more examples, implement state-of-the-art research ideas, or fix bugs. Additionally, you are welcome to join their Slack for further engagement and collaboration.\n"+ ]+ }+ ],+ "source": [+ "from camel.agents import ChatAgent\n",+ "from camel.messages import BaseMessage\n",+ "from camel.types import RoleType\n",+ "from camel.retrievers import AutoRetriever\n",+ "from camel.types import StorageType\n",+ "\n",+ "def single_agent(query: str) ->str :\n",+ " # Set agent role\n",+ " assistant_sys_msg = BaseMessage(\n",+ " role_name=\"Assistant\",\n",+ " role_type=RoleType.ASSISTANT,\n",+ " meta_dict=None,\n",+ " content=\"\"\"You are a helpful assistant to answer question,\n",+ " I will give you the Original Query and Retrieved Context,\n",+ " answer the Original Query based on the Retrieved Context,\n",+ " if you can't answer the question just say I don't know.\"\"\",\n",+ " )\n",+ "\n",+ " # Add auto retriever\n",+ " auto_retriever = AutoRetriever(\n",+ " vector_storage_local_path=\"local_data2/\",\n",+ " storage_type=StorageType.QDRANT,\n",+ " embedding_model=embedding_instance)\n",+ "\n",+ " retrieved_info = auto_retriever.run_vector_retriever(\n",+ " query=query,\n",+ " contents=[\n",+ " \"local_data/camel_paper.pdf\", # example local path\n",+ " \"https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\", # example remote url\n",+ " ],\n",+ " top_k=1,\n",+ " return_detailed_info=False,\n",+ " similarity_threshold=0.5\n",+ " )\n",+ "\n",+ " # Pass the retrieved infomation to agent\n",+ " user_msg = BaseMessage.make_user_message(role_name=\"User\", content=str(retrieved_info))\n",+ " agent = ChatAgent(assistant_sys_msg)\n",+ "\n",+ " # Get response\n",+ " assistant_response = agent.step(user_msg)\n",+ " return assistant_response.msg.content\n",+ "\n",+ "print(single_agent(\"If I'm interest in contributing to the CAMEL projec, what should I do?\"))"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "Cvh6e3KpI0rf"+ },+ "source": [+ "## 4. Role-playing with Auto RAG\n",+ "In this section we will show how to combine the `RETRIEVAL_FUNCS` with `RolePlaying` by applying `Function Calling`.\n"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 19,+ "metadata": {+ "id": "z3tX4EJVI1hb"+ },+ "outputs": [],+ "source": [+ "from typing import List\n",+ "from colorama import Fore\n",+ "\n",+ "from camel.agents.chat_agent import FunctionCallingRecord\n",+ "from camel.configs import ChatGPTConfig\n",+ "from camel.toolkits import (\n",+ " MathToolkit,\n",+ " RetrievalToolkit,\n",+ ")\n",+ "from camel.societies import RolePlaying\n",+ "from camel.types import ModelType, ModelPlatformType\n",+ "from camel.utils import print_text_animated\n",+ "from camel.models import ModelFactory\n",+ "\n",+ "def role_playing_with_rag(\n",+ " task_prompt,\n",+ " model_platform=ModelPlatformType.OPENAI,\n",+ " model_type=ModelType.GPT_4O,\n",+ " chat_turn_limit=5,\n",+ ") -> None:\n",+ " task_prompt = task_prompt\n",+ "\n",+ " user_model_config = ChatGPTConfig(temperature=0.0)\n",+ "\n",+ " tools_list = [\n",+ " *MathToolkit().get_tools(),\n",+ " *RetrievalToolkit().get_tools(),\n",+ " ]\n",+ " assistant_model_config = ChatGPTConfig(\n",+ " tools=tools_list,\n",+ " temperature=0.0,\n",+ " )\n",+ "\n",+ " role_play_session = RolePlaying(\n",+ " assistant_role_name=\"Searcher\",\n",+ " user_role_name=\"Professor\",\n",+ " assistant_agent_kwargs=dict(\n",+ " model=ModelFactory.create(\n",+ " model_platform=model_platform,\n",+ " model_type=model_type,\n",+ " model_config_dict=assistant_model_config.as_dict(),\n",+ " ),\n",+ " tools=tools_list,\n",+ " ),\n",+ " user_agent_kwargs=dict(\n",+ " model=ModelFactory.create(\n",+ " model_platform=model_platform,\n",+ " model_type=model_type,\n",+ " model_config_dict=user_model_config.as_dict(),\n",+ " ),\n",+ " ),\n",+ " task_prompt=task_prompt,\n",+ " with_task_specify=False,\n",+ " )\n",+ "\n",+ " print(\n",+ " Fore.GREEN\n",+ " + f\"AI Assistant sys message:\\n{role_play_session.assistant_sys_msg}\\n\"\n",+ " )\n",+ " print(\n",+ " Fore.BLUE + f\"AI User sys message:\\n{role_play_session.user_sys_msg}\\n\"\n",+ " )\n",+ "\n",+ " print(Fore.YELLOW + f\"Original task prompt:\\n{task_prompt}\\n\")\n",+ " print(\n",+ " Fore.CYAN\n",+ " + \"Specified task prompt:\"\n",+ " + f\"\\n{role_play_session.specified_task_prompt}\\n\"\n",+ " )\n",+ " print(Fore.RED + f\"Final task prompt:\\n{role_play_session.task_prompt}\\n\")\n",+ "\n",+ " n = 0\n",+ " input_msg = role_play_session.init_chat()\n",+ " while n < chat_turn_limit:\n",+ " n += 1\n",+ " assistant_response, user_response = role_play_session.step(input_msg)\n",+ "\n",+ " if assistant_response.terminated:\n",+ " print(\n",+ " Fore.GREEN\n",+ " + (\n",+ " \"AI Assistant terminated. Reason: \"\n",+ " f\"{assistant_response.info['termination_reasons']}.\"\n",+ " )\n",+ " )\n",+ " break\n",+ " if user_response.terminated:\n",+ " print(\n",+ " Fore.GREEN\n",+ " + (\n",+ " \"AI User terminated. \"\n",+ " f\"Reason: {user_response.info['termination_reasons']}.\"\n",+ " )\n",+ " )\n",+ " break\n",+ "\n",+ " # Print output from the user\n",+ " print_text_animated(\n",+ " Fore.BLUE + f\"AI User:\\n\\n{user_response.msg.content}\\n\"\n",+ " )\n",+ "\n",+ " # Print output from the assistant, including any function\n",+ " # execution information\n",+ " print_text_animated(Fore.GREEN + \"AI Assistant:\")\n",+ " tool_calls: List[FunctionCallingRecord] = [\n",+ " FunctionCallingRecord(**call.as_dict())\n",+ " for call in assistant_response.info['tool_calls']\n",+ " ]\n",+ " for func_record in tool_calls:\n",+ " print_text_animated(f\"{func_record}\")\n",+ " print_text_animated(f\"{assistant_response.msg.content}\\n\")\n",+ "\n",+ " if \"CAMEL_TASK_DONE\" in user_response.msg.content:\n",+ " break\n",+ "\n",+ " input_msg = assistant_response.msg"+ ]+ },+ {+ "cell_type": "markdown",+ "metadata": {+ "id": "w4-0lswwI5Gb"+ },+ "source": [+ "Run the role-playing with defined retriever function:"+ ]+ },+ {+ "cell_type": "code",+ "execution_count": 22,+ "metadata": {+ "colab": {+ "base_uri": "https://localhost:8080/"+ },+ "id": "5agjiXHeI64q",+ "outputId": "8f6c53cb-411e-440f-95bb-7a45f07c6d96"+ },+ "outputs": [+ {+ "name": "stdout",+ "output_type": "stream",+ "text": [+ "\u001b[32mAI Assistant sys message:\n",+ "BaseMessage(role_name='Searcher', role_type=<RoleType.ASSISTANT: 'assistant'>, meta_dict={'task': \"If I'm interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don't generate the answer by yourself, adjust the similarity threshold to lower value is necessary\", 'assistant_role': 'Searcher', 'user_role': 'Professor'}, content=\"===== RULES OF ASSISTANT =====\\nNever forget you are a Searcher and I am a Professor. Never flip roles! Never instruct me!\\nWe share a common interest in collaborating to successfully complete a task.\\nYou must help me to complete the task.\\nHere is the task: If I'm interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don't generate the answer by yourself, adjust the similarity threshold to lower value is necessary. Never forget our task!\\nI must instruct you based on your expertise and my needs to complete the task.\\n\\nI must give you one instruction at a time.\\nYou must write a specific solution that appropriately solves the requested instruction and explain your solutions.\\nYou must decline my instruction honestly if you cannot perform the instruction due to physical, moral, legal reasons or your capability and explain the reasons.\\nUnless I say the task is completed, you should always start with:\\n\\nSolution: <YOUR_SOLUTION>\\n\\n<YOUR_SOLUTION> should be very specific, include detailed explanations and provide preferable detailed implementations and examples and lists for task-solving.\\nAlways end <YOUR_SOLUTION> with: Next request.\", video_bytes=None, image_list=None, image_detail='auto', video_detail='low')\n",+ "\n",+ "\u001b[34mAI User sys message:\n",+ "BaseMessage(role_name='Professor', role_type=<RoleType.USER: 'user'>, meta_dict={'task': \"If I'm interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don't generate the answer by yourself, adjust the similarity threshold to lower value is necessary\", 'assistant_role': 'Searcher', 'user_role': 'Professor'}, content='===== RULES OF USER =====\\nNever forget you are a Professor and I am a Searcher. Never flip roles! You will always instruct me.\\nWe share a common interest in collaborating to successfully complete a task.\\nI must help you to complete the task.\\nHere is the task: If I\\'m interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don\\'t generate the answer by yourself, adjust the similarity threshold to lower value is necessary. Never forget our task!\\nYou must instruct me based on my expertise and your needs to solve the task ONLY in the following two ways:\\n\\n1. Instruct with a necessary input:\\nInstruction: <YOUR_INSTRUCTION>\\nInput: <YOUR_INPUT>\\n\\n2. Instruct without any input:\\nInstruction: <YOUR_INSTRUCTION>\\nInput: None\\n\\nThe \"Instruction\" describes a task or question. The paired \"Input\" provides further context or information for the requested \"Instruction\".\\n\\nYou must give me one instruction at a time.\\nI must write a response that appropriately solves the requested instruction.\\nI must decline your instruction honestly if I cannot perform the instruction due to physical, moral, legal reasons or my capability and explain the reasons.\\nYou should instruct me not ask me questions.\\nNow you must start to instruct me using the two ways described above.\\nDo not add anything else other than your instruction and the optional corresponding input!\\nKeep giving me instructions and necessary inputs until you think the task is completed.\\nWhen the task is completed, you must only reply with a single word <CAMEL_TASK_DONE>.\\nNever say <CAMEL_TASK_DONE> unless my responses have solved your task.', video_bytes=None, image_list=None, image_detail='auto', video_detail='low')\n",+ "\n",+ "\u001b[33mOriginal task prompt:\n",+ "If I'm interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don't generate the answer by yourself, adjust the similarity threshold to lower value is necessary\n",+ "\n",+ "\u001b[36mSpecified task prompt:\n",+ "None\n",+ "\n",+ "\u001b[31mFinal task prompt:\n",+ "If I'm interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don't generate the answer by yourself, adjust the similarity threshold to lower value is necessary\n",+ "\n",+ "\u001b[34mAI User:\n",+ "\n",+ "Instruction: Visit the URL provided to access the CAMEL project's contributing guidelines.\n",+ "Input: https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\n",+ "\n",+ "\n",+ "\u001b[32mAI Assistant:\n",+ "\n",+ "Function Execution: information_retrieval\n",+ "\tArgs: {'query': 'contributing guidelines for CAMEL project', 'contents': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines'}\n",+ "\tResult: {'Original Query': 'contributing guidelines for CAMEL project', 'Retrieved Context': ['No suitable information retrieved from https://github.com/camel-ai/camel/wiki/Contributing-Guidlines with similarity_threshold = 0.7.']}\n",+ "\n",+ "Solution: It appears that no suitable information was retrieved from the provided URL with the current similarity threshold. I will adjust the similarity threshold to a lower value to attempt to retrieve the relevant information.\n",+ "\n",+ "Next request.\n",+ "\n",+ "\n",+ "\u001b[34mAI User:\n",+ "\n",+ "Instruction: Adjust the similarity threshold to a lower value and attempt to retrieve the relevant information from the provided URL again.\n",+ "Input: https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\n",+ "\n",+ "\n",+ "\u001b[32mAI Assistant:\n",+ "\n",+ "Function Execution: information_retrieval\n",+ "\tArgs: {'query': 'contributing guidelines for CAMEL project', 'contents': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'similarity_threshold': 0.5}\n",+ "\tResult: {'Original Query': 'contributing guidelines for CAMEL project', 'Retrieved Context': [\"Thank you for your interest in contributing to the CAMEL project! 🎉 We're excited to have your support. As an open-source initiative in a rapidly evolving and open-ended field, we wholeheartedly welcome contributions of all kinds. Whether you want to introduce new features, enhance the infrastructure, improve documentation, asking issues, add more examples, implement state-of-the-art research ideas, or fix bugs, we appreciate your enthusiasm and efforts. 🙌 You are welcome to join our slack for \"]}\n",+ "\n",+ "Solution: Here is the relevant information retrieved from the provided URL:\n",+ "\n",+ "\"Thank you for your interest in contributing to the CAMEL project! 🎉 We're excited to have your support. As an open-source initiative in a rapidly evolving and open-ended field, we wholeheartedly welcome contributions of all kinds. Whether you want to introduce new features, enhance the infrastructure, improve documentation, ask issues, add more examples, implement state-of-the-art research ideas, or fix bugs, we appreciate your enthusiasm and efforts. 🙌 You are welcome to join our Slack for...\"\n",+ "\n",+ "This indicates that the CAMEL project is open to various types of contributions, including new features, infrastructure enhancements, documentation improvements, issue reporting, adding examples, implementing research ideas, and bug fixes. Additionally, it suggests joining their Slack for further engagement.\n",+ "\n",+ "Next request.\n",+ "\n",+ "\n",+ "\u001b[34mAI User:\n",+ "\n",+ "Instruction: Look for specific instructions or steps provided in the contributing guidelines for setting up the development environment or resolving setup challenges.\n",+ "Input: https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\n",+ "\n",+ "\n",+ "\u001b[32mAI Assistant:\n",+ "\n",+ "Function Execution: information_retrieval\n",+ "\tArgs: {'query': 'setup development environment or resolving setup challenges for CAMEL project', 'contents': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'similarity_threshold': 0.5}\n",+ "\tResult: {'Original Query': 'setup development environment or resolving setup challenges for CAMEL project', 'Retrieved Context': ['Quick Start 🚀\\n\\nTo get started with CAMEL, follow these steps:\\n\\n# Clone github repo\\ngit clone https://github.com/camel-ai/camel.git\\n\\n# Change directory into project directory\\n\\ncd camel\\n\\n# Activate camel virtual environment\\npoetry shell\\n\\n# Install camel from source\\n\\n# It takes about 75s to resolve dependencies and 10s to install them, depending on your hardware and network,\\npoetry install --with dev,docs\\n\\n# Or if you want to use all other extra packages\\npoetry install --with dev,docs -E all']}\n",+ "\n",+ "Solution: Here are the specific instructions for setting up the development environment for the CAMEL project:\n",+ "\n",+ "### Quick Start 🚀\n",+ "\n",+ "To get started with CAMEL, follow these steps:\n",+ "\n",+ "1. **Clone the GitHub repository:**\n",+ " ```sh\n",+ " git clone https://github.com/camel-ai/camel.git\n",+ " ```\n",+ "\n",+ "2. **Change directory into the project directory:**\n",+ " ```sh\n",+ " cd camel\n",+ " ```\n",+ "\n",+ "3. **Activate the CAMEL virtual environment:**\n",+ " ```sh\n",+ " poetry shell\n",+ " ```\n",+ "\n",+ "4. **Install CAMEL from source:**\n",+ " ```sh\n",+ " poetry install --with dev,docs\n",+ " ```\n",+ " - It takes about 75 seconds to resolve dependencies and 10 seconds to install them, depending on your hardware and network.\n",+ "\n",+ "5. **Alternatively, if you want to use all other extra packages:**\n",+ " ```sh\n",+ " poetry install --with dev,docs -E all\n",+ " ```\n",+ "\n",+ "These steps should help you set up the development environment for the CAMEL project. If you encounter any challenges during the setup process, these instructions should guide you through the initial setup.\n",+ "\n",+ "Next request.\n",+ "\n",+ "\n",+ "\u001b[34mAI User:\n",+ "\n",+ "Instruction: Follow the provided steps to set up the development environment for the CAMEL project. If you encounter any specific challenges during the setup process, document them.\n",+ "Input: None\n",+ "\n",+ "\n",+ "\u001b[32mAI Assistant:\n",+ "\n",+ "Solution: As an AI, I am unable to physically perform tasks such as setting up a development environment. However, I can guide you through the process and help you troubleshoot any issues you might encounter.\n",+ "\n",+ "Here are the steps you should follow to set up the development environment for the CAMEL project:\n",+ "\n",+ "1. **Clone the GitHub repository:**\n",+ " ```sh\n",+ " git clone https://github.com/camel-ai/camel.git\n",+ " ```\n",+ "\n",+ "2. **Change directory into the project directory:**\n",+ " ```sh\n",+ " cd camel\n",+ " ```\n",+ "\n",+ "3. **Activate the CAMEL virtual environment:**\n",+ " ```sh\n",+ " poetry shell\n",+ " ```\n",+ "\n",+ "4. **Install CAMEL from source:**\n",+ " ```sh\n",+ " poetry install --with dev,docs\n",+ " ```\n",+ " - It takes about 75 seconds to resolve dependencies and 10 seconds to install them, depending on your hardware and network.\n",+ "\n",+ "5. **Alternatively, if you want to use all other extra packages:**\n",+ " ```sh\n",+ " poetry install --with dev,docs -E all\n",+ " ```\n",+ "\n",+ "### Troubleshooting Common Issues\n",+ "\n",+ "- **Issue: `poetry: command not found`**\n",+ " - **Solution:** Ensure that Poetry is installed on your system. You can install it by following the instructions on the [Poetry website](https://python-poetry.org/docs/#installation).\n",+ "\n",+ "- **Issue: Network-related errors during `poetry install`**\n",+ " - **Solution:** Check your internet connection and try again. If the issue persists, you might want to use a different network or check if there are any firewall restrictions.\n",+ "\n",+ "- **Issue: Dependency resolution taking too long**\n",+ " - **Solution:** Ensure that your system has sufficient resources (CPU, memory). You can also try running the command during off-peak hours when network traffic is lower.\n",+ "\n",+ "- **Issue: Virtual environment activation issues**\n",+ " - **Solution:** Ensure that you have the necessary permissions to create and activate virtual environments. You might need to run the command with elevated privileges (e.g., using `sudo` on Unix-based systems).\n",+ "\n",+ "If you encounter any specific challenges during the setup process, please document them, and I can help you troubleshoot further.\n",+ "\n",+ "Next request.\n",+ "\n",+ "\n",+ "\u001b[34mAI User:\n",+ "\n",+ "Instruction: Attempt to set up the development environment for the CAMEL project using the provided steps. Document any specific challenges you encounter during the process.\n",+ "Input: None\n",+ "\n",+ "\n",+ "\u001b[32mAI Assistant:\n",+ "\n",+ "Solution: As an AI, I am unable to physically perform tasks such as setting up a development environment. However, I can provide a detailed guide and troubleshooting tips to help you through the process. Here’s a step-by-step guide along with potential challenges and their solutions:\n",+ "\n",+ "### Step-by-Step Guide to Set Up the Development Environment\n",+ "\n",+ "1. **Clone the GitHub repository:**\n",+ " ```sh\n",+ " git clone https://github.com/camel-ai/camel.git\n",+ " ```\n",+ " - **Potential Challenge:** If you encounter an error like `git: command not found`, ensure that Git is installed on your system. You can download and install Git from [here](https://git-scm.com/downloads).\n",+ "\n",+ "2. **Change directory into the project directory:**\n",+ " ```sh\n",+ " cd camel\n",+ " ```\n",+ " - **Potential Challenge:** If you get an error like `No such file or directory`, ensure that the repository was cloned successfully and that you are in the correct directory.\n",+ "\n",+ "3. **Activate the CAMEL virtual environment:**\n",+ " ```sh\n",+ " poetry shell\n",+ " ```\n",+ " - **Potential Challenge:** If you encounter an error like `poetry: command not found`, ensure that Poetry is installed on your system. You can install it by following the instructions on the [Poetry website](https://python-poetry.org/docs/#installation).\n",+ "\n",+ "4. **Install CAMEL from source:**\n",+ " ```sh\n",+ " poetry install --with dev,docs\n",+ " ```\n",+ " - **Potential Challenge:** If you encounter network-related errors during `poetry install`, check your internet connection and try again. If the issue persists, you might want to use a different network or check if there are any firewall restrictions.\n",+ "\n",+ "5. **Alternatively, if you want to use all other extra packages:**\n",+ " ```sh\n",+ " poetry install --with dev,docs -E all\n",+ " ```\n",+ " - **Potential Challenge:** If dependency resolution takes too long, ensure that your system has sufficient resources (CPU, memory). You can also try running the command during off-peak hours when network traffic is lower.\n",+ "\n",+ "### Documenting Specific Challenges\n",+ "\n",+ "If you encounter any specific challenges during the setup process, document them as follows:\n",+ "\n",+ "1. **Describe the Issue:**\n",+ " - Example: \"Encountered an error `poetry: command not found` when trying to activate the virtual environment.\"\n",+ "\n",+ "2. **Steps Taken to Resolve:**\n",+ " - Example: \"Checked if Poetry was installed by running `poetry --version`. Found that Poetry was not installed. Installed Poetry using the command `curl -sSL https://install.python-poetry.org | python3 -`.\"\n",+ "\n",+ "3. **Outcome:**\n",+ " - Example: \"After installing Poetry, I was able to activate the virtual environment successfully.\"\n",+ "\n",+ "By following these steps and documenting any challenges, you should be able to set up the development environment for the CAMEL project. If you encounter any issues that you cannot resolve, feel free to ask for further assistance.\n",+ "\n",+ "Next request.\n",+ "\n",+ "\n"+ ]+ }+ ],+ "source": [+ "role_playing_with_rag(task_prompt = \"\"\"If I'm interest in contributing to the CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, don't generate the answer by yourself, adjust the similarity threshold to lower value is necessary\"\"\")"+ ]}- ],- "source": [- "from camel.agents import ChatAgent\n",- "from camel.messages import BaseMessage\n",- "from camel.types import RoleType\n",- "from camel.retrievers import AutoRetriever\n",- "from camel.types import StorageType\n",- "\n",- "def single_agent(query: str) ->str :\n",- " # Set agent role\n",- " assistant_sys_msg = BaseMessage(\n",- " role_name=\"Assistant\",\n",- " role_type=RoleType.ASSISTANT,\n",- " meta_dict=None,\n",- " content=\"\"\"You are a helpful assistant to answer question,\n",- " I will give you the Original Query and Retrieved Context,\n",- " answer the Original Query based on the Retrieved Context,\n",- " if you can't answer the question just say I don't know.\"\"\",\n",- " )\n",- "\n",- " # Add auto retriever\n",- " auto_retriever = AutoRetriever(\n",- " vector_storage_local_path=\"local_data2/\",\n",- " storage_type=StorageType.QDRANT,\n",- " embedding_model=embedding_instance)\n",- "\n",- " retrieved_info = auto_retriever.run_vector_retriever(\n",- " query=query,\n",- " contents=[\n",- " \"local_data/camel_paper.pdf\", # example local path\n",- " \"https://github.com/camel-ai/camel/wiki/Contributing-Guidlines\", # example remote url\n",- " ],\n",- " top_k=1,\n",- " return_detailed_info=False,\n",- " similarity_threshold=0.5\n",- " )\n",- "\n",- " # Pass the retrieved infomation to agent\n",- " user_msg = BaseMessage.make_user_message(role_name=\"User\", content=str(retrieved_info))\n",- " agent = ChatAgent(assistant_sys_msg)\n",- "\n",- " # Get response\n",- " assistant_response = agent.step(user_msg)\n",- " return assistant_response.msg.content\n",- "\n",- "print(single_agent(\"If I'm interest in contributing to the CAMEL projec, what should I do?\"))"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "Cvh6e3KpI0rf"- },- "source": [- "## 4. Role-playing with Auto RAG\n",- "In this section we will show how to combine the `RETRIEVAL_FUNCS` with `RolePlaying` by applying `Function Calling`.\n"- ]- },- {- "cell_type": "code",- "execution_count": 12,- "metadata": {- "id": "z3tX4EJVI1hb"- },- "outputs": [],- "source": [- "from typing import List\n",- "from colorama import Fore\n",- "\n",- "from camel.agents.chat_agent import FunctionCallingRecord\n",- "from camel.configs import ChatGPTConfig\n",- "from camel.toolkits import (\n",- " MathToolkit,\n",- " RetrievalToolkit,\n",- ")\n",- "from camel.societies import RolePlaying\n",- "from camel.types import ModelType, ModelPlatformType\n",- "from camel.utils import print_text_animated\n",- "from camel.models import ModelFactory\n",- "\n",- "def role_playing_with_rag(\n",- " task_prompt,\n",- " model_platform=ModelPlatformType.OPENAI,\n",- " model_type=ModelType.GPT_4O_MINI,\n",- " chat_turn_limit=5,\n",- ") -> None:\n",- " task_prompt = task_prompt\n",- "\n",- " user_model_config = ChatGPTConfig(temperature=0.0)\n",- "\n",- " tools_list = [\n",- " *MathToolkit().get_tools(),\n",- " *RetrievalToolkit().get_tools(),\n",- " ]\n",- " assistant_model_config = ChatGPTConfig(\n",- " tools=tools_list,\n",- " temperature=0.0,\n",- " )\n",- "\n",- " role_play_session = RolePlaying(\n",- " assistant_role_name=\"Searcher\",\n",- " user_role_name=\"Professor\",\n",- " assistant_agent_kwargs=dict(\n",- " model=ModelFactory.create(\n",- " model_platform=model_platform,\n",- " model_type=model_type,\n",- " model_config_dict=assistant_model_config.as_dict(),\n",- " ),\n",- " tools=tools_list,\n",- " ),\n",- " user_agent_kwargs=dict(\n",- " model=ModelFactory.create(\n",- " model_platform=model_platform,\n",- " model_type=model_type,\n",- " model_config_dict=user_model_config.as_dict(),\n",- " ),\n",- " ),\n",- " task_prompt=task_prompt,\n",- " with_task_specify=False,\n",- " )\n",- "\n",- " print(\n",- " Fore.GREEN\n",- " + f\"AI Assistant sys message:\\n{role_play_session.assistant_sys_msg}\\n\"\n",- " )\n",- " print(\n",- " Fore.BLUE + f\"AI User sys message:\\n{role_play_session.user_sys_msg}\\n\"\n",- " )\n",- "\n",- " print(Fore.YELLOW + f\"Original task prompt:\\n{task_prompt}\\n\")\n",- " print(\n",- " Fore.CYAN\n",- " + \"Specified task prompt:\"\n",- " + f\"\\n{role_play_session.specified_task_prompt}\\n\"\n",- " )\n",- " print(Fore.RED + f\"Final task prompt:\\n{role_play_session.task_prompt}\\n\")\n",- "\n",- " n = 0\n",- " input_msg = role_play_session.init_chat()\n",- " while n < chat_turn_limit:\n",- " n += 1\n",- " assistant_response, user_response = role_play_session.step(input_msg)\n",- "\n",- " if assistant_response.terminated:\n",- " print(\n",- " Fore.GREEN\n",- " + (\n",- " \"AI Assistant terminated. Reason: \"\n",- " f\"{assistant_response.info['termination_reasons']}.\"\n",- " )\n",- " )\n",- " break\n",- " if user_response.terminated:\n",- " print(\n",- " Fore.GREEN\n",- " + (\n",- " \"AI User terminated. \"\n",- " f\"Reason: {user_response.info['termination_reasons']}.\"\n",- " )\n",- " )\n",- " break\n",- "\n",- " # Print output from the user\n",- " print_text_animated(\n",- " Fore.BLUE + f\"AI User:\\n\\n{user_response.msg.content}\\n\"\n",- " )\n",- "\n",- " # Print output from the assistant, including any function\n",- " # execution information\n",- " print_text_animated(Fore.GREEN + \"AI Assistant:\")\n",- " tool_calls: List[FunctionCallingRecord] = [\n",- " FunctionCallingRecord(**call.as_dict())\n",- " for call in assistant_response.info['tool_calls']\n",- " ]\n",- " for func_record in tool_calls:\n",- " print_text_animated(f\"{func_record}\")\n",- " print_text_animated(f\"{assistant_response.msg.content}\\n\")\n",- "\n",- " if \"CAMEL_TASK_DONE\" in user_response.msg.content:\n",- " break\n",- "\n",- " input_msg = assistant_response.msg"- ]- },- {- "cell_type": "markdown",- "metadata": {- "id": "w4-0lswwI5Gb"- },- "source": [- "Run the role-playing with defined retriever function:"- ]- },- {- "cell_type": "code",- "execution_count": 13,- "metadata": {+ ],+ "metadata": {"colab": {- "base_uri": "https://localhost:8080/"+ "provenance": []},- "id": "5agjiXHeI64q",- "outputId": "b4b47f4d-4b36-45b2-cad8-c8cf1075a802"- },- "outputs": [- {- "name": "stdout",- "output_type": "stream",- "text": [- "\u001b[32mAI Assistant sys message:\n",- "BaseMessage(role_name='Searcher', role_type=<RoleType.ASSISTANT: 'assistant'>, meta_dict={'task': \"If I'm interest in contributing to the\\n CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary\", 'assistant_role': 'Searcher', 'user_role': 'Professor'}, content=\"===== RULES OF ASSISTANT =====\\nNever forget you are a Searcher and I am a Professor. Never flip roles! Never instruct me!\\nWe share a common interest in collaborating to successfully complete a task.\\nYou must help me to complete the task.\\nHere is the task: If I'm interest in contributing to the\\n CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary. Never forget our task!\\nI must instruct you based on your expertise and my needs to complete the task.\\n\\nI must give you one instruction at a time.\\nYou must write a specific solution that appropriately solves the requested instruction and explain your solutions.\\nYou must decline my instruction honestly if you cannot perform the instruction due to physical, moral, legal reasons or your capability and explain the reasons.\\nUnless I say the task is completed, you should always start with:\\n\\nSolution: <YOUR_SOLUTION>\\n\\n<YOUR_SOLUTION> should be very specific, include detailed explanations and provide preferable detailed implementations and examples and lists for task-solving.\\nAlways end <YOUR_SOLUTION> with: Next request.\", video_bytes=None, image_list=None, image_detail='auto', video_detail='low')\n",- "\n",- "\u001b[34mAI User sys message:\n",- "BaseMessage(role_name='Professor', role_type=<RoleType.USER: 'user'>, meta_dict={'task': \"If I'm interest in contributing to the\\n CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary\", 'assistant_role': 'Searcher', 'user_role': 'Professor'}, content='===== RULES OF USER =====\\nNever forget you are a Professor and I am a Searcher. Never flip roles! You will always instruct me.\\nWe share a common interest in collaborating to successfully complete a task.\\nI must help you to complete the task.\\nHere is the task: If I\\'m interest in contributing to the\\n CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary. Never forget our task!\\nYou must instruct me based on my expertise and your needs to solve the task ONLY in the following two ways:\\n\\n1. Instruct with a necessary input:\\nInstruction: <YOUR_INSTRUCTION>\\nInput: <YOUR_INPUT>\\n\\n2. Instruct without any input:\\nInstruction: <YOUR_INSTRUCTION>\\nInput: None\\n\\nThe \"Instruction\" describes a task or question. The paired \"Input\" provides further context or information for the requested \"Instruction\".\\n\\nYou must give me one instruction at a time.\\nI must write a response that appropriately solves the requested instruction.\\nI must decline your instruction honestly if I cannot perform the instruction due to physical, moral, legal reasons or my capability and explain the reasons.\\nYou should instruct me not ask me questions.\\nNow you must start to instruct me using the two ways described above.\\nDo not add anything else other than your instruction and the optional corresponding input!\\nKeep giving me instructions and necessary inputs until you think the task is completed.\\nWhen the task is completed, you must only reply with a single word <CAMEL_TASK_DONE>.\\nNever say <CAMEL_TASK_DONE> unless my responses have solved your task.', video_bytes=None, image_list=None, image_detail='auto', video_detail='low')\n",- "\n",- "\u001b[33mOriginal task prompt:\n",- "If I'm interest in contributing to the\n",- " CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary\n",- "\n",- "\u001b[36mSpecified task prompt:\n",- "None\n",- "\n",- "\u001b[31mFinal task prompt:\n",- "If I'm interest in contributing to the\n",- " CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary\n",- "\n",- "\u001b[34mAI User:\n",- "\n",- "Instruction: Review the contributing guidelines on the CAMEL project GitHub page. \n",- "Input: None\n",- "\n",- "\n",- "\u001b[32mAI Assistant:\n",- "\n",- "Function Execution: information_retrieval\n",- "\tArgs: {'query': 'contributing guidelines', 'contents': 'https://github.com/camel-ai/camel/wiki/Contributing-Guidlines', 'top_k': 1}\n",- "\tResult: {'Original Query': 'contributing guidelines', 'Retrieved Context': ['No suitable information retrieved from https://github.com/camel-ai/camel/wiki/Contributing-Guidlines with similarity_threshold = 0.7.']}\n",- "\n",- "Solution: It seems that I was unable to retrieve specific information from the CAMEL project's contributing guidelines page due to a lack of suitable data. However, I can guide you on general steps to follow when contributing to an open-source project like CAMEL.\n",- "\n",- "1. **Read the Documentation**: Start by thoroughly reading the project's documentation, including the README file and any other relevant sections. This will give you an understanding of the project's purpose and how to set it up.\n",- "\n",- "2. **Set Up Your Environment**: Follow the setup instructions provided in the documentation to configure your development environment. This may include installing dependencies, setting up a local server, or configuring tools.\n",- "\n",- "3. **Check for Issues**: Look at the project's issue tracker to see if there are any open issues that you can help with. This is often a good way to start contributing.\n",- "\n",- "4. **Fork the Repository**: If you plan to make changes, fork the repository to your own GitHub account. This allows you to work on your changes without affecting the main project.\n",- "\n",- "5. **Create a Branch**: Before making any changes, create a new branch in your forked repository. This keeps your changes organized and separate from the main codebase.\n",- "\n",- "6. **Make Your Changes**: Implement the changes or features you want to contribute. Be sure to follow any coding standards or guidelines provided by the project.\n",- "\n",- "7. **Test Your Changes**: Run tests to ensure that your changes work as expected and do not break existing functionality.\n",- "\n",- "8. **Submit a Pull Request**: Once you are satisfied with your changes, submit a pull request to the main repository. Provide a clear description of what you have done and why.\n",- "\n",- "9. **Engage with the Community**: Be open to feedback and engage with the maintainers and other contributors. They may request changes or provide suggestions.\n",- "\n",- "If you encounter specific challenges during the setup process, consider reaching out to the community through forums, chat channels, or the issue tracker for assistance.\n",- "\n",- "Next request.\n",- "\n",- "\n",- "\u001b[34mAI User:\n",- "\n",- "Instruction: Identify any specific challenges you encountered during the setup process of the CAMEL project. \n",- "Input: None\n",- "\n",- "\n",- "\u001b[32mAI Assistant:\n",- "\n",- "Solution: As an AI, I do not have the capability to personally encounter challenges during the setup process of the CAMEL project or any other project. However, I can outline common challenges that contributors often face when setting up open-source projects like CAMEL. Here are some potential issues you might encounter:\n",- "\n",- "1. **Dependency Issues**: Conflicts or missing dependencies can arise, especially if the project relies on specific versions of libraries or tools. Ensure that you have the correct versions installed as specified in the documentation.\n",- "\n",- "2. **Environment Configuration**: Setting up the development environment can be tricky, particularly if the project requires specific configurations for tools like Docker, Node.js, or Python. Make sure to follow the setup instructions carefully.\n",- "\n",- "3. **Build Failures**: Sometimes, the project may fail to build due to misconfigurations or missing files. Check the build logs for error messages that can guide you in troubleshooting.\n",- "\n",- "4. **Version Control Conflicts**: If you are working in a team or contributing to a project with multiple contributors, you may encounter merge conflicts when trying to push your changes. Familiarize yourself with Git commands to resolve these conflicts.\n",- "\n",- "5. **Documentation Gaps**: Occasionally, the documentation may not cover all aspects of the setup process, leading to confusion. In such cases, reaching out to the community for clarification can be helpful.\n",- "\n",- "6. **Testing Failures**: After setting up the project, you may find that some tests fail. This could be due to environmental differences or issues in the code. Investigate the test failures to understand their causes.\n",- "\n",- "If you face any specific challenges during your setup process, I recommend documenting them and seeking help from the CAMEL community or checking the project's issue tracker for similar problems.\n",- "\n",- "Next request.\n",- "\n",- "\n",- "\u001b[34mAI User:\n",- "\n",- "Instruction: For any specific challenges you identified, search the CAMEL project's issue tracker for similar reported issues. \n",- "Input: None\n",- "\n",- "\n",- "\u001b[32mAI Assistant:\n",- "\n",- "Function Execution: information_retrieval\n",- "\tArgs: {'query': 'setup challenges', 'contents': 'https://github.com/camel-ai/camel/issues', 'top_k': 5}\n",- "\tResult: {'Original Query': 'setup challenges', 'Retrieved Context': ['No suitable information retrieved from https://github.com/camel-ai/camel/wiki/Contributing-Guidlines with similarity_threshold = 0.7.']}\n",- "\n",- "Solution: I was unable to retrieve specific issues from the CAMEL project's issue tracker related to setup challenges due to a lack of suitable data. However, I can guide you on how to search for similar reported issues effectively:\n",- "\n",- "1. **Visit the Issue Tracker**: Go to the CAMEL project's GitHub issues page at [CAMEL Issues](https://github.com/camel-ai/camel/issues).\n",- "\n",- "2. **Use Search Filters**: Utilize the search bar at the top of the issues page. You can enter keywords related to the challenges you are facing, such as \"setup\", \"installation\", \"dependency\", or \"build failure\".\n",- "\n",- "3. **Sort by Relevance**: You can sort the issues by \"Newest\" or \"Most commented\" to find recent discussions or popular issues that may relate to your setup challenges.\n",- "\n",- "4. **Check Labels**: Look for labels such as \"bug\", \"help wanted\", or \"question\" that may indicate issues related to setup or configuration.\n",- "\n",- "5. **Read Through Comments**: Often, the comments on issues provide valuable insights and solutions from other contributors who faced similar challenges.\n",- "\n",- "6. **Create a New Issue**: If you cannot find any existing issues that address your specific challenge, consider creating a new issue. Provide a detailed description of the problem, including any error messages and steps to reproduce the issue.\n",- "\n",- "By following these steps, you should be able to find relevant discussions or solutions related to the setup challenges you are encountering in the CAMEL project.\n",- "\n",- "Next request.\n",- "\n",- "\n",- "\u001b[34mAI User:\n",- "\n",- "Instruction: If you find relevant issues in the CAMEL project's issue tracker, summarize the solutions or suggestions provided in those issues. \n",- "Input: None\n",- "\n",- "\n",- "\u001b[32mAI Assistant:\n",- "\n",- "Function Execution: information_retrieval\n",- "\tArgs: {'query': 'setup challenges', 'contents': 'https://github.com/camel-ai/camel/issues', 'top_k': 5}\n",- "\tResult: {'Original Query': 'setup challenges', 'Retrieved Context': ['No suitable information retrieved from https://github.com/camel-ai/camel/wiki/Contributing-Guidlines with similarity_threshold = 0.7.']}\n",- "\n",- "Solution: I was unable to retrieve specific issues or their solutions from the CAMEL project's issue tracker regarding setup challenges due to a lack of suitable data. However, I can provide general guidance on how to summarize solutions or suggestions from issues if you find relevant ones:\n",- "\n",- "1. **Identify Key Issues**: Look for issues that directly relate to the setup challenges you are facing. Pay attention to the titles and descriptions.\n",- "\n",- "2. **Read Through Comments**: Go through the comments on each issue. Contributors often share their experiences, solutions, or workarounds that can be helpful.\n",- "\n",- "3. **Highlight Solutions**: Take note of any specific solutions provided, such as:\n",- " - Commands to run for installation.\n",- " - Configuration changes needed in files.\n",- " - Dependencies that need to be installed or updated.\n",- " - Environment variables that need to be set.\n",- "\n",- "4. **Summarize Suggestions**: If contributors suggest alternative approaches or tools, summarize these as well. For example, if someone recommends using a different version of a library, include that in your summary.\n",- "\n",- "5. **Document Common Patterns**: If multiple issues mention similar solutions, document these patterns as they may indicate common problems faced by users.\n",- "\n",- "6. **Provide Context**: When summarizing, include the context of the issue, such as the specific error messages or scenarios that led to the discussion.\n",- "\n",- "By following these steps, you can effectively summarize the solutions or suggestions from relevant issues in the CAMEL project's issue tracker.\n",- "\n",- "Next request.\n",- "\n",- "\n",- "\u001b[34mAI User:\n",- "\n",- "Instruction: If you encounter a specific setup challenge that is not addressed in the issue tracker, draft a new issue to report it, including all relevant details. \n",- "Input: None\n",- "\n",- "\n",- "\u001b[32mAI Assistant:\n",- "\n",- "Solution: Since I do not have the capability to encounter specific setup challenges or create issues directly on GitHub, I can guide you on how to draft a new issue to report a setup challenge effectively. Here’s a template you can use to create your issue:\n",- "\n",- "---\n",- "\n",- "**Title**: [Brief Description of the Setup Challenge]\n",- "\n",- "**Description**:\n",- "I am encountering a setup challenge while trying to configure the CAMEL project. Below are the details:\n",- "\n",- "**Environment**:\n",- "- Operating System: [e.g., Windows, macOS, Linux]\n",- "- Version: [e.g., Ubuntu 20.04, Windows 10]\n",- "- Node.js version: [if applicable]\n",- "- Python version: [if applicable]\n",- "- Any other relevant software versions\n",- "\n",- "**Steps to Reproduce**:\n",- "1. [Step 1: Describe what you did]\n",- "2. [Step 2: Describe what you did]\n",- "3. [Step 3: Describe what you did]\n",- "4. [Any additional steps]\n",- "\n",- "**Expected Behavior**:\n",- "[Describe what you expected to happen]\n",- "\n",- "**Actual Behavior**:\n",- "[Describe what actually happened, including any error messages or unexpected behavior]\n",- "\n",- "**Additional Information**:\n",- "- [Any logs or screenshots that may help in diagnosing the issue]\n",- "- [Any other relevant context or information]\n",- "\n",- "**Proposed Solution** (if applicable):\n",- "[If you have any ideas on how to resolve the issue, include them here]\n",- "\n",- "Thank you for your assistance!\n",- "\n",- "---\n",- "\n",- "Make sure to fill in the placeholders with your specific information. Once you have drafted your issue, you can submit it on the CAMEL project's GitHub issue tracker.\n",- "\n",- "Next request.\n",- "\n",- "\n"- ]+ "kernelspec": {+ "display_name": "Python 3",+ "name": "python3"+ },+ "language_info": {+ "name": "python"}- ],- "source": [- "role_playing_with_rag(task_prompt = \"\"\"If I'm interest in contributing to the\n",- " CAMEL projec and I encounter some challenges during the setup process, what should I do? You should refer to the content in url https://github.com/camel-ai/camel/wiki/Contributing-Guidlines to answer my question, adjust the similarity threshold to lower value is necessary\"\"\")"- ]- }- ],- "metadata": {- "colab": {- "provenance": []- },- "kernelspec": {- "display_name": "Python 3",- "name": "python3"},- "language_info": {- "name": "python"- }- },- "nbformat": 4,- "nbformat_minor": 0+ "nbformat": 4,+ "nbformat_minor": 0}