Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import os
from azure.core.credentials import AzureKeyCredential

from azure.ai.language.conversations import ConversationAnalysisClient
from azure.ai.language.conversations.models import AnalyzeConversationOptions
from azure.ai.language.conversations.models import AnalysisParameters

# get secrets
conv_endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
Expand All @@ -85,7 +85,7 @@ conv_project = os.environ["AZURE_CONVERSATIONS_PROJECT"]

# prepare data
query = "One california maki please."
input = AnalyzeConversationOptions(
input = AnalysisParameters(
query=query
)

Expand Down Expand Up @@ -124,7 +124,7 @@ import os
from azure.core.credentials import AzureKeyCredential

from azure.ai.language.conversations import ConversationAnalysisClient
from azure.ai.language.conversations.models import AnalyzeConversationOptions
from azure.ai.language.conversations.models import AnalysisParameters

# get secrets
conv_endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
Expand All @@ -133,7 +133,7 @@ workflow_project = os.environ["AZURE_CONVERSATIONS_WORKFLOW_PROJECT")

# prepare data
query = "How do you make sushi rice?",
input = AnalyzeConversationOptions(
input = AnalysisParameters(
query=query
)

Expand Down Expand Up @@ -169,7 +169,7 @@ import os
from azure.core.credentials import AzureKeyCredential

from azure.ai.language.conversations import ConversationAnalysisClient
from azure.ai.language.conversations.models import AnalyzeConversationOptions
from azure.ai.language.conversations.models import AnalysisParameters

# get secrets
conv_endpoint = os.environ["AZURE_CONVERSATIONS_ENDPOINT"]
Expand All @@ -179,7 +179,7 @@ workflow_project = os.environ["AZURE_CONVERSATIONS_WORKFLOW_PROJECT")
# prepare data
query = "How do you make sushi rice?",
target_intent = "SushiMaking"
input = AnalyzeConversationOptions(
input = AnalysisParameters(
query=query,
direct_target=target_intent,
parameters={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(

self.endpoint = endpoint
self.credential = credential
self.api_version = "2021-07-15-preview"
self.api_version = "2021-11-01-preview"
kwargs.setdefault('sdk_moniker', 'ai-language-conversations/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from azure.core.rest import HttpRequest, HttpResponse

class ConversationAnalysisClient(ConversationAnalysisClientOperationsMixin):
"""This API accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, LUIS Deepstack, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.
"""This API accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, Conversation, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.

In some cases, this API needs to forward requests and responses between the caller and an upstream service.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(

self.endpoint = endpoint
self.credential = credential
self.api_version = "2021-07-15-preview"
self.api_version = "2021-11-01-preview"
kwargs.setdefault('sdk_moniker', 'ai-language-conversations/{}'.format(VERSION))
self._configure(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .operations import ConversationAnalysisClientOperationsMixin

class ConversationAnalysisClient(ConversationAnalysisClientOperationsMixin):
"""This API accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, LUIS Deepstack, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.
"""This API accepts a request and mediates among multiple language projects, such as LUIS Generally Available, Question Answering, Conversation, and then calls the best candidate service to handle the request. At last, it returns a response with the candidate service's response as a payload.

In some cases, this API needs to forward requests and responses between the caller and an upstream service.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class ConversationAnalysisClientOperationsMixin:
@distributed_trace_async
async def analyze_conversations(
self,
analyze_conversation_options: "_models.AnalyzeConversationOptions",
conversation_analysis_options: "_models.ConversationAnalysisOptions",
*,
project_name: str,
deployment_name: str,
**kwargs: Any
) -> "_models.AnalyzeConversationResult":
"""Analyzes the input conversation utterance.

:param analyze_conversation_options: Post body of the request.
:type analyze_conversation_options:
~azure.ai.language.conversations.models.AnalyzeConversationOptions
:param conversation_analysis_options: Post body of the request.
:type conversation_analysis_options:
~azure.ai.language.conversations.models.ConversationAnalysisOptions
:keyword project_name: The name of the project to use.
:paramtype project_name: str
:keyword deployment_name: The name of the specific deployment of the project to use.
Expand All @@ -53,7 +53,7 @@ async def analyze_conversations(

content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]

json = self._serialize.body(analyze_conversation_options, 'AnalyzeConversationOptions')
json = self._serialize.body(conversation_analysis_options, 'ConversationAnalysisOptions')

request = build_analyze_conversations_request(
content_type=content_type,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,89 +7,99 @@
# --------------------------------------------------------------------------

try:
from ._models_py3 import AnalyzeConversationOptions
from ._models_py3 import AnalysisParameters
from ._models_py3 import AnalyzeConversationResult
from ._models_py3 import AnalyzeParameters
from ._models_py3 import AnswerSpan
from ._models_py3 import BasePrediction
from ._models_py3 import DSTargetIntentResult
from ._models_py3 import DeepStackEntityResolution
from ._models_py3 import DeepstackCallingOptions
from ._models_py3 import DeepstackEntity
from ._models_py3 import DeepstackIntent
from ._models_py3 import DeepstackParameters
from ._models_py3 import DeepstackPrediction
from ._models_py3 import DeepstackResult
from ._models_py3 import DictionaryNormalizedValueResolution
from ._models_py3 import ConversationAnalysisOptions
from ._models_py3 import ConversationCallingOptions
from ._models_py3 import ConversationEntity
from ._models_py3 import ConversationIntent
from ._models_py3 import ConversationParameters
from ._models_py3 import ConversationPrediction
from ._models_py3 import ConversationResult
from ._models_py3 import ConversationTargetIntentResult
from ._models_py3 import Error
from ._models_py3 import ErrorResponse
from ._models_py3 import InnerErrorModel
from ._models_py3 import KnowledgeBaseAnswer
from ._models_py3 import KnowledgeBaseAnswerDialog
from ._models_py3 import KnowledgeBaseAnswerPrompt
from ._models_py3 import KnowledgeBaseAnswers
from ._models_py3 import LUISCallingOptions
from ._models_py3 import LUISParameters
from ._models_py3 import LUISTargetIntentResult
from ._models_py3 import NoneLinkedTargetIntentResult
from ._models_py3 import OrchestratorPrediction
from ._models_py3 import QuestionAnsweringParameters
from ._models_py3 import QuestionAnsweringTargetIntentResult
from ._models_py3 import TargetIntentResult
from ._models_py3 import WorkflowPrediction
except (SyntaxError, ImportError):
from ._models import AnalyzeConversationOptions # type: ignore
from ._models import AnalysisParameters # type: ignore
from ._models import AnalyzeConversationResult # type: ignore
from ._models import AnalyzeParameters # type: ignore
from ._models import AnswerSpan # type: ignore
from ._models import BasePrediction # type: ignore
from ._models import DSTargetIntentResult # type: ignore
from ._models import DeepStackEntityResolution # type: ignore
from ._models import DeepstackCallingOptions # type: ignore
from ._models import DeepstackEntity # type: ignore
from ._models import DeepstackIntent # type: ignore
from ._models import DeepstackParameters # type: ignore
from ._models import DeepstackPrediction # type: ignore
from ._models import DeepstackResult # type: ignore
from ._models import DictionaryNormalizedValueResolution # type: ignore
from ._models import ConversationAnalysisOptions # type: ignore
from ._models import ConversationCallingOptions # type: ignore
from ._models import ConversationEntity # type: ignore
from ._models import ConversationIntent # type: ignore
from ._models import ConversationParameters # type: ignore
from ._models import ConversationPrediction # type: ignore
from ._models import ConversationResult # type: ignore
from ._models import ConversationTargetIntentResult # type: ignore
from ._models import Error # type: ignore
from ._models import ErrorResponse # type: ignore
from ._models import InnerErrorModel # type: ignore
from ._models import KnowledgeBaseAnswer # type: ignore
from ._models import KnowledgeBaseAnswerDialog # type: ignore
from ._models import KnowledgeBaseAnswerPrompt # type: ignore
from ._models import KnowledgeBaseAnswers # type: ignore
from ._models import LUISCallingOptions # type: ignore
from ._models import LUISParameters # type: ignore
from ._models import LUISTargetIntentResult # type: ignore
from ._models import NoneLinkedTargetIntentResult # type: ignore
from ._models import OrchestratorPrediction # type: ignore
from ._models import QuestionAnsweringParameters # type: ignore
from ._models import QuestionAnsweringTargetIntentResult # type: ignore
from ._models import TargetIntentResult # type: ignore
from ._models import WorkflowPrediction # type: ignore

from ._conversation_analysis_client_enums import (
ErrorCode,
InnerErrorCode,
ProjectKind,
ResolutionKind,
TargetKind,
)

__all__ = [
'AnalyzeConversationOptions',
'AnalysisParameters',
'AnalyzeConversationResult',
'AnalyzeParameters',
'AnswerSpan',
'BasePrediction',
'DSTargetIntentResult',
'DeepStackEntityResolution',
'DeepstackCallingOptions',
'DeepstackEntity',
'DeepstackIntent',
'DeepstackParameters',
'DeepstackPrediction',
'DeepstackResult',
'DictionaryNormalizedValueResolution',
'ConversationAnalysisOptions',
'ConversationCallingOptions',
'ConversationEntity',
'ConversationIntent',
'ConversationParameters',
'ConversationPrediction',
'ConversationResult',
'ConversationTargetIntentResult',
'Error',
'ErrorResponse',
'InnerErrorModel',
'KnowledgeBaseAnswer',
'KnowledgeBaseAnswerDialog',
'KnowledgeBaseAnswerPrompt',
'KnowledgeBaseAnswers',
'LUISCallingOptions',
'LUISParameters',
'LUISTargetIntentResult',
'NoneLinkedTargetIntentResult',
'OrchestratorPrediction',
'QuestionAnsweringParameters',
'QuestionAnsweringTargetIntentResult',
'TargetIntentResult',
'WorkflowPrediction',
'ErrorCode',
'InnerErrorCode',
'ProjectKind',
'ResolutionKind',
'TargetKind',
]
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ class ErrorCode(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
UNAUTHORIZED = "Unauthorized"
FORBIDDEN = "Forbidden"
NOT_FOUND = "NotFound"
PROJECT_NOT_FOUND = "ProjectNotFound"
OPERATION_NOT_FOUND = "OperationNotFound"
AZURE_COGNITIVE_SEARCH_NOT_FOUND = "AzureCognitiveSearchNotFound"
AZURE_COGNITIVE_SEARCH_INDEX_NOT_FOUND = "AzureCognitiveSearchIndexNotFound"
TOO_MANY_REQUESTS = "TooManyRequests"
AZURE_COGNITIVE_SEARCH_THROTTLING = "AzureCognitiveSearchThrottling"
AZURE_COGNITIVE_SEARCH_INDEX_LIMIT_REACHED = "AzureCognitiveSearchIndexLimitReached"
INTERNAL_SERVER_ERROR = "InternalServerError"
SERVICE_UNAVAILABLE = "ServiceUnavailable"

Expand All @@ -42,17 +48,11 @@ class ProjectKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
CONVERSATION = "conversation"
WORKFLOW = "workflow"

class ResolutionKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
"""The type of an entity resolution.
"""

#: Dictionary normalized entities.
DICTIONARY_NORMALIZED_VALUE = "DictionaryNormalizedValue"

class TargetKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
"""The type of a target service.
"""

LUIS = "luis"
LUIS_DEEPSTACK = "luis_deepstack"
CONVERSATION = "conversation"
QUESTION_ANSWERING = "question_answering"
NON_LINKED = "non_linked"
Loading