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

[AutoPR cognitiveservices/data-plane/LUIS/Runtime/cognitiveservices/data-plane/LUIS/Authoring] [Cognitive Services] Update endpoint URL template for LUIS. #2995

Merged
merged 6 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions azure-cognitiveservices-language-luis/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.. :changelog:

Release History
===============

0.1.0 (2018-08-15)
++++++++++++++++++

* Initial Release
2 changes: 2 additions & 0 deletions azure-cognitiveservices-language-luis/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include *.rst
include azure_bdist_wheel.py
43 changes: 43 additions & 0 deletions azure-cognitiveservices-language-luis/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Cognitive Services LUIS Client Library.

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/azure>`__ bundle package.


Compatibility
=============

**IMPORTANT**: If you have an earlier version of the azure package
(version < 1.0), you should uninstall it before installing this package.

You can check the version using pip:

.. code:: shell

pip freeze

If you see azure==0.11.0 (or any version below 1.0), uninstall it first:

.. code:: shell

pip uninstall azure


Usage
=====

For code examples, see `Cognitive Services LUIS
<https://docs.microsoft.com/python/api/overview/azure/cognitive-services>`__
on docs.microsoft.com.


Provide Feedback
================

If you encounter any bugs or have suggestions, please file an issue in the
`Issues <https://github.com/Azure/azure-sdk-for-python/issues>`__
section of the project.
1 change: 1 addition & 0 deletions azure-cognitiveservices-language-luis/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .luis_authoring_client import LUISAuthoringClient
from .version import VERSION

__all__ = ['LUISAuthoringClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from msrest.exceptions import HttpOperationError
from .operations.features_operations import FeaturesOperations
from .operations.examples_operations import ExamplesOperations
from .operations.model_operations import ModelOperations
from .operations.apps_operations import AppsOperations
from .operations.versions_operations import VersionsOperations
from .operations.train_operations import TrainOperations
from .operations.permissions_operations import PermissionsOperations
from .operations.pattern_operations import PatternOperations
from . import models


class LUISAuthoringClientConfiguration(Configuration):
"""Configuration for LUISAuthoringClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
base_url = '{Endpoint}/luis/api/v2.0'

super(LUISAuthoringClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-cognitiveservices-language-luis/{}'.format(VERSION))

self.endpoint = endpoint
self.credentials = credentials


class LUISAuthoringClient(SDKClient):
"""LUISAuthoringClient

:ivar config: Configuration for client.
:vartype config: LUISAuthoringClientConfiguration

:ivar features: Features operations
:vartype features: azure.cognitiveservices.language.luis.authoring.operations.FeaturesOperations
:ivar examples: Examples operations
:vartype examples: azure.cognitiveservices.language.luis.authoring.operations.ExamplesOperations
:ivar model: Model operations
:vartype model: azure.cognitiveservices.language.luis.authoring.operations.ModelOperations
:ivar apps: Apps operations
:vartype apps: azure.cognitiveservices.language.luis.authoring.operations.AppsOperations
:ivar versions: Versions operations
:vartype versions: azure.cognitiveservices.language.luis.authoring.operations.VersionsOperations
:ivar train: Train operations
:vartype train: azure.cognitiveservices.language.luis.authoring.operations.TrainOperations
:ivar permissions: Permissions operations
:vartype permissions: azure.cognitiveservices.language.luis.authoring.operations.PermissionsOperations
:ivar pattern: Pattern operations
:vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

self.config = LUISAuthoringClientConfiguration(endpoint, credentials)
super(LUISAuthoringClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.features = FeaturesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.examples = ExamplesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.model = ModelOperations(
self._client, self.config, self._serialize, self._deserialize)
self.apps = AppsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.versions = VersionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.train = TrainOperations(
self._client, self.config, self._serialize, self._deserialize)
self.permissions = PermissionsOperations(
self._client, self.config, self._serialize, self._deserialize)
self.pattern = PatternOperations(
self._client, self.config, self._serialize, self._deserialize)
Loading