From 2b6ed040761245d228e85b34055fe1bff6d823ba Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Fri, 20 Oct 2023 01:51:49 +0800 Subject: [PATCH] Update docs (#297) Co-authored-by: Qingyun Wu --- .../contrib/retrieve_user_proxy_agent.py | 6 +++++- website/blog/2023-10-18-RetrieveChat/index.mdx | 6 ++++++ website/docs/Installation.md | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/autogen/agentchat/contrib/retrieve_user_proxy_agent.py b/autogen/agentchat/contrib/retrieve_user_proxy_agent.py index 94677244abe9..40a146e93edb 100644 --- a/autogen/agentchat/contrib/retrieve_user_proxy_agent.py +++ b/autogen/agentchat/contrib/retrieve_user_proxy_agent.py @@ -1,5 +1,9 @@ import re -import chromadb + +try: + import chromadb +except ImportError: + raise ImportError("Please install dependencies first. `pip install pyautogen[retrievechat]`") from autogen.agentchat.agent import Agent from autogen.agentchat import UserProxyAgent from autogen.retrieve_utils import create_vector_db_from_dir, query_vector_db, num_tokens_from_text diff --git a/website/blog/2023-10-18-RetrieveChat/index.mdx b/website/blog/2023-10-18-RetrieveChat/index.mdx index c917c7ef0587..74c03d6604d0 100644 --- a/website/blog/2023-10-18-RetrieveChat/index.mdx +++ b/website/blog/2023-10-18-RetrieveChat/index.mdx @@ -47,6 +47,12 @@ an answer, it replies with “Update Context” again. This process can be repea The conversation terminates if no more documents are available for the context. ## Basic Usage of RAG Agents +0. Install dependencies +Please install pyautogen with the [retrievechat] option before using RAG agents. +```bash +pip install "pyautogen[retrievechat]" +``` + 1. Import Agents ```python from autogen diff --git a/website/docs/Installation.md b/website/docs/Installation.md index 9860c83b1a31..ede82dc534d5 100644 --- a/website/docs/Installation.md +++ b/website/docs/Installation.md @@ -4,11 +4,21 @@ When not using a docker container, we recommend using a virtual environment to install AutoGen. This will ensure that the dependencies for AutoGen are isolated from the rest of your system. +You can create a virtual environment with `venv` as below: ```bash python3 -m venv autogen source autogen/bin/activate ``` +Another option is with `Conda`, Conda works better at solving dependency conflicts than pip. You can install it by following [this doc](https://docs.conda.io/projects/conda/en/stable/user-guide/install/index.html), +and then create a virtual environment as below: +```bash +conda create -n autogen python=3.10 # python 3.10 is recommended as it's stable and not too old +conda activate autogen +``` + +Now, you're ready to install AutoGen in the virtual environment you've just created. + ## Python AutoGen requires **Python version >= 3.8**. It can be installed from pip: @@ -33,11 +43,19 @@ pip install docker ``` * blendsearch +AutoGen offers a cost-effective hyperparameter optimization technique [EcoOptiGen](https://arxiv.org/abs/2303.04673) for tuning Large Language Models. Please install with the [blendsearch] option to use it. ```bash pip install "pyautogen[blendsearch]" ``` * retrievechat +AutoGen supports retrieval-augmented generation tasks such as question answering and code generation with RAG agents. Please install with the [retrievechat] option to use it. ```bash pip install "pyautogen[retrievechat]" ``` + +* mathchat +AutoGen offers an experimental agent for math problem solving. Please install with the [mathchat] option to use it. +```bash +pip install "pyautogen[mathchat]" +```