From 3c2a38ec060889316bad08d09c9b94a5bfa6a16b Mon Sep 17 00:00:00 2001 From: Li Jiang Date: Thu, 30 Nov 2023 01:19:40 +0800 Subject: [PATCH] Improve docstring of query_texts and search_string (#795) * Improve docstring of query_texts and search_string * Update docstring * Update docstring --- autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py | 4 ++-- autogen/agentchat/contrib/retrieve_user_proxy_agent.py | 4 ++-- autogen/retrieve_utils.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py b/autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py index 619befdefbd5..88a2d318aa95 100644 --- a/autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py +++ b/autogen/agentchat/contrib/qdrant_retrieve_user_proxy_agent.py @@ -100,8 +100,8 @@ def retrieve_docs(self, problem: str, n_results: int = 20, search_string: str = """ Args: problem (str): the problem to be solved. - n_results (int): the number of results to be retrieved. - search_string (str): only docs containing this string will be retrieved. + n_results (int): the number of results to be retrieved. Default is 20. + search_string (str): only docs that contain an exact match of this string will be retrieved. Default is "". """ if not self._collection: print("Trying to create collection.") diff --git a/autogen/agentchat/contrib/retrieve_user_proxy_agent.py b/autogen/agentchat/contrib/retrieve_user_proxy_agent.py index 5edc13f2408a..777ac1f87cf4 100644 --- a/autogen/agentchat/contrib/retrieve_user_proxy_agent.py +++ b/autogen/agentchat/contrib/retrieve_user_proxy_agent.py @@ -367,8 +367,8 @@ def retrieve_docs(self, problem: str, n_results: int = 20, search_string: str = Args: problem (str): the problem to be solved. - n_results (int): the number of results to be retrieved. - search_string (str): only docs containing this string will be retrieved. + n_results (int): the number of results to be retrieved. Default is 20. + search_string (str): only docs that contain an exact match of this string will be retrieved. Default is "". """ if not self._collection or not self._get_or_create: print("Trying to create collection.") diff --git a/autogen/retrieve_utils.py b/autogen/retrieve_utils.py index ba856e3b238e..6f423b30715f 100644 --- a/autogen/retrieve_utils.py +++ b/autogen/retrieve_utils.py @@ -335,12 +335,12 @@ def query_vector_db( and query function. Args: - query_texts (List[str]): the query texts. + query_texts (List[str]): the list of strings which will be used to query the vector db. n_results (Optional, int): the number of results to return. Default is 10. client (Optional, API): the chromadb compatible client. Default is None, a chromadb client will be used. db_path (Optional, str): the path to the vector db. Default is "/tmp/chromadb.db". collection_name (Optional, str): the name of the collection. Default is "all-my-documents". - search_string (Optional, str): the search string. Default is "". + search_string (Optional, str): the search string. Only docs that contain an exact match of this string will be retrieved. Default is "". embedding_model (Optional, str): the embedding model to use. Default is "all-MiniLM-L6-v2". Will be ignored if embedding_function is not None. embedding_function (Optional, Callable): the embedding function to use. Default is None, SentenceTransformer with