Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Tirbo06 opened this issue Oct 28, 2021 · 1 comment

Comments

@Tirbo06
Copy link

Tirbo06 commented Oct 28, 2021

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
@jaimenguyen168
Copy link

Hi. Have you resolve this problem? I'm having the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants