Skip to content
Closed
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
4 changes: 4 additions & 0 deletions azure-cognitiveservices-language-luis/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
include *.rst
include azure/__init__.py
include azure/cognitiveservices/__init__.py
include azure/cognitiveservices/language/__init__.py

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .operations.train_operations import TrainOperations
from .operations.permissions_operations import PermissionsOperations
from .operations.pattern_operations import PatternOperations
from .operations.settings_operations import SettingsOperations
from . import models


Expand Down Expand Up @@ -76,6 +77,8 @@ class LUISAuthoringClient(SDKClient):
:vartype permissions: azure.cognitiveservices.language.luis.authoring.operations.PermissionsOperations
:ivar pattern: Pattern operations
:vartype pattern: azure.cognitiveservices.language.luis.authoring.operations.PatternOperations
:ivar settings: Settings operations
:vartype settings: azure.cognitiveservices.language.luis.authoring.operations.SettingsOperations

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus.api.cognitive.microsoft.com).
Expand Down Expand Up @@ -112,3 +115,5 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.pattern = PatternOperations(
self._client, self.config, self._serialize, self._deserialize)
self.settings = SettingsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
from .pattern_any_entity_extractor_py3 import PatternAnyEntityExtractor
from .pattern_rule_info_py3 import PatternRuleInfo
from .label_text_object_py3 import LabelTextObject
from .app_version_setting_object_py3 import AppVersionSettingObject
from .hierarchical_child_model_update_object_py3 import HierarchicalChildModelUpdateObject
from .hierarchical_child_model_create_object_py3 import HierarchicalChildModelCreateObject
from .composite_child_model_create_object_py3 import CompositeChildModelCreateObject
Expand Down Expand Up @@ -210,6 +211,7 @@
from .pattern_any_entity_extractor import PatternAnyEntityExtractor
from .pattern_rule_info import PatternRuleInfo
from .label_text_object import LabelTextObject
from .app_version_setting_object import AppVersionSettingObject
from .hierarchical_child_model_update_object import HierarchicalChildModelUpdateObject
from .hierarchical_child_model_create_object import HierarchicalChildModelCreateObject
from .composite_child_model_create_object import CompositeChildModelCreateObject
Expand Down Expand Up @@ -317,6 +319,7 @@
'PatternAnyEntityExtractor',
'PatternRuleInfo',
'LabelTextObject',
'AppVersionSettingObject',
'HierarchicalChildModelUpdateObject',
'HierarchicalChildModelCreateObject',
'CompositeChildModelCreateObject',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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.serialization import Model


class AppVersionSettingObject(Model):
"""Object model of an application version setting.

:param name: The application version setting name.
:type name: str
:param value: The application version setting value.
:type value: str
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AppVersionSettingObject, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.value = kwargs.get('value', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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.serialization import Model


class AppVersionSettingObject(Model):
"""Object model of an application version setting.

:param name: The application version setting name.
:type name: str
:param value: The application version setting value.
:type value: str
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, *, name: str=None, value: str=None, **kwargs) -> None:
super(AppVersionSettingObject, self).__init__(**kwargs)
self.name = name
self.value = value
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ class ApplicationPublishObject(Model):
:param is_staging: Indicates if the staging slot should be used, instead
of the Production one. Default value: False .
:type is_staging: bool
:param region: The target region that the application is published to.
:type region: str
"""

_attribute_map = {
'version_id': {'key': 'versionId', 'type': 'str'},
'is_staging': {'key': 'isStaging', 'type': 'bool'},
'region': {'key': 'region', 'type': 'str'},
}

def __init__(self, **kwargs):
super(ApplicationPublishObject, self).__init__(**kwargs)
self.version_id = kwargs.get('version_id', None)
self.is_staging = kwargs.get('is_staging', False)
self.region = kwargs.get('region', None)
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,14 @@ class ApplicationPublishObject(Model):
:param is_staging: Indicates if the staging slot should be used, instead
of the Production one. Default value: False .
:type is_staging: bool
:param region: The target region that the application is published to.
:type region: str
"""

_attribute_map = {
'version_id': {'key': 'versionId', 'type': 'str'},
'is_staging': {'key': 'isStaging', 'type': 'bool'},
'region': {'key': 'region', 'type': 'str'},
}

def __init__(self, *, version_id: str=None, is_staging: bool=False, region: str=None, **kwargs) -> None:
def __init__(self, *, version_id: str=None, is_staging: bool=False, **kwargs) -> None:
super(ApplicationPublishObject, self).__init__(**kwargs)
self.version_id = version_id
self.is_staging = is_staging
self.region = region
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class ExampleLabelObject(Model):

:param text: The sample's utterance.
:type text: str
:param entity_labels: The idenfied entities within the utterance.
:param entity_labels: The identified entities within the utterance.
:type entity_labels:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject]
:param intent_name: The idenfitied intent representing the utterance.
:param intent_name: The identified intent representing the utterance.
:type intent_name: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ class ExampleLabelObject(Model):

:param text: The sample's utterance.
:type text: str
:param entity_labels: The idenfied entities within the utterance.
:param entity_labels: The identified entities within the utterance.
:type entity_labels:
list[~azure.cognitiveservices.language.luis.authoring.models.EntityLabelObject]
:param intent_name: The idenfitied intent representing the utterance.
:param intent_name: The identified intent representing the utterance.
:type intent_name: str
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ class TrainingStatus(str, Enum):
class OperationStatusType(str, Enum):

failed = "Failed"
failed = "FAILED"
success = "Success"
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PublishSettingUpdateObject(Model):
"""Object model for updating an application's publish settings.

:param sentiment_analysis: Setting sentiment analysis as true returns the
Sentiment of the input utterance along with the resopnse
Sentiment of the input utterance along with the response
:type sentiment_analysis: bool
:param speech: Setting speech as public enables speech priming in your app
:type speech: bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class PublishSettingUpdateObject(Model):
"""Object model for updating an application's publish settings.

:param sentiment_analysis: Setting sentiment analysis as true returns the
Sentiment of the input utterance along with the resopnse
Sentiment of the input utterance along with the response
:type sentiment_analysis: bool
:param speech: Setting speech as public enables speech priming in your app
:type speech: bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PublishSettings(Model):
:type id: str
:param is_sentiment_analysis_enabled: Required. Setting sentiment analysis
as true returns the Sentiment of the input utterance along with the
resopnse
response
:type is_sentiment_analysis_enabled: bool
:param is_speech_enabled: Required. Setting speech as public enables
speech priming in your app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PublishSettings(Model):
:type id: str
:param is_sentiment_analysis_enabled: Required. Setting sentiment analysis
as true returns the Sentiment of the input utterance along with the
resopnse
response
:type is_sentiment_analysis_enabled: bool
:param is_speech_enabled: Required. Setting speech as public enables
speech priming in your app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .train_operations import TrainOperations
from .permissions_operations import PermissionsOperations
from .pattern_operations import PatternOperations
from .settings_operations import SettingsOperations

__all__ = [
'FeaturesOperations',
Expand All @@ -27,4 +28,5 @@
'TrainOperations',
'PermissionsOperations',
'PatternOperations',
'SettingsOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def list(
def import_method(
self, luis_app, app_name=None, custom_headers=None, raw=False, **operation_config):
"""Imports an application to LUIS, the application's structure should be
included in in the request body.
included in the request body.

:param luis_app: A LUIS application structure.
:type luis_app:
Expand Down Expand Up @@ -646,15 +646,16 @@ def delete(
delete.metadata = {'url': '/apps/{appId}'}

def publish(
self, app_id, application_publish_object, custom_headers=None, raw=False, **operation_config):
self, app_id, version_id=None, is_staging=False, custom_headers=None, raw=False, **operation_config):
"""Publishes a specific version of the application.

:param app_id: The application ID.
:type app_id: str
:param application_publish_object: The application publish object. The
region is the target region that the application is published to.
:type application_publish_object:
~azure.cognitiveservices.language.luis.authoring.models.ApplicationPublishObject
:param version_id: The version ID to publish.
:type version_id: str
:param is_staging: Indicates if the staging slot should be used,
instead of the Production one.
:type is_staging: bool
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -668,6 +669,8 @@ def publish(
:raises:
:class:`ErrorResponseException<azure.cognitiveservices.language.luis.authoring.models.ErrorResponseException>`
"""
application_publish_object = models.ApplicationPublishObject(version_id=version_id, is_staging=is_staging)

# Construct URL
url = self.publish.metadata['url']
path_format_arguments = {
Expand Down
Loading