Skip to content

AZURE LUIS cognitive services AttributeError: 'PredictionOperations' object has no attribute 'get_slot_prediction' #101

@Tirbo06

Description

@Tirbo06

Please provide us with the following information:

This issue is for a:

- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

import json
import creds 
import pprint
from azure.cognitiveservices.language.luis.runtime import LUISRuntimeClient
from msrest.authentication import CognitiveServicesCredentials

def predict_from_model(app_id, predictionRequest, is_printing=False):
    '''ENDPOINT'''
    # print('app_id : ', app_id)
    runtimeCredentials = CognitiveServicesCredentials(creds.predictionKey)
    clientRuntime = LUISRuntimeClient(endpoint=creds.predictionEndpoint, credentials=runtimeCredentials)
    predictionResponse = clientRuntime.prediction.get_slot_prediction(app_id, "Production", predictionRequest)
    return predictionResponse

published_app_id = "28a4d09e-a-LUIS-app-id-endpoint"                                                                                           
predictionRequest = {"query":"Hi you can help me by exploring my options to travel from Paris to San Jose."}                                        
predicted = predict_from_model(published_app_id, predictionRequest, is_printing=True)                                                               

Any log messages given by the failure

C\...\luis\trigger_predict_endpoint.py in predict_from_model(app_id, predictionRequest, is_printing)
     14     runtimeCredentials = CognitiveServicesCredentials(creds.predictionKey)
     15     clientRuntime = LUISRuntimeClient(endpoint=creds.predictionEndpoint, credentials=runtimeCredentials)
---> 16     predictionResponse = clientRuntime.prediction.get_slot_prediction(app_id, "Production", predictionRequest)
     17 
AttributeError: 'PredictionOperations' object has no attribute 'get_slot_prediction'

Expected/desired behavior

This code worked two days ago and now it does not.
I followed the doc down there and it has not changed. I cannot find any news regarding a deprecation...
Thanks you !

https://docs.microsoft.com/en-us/python/api/azure-cognitiveservices-language-luis/azure.cognitiveservices.language.luis.runtime.operations.predictionoperations?view=azure-python#get-slot-prediction-app-id--slot-name--prediction-request--verbose-none--show-all-intents-none--log-none--custom-headers-none--raw-false----operation-config-

OS and Version?

  • Windows 10 21H1
  • Python 3.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions