How to use the azure-cognitiveservices-language-luis.azure.cognitiveservices.language.luis.runtime.models.APIErrorException function in azure-cognitiveservices-language-luis

To help you get started, we’ve selected a few azure-cognitiveservices-language-luis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-python / azure-cognitiveservices-language-luis / azure / cognitiveservices / language / luis / runtime / operations / prediction_operations.py View on Github external
# Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        body_content = self._serialize.body(query, 'str')

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.APIErrorException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('LuisResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    resolve.metadata = {'url': '/apps/{appId}'}

azure-cognitiveservices-language-luis

Microsoft Azure Cognitive Services LUIS Client Library for Python

MIT
Latest version published 3 months ago

Package Health Score

81 / 100
Full package analysis

Popular azure-cognitiveservices-language-luis functions

Similar packages