-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Rebranding storage & vector integration of Azure CosmosDB Mongo vCore #20239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # LlamaIndex Chat_Store Integration: Azure DocumentDB Chat Store |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from llama_index.storage.chat_store.azuredocumentdb.base import ( | ||
| AzureDocumentDBChatStore, | ||
| ) | ||
|
|
||
| __all__ = ["AzureDocumentDBChatStore"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,9 +25,9 @@ dev = [ | |
| ] | ||
|
|
||
| [project] | ||
| name = "llama-index-storage-chat-store-azurecosmosmongovcore" | ||
| name = "llama-index-storage-chat-store-azuredocumentdb" | ||
| version = "1.2.1" | ||
| description = "llama-index storage-chat-store azure cosmosdb mongo vcore integration" | ||
| description = "llama-index storage-chat-store Azure DocumentDB integration" | ||
| authors = [{name = "Aayush Kataria", email = "[email protected]"}] | ||
| requires-python = ">=3.9,<4.0" | ||
| readme = "README.md" | ||
|
|
@@ -52,7 +52,7 @@ exclude = ["**/BUILD"] | |
|
|
||
| [tool.llamahub] | ||
| contains_example = false | ||
| import_path = "llama_index.storage.chat_store.azurecosmosmongovcore" | ||
| import_path = "llama_index.storage.chat_store.azuredocumentdb" | ||
|
|
||
| [tool.llamahub.class_authors] | ||
| AzureCosmosNoSqlChatStore = "Aayush" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from llama_index.core.storage.chat_store.base import BaseChatStore | ||
| from llama_index.storage.chat_store.azuredocumentdb import ( | ||
| AzureDocumentDBChatStore, | ||
| ) | ||
|
|
||
|
|
||
| def test_class(): | ||
| names_of_base_classes = [b.__name__ for b in AzureDocumentDBChatStore.__mro__] | ||
| assert BaseChatStore.__name__ in names_of_base_classes |
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # LlamaIndex Vector_Stores Integration: Azure DocumentDB |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from llama_index.vector_stores.azuredocumentdb.base import ( | ||
| AzureDocumentDBVectorSearch, | ||
| ) | ||
|
|
||
| __all__ = ["AzureDocumentDBVectorSearch"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| """ | ||
| Azure CosmosDB MongoDB vCore Vector store index. | ||
| Azure DocumentDB Vector store index. | ||
|
|
||
| An index that is built on top of an existing vector store. | ||
|
|
||
|
|
@@ -26,27 +26,27 @@ | |
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class AzureCosmosDBMongoDBVectorSearch(BasePydanticVectorStore): | ||
| class AzureDocumentDBVectorSearch(BasePydanticVectorStore): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can change the class names, but we should also just export an alias to make it non-breaking for users? Or is this worth a breaking change over?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @logan-markewich thanks for the comment. Let me discuss this with PMs, will back to you if we have any updates |
||
| """ | ||
| Azure CosmosDB MongoDB vCore Vector Store. | ||
| Azure DocumentDB Vector Store. | ||
|
|
||
| To use, you should have both: | ||
| - the ``pymongo`` python package installed | ||
| - a connection string associated with an Azure Cosmodb MongoDB vCore Cluster | ||
| - a connection string associated with an Azure DocumentDB | ||
|
|
||
| Examples: | ||
| `pip install llama-index-vector-stores-azurecosmosmongo` | ||
| `pip install llama-index-vector-stores-azuredocumentdb` | ||
|
|
||
| ```python | ||
| import pymongo | ||
| from llama_index.vector_stores.azurecosmosmongo import AzureCosmosDBMongoDBVectorSearch | ||
| from llama_index.vector_stores.azuredocumentdb import AzureDocumentDBVectorSearch | ||
|
|
||
| # Set up the connection string with your Azure CosmosDB MongoDB URI | ||
| connection_string = "YOUR_AZURE_COSMOSDB_MONGODB_URI" | ||
| # Set up the connection string with your Azure DocumentDB URI | ||
| connection_string = "YOUR_AZURE_DOCUMENTDB_URI" | ||
| mongodb_client = pymongo.MongoClient(connection_string) | ||
|
|
||
| # Create an instance of AzureCosmosDBMongoDBVectorSearch | ||
| vector_store = AzureCosmosDBMongoDBVectorSearch( | ||
| # Create an instance of AzureDocumentDBVectorSearch | ||
| vector_store = AzureDocumentDBVectorSearch( | ||
| mongodb_client=mongodb_client, | ||
| db_name="demo_vectordb", | ||
| collection_name="paul_graham_essay", | ||
|
|
@@ -88,17 +88,17 @@ def __init__( | |
| Initialize the vector store. | ||
|
|
||
| Args: | ||
| mongodb_client: An Azure CosmoDB MongoDB client (type: MongoClient, shown any for lazy import). | ||
| db_name: An Azure CosmosDB MongoDB database name. | ||
| collection_name: An Azure CosmosDB collection name. | ||
| index_name: An Azure CosmosDB MongoDB vCore Vector Search index name. | ||
| mongodb_client: An Azure DocumentDB client (type: MongoClient, shown any for lazy import). | ||
| db_name: An Azure DocumentDB database name. | ||
| collection_name: An Azure DocumentDB collection name. | ||
| index_name: An Azure DocumentDB Vector Search index name. | ||
| id_key: The data field to use as the id. | ||
| embedding_key: An Azure CosmosDB MongoDB field that will contain | ||
| embedding_key: An Azure DocumentDB field that will contain | ||
| the embedding for each document. | ||
| text_key: An Azure CosmosDB MongoDB field that will contain the text for each document. | ||
| metadata_key: An Azure CosmosDB MongoDB field that will contain | ||
| text_key: An Azure DocumentDB field that will contain the text for each document. | ||
| metadata_key: An Azure DocumentDB field that will contain | ||
| the metadata for each document. | ||
| cosmos_search_kwargs: An Azure CosmosDB MongoDB field that will | ||
| cosmos_search_kwargs: An Azure DocumentDB field that will | ||
| contain search options, such as kind, numLists, similarity, and dimensions. | ||
| insert_kwargs: The kwargs used during `insert`. | ||
|
|
||
|
|
@@ -108,13 +108,13 @@ def __init__( | |
| if mongodb_client is not None: | ||
| self._mongodb_client = cast(pymongo.MongoClient, mongodb_client) | ||
| else: | ||
| if "AZURE_COSMOSDB_MONGODB_URI" not in os.environ: | ||
| if "AZURE_DOCUMENTDB_URI" not in os.environ: | ||
| raise ValueError( | ||
| "Must specify Azure cosmodb 'AZURE_COSMOSDB_MONGODB_URI' via env variable " | ||
| "Must specify Azure DocumentDB 'AZURE_DOCUMENTDB_URI' via env variable " | ||
| "if not directly passing in client." | ||
| ) | ||
| self._mongodb_client = pymongo.MongoClient( | ||
| os.environ["AZURE_COSMOSDB_MONGODB_URI"], | ||
| os.environ["AZURE_DOCUMENTDB_URI"], | ||
| appname="LLAMAINDEX_PYTHON", | ||
| ) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,9 +25,9 @@ dev = [ | |
| ] | ||
|
|
||
| [project] | ||
| name = "llama-index-vector-stores-azurecosmosmongo" | ||
| name = "llama-index-vector-stores-azuredocumentdb" | ||
| version = "0.7.1" | ||
| description = "llama-index vector_stores azurecosmosmongo integration" | ||
| description = "llama-index vector_stores azuredocumentdb integration" | ||
| authors = [{name = "Aayush Kataria", email = "[email protected]"}] | ||
| requires-python = ">=3.9,<4.0" | ||
| readme = "README.md" | ||
|
|
@@ -52,10 +52,10 @@ exclude = ["**/BUILD"] | |
|
|
||
| [tool.llamahub] | ||
| contains_example = false | ||
| import_path = "llama_index.vector_stores.azurecosmosmongo" | ||
| import_path = "llama_index.vector_stores.azuredocumentdb" | ||
|
|
||
| [tool.llamahub.class_authors] | ||
| AzureCosmosDBMongoDBVectorSearch = "llama-index" | ||
| AzureDocumentDBVectorSearch = "llama-index" | ||
|
|
||
| [tool.mypy] | ||
| disallow_untyped_defs = true | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.