From 8d63d7573901ef268559324019198d113c7ee03e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 09:38:33 +0000 Subject: [PATCH 1/2] deps(deps): bump azure-search-documents from 11.6.0b4 to 11.6.0b5 Bumps [azure-search-documents](https://github.com/Azure/azure-sdk-for-python) from 11.6.0b4 to 11.6.0b5. - [Release notes](https://github.com/Azure/azure-sdk-for-python/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/search/azure-search-documents/CHANGELOG.md) - [Commits](https://github.com/Azure/azure-sdk-for-python/compare/azure-search-documents_11.6.0b4...azure-search-documents_11.6.0b5) --- updated-dependencies: - dependency-name: azure-search-documents dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- deploy_ai_search/requirements.txt | 2 +- text_2_sql/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_ai_search/requirements.txt b/deploy_ai_search/requirements.txt index 4a3e38d..6ec6c2f 100644 --- a/deploy_ai_search/requirements.txt +++ b/deploy_ai_search/requirements.txt @@ -1,5 +1,5 @@ python-dotenv -azure-search-documents==11.6.0b4 +azure-search-documents==11.6.0b5 azure-storage-blob azure-identity azure-mgmt-web diff --git a/text_2_sql/requirements.txt b/text_2_sql/requirements.txt index ccfb3ca..bd24fa4 100644 --- a/text_2_sql/requirements.txt +++ b/text_2_sql/requirements.txt @@ -1,6 +1,6 @@ semantic-kernel==1.9.0 azure-search -azure-search-documents==11.6.0b4 +azure-search-documents==11.6.0b5 aioodbc azure-identity python-dotenv From b1f38b5c2391420805104e055ee36f6f3b9b8fb5 Mon Sep 17 00:00:00 2001 From: Ben Constable Date: Tue, 24 Sep 2024 12:07:12 +0100 Subject: [PATCH 2/2] Fix models for new ver --- deploy_ai_search/ai_search.py | 24 ++++++++++++------------ deploy_ai_search/environment.py | 2 +- deploy_ai_search/rag_documents.py | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/deploy_ai_search/ai_search.py b/deploy_ai_search/ai_search.py index 0ea69ff..4046f62 100644 --- a/deploy_ai_search/ai_search.py +++ b/deploy_ai_search/ai_search.py @@ -14,7 +14,7 @@ WebApiSkill, AzureOpenAIEmbeddingSkill, AzureOpenAIVectorizer, - AzureOpenAIParameters, + AzureOpenAIVectorizerParameters, SearchIndexer, SearchIndexerSkillset, SearchIndexerDataContainer, @@ -24,7 +24,7 @@ InputFieldMappingEntry, SynonymMap, SplitSkill, - SearchIndexerIndexProjections, + SearchIndexerIndexProjection, BlobIndexerParsingMode, ) from azure.core.exceptions import HttpResponseError @@ -146,7 +146,7 @@ def get_indexer(self) -> SearchIndexer: return None - def get_index_projections(self) -> SearchIndexerIndexProjections: + def get_index_projections(self) -> SearchIndexerIndexProjection: """Get the index projections for the indexer.""" return None @@ -353,9 +353,9 @@ def get_vector_skill( name="Vector Skill", description="Skill to generate embeddings", context=context, - deployment_id=self.environment.open_ai_embedding_deployment, + deployment_name=self.environment.open_ai_embedding_deployment, model_name=self.environment.open_ai_embedding_model, - resource_uri=self.environment.open_ai_endpoint, + resource_url=self.environment.open_ai_endpoint, inputs=embedding_skill_inputs, outputs=embedding_skill_outputs, dimensions=self.environment.open_ai_embedding_dimensions, @@ -430,10 +430,10 @@ def get_vector_search(self) -> VectorSearch: VectorSearch: The vector search configuration """ - open_ai_params = AzureOpenAIParameters( - resource_uri=self.environment.open_ai_endpoint, + open_ai_params = AzureOpenAIVectorizerParameters( + resource_url=self.environment.open_ai_endpoint, model_name=self.environment.open_ai_embedding_model, - deployment_id=self.environment.open_ai_embedding_deployment, + deployment_name=self.environment.open_ai_embedding_deployment, ) if self.environment.identity_type == IdentityType.KEY: @@ -451,13 +451,13 @@ def get_vector_search(self) -> VectorSearch: VectorSearchProfile( name=self.vector_search_profile_name, algorithm_configuration_name=self.algorithm_name, - vectorizer=self.vectorizer_name, + vectorizer_name=self.vectorizer_name, ) ], vectorizers=[ AzureOpenAIVectorizer( - name=self.vectorizer_name, - azure_open_ai_parameters=open_ai_params, + vectorizer_name=self.vectorizer_name, + parameters=open_ai_params, ), ], ) @@ -497,7 +497,7 @@ def deploy_skillset(self): name=self.skillset_name, description="Skillset to chunk documents and generating embeddings", skills=skills, - index_projections=index_projections, + index_projection=index_projections, ) self._search_indexer_client.create_or_update_skillset(skillset) diff --git a/deploy_ai_search/environment.py b/deploy_ai_search/environment.py index 3e47955..a47bf1c 100644 --- a/deploy_ai_search/environment.py +++ b/deploy_ai_search/environment.py @@ -95,7 +95,7 @@ def ai_search_user_assigned_identity(self) -> SearchIndexerDataUserAssignedIdent SearchIndexerDataUserAssignedIdentity: The ai search user assigned identity """ user_assigned_identity = SearchIndexerDataUserAssignedIdentity( - user_assigned_identity=os.environ.get( + resource_id=os.environ.get( "AIService__AzureSearchOptions__Identity__FQName" ) ) diff --git a/deploy_ai_search/rag_documents.py b/deploy_ai_search/rag_documents.py index dba2645..3ae5180 100644 --- a/deploy_ai_search/rag_documents.py +++ b/deploy_ai_search/rag_documents.py @@ -14,7 +14,7 @@ FieldMapping, IndexingParameters, IndexingParametersConfiguration, - SearchIndexerIndexProjections, + SearchIndexerIndexProjection, SearchIndexerIndexProjectionSelector, SearchIndexerIndexProjectionsParameters, IndexProjectionMode, @@ -199,7 +199,7 @@ def get_skills(self) -> list: return skills - def get_index_projections(self) -> SearchIndexerIndexProjections: + def get_index_projections(self) -> SearchIndexerIndexProjection: """This function returns the index projections for rag document.""" mappings = [ InputFieldMappingEntry(name="Chunk", source="/document/pages/*/chunk"), @@ -241,7 +241,7 @@ def get_index_projections(self) -> SearchIndexerIndexProjections: ] ) - index_projections = SearchIndexerIndexProjections( + index_projections = SearchIndexerIndexProjection( selectors=[ SearchIndexerIndexProjectionSelector( target_index_name=self.index_name,