Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.64k stars 2.84k forks source link

Cannot import name 'PrioritizedFields' from 'azure.search.documents.indexes.models' #34538

Open made-on-earth opened 9 months ago

made-on-earth commented 9 months ago

Describe the bug I encountered this error when following the steps in aistudio-copilot-sample to build an Azure Search index.

Step 3: Build an Azure Search index ai search index update --files "./data/3-product-info/*.md" --index-name "product-info"

Error:

aistudio-copilot-sample % ai search index update --files "./data/3-product-info/*.md" --index-name "product-info"
AI - Azure AI CLI, Version 1.0.0-preview-20240216.1
Copyright (c) 2024 Microsoft Corporation. All Rights Reserved.

This PUBLIC PREVIEW version may change at any time.
See: https://aka.ms/azure-ai-cli-public-preview

Updating search index 'product-info' ...
  WARNING: azure-ai-resources Python wheel not found!

      TRY: pip install azure-ai-generative
      SEE: https://pypi.org/project/azure-ai-generative/

    ERROR: Python script failed! (exit code=1)

   OUTPUT: cannot import name 'PrioritizedFields' from 'azure.search.documents.indexes.models' (/Users/woo/Dev/aistudio-copilot-sample/venv/lib/python3.11/site-packages/azure/search/documents/indexes/models/__init__.py)

To Reproduce Steps to reproduce the behavior:

  1. Follow steps in this sample: https://github.com/Azure/aistudio-copilot-sample
  2. Error happened in step3.

Expected behavior Command complete without error.

Screenshots

image

Additional context

According azure-search-documents/CHANGELOG.md

PrioritizedFields was renamed to SemanticPrioritizedFields. But azure-ai-generative is still referring PrioritizedFields. sdk/ai/azure-ai-generative/azure/ai/generative/index/_tasks/update_acs.py

image
xiangyan99 commented 9 months ago

Thanks for the feedback, we’ll investigate asap.