Azure
Labels: name: area: vector store, name: auto:bug

### System Info

Traceback (most recent call last):
  File "C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_community\vectorstores\azuresearch.py", line 97, in _get_search_client
    from azure.search.documents.indexes.models import (
ImportError: cannot import name 'HnswAlgorithmConfiguration' from 'azure.search.documents.indexes.models' (C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\search\documents\indexes\models\__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\vivek\OneDrive\Desktop\Hackathon\userdoc1.py", line 47, in <module>
    vector_store: AzureSearch = AzureSearch(
                                ^^^^^^^^^^^^
  File "C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_community\vectorstores\azuresearch.py", line 299, in __init__
    self.client = _get_search_client(
                  ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\langchain_community\vectorstores\azuresearch.py", line 105, in _get_search_client
    from azure.search.documents.indexes.models import (
ImportError: cannot import name 'HnswVectorSearchAlgorithmConfiguration' from 'azure.search.documents.indexes.models' (C:\Users\vivek\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\search\documents\indexes\models\__init__.py)

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

embedding_model="BAAI/bge-small-en-v1.5"
embeddings= HuggingFaceEmbeddings(model_name=embedding_model)
# embeddings = AzureOpenAIEmbeddings(deployment=model, chunk_size=100)
# embeddings = AzureOpenAIEmbeddings(azure_deployment="T-ada-002",openai_api_version="2023-05-15")
index_name: str = "i17"
vector_store: AzureSearch = AzureSearch(
    azure_search_endpoint=vector_store_address,
    azure_search_key=os.environ.get("AZURE_COGNITIVE_SEARCH_API_KEY"),
    index_name=index_name,
    embedding_function=embeddings.embed_query,
)

loader = AzureBlobStorageContainerLoader(
    conn_str=os.environ.get("AZURE_CONN_STRING"),
    container=os.environ.get("CONTAINER_NAME"),
)
documents = loader.load()

text_splitter = CharacterTextSplitter(chunk_size=150, chunk_overlap=20)
docs = text_splitter.split_documents(documents)
vector_store.add_documents(documents=docs)

### Expected behavior

data from azure cognitive service