cosmosdbnosql: Added Cosmos DB NoSQL Semantic Cache Integration with tests and jupyter notebook (#24424)

* Added Cosmos DB NoSQL Semantic Cache Integration with tests and
jupyter notebook

---------

Co-authored-by: Aayush Kataria <aayushkataria3011@gmail.com>
Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
gsa9989
2024-12-16 21:57:05 -05:00
committed by GitHub
parent 27a9056725
commit cdf6202156
6 changed files with 495 additions and 81 deletions

View File

@@ -82,7 +82,7 @@ class AzureCosmosDBVectorSearch(VectorStore):
index_name: str = "vectorSearchIndex",
text_key: str = "textContent",
embedding_key: str = "vectorContent",
application_name: str = "LANGCHAIN_PYTHON",
application_name: str = "LangChain-CDBMongoVCore-VectorStore-Python",
):
"""Constructor for AzureCosmosDBVectorSearch
@@ -121,7 +121,7 @@ class AzureCosmosDBVectorSearch(VectorStore):
connection_string: str,
namespace: str,
embedding: Embeddings,
application_name: str = "LANGCHAIN_PYTHON",
application_name: str = "LangChain-CDBMongoVCore-VectorStore-Python",
**kwargs: Any,
) -> AzureCosmosDBVectorSearch:
"""Creates an Instance of AzureCosmosDBVectorSearch

View File

@@ -14,7 +14,7 @@ from pydantic import BaseModel, Field
from langchain_community.vectorstores.utils import maximal_marginal_relevance
if TYPE_CHECKING:
from azure.cosmos import CosmosClient
from azure.cosmos import ContainerProxy, CosmosClient
from azure.identity import DefaultAzureCredential
USER_AGENT = ("LangChain-CDBNoSql-VectorStore-Python",)
@@ -859,3 +859,6 @@ class AzureCosmosDBNoSqlVectorSearch(VectorStore):
"$full_text_contains_any": "FullTextContainsAny",
}
return operator_map
def get_container(self) -> ContainerProxy:
return self._container