mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-12 12:59:07 +00:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user