# the deployment name for the embedding modelos.environ["OPENAI_EMBEDDINGS_MODEL_NAME"] = "text-embedding-ada-002" # the model nameNow, we need to load the documents into the collection, create the index and then run our queries against the index to retrieve matches.Please refer to the documentation if you have questions about certain parametersfrom langchain.docstore.document import Documentfrom langchain.embeddings import OpenAIEmbeddingsfrom langchain.schema.embeddings import Embeddingsfrom langchain.vectorstores.azure_cosmos_db_vector_search import AzureCosmosDBVectorSearch, CosmosDBSimilarityTypefrom langchain.text_splitter import CharacterTextSplitterfrom langchain.document_loaders import TextLoaderSOURCE_FILE_NAME = "../../modules/state_of_the_union.txt"loader = TextLoader(SOURCE_FILE_NAME)documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)# OpenAI Settingsmodel_deployment = os.getenv("OPENAI_EMBEDDINGS_DEPLOYMENT", "smart-agent-embedding-ada")model_name = os.getenv("OPENAI_EMBEDDINGS_MODEL_NAME", "text-embedding-ada-002")openai_embeddings: OpenAIEmbeddings = OpenAIEmbeddings(deployment=model_deployment, model=model_name, chunk_size=1)from pymongo import MongoClientINDEX_NAME = "izzy-test-index-2"NAMESPACE = "izzy_test_db.izzy_test_collection"DB_NAME, COLLECTION_NAME = NAMESPACE.split(".")client: MongoClient = MongoClient(CONNECTION_STRING)collection = client[DB_NAME][COLLECTION_NAME]model_deployment = os.getenv("OPENAI_EMBEDDINGS_DEPLOYMENT", "smart-agent-embedding-ada")model_name = os.getenv("OPENAI_EMBEDDINGS_MODEL_NAME", "text-embedding-ada-002")vectorstore = AzureCosmosDBVectorSearch.from_documents(        docs,        openai_embeddings,        collection=collection,        index_name=INDEX_NAME,)num_lists = 100dimensions = 1536similarity_algorithm = CosmosDBSimilarityType.COSvectorstore.create_index(num_lists, dimensions, similarity_algorithm)    {'raw':
Azure Cosmos DB for MongoDB vCore makes it easy to create a database with full native MongoDB support.
Azure Cosmos DB for MongoDB vCore makes it easy to create a database with full native MongoDB support. ->: # the deployment name for the embedding modelos.environ["OPENAI_EMBEDDINGS_MODEL_NAME"] = "text-embedding-ada-002" # the model nameNow, we need to load the documents into the collection, create the index and then run our queries against the index to retrieve matches.Please refer to the documentation if you have questions about certain parametersfrom langchain.docstore.document import Documentfrom langchain.embeddings import OpenAIEmbeddingsfrom langchain.schema.embeddings import Embeddingsfrom langchain.vectorstores.azure_cosmos_db_vector_search import AzureCosmosDBVectorSearch, CosmosDBSimilarityTypefrom langchain.text_splitter import CharacterTextSplitterfrom langchain.document_loaders import TextLoaderSOURCE_FILE_NAME = "../../modules/state_of_the_union.txt"loader = TextLoader(SOURCE_FILE_NAME)documents = loader.load()text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)docs = text_splitter.split_documents(documents)# OpenAI Settingsmodel_deployment = os.getenv("OPENAI_EMBEDDINGS_DEPLOYMENT", "smart-agent-embedding-ada")model_name = os.getenv("OPENAI_EMBEDDINGS_MODEL_NAME", "text-embedding-ada-002")openai_embeddings: OpenAIEmbeddings = OpenAIEmbeddings(deployment=model_deployment, model=model_name, chunk_size=1)from pymongo import MongoClientINDEX_NAME = "izzy-test-index-2"NAMESPACE = "izzy_test_db.izzy_test_collection"DB_NAME, COLLECTION_NAME = NAMESPACE.split(".")client: MongoClient = MongoClient(CONNECTION_STRING)collection = client[DB_NAME][COLLECTION_NAME]model_deployment = os.getenv("OPENAI_EMBEDDINGS_DEPLOYMENT", "smart-agent-embedding-ada")model_name = os.getenv("OPENAI_EMBEDDINGS_MODEL_NAME", "text-embedding-ada-002")vectorstore = AzureCosmosDBVectorSearch.from_documents(        docs,        openai_embeddings,        collection=collection,        index_name=INDEX_NAME,)num_lists = 100dimensions = 1536similarity_algorithm = CosmosDBSimilarityType.COSvectorstore.create_index(num_lists, dimensions, similarity_algorithm)    {'raw':