Skip to content

Commit b040b1d

Browse files
authored
Merge branch 'main' into rajan/cap-factory
2 parents 9f27b79 + f9295c4 commit b040b1d

File tree

46 files changed

+1638
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1638
-52
lines changed

.github/workflows/contrib-tests.yml

+7
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ jobs:
8787
--health-retries 5
8888
ports:
8989
- 5432:5432
90+
mongodb:
91+
image: mongodb/mongodb-atlas-local:latest
92+
ports:
93+
- 27017:27017
9094
steps:
9195
- uses: actions/checkout@v4
9296
- name: Set up Python ${{ matrix.python-version }}
@@ -104,6 +108,9 @@ jobs:
104108
- name: Install pgvector when on linux
105109
run: |
106110
pip install -e .[retrievechat-pgvector]
111+
- name: Install mongodb when on linux
112+
run: |
113+
pip install -e .[retrievechat-mongodb]
107114
- name: Install unstructured when python-version is 3.9 and on linux
108115
if: matrix.python-version == '3.9'
109116
run: |

autogen/agentchat/chat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def initiate_chats(chat_queue: List[Dict[str, Any]]) -> List[ChatResult]:
162162
For example:
163163
- `"sender"` - the sender agent.
164164
- `"recipient"` - the recipient agent.
165-
- `"clear_history" (bool) - whether to clear the chat history with the agent.
165+
- `"clear_history"` (bool) - whether to clear the chat history with the agent.
166166
Default is True.
167167
- `"silent"` (bool or None) - (Experimental) whether to print the messages in this
168168
conversation. Default is False.

autogen/agentchat/contrib/vectordb/base.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ def get_docs_by_ids(
186186
ids: List[ItemID] | A list of document ids. If None, will return all the documents. Default is None.
187187
collection_name: str | The name of the collection. Default is None.
188188
include: List[str] | The fields to include. Default is None.
189-
If None, will include ["metadatas", "documents"], ids will always be included.
189+
If None, will include ["metadatas", "documents"], ids will always be included. This may differ
190+
depending on the implementation.
190191
kwargs: dict | Additional keyword arguments.
191192
192193
Returns:
@@ -200,7 +201,7 @@ class VectorDBFactory:
200201
Factory class for creating vector databases.
201202
"""
202203

203-
PREDEFINED_VECTOR_DB = ["chroma", "pgvector", "qdrant"]
204+
PREDEFINED_VECTOR_DB = ["chroma", "pgvector", "mongodb", "qdrant"]
204205

205206
@staticmethod
206207
def create_vector_db(db_type: str, **kwargs) -> VectorDB:
@@ -222,6 +223,10 @@ def create_vector_db(db_type: str, **kwargs) -> VectorDB:
222223
from .pgvectordb import PGVectorDB
223224

224225
return PGVectorDB(**kwargs)
226+
if db_type.lower() in ["mdb", "mongodb", "atlas"]:
227+
from .mongodb import MongoDBAtlasVectorDB
228+
229+
return MongoDBAtlasVectorDB(**kwargs)
225230
if db_type.lower() in ["qdrant", "qdrantdb"]:
226231
from .qdrant import QdrantVectorDB
227232

0 commit comments

Comments
 (0)