from azure.search.documents.indexes import SearchIndexClient
from azure.search.documents.indexes.models import (
SearchField,
SearchFieldDataType,
VectorSearch,
HnswAlgorithmConfiguration,
HnswParameters,
VectorSearchAlgorithmMetric,
ExhaustiveKnnAlgorithmConfiguration,
ExhaustiveKnnParameters,
VectorSearchProfile,
AzureOpenAIVectorizer,
AzureOpenAIParameters,
SemanticConfiguration,
SemanticSearch,
SemanticPrioritizedFields,
SemanticField,
SearchIndex
)
...
cannot import name 'AzureOpenAIVectorizer' from 'azure.search.documents.indexes.models' (C:\Users\subramaniann\AppData\Local\anaconda3\Lib\site-packages\azure\search\documents\indexes\models\__init__.py)
version using azure-search-documents==11.6.0b1
...
I tried doing: !pip install azure-core --pre --upgrade and !pip install azure-search-documents --pre --upgrade still it is showing error
The issue with importing the
AzureOpenAIVectorizerclass from theazure.search.documents.indexes.modelsmodule occurs due to an installation problem.pip uninstall azure-search-documentspip install azure-search-documents==11.6.0b1The command
python -m venv myenvcreates a virtual environment named "myenv" in your current directory.python -m venv myenvmyenv\Scripts\activateis used to activate the virtual environment. Once activated, your terminal or command prompt session will use the Python interpreter and packages installed within the virtual environment rather than the global Python environment.myenv\Scripts\activateInstall the below packages:
pip install python-dotenv azure-search-documents==11.6.0b1 azure-storage-blob azure-identityThe code for azure-search-vector-samples for azure-search-integrate is taken from git and requirements.txt.
Output: