AttributeError: 'ConversationAnalysisClient' object has no attribute 'begin_conversation_analysis'

YQ 45 Reputation points
2023-05-02T10:05:27.7233333+00:00

Hi, I would like to ask

How to solve this AttributeError: 'ConversationAnalysisClient' object has no attribute 'begin_conversation_analysis' as I following the sample code from this link https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/cognitivelanguage/azure-ai-language-conversations/samples/sample_conv_pii_transcript_input.py under Cognitive Service - Language?

Here are the items/steps that I have done:

  1. I have installed the pip install azure-ai-language-conversations
  2. Updated both Key and Endpoint from code from link into my own key and endpoint
  3. Using python 3.8 to run the code

This is the error showed me after ran the code.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[7], line 105
    101     # [END analyze_conversation_app]
    104 if __name__ == '__main__':
--> 105     sample_conv_pii_transcript_input()

Cell In[7], line 17, in sample_conv_pii_transcript_input()
     14 client = ConversationAnalysisClient(endpoint, credential)
     15 with client:
---> 17     poller = client.begin_conversation_analysis(
     18         task={
     19             "displayName": "Analyze PII in conversation",
     20             "analysisInput": {
     21                 "conversations": [
     22                     {
     23                         "conversationItems": [
     24                             {
     25                                 "id": "1",
     26                                 "participantId": "0",
     27                                 "modality": "transcript",
     28                                 "text": "It is john doe.",
     29                                 "lexical": "It is john doe",
     30                                 "itn": "It is john doe",
     31                                 "maskedItn": "It is john doe"
     32                             },

I also checked on this page, my parameter is included but I still get this error.

Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
518 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,598 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VasaviLankipalle-MSFT 18,676 Reputation points Moderator
    2023-05-02T20:51:17.6566667+00:00

    Hi @YQ , Thanks for using Microsoft Q&A Platform.

    I just reproduced the GitHub code everything is working well on my end. https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/cognitivelanguage/azure-ai-language-conversations/samples/sample_conv_pii_transcript_input.py

    This error can occur if you are using an older version of the azure-ai-language-conversations package.

    To resolve this issue, please make sure that you have installed the latest version of the azure-ai-language-conversations package. You can do this by running the following command:

    pip install --upgrade azure-ai-language-conversations
    

    I have used, pip install azure-ai-language-conversations==1.1.0b3 with CLU resource: Standard pricing tier

    Could you please provide your pricing tier?

    Please try these and let us know.

    I hope this helps.

    Regards,
    Vasavi

    -Please kindly accept the answer and vote 'yes' if you feel helpful to support the community, thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.