diff --git a/.librarian/state.yaml b/.librarian/state.yaml index 1cdb47b74893..695c8a64c786 100644 --- a/.librarian/state.yaml +++ b/.librarian/state.yaml @@ -1535,7 +1535,7 @@ libraries: tag_format: '{id}-v{version}' - id: google-cloud-dialogflow version: 2.46.0 - last_generated_commit: 256b575f6915282b20795c13414b21f2c0af65db + last_generated_commit: 59d5f2b46924714af627ac29ea6de78641a00835 apis: - path: google/cloud/dialogflow/v2beta1 service_config: dialogflow_v2beta1.yaml diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py index df8571957553..60ec39e82c6c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow/__init__.py @@ -158,6 +158,8 @@ TelephonyDtmfEvents, VoiceSelectionParams, ) +from google.cloud.dialogflow_v2.types.ces_app import CesAppSpec +from google.cloud.dialogflow_v2.types.ces_tool import CesToolSpec from google.cloud.dialogflow_v2.types.context import ( Context, CreateContextRequest, @@ -186,6 +188,7 @@ ListMessagesRequest, ListMessagesResponse, SearchKnowledgeAnswer, + SearchKnowledgeDebugInfo, SearchKnowledgeRequest, SearchKnowledgeResponse, SuggestConversationSummaryRequest, @@ -382,20 +385,24 @@ AudioInput, AutomatedAgentReply, CreateParticipantRequest, + DatastoreResponseReason, DialogflowAssistAnswer, DtmfParameters, FaqAnswer, GenerateSuggestionsResponse, GetParticipantRequest, + IngestedContextReferenceDebugInfo, InputTextConfig, IntentSuggestion, KnowledgeAssistAnswer, + KnowledgeAssistDebugInfo, ListParticipantsRequest, ListParticipantsResponse, Message, MessageAnnotation, OutputAudio, Participant, + ServiceLatency, SmartReplyAnswer, StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse, @@ -456,6 +463,7 @@ UpdateToolRequest, ) from google.cloud.dialogflow_v2.types.tool_call import ToolCall, ToolCallResult +from google.cloud.dialogflow_v2.types.toolset import ToolsetTool from google.cloud.dialogflow_v2.types.validation_result import ( ValidationError, ValidationResult, @@ -554,6 +562,8 @@ "SpeechModelVariant", "SsmlVoiceGender", "TelephonyDtmf", + "CesAppSpec", + "CesToolSpec", "Context", "CreateContextRequest", "DeleteAllContextsRequest", @@ -579,6 +589,7 @@ "ListMessagesRequest", "ListMessagesResponse", "SearchKnowledgeAnswer", + "SearchKnowledgeDebugInfo", "SearchKnowledgeRequest", "SearchKnowledgeResponse", "SuggestConversationSummaryRequest", @@ -751,15 +762,18 @@ "FaqAnswer", "GenerateSuggestionsResponse", "GetParticipantRequest", + "IngestedContextReferenceDebugInfo", "InputTextConfig", "IntentSuggestion", "KnowledgeAssistAnswer", + "KnowledgeAssistDebugInfo", "ListParticipantsRequest", "ListParticipantsResponse", "Message", "MessageAnnotation", "OutputAudio", "Participant", + "ServiceLatency", "SmartReplyAnswer", "StreamingAnalyzeContentRequest", "StreamingAnalyzeContentResponse", @@ -774,6 +788,7 @@ "SuggestSmartRepliesRequest", "SuggestSmartRepliesResponse", "UpdateParticipantRequest", + "DatastoreResponseReason", "CloudConversationDebuggingInfo", "DetectIntentRequest", "DetectIntentResponse", @@ -812,6 +827,7 @@ "UpdateToolRequest", "ToolCall", "ToolCallResult", + "ToolsetTool", "ValidationError", "ValidationResult", "CreateVersionRequest", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py index 831da88affb4..746bb025627e 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/__init__.py @@ -109,6 +109,8 @@ TelephonyDtmfEvents, VoiceSelectionParams, ) +from .types.ces_app import CesAppSpec +from .types.ces_tool import CesToolSpec from .types.context import ( Context, CreateContextRequest, @@ -137,6 +139,7 @@ ListMessagesRequest, ListMessagesResponse, SearchKnowledgeAnswer, + SearchKnowledgeDebugInfo, SearchKnowledgeRequest, SearchKnowledgeResponse, SuggestConversationSummaryRequest, @@ -329,20 +332,24 @@ AudioInput, AutomatedAgentReply, CreateParticipantRequest, + DatastoreResponseReason, DialogflowAssistAnswer, DtmfParameters, FaqAnswer, GenerateSuggestionsResponse, GetParticipantRequest, + IngestedContextReferenceDebugInfo, InputTextConfig, IntentSuggestion, KnowledgeAssistAnswer, + KnowledgeAssistDebugInfo, ListParticipantsRequest, ListParticipantsResponse, Message, MessageAnnotation, OutputAudio, Participant, + ServiceLatency, SmartReplyAnswer, StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse, @@ -403,6 +410,7 @@ UpdateToolRequest, ) from .types.tool_call import ToolCall, ToolCallResult +from .types.toolset import ToolsetTool from .types.validation_result import ValidationError, ValidationResult from .types.version import ( CreateVersionRequest, @@ -561,6 +569,8 @@ def _get_version(dependency_name): "BatchUpdateEntityTypesResponse", "BatchUpdateIntentsRequest", "BatchUpdateIntentsResponse", + "CesAppSpec", + "CesToolSpec", "ClearSuggestionFeatureConfigOperationMetadata", "ClearSuggestionFeatureConfigRequest", "CloudConversationDebuggingInfo", @@ -603,6 +613,7 @@ def _get_version(dependency_name): "CreateToolRequest", "CreateVersionRequest", "CustomPronunciationParams", + "DatastoreResponseReason", "DeleteAgentRequest", "DeleteAllContextsRequest", "DeleteContextRequest", @@ -702,6 +713,7 @@ def _get_version(dependency_name): "InferenceParameter", "IngestContextReferencesRequest", "IngestContextReferencesResponse", + "IngestedContextReferenceDebugInfo", "InitializeEncryptionSpecMetadata", "InitializeEncryptionSpecRequest", "InitializeEncryptionSpecResponse", @@ -715,6 +727,7 @@ def _get_version(dependency_name): "IntentView", "IntentsClient", "KnowledgeAssistAnswer", + "KnowledgeAssistDebugInfo", "KnowledgeBase", "KnowledgeBasesClient", "KnowledgeOperationMetadata", @@ -778,11 +791,13 @@ def _get_version(dependency_name): "SearchAgentsRequest", "SearchAgentsResponse", "SearchKnowledgeAnswer", + "SearchKnowledgeDebugInfo", "SearchKnowledgeRequest", "SearchKnowledgeResponse", "Sentiment", "SentimentAnalysisRequestConfig", "SentimentAnalysisResult", + "ServiceLatency", "SessionEntityType", "SessionEntityTypesClient", "SessionsClient", @@ -832,6 +847,7 @@ def _get_version(dependency_name): "ToolCall", "ToolCallResult", "ToolsClient", + "ToolsetTool", "TrainAgentRequest", "TriggerEvent", "UndeployConversationModelOperationMetadata", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py index 3af188307ef1..ca4a053584c3 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/async_client.py @@ -84,12 +84,18 @@ class AnswerRecordsAsyncClient: parse_answer_record_path = staticmethod( AnswerRecordsClient.parse_answer_record_path ) + app_path = staticmethod(AnswerRecordsClient.app_path) + parse_app_path = staticmethod(AnswerRecordsClient.parse_app_path) context_path = staticmethod(AnswerRecordsClient.context_path) parse_context_path = staticmethod(AnswerRecordsClient.parse_context_path) intent_path = staticmethod(AnswerRecordsClient.intent_path) parse_intent_path = staticmethod(AnswerRecordsClient.parse_intent_path) tool_path = staticmethod(AnswerRecordsClient.tool_path) parse_tool_path = staticmethod(AnswerRecordsClient.parse_tool_path) + tool_path = staticmethod(AnswerRecordsClient.tool_path) + parse_tool_path = staticmethod(AnswerRecordsClient.parse_tool_path) + toolset_path = staticmethod(AnswerRecordsClient.toolset_path) + parse_toolset_path = staticmethod(AnswerRecordsClient.parse_toolset_path) common_billing_account_path = staticmethod( AnswerRecordsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py index 0c160ceb3b62..edbc8be80bcb 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/answer_records/client.py @@ -252,6 +252,28 @@ def parse_answer_record_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def context_path( project: str, @@ -313,6 +335,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py index 177da090a198..57762d5eb10d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/async_client.py @@ -49,7 +49,12 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2.services.conversations import pagers -from google.cloud.dialogflow_v2.types import conversation, generator, participant +from google.cloud.dialogflow_v2.types import ( + conversation, + conversation_profile, + generator, + participant, +) from google.cloud.dialogflow_v2.types import conversation as gcd_conversation from .client import ConversationsClient @@ -86,6 +91,8 @@ class ConversationsAsyncClient: parse_answer_record_path = staticmethod( ConversationsClient.parse_answer_record_path ) + app_path = staticmethod(ConversationsClient.app_path) + parse_app_path = staticmethod(ConversationsClient.parse_app_path) conversation_path = staticmethod(ConversationsClient.conversation_path) parse_conversation_path = staticmethod(ConversationsClient.parse_conversation_path) conversation_model_path = staticmethod(ConversationsClient.conversation_model_path) @@ -120,6 +127,10 @@ class ConversationsAsyncClient: parse_phrase_set_path = staticmethod(ConversationsClient.parse_phrase_set_path) tool_path = staticmethod(ConversationsClient.tool_path) parse_tool_path = staticmethod(ConversationsClient.parse_tool_path) + tool_path = staticmethod(ConversationsClient.tool_path) + parse_tool_path = staticmethod(ConversationsClient.parse_tool_path) + toolset_path = staticmethod(ConversationsClient.toolset_path) + parse_toolset_path = staticmethod(ConversationsClient.parse_toolset_path) common_billing_account_path = staticmethod( ConversationsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py index 659531046ae9..bed12d5bfabd 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/conversations/client.py @@ -66,7 +66,12 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2.services.conversations import pagers -from google.cloud.dialogflow_v2.types import conversation, generator, participant +from google.cloud.dialogflow_v2.types import ( + conversation, + conversation_profile, + generator, + participant, +) from google.cloud.dialogflow_v2.types import conversation as gcd_conversation from .transports.base import DEFAULT_CLIENT_INFO, ConversationsTransport @@ -267,6 +272,28 @@ def parse_answer_record_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def conversation_path( project: str, @@ -505,6 +532,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/async_client.py index d03e14c4f2e2..13dda1730559 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/async_client.py @@ -82,6 +82,8 @@ class GeneratorEvaluationsAsyncClient: _DEFAULT_ENDPOINT_TEMPLATE = GeneratorEvaluationsClient._DEFAULT_ENDPOINT_TEMPLATE _DEFAULT_UNIVERSE = GeneratorEvaluationsClient._DEFAULT_UNIVERSE + app_path = staticmethod(GeneratorEvaluationsClient.app_path) + parse_app_path = staticmethod(GeneratorEvaluationsClient.parse_app_path) generator_path = staticmethod(GeneratorEvaluationsClient.generator_path) parse_generator_path = staticmethod(GeneratorEvaluationsClient.parse_generator_path) generator_evaluation_path = staticmethod( @@ -92,6 +94,10 @@ class GeneratorEvaluationsAsyncClient: ) tool_path = staticmethod(GeneratorEvaluationsClient.tool_path) parse_tool_path = staticmethod(GeneratorEvaluationsClient.parse_tool_path) + tool_path = staticmethod(GeneratorEvaluationsClient.tool_path) + parse_tool_path = staticmethod(GeneratorEvaluationsClient.parse_tool_path) + toolset_path = staticmethod(GeneratorEvaluationsClient.toolset_path) + parse_toolset_path = staticmethod(GeneratorEvaluationsClient.parse_toolset_path) common_billing_account_path = staticmethod( GeneratorEvaluationsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/client.py index 294919aad191..996baa8819f9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generator_evaluations/client.py @@ -235,6 +235,28 @@ def transport(self) -> GeneratorEvaluationsTransport: """ return self._transport + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def generator_path( project: str, @@ -303,6 +325,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/async_client.py index dd6fa36fe6d9..5e46084b6f57 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/async_client.py @@ -50,7 +50,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2.services.generators import pagers -from google.cloud.dialogflow_v2.types import generator +from google.cloud.dialogflow_v2.types import ces_app, ces_tool, generator, toolset from google.cloud.dialogflow_v2.types import generator as gcd_generator from .client import GeneratorsClient @@ -84,10 +84,16 @@ class GeneratorsAsyncClient: _DEFAULT_ENDPOINT_TEMPLATE = GeneratorsClient._DEFAULT_ENDPOINT_TEMPLATE _DEFAULT_UNIVERSE = GeneratorsClient._DEFAULT_UNIVERSE + app_path = staticmethod(GeneratorsClient.app_path) + parse_app_path = staticmethod(GeneratorsClient.parse_app_path) generator_path = staticmethod(GeneratorsClient.generator_path) parse_generator_path = staticmethod(GeneratorsClient.parse_generator_path) tool_path = staticmethod(GeneratorsClient.tool_path) parse_tool_path = staticmethod(GeneratorsClient.parse_tool_path) + tool_path = staticmethod(GeneratorsClient.tool_path) + parse_tool_path = staticmethod(GeneratorsClient.parse_tool_path) + toolset_path = staticmethod(GeneratorsClient.toolset_path) + parse_toolset_path = staticmethod(GeneratorsClient.parse_toolset_path) common_billing_account_path = staticmethod( GeneratorsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/client.py index 365855fd35c1..676cec7c8382 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/generators/client.py @@ -67,7 +67,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2.services.generators import pagers -from google.cloud.dialogflow_v2.types import generator +from google.cloud.dialogflow_v2.types import ces_app, ces_tool, generator, toolset from google.cloud.dialogflow_v2.types import generator as gcd_generator from .transports.base import DEFAULT_CLIENT_INFO, GeneratorsTransport @@ -237,6 +237,28 @@ def transport(self) -> GeneratorsTransport: """ return self._transport + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def generator_path( project: str, @@ -281,6 +303,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py index 508ada1daf04..3848ed3fd417 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/async_client.py @@ -85,6 +85,8 @@ class ParticipantsAsyncClient: answer_record_path = staticmethod(ParticipantsClient.answer_record_path) parse_answer_record_path = staticmethod(ParticipantsClient.parse_answer_record_path) + app_path = staticmethod(ParticipantsClient.app_path) + parse_app_path = staticmethod(ParticipantsClient.parse_app_path) context_path = staticmethod(ParticipantsClient.context_path) parse_context_path = staticmethod(ParticipantsClient.parse_context_path) intent_path = staticmethod(ParticipantsClient.intent_path) @@ -101,6 +103,10 @@ class ParticipantsAsyncClient: ) tool_path = staticmethod(ParticipantsClient.tool_path) parse_tool_path = staticmethod(ParticipantsClient.parse_tool_path) + tool_path = staticmethod(ParticipantsClient.tool_path) + parse_tool_path = staticmethod(ParticipantsClient.parse_tool_path) + toolset_path = staticmethod(ParticipantsClient.toolset_path) + parse_toolset_path = staticmethod(ParticipantsClient.parse_toolset_path) common_billing_account_path = staticmethod( ParticipantsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py index 46a274dbd63a..018b664750e2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/services/participants/client.py @@ -254,6 +254,28 @@ def parse_answer_record_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def context_path( project: str, @@ -405,6 +427,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py index 672bfeb257f6..e595297116fa 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/__init__.py @@ -55,6 +55,12 @@ TelephonyDtmfEvents, VoiceSelectionParams, ) +from .ces_app import ( + CesAppSpec, +) +from .ces_tool import ( + CesToolSpec, +) from .context import ( Context, CreateContextRequest, @@ -83,6 +89,7 @@ ListMessagesRequest, ListMessagesResponse, SearchKnowledgeAnswer, + SearchKnowledgeDebugInfo, SearchKnowledgeRequest, SearchKnowledgeResponse, SuggestConversationSummaryRequest, @@ -284,20 +291,24 @@ AudioInput, AutomatedAgentReply, CreateParticipantRequest, + DatastoreResponseReason, DialogflowAssistAnswer, DtmfParameters, FaqAnswer, GenerateSuggestionsResponse, GetParticipantRequest, + IngestedContextReferenceDebugInfo, InputTextConfig, IntentSuggestion, KnowledgeAssistAnswer, + KnowledgeAssistDebugInfo, ListParticipantsRequest, ListParticipantsResponse, Message, MessageAnnotation, OutputAudio, Participant, + ServiceLatency, SmartReplyAnswer, StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse, @@ -361,6 +372,9 @@ ToolCall, ToolCallResult, ) +from .toolset import ( + ToolsetTool, +) from .validation_result import ( ValidationError, ValidationResult, @@ -415,6 +429,8 @@ "SpeechModelVariant", "SsmlVoiceGender", "TelephonyDtmf", + "CesAppSpec", + "CesToolSpec", "Context", "CreateContextRequest", "DeleteAllContextsRequest", @@ -440,6 +456,7 @@ "ListMessagesRequest", "ListMessagesResponse", "SearchKnowledgeAnswer", + "SearchKnowledgeDebugInfo", "SearchKnowledgeRequest", "SearchKnowledgeResponse", "SuggestConversationSummaryRequest", @@ -612,15 +629,18 @@ "FaqAnswer", "GenerateSuggestionsResponse", "GetParticipantRequest", + "IngestedContextReferenceDebugInfo", "InputTextConfig", "IntentSuggestion", "KnowledgeAssistAnswer", + "KnowledgeAssistDebugInfo", "ListParticipantsRequest", "ListParticipantsResponse", "Message", "MessageAnnotation", "OutputAudio", "Participant", + "ServiceLatency", "SmartReplyAnswer", "StreamingAnalyzeContentRequest", "StreamingAnalyzeContentResponse", @@ -635,6 +655,7 @@ "SuggestSmartRepliesRequest", "SuggestSmartRepliesResponse", "UpdateParticipantRequest", + "DatastoreResponseReason", "CloudConversationDebuggingInfo", "DetectIntentRequest", "DetectIntentResponse", @@ -673,6 +694,7 @@ "UpdateToolRequest", "ToolCall", "ToolCallResult", + "ToolsetTool", "ValidationError", "ValidationResult", "CreateVersionRequest", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/ces_app.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/ces_app.py new file mode 100644 index 000000000000..42eca4de90cb --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/ces_app.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.dialogflow_v2.types import tool + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2", + manifest={ + "CesAppSpec", + }, +) + + +class CesAppSpec(proto.Message): + r"""Spec of CES app that the generator can choose from. + + Attributes: + ces_app (str): + Optional. Format: + ``projects//locations//apps/``. + confirmation_requirement (google.cloud.dialogflow_v2.types.Tool.ConfirmationRequirement): + Optional. Indicates whether the app requires + human confirmation. + """ + + ces_app: str = proto.Field( + proto.STRING, + number=1, + ) + confirmation_requirement: tool.Tool.ConfirmationRequirement = proto.Field( + proto.ENUM, + number=2, + enum=tool.Tool.ConfirmationRequirement, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/ces_tool.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/ces_tool.py new file mode 100644 index 000000000000..4686978d8fcc --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/ces_tool.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.dialogflow_v2.types import tool + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2", + manifest={ + "CesToolSpec", + }, +) + + +class CesToolSpec(proto.Message): + r"""Spec of CES tool that the generator can choose from. + + Attributes: + ces_tool (str): + Optional. Format: + ``projects//locations//apps//tools/``. + confirmation_requirement (google.cloud.dialogflow_v2.types.Tool.ConfirmationRequirement): + Optional. Indicates whether the tool requires + human confirmation. + """ + + ces_tool: str = proto.Field( + proto.STRING, + number=1, + ) + confirmation_requirement: tool.Tool.ConfirmationRequirement = proto.Field( + proto.ENUM, + number=2, + enum=tool.Tool.ConfirmationRequirement, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py index ea07c9f178ca..d564dd2c3112 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation.py @@ -48,6 +48,7 @@ "GenerateStatelessSuggestionRequest", "GenerateStatelessSuggestionResponse", "SearchKnowledgeRequest", + "SearchKnowledgeDebugInfo", "SearchKnowledgeResponse", "SearchKnowledgeAnswer", "GenerateSuggestionsRequest", @@ -105,9 +106,18 @@ class Conversation(proto.Message): telephony_connection_info (google.cloud.dialogflow_v2.types.Conversation.TelephonyConnectionInfo): Output only. The telephony connection information. + initial_conversation_profile (google.cloud.dialogflow_v2.types.ConversationProfile): + Optional. Output only. The initial + conversation profile to be used to configure + this conversation, which is a copy of the + conversation profile config read at conversation + creation time. ingested_context_references (MutableMapping[str, google.cloud.dialogflow_v2.types.Conversation.ContextReference]): Output only. The context reference updates provided by external systems. + initial_generator_contexts (MutableMapping[str, google.cloud.dialogflow_v2.types.Conversation.GeneratorContext]): + Output only. A map with generator name as key + and generator context as value. """ class LifecycleState(proto.Enum): @@ -344,6 +354,48 @@ class ContentFormat(proto.Enum): message=timestamp_pb2.Timestamp, ) + class GeneratorContext(proto.Message): + r"""Represents the context of a generator. + + Attributes: + generator_type (google.cloud.dialogflow_v2.types.Conversation.GeneratorContext.GeneratorType): + Output only. The type of the generator. + """ + + class GeneratorType(proto.Enum): + r"""The available generator types. + + Values: + GENERATOR_TYPE_UNSPECIFIED (0): + Unspecified generator type. + FREE_FORM (1): + Free form generator type. + AGENT_COACHING (2): + Agent coaching generator type. + SUMMARIZATION (3): + Summarization generator type. + TRANSLATION (4): + Translation generator type. + AGENT_FEEDBACK (5): + Agent feedback generator type. + CUSTOMER_MESSAGE_GENERATION (6): + Customer message generation generator type. + """ + + GENERATOR_TYPE_UNSPECIFIED = 0 + FREE_FORM = 1 + AGENT_COACHING = 2 + SUMMARIZATION = 3 + TRANSLATION = 4 + AGENT_FEEDBACK = 5 + CUSTOMER_MESSAGE_GENERATION = 6 + + generator_type: "Conversation.GeneratorContext.GeneratorType" = proto.Field( + proto.ENUM, + number=1, + enum="Conversation.GeneratorContext.GeneratorType", + ) + name: str = proto.Field( proto.STRING, number=1, @@ -382,12 +434,25 @@ class ContentFormat(proto.Enum): number=10, message=TelephonyConnectionInfo, ) + initial_conversation_profile: gcd_conversation_profile.ConversationProfile = ( + proto.Field( + proto.MESSAGE, + number=15, + message=gcd_conversation_profile.ConversationProfile, + ) + ) ingested_context_references: MutableMapping[str, ContextReference] = proto.MapField( proto.STRING, proto.MESSAGE, number=17, message=ContextReference, ) + initial_generator_contexts: MutableMapping[str, GeneratorContext] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=18, + message=GeneratorContext, + ) class CreateConversationRequest(proto.Message): @@ -767,6 +832,9 @@ class Summary(proto.Message): sections. The key is the section's name and the value is the section's content. There is no specific format for the key or value. + sorted_text_sections (MutableSequence[google.cloud.dialogflow_v2.types.SuggestConversationSummaryResponse.Summary.SummarySection]): + Same as text_sections, but in an order that is consistent + with the order of the sections in the generator. answer_record (str): The name of the answer record. Format: @@ -778,6 +846,25 @@ class Summary(proto.Message): was not used to generate this summary. """ + class SummarySection(proto.Message): + r"""A component of the generated summary. + + Attributes: + section (str): + Output only. Name of the section. + summary (str): + Output only. Summary text for the section. + """ + + section: str = proto.Field( + proto.STRING, + number=1, + ) + summary: str = proto.Field( + proto.STRING, + number=2, + ) + text: str = proto.Field( proto.STRING, number=1, @@ -787,6 +874,13 @@ class Summary(proto.Message): proto.STRING, number=4, ) + sorted_text_sections: MutableSequence[ + "SuggestConversationSummaryResponse.Summary.SummarySection" + ] = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="SuggestConversationSummaryResponse.Summary.SummarySection", + ) answer_record: str = proto.Field( proto.STRING, number=3, @@ -1478,6 +1572,75 @@ class FilterSpecs(proto.Message): ) +class SearchKnowledgeDebugInfo(proto.Message): + r"""Debug information related to SearchKnowledge feature. + + Attributes: + datastore_response_reason (google.cloud.dialogflow_v2.types.DatastoreResponseReason): + Response reason from datastore which + indicates data serving status or answer quality + degradation. + search_knowledge_behavior (google.cloud.dialogflow_v2.types.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior): + Configured behaviors for SearchKnowledge. + ingested_context_reference_debug_info (google.cloud.dialogflow_v2.types.IngestedContextReferenceDebugInfo): + Information about parameters ingested for + search knowledge. + service_latency (google.cloud.dialogflow_v2.types.ServiceLatency): + The latency of the service. + """ + + class SearchKnowledgeBehavior(proto.Message): + r"""Configured behaviors for SearchKnowledge. + + Attributes: + answer_generation_rewriter_on (bool): + Whether data store agent rewriter was turned + on for the request. + end_user_metadata_included (bool): + Whether end_user_metadata is included in the data store + agent call. + third_party_connector_allowed (bool): + This field indicates whether third party + connectors are enabled for the project. Note + that this field only indicates if the project is + allowlisted for connectors. + """ + + answer_generation_rewriter_on: bool = proto.Field( + proto.BOOL, + number=1, + ) + end_user_metadata_included: bool = proto.Field( + proto.BOOL, + number=2, + ) + third_party_connector_allowed: bool = proto.Field( + proto.BOOL, + number=4, + ) + + datastore_response_reason: participant.DatastoreResponseReason = proto.Field( + proto.ENUM, + number=1, + enum=participant.DatastoreResponseReason, + ) + search_knowledge_behavior: SearchKnowledgeBehavior = proto.Field( + proto.MESSAGE, + number=2, + message=SearchKnowledgeBehavior, + ) + ingested_context_reference_debug_info: participant.IngestedContextReferenceDebugInfo = proto.Field( + proto.MESSAGE, + number=3, + message=participant.IngestedContextReferenceDebugInfo, + ) + service_latency: participant.ServiceLatency = proto.Field( + proto.MESSAGE, + number=4, + message=participant.ServiceLatency, + ) + + class SearchKnowledgeResponse(proto.Message): r"""The response message for [Conversations.SearchKnowledge][google.cloud.dialogflow.v2.Conversations.SearchKnowledge]. @@ -1489,6 +1652,8 @@ class SearchKnowledgeResponse(proto.Message): confidence. rewritten_query (str): The rewritten query used to search knowledge. + search_knowledge_debug_info (google.cloud.dialogflow_v2.types.SearchKnowledgeDebugInfo): + Debug info for SearchKnowledge. """ answers: MutableSequence["SearchKnowledgeAnswer"] = proto.RepeatedField( @@ -1500,6 +1665,11 @@ class SearchKnowledgeResponse(proto.Message): proto.STRING, number=3, ) + search_knowledge_debug_info: "SearchKnowledgeDebugInfo" = proto.Field( + proto.MESSAGE, + number=4, + message="SearchKnowledgeDebugInfo", + ) class SearchKnowledgeAnswer(proto.Message): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py index 2440aa429235..d6cd9137557c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/conversation_profile.py @@ -990,6 +990,30 @@ class MessageAnalysisConfig(proto.Message): [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] If Pub/Sub notification is configured, result will be in [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + enable_sentiment_analysis_v3 (bool): + Optional. Enables sentiment analysis for audio input and + conversation messages. If unspecified, defaults to false. If + this flag is set to true, other 'enable_sentiment_analysis' + fields will be ignored. + + Sentiment analysis inspects user input and identifies the + prevailing subjective opinion, especially to determine a + user's attitude as positive, negative, or neutral. + https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + For + [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + method, result will be in + [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + For + [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] + method, result will be in + [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + For + [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] + method, result will be in + [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + If Pub/Sub notification is configured, result will be in + [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. """ enable_entity_extraction: bool = proto.Field( @@ -1000,6 +1024,10 @@ class MessageAnalysisConfig(proto.Message): proto.BOOL, number=3, ) + enable_sentiment_analysis_v3: bool = proto.Field( + proto.BOOL, + number=5, + ) notification_config: "NotificationConfig" = proto.Field( proto.MESSAGE, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/generator.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/generator.py index d3ff39df4db1..318141defc28 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/generator.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/generator.py @@ -21,7 +21,12 @@ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore import proto # type: ignore -from google.cloud.dialogflow_v2.types import agent_coaching_instruction +from google.cloud.dialogflow_v2.types import ( + agent_coaching_instruction, + ces_app, + ces_tool, + toolset, +) from google.cloud.dialogflow_v2.types import tool_call as gcd_tool_call __protobuf__ = proto.module( @@ -675,6 +680,15 @@ class Generator(proto.Message): Optional. Configuration for suggestion deduping. This is only applicable to AI Coach feature. + toolset_tools (MutableSequence[google.cloud.dialogflow_v2.types.ToolsetTool]): + Optional. List of CES toolset specs that the + generator can choose from. + ces_tool_specs (MutableSequence[google.cloud.dialogflow_v2.types.CesToolSpec]): + Optional. List of CES tool specs that the + generator can choose from. + ces_app_specs (MutableSequence[google.cloud.dialogflow_v2.types.CesAppSpec]): + Optional. List of CES app specs that the + generator can choose from. """ name: str = proto.Field( @@ -737,6 +751,21 @@ class Generator(proto.Message): number=23, message="SuggestionDedupingConfig", ) + toolset_tools: MutableSequence[toolset.ToolsetTool] = proto.RepeatedField( + proto.MESSAGE, + number=27, + message=toolset.ToolsetTool, + ) + ces_tool_specs: MutableSequence[ces_tool.CesToolSpec] = proto.RepeatedField( + proto.MESSAGE, + number=28, + message=ces_tool.CesToolSpec, + ) + ces_app_specs: MutableSequence[ces_app.CesAppSpec] = proto.RepeatedField( + proto.MESSAGE, + number=29, + message=ces_app.CesAppSpec, + ) class FreeFormSuggestion(proto.Message): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py index d4cf47ffa434..17007e4941ab 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/participant.py @@ -29,6 +29,7 @@ __protobuf__ = proto.module( package="google.cloud.dialogflow.v2", manifest={ + "DatastoreResponseReason", "Participant", "Message", "CreateParticipantRequest", @@ -64,11 +65,57 @@ "AssistQueryParameters", "SuggestKnowledgeAssistRequest", "SuggestKnowledgeAssistResponse", + "IngestedContextReferenceDebugInfo", + "ServiceLatency", + "KnowledgeAssistDebugInfo", "KnowledgeAssistAnswer", }, ) +class DatastoreResponseReason(proto.Enum): + r"""Response reason from datastore which indicates data serving + status or answer quality degradation. + + Values: + DATASTORE_RESPONSE_REASON_UNSPECIFIED (0): + Default value. + NONE (1): + No specific response reason from datastore. + SEARCH_OUT_OF_QUOTA (2): + Search is blocked due to out of quota. + SEARCH_EMPTY_RESULTS (3): + Search returns empty results. + ANSWER_GENERATION_GEN_AI_DISABLED (4): + Generative AI is disabled. + ANSWER_GENERATION_OUT_OF_QUOTA (5): + Answer generation is blocked due to out of + quota. + ANSWER_GENERATION_ERROR (6): + Answer generation encounters an error. + ANSWER_GENERATION_NOT_ENOUGH_INFO (7): + Answer generation does not have enough + information to generate answer. + ANSWER_GENERATION_RAI_FAILED (8): + Answer generation is blocked by RAI + (Responsible AI) failure. + ANSWER_GENERATION_NOT_GROUNDED (9): + Answer generation is not grounded on reliable + sources. + """ + + DATASTORE_RESPONSE_REASON_UNSPECIFIED = 0 + NONE = 1 + SEARCH_OUT_OF_QUOTA = 2 + SEARCH_EMPTY_RESULTS = 3 + ANSWER_GENERATION_GEN_AI_DISABLED = 4 + ANSWER_GENERATION_OUT_OF_QUOTA = 5 + ANSWER_GENERATION_ERROR = 6 + ANSWER_GENERATION_NOT_ENOUGH_INFO = 7 + ANSWER_GENERATION_RAI_FAILED = 8 + ANSWER_GENERATION_NOT_GROUNDED = 9 + + class Participant(proto.Message): r"""Represents a conversation participant (human agent, virtual agent, end-user). @@ -794,6 +841,11 @@ class StreamingAnalyzeContentRequest(proto.Message): only one final response even if some ``Fulfillment``\ s in Dialogflow CX agent have been configured to return partial responses. + output_multiple_utterances (bool): + Optional. If multiple uttereances are + detected in the audio stream, process them + individually instead of stitching them together + to form a single utterance. enable_debugging_info (bool): If true, ``StreamingAnalyzeContentResponse.debugging_info`` will get populated. @@ -859,6 +911,10 @@ class StreamingAnalyzeContentRequest(proto.Message): proto.BOOL, number=12, ) + output_multiple_utterances: bool = proto.Field( + proto.BOOL, + number=18, + ) enable_debugging_info: bool = proto.Field( proto.BOOL, number=19, @@ -1989,6 +2045,406 @@ class SuggestKnowledgeAssistResponse(proto.Message): ) +class IngestedContextReferenceDebugInfo(proto.Message): + r"""Debug information related to ingested context reference. + + Attributes: + project_not_allowlisted (bool): + Indicates if the project is allowlisted to + use ingested context reference. + context_reference_retrieved (bool): + The status of context_reference retrieval from database. + ingested_parameters_debug_info (MutableSequence[google.cloud.dialogflow_v2.types.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo]): + Parameters ingested from the context + reference. + """ + + class IngestedParameterDebugInfo(proto.Message): + r"""Debug information related to ingested parameters from context + reference. + + Attributes: + parameter (str): + The name of the parameter in the context + reference. + ingestion_status (google.cloud.dialogflow_v2.types.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus): + The ingestion status for this specific + parameter. + """ + + class IngestionStatus(proto.Enum): + r"""Enum representing the various states of parameter ingestion. + + Values: + INGESTION_STATUS_UNSPECIFIED (0): + Default value, indicates that the ingestion + status is not specified. + INGESTION_STATUS_SUCCEEDED (1): + Indicates that the parameter was successfully + ingested. + INGESTION_STATUS_CONTEXT_NOT_AVAILABLE (2): + Indicates that the parameter was not + available for ingestion. + INGESTION_STATUS_PARSE_FAILED (3): + Indicates that there was a failure parsing + the parameter content. + INGESTION_STATUS_INVALID_ENTRY (4): + Indicates that the context reference had an + unexpected number of content entries as Context + reference should only have one entry. + INGESTION_STATUS_INVALID_FORMAT (5): + Indicates that the context reference content + was not in the expected format (e.g., JSON). + INGESTION_STATUS_LANGUAGE_MISMATCH (6): + Indicates that the context reference language + does not match the conversation language. + """ + + INGESTION_STATUS_UNSPECIFIED = 0 + INGESTION_STATUS_SUCCEEDED = 1 + INGESTION_STATUS_CONTEXT_NOT_AVAILABLE = 2 + INGESTION_STATUS_PARSE_FAILED = 3 + INGESTION_STATUS_INVALID_ENTRY = 4 + INGESTION_STATUS_INVALID_FORMAT = 5 + INGESTION_STATUS_LANGUAGE_MISMATCH = 6 + + parameter: str = proto.Field( + proto.STRING, + number=1, + ) + ingestion_status: "IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus" = proto.Field( + proto.ENUM, + number=2, + enum="IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus", + ) + + project_not_allowlisted: bool = proto.Field( + proto.BOOL, + number=1, + ) + context_reference_retrieved: bool = proto.Field( + proto.BOOL, + number=2, + ) + ingested_parameters_debug_info: MutableSequence[IngestedParameterDebugInfo] = ( + proto.RepeatedField( + proto.MESSAGE, + number=3, + message=IngestedParameterDebugInfo, + ) + ) + + +class ServiceLatency(proto.Message): + r"""Message to represent the latency of the service. + + Attributes: + internal_service_latencies (MutableSequence[google.cloud.dialogflow_v2.types.ServiceLatency.InternalServiceLatency]): + A list of internal service latencies. + """ + + class InternalServiceLatency(proto.Message): + r"""Message to represent the latency of an internal service. + + Attributes: + step (str): + The name of the internal service. + latency_ms (float): + The latency of the internal service in + milliseconds. + start_time (google.protobuf.timestamp_pb2.Timestamp): + The start time of the internal service. + complete_time (google.protobuf.timestamp_pb2.Timestamp): + The completion time of the internal service. + """ + + step: str = proto.Field( + proto.STRING, + number=1, + ) + latency_ms: float = proto.Field( + proto.FLOAT, + number=2, + ) + start_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + complete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + + internal_service_latencies: MutableSequence[InternalServiceLatency] = ( + proto.RepeatedField( + proto.MESSAGE, + number=1, + message=InternalServiceLatency, + ) + ) + + +class KnowledgeAssistDebugInfo(proto.Message): + r"""Debug information related to Knowledge Assist feature. + + Attributes: + query_generation_failure_reason (google.cloud.dialogflow_v2.types.KnowledgeAssistDebugInfo.QueryGenerationFailureReason): + Reason for query generation. + query_categorization_failure_reason (google.cloud.dialogflow_v2.types.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason): + Reason for query categorization. + datastore_response_reason (google.cloud.dialogflow_v2.types.DatastoreResponseReason): + Response reason from datastore which + indicates data serving status or answer quality + degradation. + knowledge_assist_behavior (google.cloud.dialogflow_v2.types.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior): + Configured behaviors for Knowedge Assist. + ingested_context_reference_debug_info (google.cloud.dialogflow_v2.types.IngestedContextReferenceDebugInfo): + Information about parameters ingested for + search knowledge. + service_latency (google.cloud.dialogflow_v2.types.ServiceLatency): + The latency of the service. + """ + + class QueryGenerationFailureReason(proto.Enum): + r"""Reason for query generation failure. + + Values: + QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED (0): + Default value. + QUERY_GENERATION_OUT_OF_QUOTA (1): + Query generation is blocked due to out of + quota. + QUERY_GENERATION_FAILED (2): + Call to Knowedge Assist query generation + model fails. + QUERY_GENERATION_NO_QUERY_GENERATED (3): + Query generation model decides that there is + no new topic change or there has been similar + queries generated in the previous turns. + QUERY_GENERATION_RAI_FAILED (4): + Knowedge Assist generated query is blocked by + RAI (Responsible AI). + NOT_IN_ALLOWLIST (5): + Query generation is blocked by Knowledge + Assist conversation profile level / agent id + level filtering. + QUERY_GENERATION_QUERY_REDACTED (6): + The generated query is blocked due to + redaction. + QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED (10): + Query generation failed due to LLM response + parse failure. + QUERY_GENERATION_EMPTY_CONVERSATION (11): + The conversation has no messages. + QUERY_GENERATION_EMPTY_LAST_MESSAGE (12): + The last message in the conversation is + empty. + QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET (13): + The trigger event condition is not met. This occurs in the + following scenarios: + + 1. The trigger_event is CUSTOMER_MESSAGE or UNSPECIFIED, but + the last message is not from the customer. + 2. The trigger_event is AGENT_MESSAGE, but the last message + is not from the agent. + """ + + QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0 + QUERY_GENERATION_OUT_OF_QUOTA = 1 + QUERY_GENERATION_FAILED = 2 + QUERY_GENERATION_NO_QUERY_GENERATED = 3 + QUERY_GENERATION_RAI_FAILED = 4 + NOT_IN_ALLOWLIST = 5 + QUERY_GENERATION_QUERY_REDACTED = 6 + QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10 + QUERY_GENERATION_EMPTY_CONVERSATION = 11 + QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12 + QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13 + + class QueryCategorizationFailureReason(proto.Enum): + r"""Reason for query categorization failure. + + Values: + QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED (0): + Default value. + QUERY_CATEGORIZATION_INVALID_CONFIG (1): + Vertex AI Search config supplied for query + categorization is invalid. + QUERY_CATEGORIZATION_RESULT_NOT_FOUND (2): + Vertex AI Search result does not contain a + query categorization result. + QUERY_CATEGORIZATION_FAILED (3): + Vertex AI Search call fails. + """ + + QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0 + QUERY_CATEGORIZATION_INVALID_CONFIG = 1 + QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2 + QUERY_CATEGORIZATION_FAILED = 3 + + class KnowledgeAssistBehavior(proto.Message): + r"""Configured behaviors for Knowedge Assist. + + Attributes: + answer_generation_rewriter_on (bool): + Whether data store agent rewriter was turned + off for the request. + end_user_metadata_included (bool): + Whether end_user_metadata is included in the data store + agent call. + return_query_only (bool): + Whether customers configured to return query + only in the conversation profile. + use_pubsub_delivery (bool): + Whether customers configured to use pubsub to + deliver. + disable_sync_delivery (bool): + Whether customers configured to disable the + synchronous delivery of Knowedge Assist + response. + previous_queries_included (bool): + Whether previously suggested queries are + included in the query generation process. + use_translated_message (bool): + Translated message is included in query + generation process. + use_custom_safety_filter_level (bool): + Safety filter is adjusted by user. + conversation_transcript_has_mixed_languages (bool): + Conversation transcript has mixed languages. + query_generation_agent_language_mismatch (bool): + Whether the agent language from the + translation generator mismatches the end-user + language. + query_generation_end_user_language_mismatch (bool): + Whether the end-user language from the + translation generator mismatches the end-user + language. + third_party_connector_allowed (bool): + This field indicates whether third party + connectors are enabled for the project + multiple_queries_generated (bool): + Indicates that the query generation model + generated multiple queries. + query_contained_search_context (bool): + Indicates that the generated query contains + search context. + invalid_items_query_suggestion_skipped (bool): + Indicates that invalid items were skipped + when parsing the LLM response. + primary_query_redacted_and_replaced (bool): + True if the primary suggested query was + redacted and replaced by an additional query. + appended_search_context_count (int): + The number of search contexts appended to the + query. + """ + + answer_generation_rewriter_on: bool = proto.Field( + proto.BOOL, + number=1, + ) + end_user_metadata_included: bool = proto.Field( + proto.BOOL, + number=2, + ) + return_query_only: bool = proto.Field( + proto.BOOL, + number=4, + ) + use_pubsub_delivery: bool = proto.Field( + proto.BOOL, + number=5, + ) + disable_sync_delivery: bool = proto.Field( + proto.BOOL, + number=6, + ) + previous_queries_included: bool = proto.Field( + proto.BOOL, + number=7, + ) + use_translated_message: bool = proto.Field( + proto.BOOL, + number=8, + ) + use_custom_safety_filter_level: bool = proto.Field( + proto.BOOL, + number=9, + ) + conversation_transcript_has_mixed_languages: bool = proto.Field( + proto.BOOL, + number=10, + ) + query_generation_agent_language_mismatch: bool = proto.Field( + proto.BOOL, + number=11, + ) + query_generation_end_user_language_mismatch: bool = proto.Field( + proto.BOOL, + number=12, + ) + third_party_connector_allowed: bool = proto.Field( + proto.BOOL, + number=13, + ) + multiple_queries_generated: bool = proto.Field( + proto.BOOL, + number=14, + ) + query_contained_search_context: bool = proto.Field( + proto.BOOL, + number=15, + ) + invalid_items_query_suggestion_skipped: bool = proto.Field( + proto.BOOL, + number=16, + ) + primary_query_redacted_and_replaced: bool = proto.Field( + proto.BOOL, + number=17, + ) + appended_search_context_count: int = proto.Field( + proto.INT32, + number=18, + ) + + query_generation_failure_reason: QueryGenerationFailureReason = proto.Field( + proto.ENUM, + number=1, + enum=QueryGenerationFailureReason, + ) + query_categorization_failure_reason: QueryCategorizationFailureReason = proto.Field( + proto.ENUM, + number=2, + enum=QueryCategorizationFailureReason, + ) + datastore_response_reason: "DatastoreResponseReason" = proto.Field( + proto.ENUM, + number=3, + enum="DatastoreResponseReason", + ) + knowledge_assist_behavior: KnowledgeAssistBehavior = proto.Field( + proto.MESSAGE, + number=4, + message=KnowledgeAssistBehavior, + ) + ingested_context_reference_debug_info: "IngestedContextReferenceDebugInfo" = ( + proto.Field( + proto.MESSAGE, + number=5, + message="IngestedContextReferenceDebugInfo", + ) + ) + service_latency: "ServiceLatency" = proto.Field( + proto.MESSAGE, + number=6, + message="ServiceLatency", + ) + + class KnowledgeAssistAnswer(proto.Message): r"""Represents a Knowledge Assist answer. @@ -2004,6 +2460,9 @@ class KnowledgeAssistAnswer(proto.Message): answer_record (str): The name of the answer record. Format: ``projects//locations//answer Records/``. + knowledge_assist_debug_info (google.cloud.dialogflow_v2.types.KnowledgeAssistDebugInfo): + Debug information related to Knowledge Assist + feature. """ class SuggestedQuery(proto.Message): @@ -2139,6 +2598,11 @@ class Snippet(proto.Message): proto.STRING, number=3, ) + knowledge_assist_debug_info: "KnowledgeAssistDebugInfo" = proto.Field( + proto.MESSAGE, + number=7, + message="KnowledgeAssistDebugInfo", + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/tool_call.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/tool_call.py index 912568c6f8d0..d1edc4e4ad90 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/tool_call.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/tool_call.py @@ -34,6 +34,10 @@ class ToolCall(proto.Message): r"""Represents a call of a specific tool's action with the specified inputs. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -43,6 +47,21 @@ class ToolCall(proto.Message): associated with this call. Format: ``projects//locations//tools/``. + This field is a member of `oneof`_ ``source``. + ces_tool (str): + Optional. CES tool name for this call. Format: + ``projects//locations//apps//tools/``. + + This field is a member of `oneof`_ ``source``. + ces_toolset (str): + Optional. CES toolset name for this call. Format: + ``projects//locations//apps//toolsets/ToolsetID>``. + + This field is a member of `oneof`_ ``source``. + ces_app (str): + Optional. CES app name for this call. Format: + ``projects//locations//apps/``. + This field is a member of `oneof`_ ``source``. tool_display_name (str): Optional. A human readable short name of the @@ -86,6 +105,21 @@ class State(proto.Enum): number=1, oneof="source", ) + ces_tool: str = proto.Field( + proto.STRING, + number=11, + oneof="source", + ) + ces_toolset: str = proto.Field( + proto.STRING, + number=12, + oneof="source", + ) + ces_app: str = proto.Field( + proto.STRING, + number=8, + oneof="source", + ) tool_display_name: str = proto.Field( proto.STRING, number=9, @@ -135,6 +169,21 @@ class ToolCallResult(proto.Message): associated with this call. Format: ``projects//locations//tools/``. + This field is a member of `oneof`_ ``source``. + ces_toolset (str): + Optional. CES toolset name for this call. Format: + ``projects//locations//apps//toolsets/ToolsetID>``. + + This field is a member of `oneof`_ ``source``. + ces_tool (str): + Optional. CES tool name for this call. Format: + ``projects//locations//apps//tools/``. + + This field is a member of `oneof`_ ``source``. + ces_app (str): + Optional. CES app name for this call. Format: + ``projects//locations//apps/``. + This field is a member of `oneof`_ ``source``. action (str): Optional. The name of the tool's action @@ -180,6 +229,21 @@ class Error(proto.Message): number=1, oneof="source", ) + ces_toolset: str = proto.Field( + proto.STRING, + number=13, + oneof="source", + ) + ces_tool: str = proto.Field( + proto.STRING, + number=12, + oneof="source", + ) + ces_app: str = proto.Field( + proto.STRING, + number=11, + oneof="source", + ) action: str = proto.Field( proto.STRING, number=2, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/toolset.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/toolset.py new file mode 100644 index 000000000000..1b5b51b4a66e --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2/types/toolset.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.dialogflow_v2.types import tool + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2", + manifest={ + "ToolsetTool", + }, +) + + +class ToolsetTool(proto.Message): + r"""A tool that is created from a toolset. + + Attributes: + toolset (str): + Required. The name of the toolset to retrieve the schema + for. Format: + ``projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`` + operation_id (str): + Optional. The operationId field of the + OpenAPI endpoint. The operationId must be + present in the toolset's definition. + confirmation_requirement (google.cloud.dialogflow_v2.types.Tool.ConfirmationRequirement): + Optional. Indicates whether the tool requires + human confirmation. + """ + + toolset: str = proto.Field( + proto.STRING, + number=1, + ) + operation_id: str = proto.Field( + proto.STRING, + number=2, + ) + confirmation_requirement: tool.Tool.ConfirmationRequirement = proto.Field( + proto.ENUM, + number=3, + enum=tool.Tool.ConfirmationRequirement, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py index cd836430eaab..ec1eae574285 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/__init__.py @@ -105,6 +105,8 @@ TelephonyDtmfEvents, VoiceSelectionParams, ) +from .types.ces_app import CesAppSpec +from .types.ces_tool import CesToolSpec from .types.context import ( Context, CreateContextRequest, @@ -136,6 +138,7 @@ ListMessagesRequest, ListMessagesResponse, SearchKnowledgeAnswer, + SearchKnowledgeDebugInfo, SearchKnowledgeRequest, SearchKnowledgeResponse, SuggestConversationSummaryRequest, @@ -290,15 +293,18 @@ CompileSuggestionRequest, CompileSuggestionResponse, CreateParticipantRequest, + DatastoreResponseReason, DialogflowAssistAnswer, DtmfParameters, FaqAnswer, GenerateSuggestionsResponse, GetParticipantRequest, + IngestedContextReferenceDebugInfo, InputTextConfig, IntentInput, IntentSuggestion, KnowledgeAssistAnswer, + KnowledgeAssistDebugInfo, ListParticipantsRequest, ListParticipantsResponse, ListSuggestionsRequest, @@ -308,6 +314,7 @@ OutputAudio, Participant, ResponseMessage, + ServiceLatency, SmartReplyAnswer, StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse, @@ -380,6 +387,7 @@ UpdateToolRequest, ) from .types.tool_call import ToolCall, ToolCallResult +from .types.toolset import ToolsetTool from .types.validation_result import ValidationError, ValidationResult from .types.version import ( CreateVersionRequest, @@ -541,6 +549,8 @@ def _get_version(dependency_name): "BatchUpdateIntentsResponse", "BidiStreamingAnalyzeContentRequest", "BidiStreamingAnalyzeContentResponse", + "CesAppSpec", + "CesToolSpec", "ClearSuggestionFeatureConfigOperationMetadata", "ClearSuggestionFeatureConfigRequest", "CloudConversationDebuggingInfo", @@ -574,6 +584,7 @@ def _get_version(dependency_name): "CreateToolRequest", "CreateVersionRequest", "CustomPronunciationParams", + "DatastoreResponseReason", "DeleteAgentRequest", "DeleteAllContextsRequest", "DeleteContextRequest", @@ -662,6 +673,7 @@ def _get_version(dependency_name): "InferenceParameter", "IngestContextReferencesRequest", "IngestContextReferencesResponse", + "IngestedContextReferenceDebugInfo", "InitializeEncryptionSpecMetadata", "InitializeEncryptionSpecRequest", "InitializeEncryptionSpecResponse", @@ -675,6 +687,7 @@ def _get_version(dependency_name): "IntentsClient", "KnowledgeAnswers", "KnowledgeAssistAnswer", + "KnowledgeAssistDebugInfo", "KnowledgeBase", "KnowledgeBasesClient", "KnowledgeOperationMetadata", @@ -739,11 +752,13 @@ def _get_version(dependency_name): "SearchAgentsRequest", "SearchAgentsResponse", "SearchKnowledgeAnswer", + "SearchKnowledgeDebugInfo", "SearchKnowledgeRequest", "SearchKnowledgeResponse", "Sentiment", "SentimentAnalysisRequestConfig", "SentimentAnalysisResult", + "ServiceLatency", "SessionEntityType", "SessionEntityTypesClient", "SessionsClient", @@ -794,6 +809,7 @@ def _get_version(dependency_name): "ToolCall", "ToolCallResult", "ToolsClient", + "ToolsetTool", "TrainAgentRequest", "TriggerEvent", "UndeletePhoneNumberRequest", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py index 43508ed49a9d..8fb49700ec10 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py @@ -85,6 +85,8 @@ class AnswerRecordsAsyncClient: parse_answer_record_path = staticmethod( AnswerRecordsClient.parse_answer_record_path ) + app_path = staticmethod(AnswerRecordsClient.app_path) + parse_app_path = staticmethod(AnswerRecordsClient.parse_app_path) context_path = staticmethod(AnswerRecordsClient.context_path) parse_context_path = staticmethod(AnswerRecordsClient.parse_context_path) document_path = staticmethod(AnswerRecordsClient.document_path) @@ -93,6 +95,10 @@ class AnswerRecordsAsyncClient: parse_intent_path = staticmethod(AnswerRecordsClient.parse_intent_path) tool_path = staticmethod(AnswerRecordsClient.tool_path) parse_tool_path = staticmethod(AnswerRecordsClient.parse_tool_path) + tool_path = staticmethod(AnswerRecordsClient.tool_path) + parse_tool_path = staticmethod(AnswerRecordsClient.parse_tool_path) + toolset_path = staticmethod(AnswerRecordsClient.toolset_path) + parse_toolset_path = staticmethod(AnswerRecordsClient.parse_toolset_path) common_billing_account_path = staticmethod( AnswerRecordsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py index ff8fbd219e65..4ec0fcaedc1d 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/answer_records/client.py @@ -252,6 +252,28 @@ def parse_answer_record_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def context_path( project: str, @@ -335,6 +357,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py index 440358830bd0..f4970d5604d9 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/async_client.py @@ -49,7 +49,12 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2beta1.services.conversations import pagers -from google.cloud.dialogflow_v2beta1.types import conversation, generator, participant +from google.cloud.dialogflow_v2beta1.types import ( + conversation, + conversation_profile, + generator, + participant, +) from google.cloud.dialogflow_v2beta1.types import conversation as gcd_conversation from .client import ConversationsClient @@ -86,6 +91,8 @@ class ConversationsAsyncClient: parse_answer_record_path = staticmethod( ConversationsClient.parse_answer_record_path ) + app_path = staticmethod(ConversationsClient.app_path) + parse_app_path = staticmethod(ConversationsClient.parse_app_path) conversation_path = staticmethod(ConversationsClient.conversation_path) parse_conversation_path = staticmethod(ConversationsClient.parse_conversation_path) conversation_model_path = staticmethod(ConversationsClient.conversation_model_path) @@ -120,6 +127,10 @@ class ConversationsAsyncClient: parse_phrase_set_path = staticmethod(ConversationsClient.parse_phrase_set_path) tool_path = staticmethod(ConversationsClient.tool_path) parse_tool_path = staticmethod(ConversationsClient.parse_tool_path) + tool_path = staticmethod(ConversationsClient.tool_path) + parse_tool_path = staticmethod(ConversationsClient.parse_tool_path) + toolset_path = staticmethod(ConversationsClient.toolset_path) + parse_toolset_path = staticmethod(ConversationsClient.parse_toolset_path) common_billing_account_path = staticmethod( ConversationsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py index 296f364ac5c2..6a3060f9a2de 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/conversations/client.py @@ -66,7 +66,12 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2beta1.services.conversations import pagers -from google.cloud.dialogflow_v2beta1.types import conversation, generator, participant +from google.cloud.dialogflow_v2beta1.types import ( + conversation, + conversation_profile, + generator, + participant, +) from google.cloud.dialogflow_v2beta1.types import conversation as gcd_conversation from .transports.base import DEFAULT_CLIENT_INFO, ConversationsTransport @@ -267,6 +272,28 @@ def parse_answer_record_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def conversation_path( project: str, @@ -505,6 +532,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/async_client.py index f1a0bdcf0d7c..b08d2a5f4127 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/async_client.py @@ -86,6 +86,8 @@ class GeneratorEvaluationsAsyncClient: _DEFAULT_ENDPOINT_TEMPLATE = GeneratorEvaluationsClient._DEFAULT_ENDPOINT_TEMPLATE _DEFAULT_UNIVERSE = GeneratorEvaluationsClient._DEFAULT_UNIVERSE + app_path = staticmethod(GeneratorEvaluationsClient.app_path) + parse_app_path = staticmethod(GeneratorEvaluationsClient.parse_app_path) generator_path = staticmethod(GeneratorEvaluationsClient.generator_path) parse_generator_path = staticmethod(GeneratorEvaluationsClient.parse_generator_path) generator_evaluation_path = staticmethod( @@ -96,6 +98,10 @@ class GeneratorEvaluationsAsyncClient: ) tool_path = staticmethod(GeneratorEvaluationsClient.tool_path) parse_tool_path = staticmethod(GeneratorEvaluationsClient.parse_tool_path) + tool_path = staticmethod(GeneratorEvaluationsClient.tool_path) + parse_tool_path = staticmethod(GeneratorEvaluationsClient.parse_tool_path) + toolset_path = staticmethod(GeneratorEvaluationsClient.toolset_path) + parse_toolset_path = staticmethod(GeneratorEvaluationsClient.parse_toolset_path) common_billing_account_path = staticmethod( GeneratorEvaluationsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/client.py index d6abe20edb25..45b415e7c3d2 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generator_evaluations/client.py @@ -239,6 +239,28 @@ def transport(self) -> GeneratorEvaluationsTransport: """ return self._transport + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def generator_path( project: str, @@ -307,6 +329,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/async_client.py index 5e1ac807480a..b7d1053e4945 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/async_client.py @@ -50,7 +50,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2beta1.services.generators import pagers -from google.cloud.dialogflow_v2beta1.types import generator +from google.cloud.dialogflow_v2beta1.types import ces_app, ces_tool, generator, toolset from google.cloud.dialogflow_v2beta1.types import generator as gcd_generator from .client import GeneratorsClient @@ -84,10 +84,16 @@ class GeneratorsAsyncClient: _DEFAULT_ENDPOINT_TEMPLATE = GeneratorsClient._DEFAULT_ENDPOINT_TEMPLATE _DEFAULT_UNIVERSE = GeneratorsClient._DEFAULT_UNIVERSE + app_path = staticmethod(GeneratorsClient.app_path) + parse_app_path = staticmethod(GeneratorsClient.parse_app_path) generator_path = staticmethod(GeneratorsClient.generator_path) parse_generator_path = staticmethod(GeneratorsClient.parse_generator_path) tool_path = staticmethod(GeneratorsClient.tool_path) parse_tool_path = staticmethod(GeneratorsClient.parse_tool_path) + tool_path = staticmethod(GeneratorsClient.tool_path) + parse_tool_path = staticmethod(GeneratorsClient.parse_tool_path) + toolset_path = staticmethod(GeneratorsClient.toolset_path) + parse_toolset_path = staticmethod(GeneratorsClient.parse_toolset_path) common_billing_account_path = staticmethod( GeneratorsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/client.py index 127c45a5f3c7..d026dc50451a 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/generators/client.py @@ -67,7 +67,7 @@ from google.longrunning import operations_pb2 # type: ignore from google.cloud.dialogflow_v2beta1.services.generators import pagers -from google.cloud.dialogflow_v2beta1.types import generator +from google.cloud.dialogflow_v2beta1.types import ces_app, ces_tool, generator, toolset from google.cloud.dialogflow_v2beta1.types import generator as gcd_generator from .transports.base import DEFAULT_CLIENT_INFO, GeneratorsTransport @@ -237,6 +237,28 @@ def transport(self) -> GeneratorsTransport: """ return self._transport + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def generator_path( project: str, @@ -281,6 +303,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py index ea752c961ac2..c4291d75ad12 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/async_client.py @@ -86,6 +86,8 @@ class ParticipantsAsyncClient: answer_record_path = staticmethod(ParticipantsClient.answer_record_path) parse_answer_record_path = staticmethod(ParticipantsClient.parse_answer_record_path) + app_path = staticmethod(ParticipantsClient.app_path) + parse_app_path = staticmethod(ParticipantsClient.parse_app_path) context_path = staticmethod(ParticipantsClient.context_path) parse_context_path = staticmethod(ParticipantsClient.parse_context_path) document_path = staticmethod(ParticipantsClient.document_path) @@ -104,6 +106,10 @@ class ParticipantsAsyncClient: ) tool_path = staticmethod(ParticipantsClient.tool_path) parse_tool_path = staticmethod(ParticipantsClient.parse_tool_path) + tool_path = staticmethod(ParticipantsClient.tool_path) + parse_tool_path = staticmethod(ParticipantsClient.parse_tool_path) + toolset_path = staticmethod(ParticipantsClient.toolset_path) + parse_toolset_path = staticmethod(ParticipantsClient.parse_toolset_path) common_billing_account_path = staticmethod( ParticipantsClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py index 9f72fefeec53..64d781131a13 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/participants/client.py @@ -254,6 +254,28 @@ def parse_answer_record_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def app_path( + project: str, + location: str, + app: str, + ) -> str: + """Returns a fully-qualified app string.""" + return "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + + @staticmethod + def parse_app_path(path: str) -> Dict[str, str]: + """Parses a app path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def context_path( project: str, @@ -427,6 +449,54 @@ def parse_tool_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def tool_path( + project: str, + location: str, + app: str, + tool: str, + ) -> str: + """Returns a fully-qualified tool string.""" + return "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + + @staticmethod + def parse_tool_path(path: str) -> Dict[str, str]: + """Parses a tool path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/tools/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + + @staticmethod + def toolset_path( + project: str, + location: str, + app: str, + toolset: str, + ) -> str: + """Returns a fully-qualified toolset string.""" + return "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + + @staticmethod + def parse_toolset_path(path: str) -> Dict[str, str]: + """Parses a toolset path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/apps/(?P.+?)/toolsets/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/async_client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/async_client.py index 1c48b6fb5b57..4b0a387666ce 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/async_client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/async_client.py @@ -45,6 +45,7 @@ OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -82,6 +83,8 @@ class PhoneNumbersAsyncClient: phone_number_path = staticmethod(PhoneNumbersClient.phone_number_path) parse_phone_number_path = staticmethod(PhoneNumbersClient.parse_phone_number_path) + sip_trunk_path = staticmethod(PhoneNumbersClient.sip_trunk_path) + parse_sip_trunk_path = staticmethod(PhoneNumbersClient.parse_sip_trunk_path) common_billing_account_path = staticmethod( PhoneNumbersClient.common_billing_account_path ) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/client.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/client.py index fa5f32da9a9f..ef83561a07f0 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/client.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/services/phone_numbers/client.py @@ -62,6 +62,7 @@ _LOGGER = std_logging.getLogger(__name__) import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from google.cloud.location import locations_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -252,6 +253,28 @@ def parse_phone_number_path(path: str) -> Dict[str, str]: ) return m.groupdict() if m else {} + @staticmethod + def sip_trunk_path( + project: str, + location: str, + siptrunk: str, + ) -> str: + """Returns a fully-qualified sip_trunk string.""" + return "projects/{project}/locations/{location}/sipTrunks/{siptrunk}".format( + project=project, + location=location, + siptrunk=siptrunk, + ) + + @staticmethod + def parse_sip_trunk_path(path: str) -> Dict[str, str]: + """Parses a sip_trunk path into its component segments.""" + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/sipTrunks/(?P.+?)$", + path, + ) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py index 9c9969e82f7f..819e5212d21c 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/__init__.py @@ -58,6 +58,12 @@ TelephonyDtmfEvents, VoiceSelectionParams, ) +from .ces_app import ( + CesAppSpec, +) +from .ces_tool import ( + CesToolSpec, +) from .context import ( Context, CreateContextRequest, @@ -89,6 +95,7 @@ ListMessagesRequest, ListMessagesResponse, SearchKnowledgeAnswer, + SearchKnowledgeDebugInfo, SearchKnowledgeRequest, SearchKnowledgeResponse, SuggestConversationSummaryRequest, @@ -253,15 +260,18 @@ CompileSuggestionRequest, CompileSuggestionResponse, CreateParticipantRequest, + DatastoreResponseReason, DialogflowAssistAnswer, DtmfParameters, FaqAnswer, GenerateSuggestionsResponse, GetParticipantRequest, + IngestedContextReferenceDebugInfo, InputTextConfig, IntentInput, IntentSuggestion, KnowledgeAssistAnswer, + KnowledgeAssistDebugInfo, ListParticipantsRequest, ListParticipantsResponse, ListSuggestionsRequest, @@ -271,6 +281,7 @@ OutputAudio, Participant, ResponseMessage, + ServiceLatency, SmartReplyAnswer, StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse, @@ -346,6 +357,9 @@ ToolCall, ToolCallResult, ) +from .toolset import ( + ToolsetTool, +) from .validation_result import ( ValidationError, ValidationResult, @@ -403,6 +417,8 @@ "SpeechModelVariant", "SsmlVoiceGender", "TelephonyDtmf", + "CesAppSpec", + "CesToolSpec", "Context", "CreateContextRequest", "DeleteAllContextsRequest", @@ -431,6 +447,7 @@ "ListMessagesRequest", "ListMessagesResponse", "SearchKnowledgeAnswer", + "SearchKnowledgeDebugInfo", "SearchKnowledgeRequest", "SearchKnowledgeResponse", "SuggestConversationSummaryRequest", @@ -570,10 +587,12 @@ "FaqAnswer", "GenerateSuggestionsResponse", "GetParticipantRequest", + "IngestedContextReferenceDebugInfo", "InputTextConfig", "IntentInput", "IntentSuggestion", "KnowledgeAssistAnswer", + "KnowledgeAssistDebugInfo", "ListParticipantsRequest", "ListParticipantsResponse", "ListSuggestionsRequest", @@ -583,6 +602,7 @@ "OutputAudio", "Participant", "ResponseMessage", + "ServiceLatency", "SmartReplyAnswer", "StreamingAnalyzeContentRequest", "StreamingAnalyzeContentResponse", @@ -600,6 +620,7 @@ "SuggestSmartRepliesRequest", "SuggestSmartRepliesResponse", "UpdateParticipantRequest", + "DatastoreResponseReason", "DeletePhoneNumberRequest", "ListPhoneNumbersRequest", "ListPhoneNumbersResponse", @@ -645,6 +666,7 @@ "UpdateToolRequest", "ToolCall", "ToolCallResult", + "ToolsetTool", "ValidationError", "ValidationResult", "CreateVersionRequest", diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/ces_app.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/ces_app.py new file mode 100644 index 000000000000..7c3688df4c5b --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/ces_app.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.dialogflow_v2beta1.types import tool + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2beta1", + manifest={ + "CesAppSpec", + }, +) + + +class CesAppSpec(proto.Message): + r"""Spec of CES app that the generator can choose from. + + Attributes: + ces_app (str): + Optional. Format: + ``projects//locations//apps/``. + confirmation_requirement (google.cloud.dialogflow_v2beta1.types.Tool.ConfirmationRequirement): + Optional. Indicates whether the app requires + human confirmation. + """ + + ces_app: str = proto.Field( + proto.STRING, + number=1, + ) + confirmation_requirement: tool.Tool.ConfirmationRequirement = proto.Field( + proto.ENUM, + number=2, + enum=tool.Tool.ConfirmationRequirement, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/ces_tool.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/ces_tool.py new file mode 100644 index 000000000000..e44c12132469 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/ces_tool.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.dialogflow_v2beta1.types import tool + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2beta1", + manifest={ + "CesToolSpec", + }, +) + + +class CesToolSpec(proto.Message): + r"""Spec of CES tool that the generator can choose from. + + Attributes: + ces_tool (str): + Optional. Format: + ``projects//locations//apps//tools/``. + confirmation_requirement (google.cloud.dialogflow_v2beta1.types.Tool.ConfirmationRequirement): + Optional. Indicates whether the tool requires + human confirmation. + """ + + ces_tool: str = proto.Field( + proto.STRING, + number=1, + ) + confirmation_requirement: tool.Tool.ConfirmationRequirement = proto.Field( + proto.ENUM, + number=2, + enum=tool.Tool.ConfirmationRequirement, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py index 732f0e10aa84..774a3fb17103 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation.py @@ -51,6 +51,7 @@ "GenerateStatelessSuggestionRequest", "GenerateStatelessSuggestionResponse", "SearchKnowledgeRequest", + "SearchKnowledgeDebugInfo", "SearchKnowledgeResponse", "SearchKnowledgeAnswer", "GenerateSuggestionsRequest", @@ -108,9 +109,18 @@ class Conversation(proto.Message): telephony_connection_info (google.cloud.dialogflow_v2beta1.types.Conversation.TelephonyConnectionInfo): Output only. The telephony connection information. + initial_conversation_profile (google.cloud.dialogflow_v2beta1.types.ConversationProfile): + Optional. Output only. The initial + conversation profile to be used to configure + this conversation, which is a copy of the + conversation profile config read at conversation + creation time. ingested_context_references (MutableMapping[str, google.cloud.dialogflow_v2beta1.types.Conversation.ContextReference]): Output only. The context reference updates provided by external systems. + initial_generator_contexts (MutableMapping[str, google.cloud.dialogflow_v2beta1.types.Conversation.GeneratorContext]): + Output only. A map with generator name as key + and generator context as value. """ class LifecycleState(proto.Enum): @@ -347,6 +357,48 @@ class ContentFormat(proto.Enum): message=timestamp_pb2.Timestamp, ) + class GeneratorContext(proto.Message): + r"""Represents the context of a generator. + + Attributes: + generator_type (google.cloud.dialogflow_v2beta1.types.Conversation.GeneratorContext.GeneratorType): + Output only. The type of the generator. + """ + + class GeneratorType(proto.Enum): + r"""The available generator types. + + Values: + GENERATOR_TYPE_UNSPECIFIED (0): + Unspecified generator type. + FREE_FORM (1): + Free form generator type. + AGENT_COACHING (2): + Agent coaching generator type. + SUMMARIZATION (3): + Summarization generator type. + TRANSLATION (4): + Translation generator type. + AGENT_FEEDBACK (5): + Agent feedback generator type. + CUSTOMER_MESSAGE_GENERATION (6): + Customer message generation generator type. + """ + + GENERATOR_TYPE_UNSPECIFIED = 0 + FREE_FORM = 1 + AGENT_COACHING = 2 + SUMMARIZATION = 3 + TRANSLATION = 4 + AGENT_FEEDBACK = 5 + CUSTOMER_MESSAGE_GENERATION = 6 + + generator_type: "Conversation.GeneratorContext.GeneratorType" = proto.Field( + proto.ENUM, + number=1, + enum="Conversation.GeneratorContext.GeneratorType", + ) + name: str = proto.Field( proto.STRING, number=1, @@ -385,12 +437,25 @@ class ContentFormat(proto.Enum): number=10, message=TelephonyConnectionInfo, ) + initial_conversation_profile: gcd_conversation_profile.ConversationProfile = ( + proto.Field( + proto.MESSAGE, + number=15, + message=gcd_conversation_profile.ConversationProfile, + ) + ) ingested_context_references: MutableMapping[str, ContextReference] = proto.MapField( proto.STRING, proto.MESSAGE, number=17, message=ContextReference, ) + initial_generator_contexts: MutableMapping[str, GeneratorContext] = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=18, + message=GeneratorContext, + ) class ConversationPhoneNumber(proto.Message): @@ -838,6 +903,9 @@ class Summary(proto.Message): sections. The key is the section's name and the value is the section's content. There is no specific format for the key or value. + sorted_text_sections (MutableSequence[google.cloud.dialogflow_v2beta1.types.SuggestConversationSummaryResponse.Summary.SummarySection]): + Same as text_sections, but in an order that is consistent + with the order of the sections in the generator. answer_record (str): The name of the answer record. Format: @@ -849,6 +917,25 @@ class Summary(proto.Message): was not used to generate this summary. """ + class SummarySection(proto.Message): + r"""A component of the generated summary. + + Attributes: + section (str): + Output only. Name of the section. + summary (str): + Output only. Summary text for the section. + """ + + section: str = proto.Field( + proto.STRING, + number=1, + ) + summary: str = proto.Field( + proto.STRING, + number=2, + ) + text: str = proto.Field( proto.STRING, number=1, @@ -858,6 +945,13 @@ class Summary(proto.Message): proto.STRING, number=4, ) + sorted_text_sections: MutableSequence[ + "SuggestConversationSummaryResponse.Summary.SummarySection" + ] = proto.RepeatedField( + proto.MESSAGE, + number=6, + message="SuggestConversationSummaryResponse.Summary.SummarySection", + ) answer_record: str = proto.Field( proto.STRING, number=3, @@ -1549,6 +1643,75 @@ class FilterSpecs(proto.Message): ) +class SearchKnowledgeDebugInfo(proto.Message): + r"""Debug information related to SearchKnowledge feature. + + Attributes: + datastore_response_reason (google.cloud.dialogflow_v2beta1.types.DatastoreResponseReason): + Response reason from datastore which + indicates data serving status or answer quality + degradation. + search_knowledge_behavior (google.cloud.dialogflow_v2beta1.types.SearchKnowledgeDebugInfo.SearchKnowledgeBehavior): + Configured behaviors for SearchKnowledge. + ingested_context_reference_debug_info (google.cloud.dialogflow_v2beta1.types.IngestedContextReferenceDebugInfo): + Information about parameters ingested for + search knowledge. + service_latency (google.cloud.dialogflow_v2beta1.types.ServiceLatency): + The latency of the service. + """ + + class SearchKnowledgeBehavior(proto.Message): + r"""Configured behaviors for SearchKnowledge. + + Attributes: + answer_generation_rewriter_on (bool): + Whether data store agent rewriter was turned + on for the request. + end_user_metadata_included (bool): + Whether end_user_metadata is included in the data store + agent call. + third_party_connector_allowed (bool): + This field indicates whether third party + connectors are enabled for the project. Note + that this field only indicates if the project is + allowlisted for connectors. + """ + + answer_generation_rewriter_on: bool = proto.Field( + proto.BOOL, + number=1, + ) + end_user_metadata_included: bool = proto.Field( + proto.BOOL, + number=2, + ) + third_party_connector_allowed: bool = proto.Field( + proto.BOOL, + number=4, + ) + + datastore_response_reason: participant.DatastoreResponseReason = proto.Field( + proto.ENUM, + number=1, + enum=participant.DatastoreResponseReason, + ) + search_knowledge_behavior: SearchKnowledgeBehavior = proto.Field( + proto.MESSAGE, + number=2, + message=SearchKnowledgeBehavior, + ) + ingested_context_reference_debug_info: participant.IngestedContextReferenceDebugInfo = proto.Field( + proto.MESSAGE, + number=3, + message=participant.IngestedContextReferenceDebugInfo, + ) + service_latency: participant.ServiceLatency = proto.Field( + proto.MESSAGE, + number=4, + message=participant.ServiceLatency, + ) + + class SearchKnowledgeResponse(proto.Message): r"""The response message for [Conversations.SearchKnowledge][google.cloud.dialogflow.v2beta1.Conversations.SearchKnowledge]. @@ -1560,6 +1723,8 @@ class SearchKnowledgeResponse(proto.Message): confidence. rewritten_query (str): The rewritten query used to search knowledge. + search_knowledge_debug_info (google.cloud.dialogflow_v2beta1.types.SearchKnowledgeDebugInfo): + Debug info for SearchKnowledge. """ answers: MutableSequence["SearchKnowledgeAnswer"] = proto.RepeatedField( @@ -1571,6 +1736,11 @@ class SearchKnowledgeResponse(proto.Message): proto.STRING, number=3, ) + search_knowledge_debug_info: "SearchKnowledgeDebugInfo" = proto.Field( + proto.MESSAGE, + number=4, + message="SearchKnowledgeDebugInfo", + ) class SearchKnowledgeAnswer(proto.Message): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py index 45e5ef265ef5..34b35d22ef56 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/conversation_profile.py @@ -64,6 +64,10 @@ class ConversationProfile(proto.Message): update_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Update time of the conversation profile. + use_bidi_streaming (bool): + Optional. Whether to use the bidi streaming + API in telephony integration for the + conversation profile. automated_agent_config (google.cloud.dialogflow_v2beta1.types.AutomatedAgentConfig): Configuration for an automated agent to use with this profile. @@ -142,6 +146,10 @@ class ConversationProfile(proto.Message): number=12, message=timestamp_pb2.Timestamp, ) + use_bidi_streaming: bool = proto.Field( + proto.BOOL, + number=23, + ) automated_agent_config: "AutomatedAgentConfig" = proto.Field( proto.MESSAGE, number=3, @@ -845,6 +853,30 @@ class MessageAnalysisConfig(proto.Message): [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.ListMessagesResponse.messages] If Pub/Sub notification is configured, result will be in [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.ConversationEvent.new_message_payload]. + enable_sentiment_analysis_v3 (bool): + Optional. Enables sentiment analysis for audio input and + conversation messages. If unspecified, defaults to false. If + this flag is set to true, other 'enable_sentiment_analysis' + fields will be ignored. + + Sentiment analysis inspects user input and identifies the + prevailing subjective opinion, especially to determine a + user's attitude as positive, negative, or neutral. + https://cloud.google.com/natural-language/docs/basics#sentiment_analysis + For + [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent] + method, result will be in + [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.message]. + For + [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] + method, result will be in + [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.message] + For + [Conversations.ListMessages][google.cloud.dialogflow.v2beta1.Conversations.ListMessages] + method, result will be in + [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.ListMessagesResponse.messages] + If Pub/Sub notification is configured, result will be in + [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.ConversationEvent.new_message_payload]. """ enable_entity_extraction: bool = proto.Field( @@ -855,6 +887,10 @@ class MessageAnalysisConfig(proto.Message): proto.BOOL, number=3, ) + enable_sentiment_analysis_v3: bool = proto.Field( + proto.BOOL, + number=5, + ) notification_config: "NotificationConfig" = proto.Field( proto.MESSAGE, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/generator.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/generator.py index 19f64aa8dc7e..6f8748305136 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/generator.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/generator.py @@ -21,7 +21,12 @@ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore import proto # type: ignore -from google.cloud.dialogflow_v2beta1.types import agent_coaching_instruction +from google.cloud.dialogflow_v2beta1.types import ( + agent_coaching_instruction, + ces_app, + ces_tool, + toolset, +) from google.cloud.dialogflow_v2beta1.types import tool_call as gcd_tool_call __protobuf__ = proto.module( @@ -675,6 +680,15 @@ class Generator(proto.Message): Optional. Configuration for suggestion deduping. This is only applicable to AI Coach feature. + toolset_tools (MutableSequence[google.cloud.dialogflow_v2beta1.types.ToolsetTool]): + Optional. List of CES toolset specs that the + generator can choose from. + ces_tool_specs (MutableSequence[google.cloud.dialogflow_v2beta1.types.CesToolSpec]): + Optional. List of CES tool specs that the + generator can choose from. + ces_app_specs (MutableSequence[google.cloud.dialogflow_v2beta1.types.CesAppSpec]): + Optional. List of CES app specs that the + generator can choose from. """ name: str = proto.Field( @@ -737,6 +751,21 @@ class Generator(proto.Message): number=23, message="SuggestionDedupingConfig", ) + toolset_tools: MutableSequence[toolset.ToolsetTool] = proto.RepeatedField( + proto.MESSAGE, + number=27, + message=toolset.ToolsetTool, + ) + ces_tool_specs: MutableSequence[ces_tool.CesToolSpec] = proto.RepeatedField( + proto.MESSAGE, + number=28, + message=ces_tool.CesToolSpec, + ) + ces_app_specs: MutableSequence[ces_app.CesAppSpec] = proto.RepeatedField( + proto.MESSAGE, + number=29, + message=ces_app.CesAppSpec, + ) class FreeFormSuggestion(proto.Message): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py index 51baa4b7cb39..a4bf988ccc12 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/participant.py @@ -29,6 +29,7 @@ __protobuf__ = proto.module( package="google.cloud.dialogflow.v2beta1", manifest={ + "DatastoreResponseReason", "Participant", "Message", "CreateParticipantRequest", @@ -73,6 +74,9 @@ "ResponseMessage", "SuggestKnowledgeAssistRequest", "SuggestKnowledgeAssistResponse", + "IngestedContextReferenceDebugInfo", + "ServiceLatency", + "KnowledgeAssistDebugInfo", "KnowledgeAssistAnswer", "BidiStreamingAnalyzeContentRequest", "BidiStreamingAnalyzeContentResponse", @@ -80,6 +84,49 @@ ) +class DatastoreResponseReason(proto.Enum): + r"""Response reason from datastore which indicates data serving + status or answer quality degradation. + + Values: + DATASTORE_RESPONSE_REASON_UNSPECIFIED (0): + Default value. + NONE (1): + No specific response reason from datastore. + SEARCH_OUT_OF_QUOTA (2): + Search is blocked due to out of quota. + SEARCH_EMPTY_RESULTS (3): + Search returns empty results. + ANSWER_GENERATION_GEN_AI_DISABLED (4): + Generative AI is disabled. + ANSWER_GENERATION_OUT_OF_QUOTA (5): + Answer generation is blocked due to out of + quota. + ANSWER_GENERATION_ERROR (6): + Answer generation encounters an error. + ANSWER_GENERATION_NOT_ENOUGH_INFO (7): + Answer generation does not have enough + information to generate answer. + ANSWER_GENERATION_RAI_FAILED (8): + Answer generation is blocked by RAI + (Responsible AI) failure. + ANSWER_GENERATION_NOT_GROUNDED (9): + Answer generation is not grounded on reliable + sources. + """ + + DATASTORE_RESPONSE_REASON_UNSPECIFIED = 0 + NONE = 1 + SEARCH_OUT_OF_QUOTA = 2 + SEARCH_EMPTY_RESULTS = 3 + ANSWER_GENERATION_GEN_AI_DISABLED = 4 + ANSWER_GENERATION_OUT_OF_QUOTA = 5 + ANSWER_GENERATION_ERROR = 6 + ANSWER_GENERATION_NOT_ENOUGH_INFO = 7 + ANSWER_GENERATION_RAI_FAILED = 8 + ANSWER_GENERATION_NOT_GROUNDED = 9 + + class Participant(proto.Message): r"""Represents a conversation participant (human agent, virtual agent, end-user). @@ -2867,6 +2914,406 @@ class SuggestKnowledgeAssistResponse(proto.Message): ) +class IngestedContextReferenceDebugInfo(proto.Message): + r"""Debug information related to ingested context reference. + + Attributes: + project_not_allowlisted (bool): + Indicates if the project is allowlisted to + use ingested context reference. + context_reference_retrieved (bool): + The status of context_reference retrieval from database. + ingested_parameters_debug_info (MutableSequence[google.cloud.dialogflow_v2beta1.types.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo]): + Parameters ingested from the context + reference. + """ + + class IngestedParameterDebugInfo(proto.Message): + r"""Debug information related to ingested parameters from context + reference. + + Attributes: + parameter (str): + The name of the parameter in the context + reference. + ingestion_status (google.cloud.dialogflow_v2beta1.types.IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus): + The ingestion status for this specific + parameter. + """ + + class IngestionStatus(proto.Enum): + r"""Enum representing the various states of parameter ingestion. + + Values: + INGESTION_STATUS_UNSPECIFIED (0): + Default value, indicates that the ingestion + status is not specified. + INGESTION_STATUS_SUCCEEDED (1): + Indicates that the parameter was successfully + ingested. + INGESTION_STATUS_CONTEXT_NOT_AVAILABLE (2): + Indicates that the parameter was not + available for ingestion. + INGESTION_STATUS_PARSE_FAILED (3): + Indicates that there was a failure parsing + the parameter content. + INGESTION_STATUS_INVALID_ENTRY (4): + Indicates that the context reference had an + unexpected number of content entries as Context + reference should only have one entry. + INGESTION_STATUS_INVALID_FORMAT (5): + Indicates that the context reference content + was not in the expected format (e.g., JSON). + INGESTION_STATUS_LANGUAGE_MISMATCH (6): + Indicates that the context reference language + does not match the conversation language. + """ + + INGESTION_STATUS_UNSPECIFIED = 0 + INGESTION_STATUS_SUCCEEDED = 1 + INGESTION_STATUS_CONTEXT_NOT_AVAILABLE = 2 + INGESTION_STATUS_PARSE_FAILED = 3 + INGESTION_STATUS_INVALID_ENTRY = 4 + INGESTION_STATUS_INVALID_FORMAT = 5 + INGESTION_STATUS_LANGUAGE_MISMATCH = 6 + + parameter: str = proto.Field( + proto.STRING, + number=1, + ) + ingestion_status: "IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus" = proto.Field( + proto.ENUM, + number=2, + enum="IngestedContextReferenceDebugInfo.IngestedParameterDebugInfo.IngestionStatus", + ) + + project_not_allowlisted: bool = proto.Field( + proto.BOOL, + number=1, + ) + context_reference_retrieved: bool = proto.Field( + proto.BOOL, + number=2, + ) + ingested_parameters_debug_info: MutableSequence[IngestedParameterDebugInfo] = ( + proto.RepeatedField( + proto.MESSAGE, + number=3, + message=IngestedParameterDebugInfo, + ) + ) + + +class ServiceLatency(proto.Message): + r"""Message to represent the latency of the service. + + Attributes: + internal_service_latencies (MutableSequence[google.cloud.dialogflow_v2beta1.types.ServiceLatency.InternalServiceLatency]): + A list of internal service latencies. + """ + + class InternalServiceLatency(proto.Message): + r"""Message to represent the latency of an internal service. + + Attributes: + step (str): + The name of the internal service. + latency_ms (float): + The latency of the internal service in + milliseconds. + start_time (google.protobuf.timestamp_pb2.Timestamp): + The start time of the internal service. + complete_time (google.protobuf.timestamp_pb2.Timestamp): + The completion time of the internal service. + """ + + step: str = proto.Field( + proto.STRING, + number=1, + ) + latency_ms: float = proto.Field( + proto.FLOAT, + number=2, + ) + start_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + complete_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + + internal_service_latencies: MutableSequence[InternalServiceLatency] = ( + proto.RepeatedField( + proto.MESSAGE, + number=1, + message=InternalServiceLatency, + ) + ) + + +class KnowledgeAssistDebugInfo(proto.Message): + r"""Debug information related to Knowledge Assist feature. + + Attributes: + query_generation_failure_reason (google.cloud.dialogflow_v2beta1.types.KnowledgeAssistDebugInfo.QueryGenerationFailureReason): + Reason for query generation. + query_categorization_failure_reason (google.cloud.dialogflow_v2beta1.types.KnowledgeAssistDebugInfo.QueryCategorizationFailureReason): + Reason for query categorization. + datastore_response_reason (google.cloud.dialogflow_v2beta1.types.DatastoreResponseReason): + Response reason from datastore which + indicates data serving status or answer quality + degradation. + knowledge_assist_behavior (google.cloud.dialogflow_v2beta1.types.KnowledgeAssistDebugInfo.KnowledgeAssistBehavior): + Configured behaviors for Knowedge Assist. + ingested_context_reference_debug_info (google.cloud.dialogflow_v2beta1.types.IngestedContextReferenceDebugInfo): + Information about parameters ingested for + search knowledge. + service_latency (google.cloud.dialogflow_v2beta1.types.ServiceLatency): + The latency of the service. + """ + + class QueryGenerationFailureReason(proto.Enum): + r"""Reason for query generation failure. + + Values: + QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED (0): + Default value. + QUERY_GENERATION_OUT_OF_QUOTA (1): + Query generation is blocked due to out of + quota. + QUERY_GENERATION_FAILED (2): + Call to Knowedge Assist query generation + model fails. + QUERY_GENERATION_NO_QUERY_GENERATED (3): + Query generation model decides that there is + no new topic change or there has been similar + queries generated in the previous turns. + QUERY_GENERATION_RAI_FAILED (4): + Knowedge Assist generated query is blocked by + RAI (Responsible AI). + NOT_IN_ALLOWLIST (5): + Query generation is blocked by Knowledge + Assist conversation profile level / agent id + level filtering. + QUERY_GENERATION_QUERY_REDACTED (6): + The generated query is blocked due to + redaction. + QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED (10): + Query generation failed due to LLM response + parse failure. + QUERY_GENERATION_EMPTY_CONVERSATION (11): + The conversation has no messages. + QUERY_GENERATION_EMPTY_LAST_MESSAGE (12): + The last message in the conversation is + empty. + QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET (13): + The trigger event condition is not met. This occurs in the + following scenarios: + + 1. The trigger_event is CUSTOMER_MESSAGE or UNSPECIFIED, but + the last message is not from the customer. + 2. The trigger_event is AGENT_MESSAGE, but the last message + is not from the agent. + """ + + QUERY_GENERATION_FAILURE_REASON_UNSPECIFIED = 0 + QUERY_GENERATION_OUT_OF_QUOTA = 1 + QUERY_GENERATION_FAILED = 2 + QUERY_GENERATION_NO_QUERY_GENERATED = 3 + QUERY_GENERATION_RAI_FAILED = 4 + NOT_IN_ALLOWLIST = 5 + QUERY_GENERATION_QUERY_REDACTED = 6 + QUERY_GENERATION_LLM_RESPONSE_PARSE_FAILED = 10 + QUERY_GENERATION_EMPTY_CONVERSATION = 11 + QUERY_GENERATION_EMPTY_LAST_MESSAGE = 12 + QUERY_GENERATION_TRIGGERING_EVENT_CONDITION_NOT_MET = 13 + + class QueryCategorizationFailureReason(proto.Enum): + r"""Reason for query categorization failure. + + Values: + QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED (0): + Default value. + QUERY_CATEGORIZATION_INVALID_CONFIG (1): + Vertex AI Search config supplied for query + categorization is invalid. + QUERY_CATEGORIZATION_RESULT_NOT_FOUND (2): + Vertex AI Search result does not contain a + query categorization result. + QUERY_CATEGORIZATION_FAILED (3): + Vertex AI Search call fails. + """ + + QUERY_CATEGORIZATION_FAILURE_REASON_UNSPECIFIED = 0 + QUERY_CATEGORIZATION_INVALID_CONFIG = 1 + QUERY_CATEGORIZATION_RESULT_NOT_FOUND = 2 + QUERY_CATEGORIZATION_FAILED = 3 + + class KnowledgeAssistBehavior(proto.Message): + r"""Configured behaviors for Knowedge Assist. + + Attributes: + answer_generation_rewriter_on (bool): + Whether data store agent rewriter was turned + off for the request. + end_user_metadata_included (bool): + Whether end_user_metadata is included in the data store + agent call. + return_query_only (bool): + Whether customers configured to return query + only in the conversation profile. + use_pubsub_delivery (bool): + Whether customers configured to use pubsub to + deliver. + disable_sync_delivery (bool): + Whether customers configured to disable the + synchronous delivery of Knowedge Assist + response. + previous_queries_included (bool): + Whether previously suggested queries are + included in the query generation process. + use_translated_message (bool): + Translated message is included in query + generation process. + use_custom_safety_filter_level (bool): + Safety filter is adjusted by user. + conversation_transcript_has_mixed_languages (bool): + Conversation transcript has mixed languages. + query_generation_agent_language_mismatch (bool): + Whether the agent language from the + translation generator mismatches the end-user + language. + query_generation_end_user_language_mismatch (bool): + Whether the end-user language from the + translation generator mismatches the end-user + language. + third_party_connector_allowed (bool): + This field indicates whether third party + connectors are enabled for the project. + multiple_queries_generated (bool): + Indicates that the query generation model + generated multiple queries. + query_contained_search_context (bool): + Indicates that the generated query contains + search context. + invalid_items_query_suggestion_skipped (bool): + Indicates that invalid items were skipped + when parsing the LLM response. + primary_query_redacted_and_replaced (bool): + True if the primary suggested query was + redacted and replaced by an additional query. + appended_search_context_count (int): + The number of search contexts appended to the + query. + """ + + answer_generation_rewriter_on: bool = proto.Field( + proto.BOOL, + number=1, + ) + end_user_metadata_included: bool = proto.Field( + proto.BOOL, + number=2, + ) + return_query_only: bool = proto.Field( + proto.BOOL, + number=4, + ) + use_pubsub_delivery: bool = proto.Field( + proto.BOOL, + number=5, + ) + disable_sync_delivery: bool = proto.Field( + proto.BOOL, + number=6, + ) + previous_queries_included: bool = proto.Field( + proto.BOOL, + number=7, + ) + use_translated_message: bool = proto.Field( + proto.BOOL, + number=8, + ) + use_custom_safety_filter_level: bool = proto.Field( + proto.BOOL, + number=9, + ) + conversation_transcript_has_mixed_languages: bool = proto.Field( + proto.BOOL, + number=10, + ) + query_generation_agent_language_mismatch: bool = proto.Field( + proto.BOOL, + number=11, + ) + query_generation_end_user_language_mismatch: bool = proto.Field( + proto.BOOL, + number=12, + ) + third_party_connector_allowed: bool = proto.Field( + proto.BOOL, + number=13, + ) + multiple_queries_generated: bool = proto.Field( + proto.BOOL, + number=14, + ) + query_contained_search_context: bool = proto.Field( + proto.BOOL, + number=15, + ) + invalid_items_query_suggestion_skipped: bool = proto.Field( + proto.BOOL, + number=16, + ) + primary_query_redacted_and_replaced: bool = proto.Field( + proto.BOOL, + number=17, + ) + appended_search_context_count: int = proto.Field( + proto.INT32, + number=18, + ) + + query_generation_failure_reason: QueryGenerationFailureReason = proto.Field( + proto.ENUM, + number=1, + enum=QueryGenerationFailureReason, + ) + query_categorization_failure_reason: QueryCategorizationFailureReason = proto.Field( + proto.ENUM, + number=2, + enum=QueryCategorizationFailureReason, + ) + datastore_response_reason: "DatastoreResponseReason" = proto.Field( + proto.ENUM, + number=3, + enum="DatastoreResponseReason", + ) + knowledge_assist_behavior: KnowledgeAssistBehavior = proto.Field( + proto.MESSAGE, + number=4, + message=KnowledgeAssistBehavior, + ) + ingested_context_reference_debug_info: "IngestedContextReferenceDebugInfo" = ( + proto.Field( + proto.MESSAGE, + number=5, + message="IngestedContextReferenceDebugInfo", + ) + ) + service_latency: "ServiceLatency" = proto.Field( + proto.MESSAGE, + number=6, + message="ServiceLatency", + ) + + class KnowledgeAssistAnswer(proto.Message): r"""Represents a Knowledge Assist answer. @@ -2882,6 +3329,9 @@ class KnowledgeAssistAnswer(proto.Message): answer_record (str): The name of the answer record. Format: ``projects//locations//answer Records/``. + knowledge_assist_debug_info (google.cloud.dialogflow_v2beta1.types.KnowledgeAssistDebugInfo): + Debug information related to Knowledge Assist + feature. """ class SuggestedQuery(proto.Message): @@ -3017,6 +3467,11 @@ class Snippet(proto.Message): proto.STRING, number=3, ) + knowledge_assist_debug_info: "KnowledgeAssistDebugInfo" = proto.Field( + proto.MESSAGE, + number=7, + message="KnowledgeAssistDebugInfo", + ) class BidiStreamingAnalyzeContentRequest(proto.Message): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/phone_number.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/phone_number.py index debe4c0bfabd..d70fb38685e4 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/phone_number.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/phone_number.py @@ -18,6 +18,7 @@ from typing import MutableMapping, MutableSequence import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore import proto # type: ignore __protobuf__ = proto.module( @@ -39,6 +40,9 @@ class PhoneNumber(proto.Message): project through a [PhoneNumberOrder][google.cloud.dialogflow.v2beta1.PhoneNumberOrder]. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + Attributes: name (str): Optional. The unique identifier of this phone number. @@ -66,6 +70,14 @@ class PhoneNumber(proto.Message): ``ACTIVE``. ``PhoneNumber`` objects set to ``DELETE_REQUESTED`` always decline incoming calls and can be removed completely within 30 days. + allowed_sip_trunks (google.cloud.dialogflow_v2beta1.types.PhoneNumber.AllowedSipTrunks): + Optional. Only allow calls from the specified + SIP trunks. + + This field is a member of `oneof`_ ``inbound_restriction``. + purge_time (google.protobuf.timestamp_pb2.Timestamp): + Output only. The time at which this resource + will be purged. """ class LifecycleState(proto.Enum): @@ -85,6 +97,31 @@ class LifecycleState(proto.Enum): ACTIVE = 1 DELETE_REQUESTED = 2 + class AllowedSipTrunks(proto.Message): + r"""List of SIP trunks that are allowed to make calls to this + phone number. + + Attributes: + sip_trunks (MutableSequence[str]): + List of SIP trunks that are allowed to make + calls to this phone number. If empty, any SIP + trunk is allowed. + carrier_ids (MutableSequence[str]): + Optional. List of GTP carrier IDs allowed to + make calls to this phone number. Used for + private interconnects where standard SIP trunks + aren't applicable. + """ + + sip_trunks: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=1, + ) + carrier_ids: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=2, + ) + name: str = proto.Field( proto.STRING, number=1, @@ -102,6 +139,17 @@ class LifecycleState(proto.Enum): number=4, enum=LifecycleState, ) + allowed_sip_trunks: AllowedSipTrunks = proto.Field( + proto.MESSAGE, + number=7, + oneof="inbound_restriction", + message=AllowedSipTrunks, + ) + purge_time: timestamp_pb2.Timestamp = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) class DeletePhoneNumberRequest(proto.Message): diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/tool_call.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/tool_call.py index c93222d4f7eb..d6f9beb49f13 100644 --- a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/tool_call.py +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/tool_call.py @@ -34,6 +34,10 @@ class ToolCall(proto.Message): r"""Represents a call of a specific tool's action with the specified inputs. + This message has `oneof`_ fields (mutually exclusive fields). + For each oneof, at most one member field can be set at the same time. + Setting any member of the oneof automatically clears all other + members. .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -43,6 +47,21 @@ class ToolCall(proto.Message): associated with this call. Format: ``projects//locations//tools/``. + This field is a member of `oneof`_ ``source``. + ces_tool (str): + Optional. CES tool name for this call. Format: + ``projects//locations//apps//tools/``. + + This field is a member of `oneof`_ ``source``. + ces_toolset (str): + Optional. CES toolset name for this call. Format: + ``projects//locations//apps//toolsets/ToolsetID>``. + + This field is a member of `oneof`_ ``source``. + ces_app (str): + Optional. CES app name for this call. Format: + ``projects//locations//apps/``. + This field is a member of `oneof`_ ``source``. tool_display_name (str): Optional. A human readable short name of the @@ -86,6 +105,21 @@ class State(proto.Enum): number=1, oneof="source", ) + ces_tool: str = proto.Field( + proto.STRING, + number=11, + oneof="source", + ) + ces_toolset: str = proto.Field( + proto.STRING, + number=12, + oneof="source", + ) + ces_app: str = proto.Field( + proto.STRING, + number=8, + oneof="source", + ) tool_display_name: str = proto.Field( proto.STRING, number=9, @@ -135,6 +169,21 @@ class ToolCallResult(proto.Message): associated with this call. Format: ``projects//locations//tools/``. + This field is a member of `oneof`_ ``source``. + ces_tool (str): + Optional. CES tool name for this call. Format: + ``projects//locations//apps//tools/``. + + This field is a member of `oneof`_ ``source``. + ces_toolset (str): + Optional. CES toolset name for this call. Format: + ``projects//locations//apps//toolsets/ToolsetID>``. + + This field is a member of `oneof`_ ``source``. + ces_app (str): + Optional. CES app name for this call. Format: + ``projects//locations//apps/``. + This field is a member of `oneof`_ ``source``. action (str): Optional. The name of the tool's action @@ -180,6 +229,21 @@ class Error(proto.Message): number=1, oneof="source", ) + ces_tool: str = proto.Field( + proto.STRING, + number=12, + oneof="source", + ) + ces_toolset: str = proto.Field( + proto.STRING, + number=13, + oneof="source", + ) + ces_app: str = proto.Field( + proto.STRING, + number=11, + oneof="source", + ) action: str = proto.Field( proto.STRING, number=2, diff --git a/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/toolset.py b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/toolset.py new file mode 100644 index 000000000000..cdc6d5c48ed8 --- /dev/null +++ b/packages/google-cloud-dialogflow/google/cloud/dialogflow_v2beta1/types/toolset.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from __future__ import annotations + +from typing import MutableMapping, MutableSequence + +import proto # type: ignore + +from google.cloud.dialogflow_v2beta1.types import tool + +__protobuf__ = proto.module( + package="google.cloud.dialogflow.v2beta1", + manifest={ + "ToolsetTool", + }, +) + + +class ToolsetTool(proto.Message): + r"""A tool that is created from a toolset. + + Attributes: + toolset (str): + Required. The name of the toolset to retrieve the schema + for. Format: + ``projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}`` + operation_id (str): + Optional. The operationId field of the + OpenAPI endpoint. The operationId must be + present in the toolset's definition. + confirmation_requirement (google.cloud.dialogflow_v2beta1.types.Tool.ConfirmationRequirement): + Optional. Indicates whether the tool requires + human confirmation. + """ + + toolset: str = proto.Field( + proto.STRING, + number=1, + ) + operation_id: str = proto.Field( + proto.STRING, + number=2, + ) + confirmation_requirement: tool.Tool.ConfirmationRequirement = proto.Field( + proto.ENUM, + number=3, + enum=tool.Tool.ConfirmationRequirement, + ) + + +__all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py index eb4d7518a5d8..404dc0c19759 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_answer_records.py @@ -3392,6 +3392,9 @@ def test_update_answer_record_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -3402,6 +3405,9 @@ def test_update_answer_record_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_toolset": "ces_toolset_value", + "ces_tool": "ces_tool_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -4409,10 +4415,36 @@ def test_parse_answer_record_path(): assert expected == actual -def test_context_path(): +def test_app_path(): project = "oyster" - session = "nudibranch" - context = "cuttlefish" + location = "nudibranch" + app = "cuttlefish" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = AnswerRecordsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "mussel", + "location": "winkle", + "app": "nautilus", + } + path = AnswerRecordsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = AnswerRecordsClient.parse_app_path(path) + assert expected == actual + + +def test_context_path(): + project = "scallop" + session = "abalone" + context = "squid" expected = "projects/{project}/agent/sessions/{session}/contexts/{context}".format( project=project, session=session, @@ -4424,9 +4456,9 @@ def test_context_path(): def test_parse_context_path(): expected = { - "project": "mussel", - "session": "winkle", - "context": "nautilus", + "project": "clam", + "session": "whelk", + "context": "octopus", } path = AnswerRecordsClient.context_path(**expected) @@ -4436,8 +4468,8 @@ def test_parse_context_path(): def test_intent_path(): - project = "scallop" - intent = "abalone" + project = "oyster" + intent = "nudibranch" expected = "projects/{project}/agent/intents/{intent}".format( project=project, intent=intent, @@ -4448,8 +4480,8 @@ def test_intent_path(): def test_parse_intent_path(): expected = { - "project": "squid", - "intent": "clam", + "project": "cuttlefish", + "intent": "mussel", } path = AnswerRecordsClient.intent_path(**expected) @@ -4459,9 +4491,9 @@ def test_parse_intent_path(): def test_tool_path(): - project = "whelk" - location = "octopus" - tool = "oyster" + project = "winkle" + location = "nautilus" + tool = "scallop" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -4473,9 +4505,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "tool": "mussel", + "project": "abalone", + "location": "squid", + "tool": "clam", + } + path = AnswerRecordsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = AnswerRecordsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "whelk" + location = "octopus" + app = "oyster" + tool = "nudibranch" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = AnswerRecordsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "tool": "nautilus", } path = AnswerRecordsClient.tool_path(**expected) @@ -4484,8 +4545,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "scallop" + location = "abalone" + app = "squid" + toolset = "clam" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = AnswerRecordsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "whelk", + "location": "octopus", + "app": "oyster", + "toolset": "nudibranch", + } + path = AnswerRecordsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = AnswerRecordsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -4495,7 +4587,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "mussel", } path = AnswerRecordsClient.common_billing_account_path(**expected) @@ -4505,7 +4597,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -4515,7 +4607,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nautilus", } path = AnswerRecordsClient.common_folder_path(**expected) @@ -4525,7 +4617,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -4535,7 +4627,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "abalone", } path = AnswerRecordsClient.common_organization_path(**expected) @@ -4545,7 +4637,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -4555,7 +4647,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "clam", } path = AnswerRecordsClient.common_project_path(**expected) @@ -4565,8 +4657,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -4577,8 +4669,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "oyster", + "location": "nudibranch", } path = AnswerRecordsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py index 5943fbe7b2a1..0b54dd0e3cda 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversation_profiles.py @@ -6467,6 +6467,7 @@ def test_create_conversation_profile_rest_call_success(request_type): "message_analysis_config": { "enable_entity_extraction": True, "enable_sentiment_analysis": True, + "enable_sentiment_analysis_v3": True, }, }, "human_agent_handoff_config": { @@ -6810,6 +6811,7 @@ def test_update_conversation_profile_rest_call_success(request_type): "message_analysis_config": { "enable_entity_extraction": True, "enable_sentiment_analysis": True, + "enable_sentiment_analysis_v3": True, }, }, "human_agent_handoff_config": { diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py index 861494a5c48b..b1ff4438323a 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_conversations.py @@ -71,12 +71,16 @@ from google.cloud.dialogflow_v2.types import ( agent_coaching_instruction, audio_config, + ces_app, + ces_tool, conversation, conversation_profile, generator, participant, session, + tool, tool_call, + toolset, ) from google.cloud.dialogflow_v2.types import conversation as gcd_conversation @@ -8147,7 +8151,132 @@ def test_create_conversation_rest_call_success(request_type): {"mime_type": "mime_type_value", "content": b"content_blob"} ], }, + "initial_conversation_profile": { + "name": "name_value", + "display_name": "display_name_value", + "create_time": {}, + "update_time": {}, + "automated_agent_config": { + "agent": "agent_value", + "session_ttl": {"seconds": 751, "nanos": 543}, + }, + "human_agent_assistant_config": { + "notification_config": {"topic": "topic_value", "message_format": 1}, + "human_agent_suggestion_config": { + "feature_configs": [ + { + "suggestion_feature": {"type_": 1}, + "enable_event_based_suggestion": True, + "disable_agent_query_logging": True, + "enable_query_suggestion_when_no_answer": True, + "enable_conversation_augmented_query": True, + "enable_query_suggestion_only": True, + "enable_response_debug_info": True, + "rai_settings": { + "rai_category_configs": [ + {"category": 1, "sensitivity_level": 1} + ] + }, + "suggestion_trigger_settings": { + "no_smalltalk": True, + "only_end_user": True, + }, + "query_config": { + "knowledge_base_query_source": { + "knowledge_bases": [ + "knowledge_bases_value1", + "knowledge_bases_value2", + ] + }, + "document_query_source": { + "documents": [ + "documents_value1", + "documents_value2", + ] + }, + "dialogflow_query_source": { + "agent": "agent_value", + "human_agent_side_config": {"agent": "agent_value"}, + }, + "max_results": 1207, + "confidence_threshold": 0.2106, + "context_filter_settings": { + "drop_handoff_messages": True, + "drop_virtual_agent_messages": True, + "drop_ivr_messages": True, + }, + "sections": {"section_types": [1]}, + "context_size": 1311, + }, + "conversation_model_config": { + "model": "model_value", + "baseline_model_version": "baseline_model_version_value", + }, + "conversation_process_config": { + "recent_sentences_count": 2352 + }, + } + ], + "group_suggestion_responses": True, + "generators": ["generators_value1", "generators_value2"], + "disable_high_latency_features_sync_delivery": True, + "skip_empty_event_based_suggestion": True, + "use_unredacted_conversation_data": True, + "enable_async_tool_call": True, + }, + "end_user_suggestion_config": {}, + "message_analysis_config": { + "enable_entity_extraction": True, + "enable_sentiment_analysis": True, + "enable_sentiment_analysis_v3": True, + }, + }, + "human_agent_handoff_config": { + "live_person_config": {"account_number": "account_number_value"}, + "salesforce_live_agent_config": { + "organization_id": "organization_id_value", + "deployment_id": "deployment_id_value", + "button_id": "button_id_value", + "endpoint_domain": "endpoint_domain_value", + }, + }, + "notification_config": {}, + "logging_config": {"enable_stackdriver_logging": True}, + "new_message_event_notification_config": {}, + "new_recognition_result_notification_config": {}, + "stt_config": { + "speech_model_variant": 1, + "model": "model_value", + "phrase_sets": ["phrase_sets_value1", "phrase_sets_value2"], + "audio_encoding": 1, + "sample_rate_hertz": 1817, + "language_code": "language_code_value", + "enable_word_info": True, + "use_timeout_based_endpointing": True, + }, + "language_code": "language_code_value", + "time_zone": "time_zone_value", + "security_settings": "security_settings_value", + "tts_config": { + "speaking_rate": 0.1373, + "pitch": 0.536, + "volume_gain_db": 0.1467, + "effects_profile_id": [ + "effects_profile_id_value1", + "effects_profile_id_value2", + ], + "voice": {"name": "name_value", "ssml_gender": 1}, + "pronunciations": [ + { + "phrase": "phrase_value", + "phonetic_encoding": 1, + "pronunciation": "pronunciation_value", + } + ], + }, + }, "ingested_context_references": {}, + "initial_generator_contexts": {}, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -10773,9 +10902,35 @@ def test_parse_answer_record_path(): assert expected == actual -def test_conversation_path(): +def test_app_path(): project = "cuttlefish" - conversation = "mussel" + location = "mussel" + app = "winkle" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = ConversationsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "nautilus", + "location": "scallop", + "app": "abalone", + } + path = ConversationsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationsClient.parse_app_path(path) + assert expected == actual + + +def test_conversation_path(): + project = "squid" + conversation = "clam" expected = "projects/{project}/conversations/{conversation}".format( project=project, conversation=conversation, @@ -10786,8 +10941,8 @@ def test_conversation_path(): def test_parse_conversation_path(): expected = { - "project": "winkle", - "conversation": "nautilus", + "project": "whelk", + "conversation": "octopus", } path = ConversationsClient.conversation_path(**expected) @@ -10797,9 +10952,9 @@ def test_parse_conversation_path(): def test_conversation_model_path(): - project = "scallop" - location = "abalone" - conversation_model = "squid" + project = "oyster" + location = "nudibranch" + conversation_model = "cuttlefish" expected = "projects/{project}/locations/{location}/conversationModels/{conversation_model}".format( project=project, location=location, @@ -10813,9 +10968,9 @@ def test_conversation_model_path(): def test_parse_conversation_model_path(): expected = { - "project": "clam", - "location": "whelk", - "conversation_model": "octopus", + "project": "mussel", + "location": "winkle", + "conversation_model": "nautilus", } path = ConversationsClient.conversation_model_path(**expected) @@ -10825,8 +10980,8 @@ def test_parse_conversation_model_path(): def test_conversation_profile_path(): - project = "oyster" - conversation_profile = "nudibranch" + project = "scallop" + conversation_profile = "abalone" expected = "projects/{project}/conversationProfiles/{conversation_profile}".format( project=project, conversation_profile=conversation_profile, @@ -10839,8 +10994,8 @@ def test_conversation_profile_path(): def test_parse_conversation_profile_path(): expected = { - "project": "cuttlefish", - "conversation_profile": "mussel", + "project": "squid", + "conversation_profile": "clam", } path = ConversationsClient.conversation_profile_path(**expected) @@ -10850,9 +11005,9 @@ def test_parse_conversation_profile_path(): def test_cx_security_settings_path(): - project = "winkle" - location = "nautilus" - security_settings = "scallop" + project = "whelk" + location = "octopus" + security_settings = "oyster" expected = "projects/{project}/locations/{location}/securitySettings/{security_settings}".format( project=project, location=location, @@ -10866,9 +11021,9 @@ def test_cx_security_settings_path(): def test_parse_cx_security_settings_path(): expected = { - "project": "abalone", - "location": "squid", - "security_settings": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "security_settings": "mussel", } path = ConversationsClient.cx_security_settings_path(**expected) @@ -10878,10 +11033,10 @@ def test_parse_cx_security_settings_path(): def test_data_store_path(): - project = "whelk" - location = "octopus" - collection = "oyster" - data_store = "nudibranch" + project = "winkle" + location = "nautilus" + collection = "scallop" + data_store = "abalone" expected = "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}".format( project=project, location=location, @@ -10896,10 +11051,10 @@ def test_data_store_path(): def test_parse_data_store_path(): expected = { - "project": "cuttlefish", - "location": "mussel", - "collection": "winkle", - "data_store": "nautilus", + "project": "squid", + "location": "clam", + "collection": "whelk", + "data_store": "octopus", } path = ConversationsClient.data_store_path(**expected) @@ -10909,9 +11064,9 @@ def test_parse_data_store_path(): def test_document_path(): - project = "scallop" - knowledge_base = "abalone" - document = "squid" + project = "oyster" + knowledge_base = "nudibranch" + document = "cuttlefish" expected = "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format( project=project, knowledge_base=knowledge_base, @@ -10923,9 +11078,9 @@ def test_document_path(): def test_parse_document_path(): expected = { - "project": "clam", - "knowledge_base": "whelk", - "document": "octopus", + "project": "mussel", + "knowledge_base": "winkle", + "document": "nautilus", } path = ConversationsClient.document_path(**expected) @@ -10935,9 +11090,9 @@ def test_parse_document_path(): def test_generator_path(): - project = "oyster" - location = "nudibranch" - generator = "cuttlefish" + project = "scallop" + location = "abalone" + generator = "squid" expected = "projects/{project}/locations/{location}/generators/{generator}".format( project=project, location=location, @@ -10949,9 +11104,9 @@ def test_generator_path(): def test_parse_generator_path(): expected = { - "project": "mussel", - "location": "winkle", - "generator": "nautilus", + "project": "clam", + "location": "whelk", + "generator": "octopus", } path = ConversationsClient.generator_path(**expected) @@ -10961,8 +11116,8 @@ def test_parse_generator_path(): def test_knowledge_base_path(): - project = "scallop" - knowledge_base = "abalone" + project = "oyster" + knowledge_base = "nudibranch" expected = "projects/{project}/knowledgeBases/{knowledge_base}".format( project=project, knowledge_base=knowledge_base, @@ -10973,8 +11128,8 @@ def test_knowledge_base_path(): def test_parse_knowledge_base_path(): expected = { - "project": "squid", - "knowledge_base": "clam", + "project": "cuttlefish", + "knowledge_base": "mussel", } path = ConversationsClient.knowledge_base_path(**expected) @@ -10984,9 +11139,9 @@ def test_parse_knowledge_base_path(): def test_message_path(): - project = "whelk" - conversation = "octopus" - message = "oyster" + project = "winkle" + conversation = "nautilus" + message = "scallop" expected = ( "projects/{project}/conversations/{conversation}/messages/{message}".format( project=project, @@ -11000,9 +11155,9 @@ def test_message_path(): def test_parse_message_path(): expected = { - "project": "nudibranch", - "conversation": "cuttlefish", - "message": "mussel", + "project": "abalone", + "conversation": "squid", + "message": "clam", } path = ConversationsClient.message_path(**expected) @@ -11012,9 +11167,9 @@ def test_parse_message_path(): def test_phrase_set_path(): - project = "winkle" - location = "nautilus" - phrase_set = "scallop" + project = "whelk" + location = "octopus" + phrase_set = "oyster" expected = "projects/{project}/locations/{location}/phraseSets/{phrase_set}".format( project=project, location=location, @@ -11026,9 +11181,9 @@ def test_phrase_set_path(): def test_parse_phrase_set_path(): expected = { - "project": "abalone", - "location": "squid", - "phrase_set": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "phrase_set": "mussel", } path = ConversationsClient.phrase_set_path(**expected) @@ -11038,9 +11193,9 @@ def test_parse_phrase_set_path(): def test_tool_path(): - project = "whelk" - location = "octopus" - tool = "oyster" + project = "winkle" + location = "nautilus" + tool = "scallop" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -11052,9 +11207,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "tool": "mussel", + "project": "abalone", + "location": "squid", + "tool": "clam", + } + path = ConversationsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "whelk" + location = "octopus" + app = "oyster" + tool = "nudibranch" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = ConversationsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "tool": "nautilus", } path = ConversationsClient.tool_path(**expected) @@ -11063,8 +11247,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "scallop" + location = "abalone" + app = "squid" + toolset = "clam" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = ConversationsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "whelk", + "location": "octopus", + "app": "oyster", + "toolset": "nudibranch", + } + path = ConversationsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -11074,7 +11289,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "mussel", } path = ConversationsClient.common_billing_account_path(**expected) @@ -11084,7 +11299,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -11094,7 +11309,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nautilus", } path = ConversationsClient.common_folder_path(**expected) @@ -11104,7 +11319,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -11114,7 +11329,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "abalone", } path = ConversationsClient.common_organization_path(**expected) @@ -11124,7 +11339,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -11134,7 +11349,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "clam", } path = ConversationsClient.common_project_path(**expected) @@ -11144,8 +11359,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -11156,8 +11371,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "oyster", + "location": "nudibranch", } path = ConversationsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generator_evaluations.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generator_evaluations.py index bfd7170a00cc..6ff1586e0777 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generator_evaluations.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generator_evaluations.py @@ -75,10 +75,14 @@ ) from google.cloud.dialogflow_v2.types import ( agent_coaching_instruction, + ces_app, + ces_tool, generator, generator_evaluation, operations, + tool, tool_call, + toolset, ) from google.cloud.dialogflow_v2.types import ( generator_evaluation as gcd_generator_evaluation, @@ -4320,6 +4324,9 @@ def test_create_generator_evaluation_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -4330,6 +4337,9 @@ def test_create_generator_evaluation_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_toolset": "ces_toolset_value", + "ces_tool": "ces_tool_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -4360,6 +4370,19 @@ def test_create_generator_evaluation_rest_call_success(request_type): "enable_deduping": True, "similarity_threshold": 0.21630000000000002, }, + "toolset_tools": [ + { + "toolset": "toolset_value", + "operation_id": "operation_id_value", + "confirmation_requirement": 1, + } + ], + "ces_tool_specs": [ + {"ces_tool": "ces_tool_value", "confirmation_requirement": 1} + ], + "ces_app_specs": [ + {"ces_app": "ces_app_value", "confirmation_requirement": 1} + ], }, "summarization_metrics": { "summarization_evaluation_results": [ @@ -5926,10 +5949,36 @@ def test_generator_evaluations_grpc_lro_async_client(): assert transport.operations_client is transport.operations_client -def test_generator_path(): +def test_app_path(): project = "squid" location = "clam" - generator = "whelk" + app = "whelk" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = GeneratorEvaluationsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "octopus", + "location": "oyster", + "app": "nudibranch", + } + path = GeneratorEvaluationsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorEvaluationsClient.parse_app_path(path) + assert expected == actual + + +def test_generator_path(): + project = "cuttlefish" + location = "mussel" + generator = "winkle" expected = "projects/{project}/locations/{location}/generators/{generator}".format( project=project, location=location, @@ -5941,9 +5990,9 @@ def test_generator_path(): def test_parse_generator_path(): expected = { - "project": "octopus", - "location": "oyster", - "generator": "nudibranch", + "project": "nautilus", + "location": "scallop", + "generator": "abalone", } path = GeneratorEvaluationsClient.generator_path(**expected) @@ -5953,10 +6002,10 @@ def test_parse_generator_path(): def test_generator_evaluation_path(): - project = "cuttlefish" - location = "mussel" - generator = "winkle" - evaluation = "nautilus" + project = "squid" + location = "clam" + generator = "whelk" + evaluation = "octopus" expected = "projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}".format( project=project, location=location, @@ -5971,10 +6020,10 @@ def test_generator_evaluation_path(): def test_parse_generator_evaluation_path(): expected = { - "project": "scallop", - "location": "abalone", - "generator": "squid", - "evaluation": "clam", + "project": "oyster", + "location": "nudibranch", + "generator": "cuttlefish", + "evaluation": "mussel", } path = GeneratorEvaluationsClient.generator_evaluation_path(**expected) @@ -5984,9 +6033,9 @@ def test_parse_generator_evaluation_path(): def test_tool_path(): - project = "whelk" - location = "octopus" - tool = "oyster" + project = "winkle" + location = "nautilus" + tool = "scallop" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -5998,9 +6047,9 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "tool": "mussel", + "project": "abalone", + "location": "squid", + "tool": "clam", } path = GeneratorEvaluationsClient.tool_path(**expected) @@ -6009,8 +6058,68 @@ def test_parse_tool_path(): assert expected == actual +def test_tool_path(): + project = "whelk" + location = "octopus" + app = "oyster" + tool = "nudibranch" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = GeneratorEvaluationsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "tool": "nautilus", + } + path = GeneratorEvaluationsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorEvaluationsClient.parse_tool_path(path) + assert expected == actual + + +def test_toolset_path(): + project = "scallop" + location = "abalone" + app = "squid" + toolset = "clam" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = GeneratorEvaluationsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "whelk", + "location": "octopus", + "app": "oyster", + "toolset": "nudibranch", + } + path = GeneratorEvaluationsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorEvaluationsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -6020,7 +6129,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "mussel", } path = GeneratorEvaluationsClient.common_billing_account_path(**expected) @@ -6030,7 +6139,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -6040,7 +6149,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nautilus", } path = GeneratorEvaluationsClient.common_folder_path(**expected) @@ -6050,7 +6159,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -6060,7 +6169,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "abalone", } path = GeneratorEvaluationsClient.common_organization_path(**expected) @@ -6070,7 +6179,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -6080,7 +6189,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "clam", } path = GeneratorEvaluationsClient.common_project_path(**expected) @@ -6090,8 +6199,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -6102,8 +6211,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "oyster", + "location": "nudibranch", } path = GeneratorEvaluationsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generators.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generators.py index bd8a0c9ee9fd..9b2362634409 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generators.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_generators.py @@ -70,8 +70,12 @@ ) from google.cloud.dialogflow_v2.types import ( agent_coaching_instruction, + ces_app, + ces_tool, generator, + tool, tool_call, + toolset, ) from google.cloud.dialogflow_v2.types import generator as gcd_generator @@ -4631,6 +4635,9 @@ def test_create_generator_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -4641,6 +4648,9 @@ def test_create_generator_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_toolset": "ces_toolset_value", + "ces_tool": "ces_tool_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -4671,6 +4681,17 @@ def test_create_generator_rest_call_success(request_type): "enable_deduping": True, "similarity_threshold": 0.21630000000000002, }, + "toolset_tools": [ + { + "toolset": "toolset_value", + "operation_id": "operation_id_value", + "confirmation_requirement": 1, + } + ], + "ces_tool_specs": [ + {"ces_tool": "ces_tool_value", "confirmation_requirement": 1} + ], + "ces_app_specs": [{"ces_app": "ces_app_value", "confirmation_requirement": 1}], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -5336,6 +5357,9 @@ def test_update_generator_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -5346,6 +5370,9 @@ def test_update_generator_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_toolset": "ces_toolset_value", + "ces_tool": "ces_tool_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -5376,6 +5403,17 @@ def test_update_generator_rest_call_success(request_type): "enable_deduping": True, "similarity_threshold": 0.21630000000000002, }, + "toolset_tools": [ + { + "toolset": "toolset_value", + "operation_id": "operation_id_value", + "confirmation_requirement": 1, + } + ], + "ces_tool_specs": [ + {"ces_tool": "ces_tool_value", "confirmation_requirement": 1} + ], + "ces_app_specs": [{"ces_app": "ces_app_value", "confirmation_requirement": 1}], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -6410,10 +6448,36 @@ def test_generators_transport_channel_mtls_with_adc(transport_class): assert transport.grpc_channel == mock_grpc_channel -def test_generator_path(): +def test_app_path(): project = "squid" location = "clam" - generator = "whelk" + app = "whelk" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = GeneratorsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "octopus", + "location": "oyster", + "app": "nudibranch", + } + path = GeneratorsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorsClient.parse_app_path(path) + assert expected == actual + + +def test_generator_path(): + project = "cuttlefish" + location = "mussel" + generator = "winkle" expected = "projects/{project}/locations/{location}/generators/{generator}".format( project=project, location=location, @@ -6425,9 +6489,9 @@ def test_generator_path(): def test_parse_generator_path(): expected = { - "project": "octopus", - "location": "oyster", - "generator": "nudibranch", + "project": "nautilus", + "location": "scallop", + "generator": "abalone", } path = GeneratorsClient.generator_path(**expected) @@ -6437,9 +6501,9 @@ def test_parse_generator_path(): def test_tool_path(): - project = "cuttlefish" - location = "mussel" - tool = "winkle" + project = "squid" + location = "clam" + tool = "whelk" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -6451,9 +6515,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nautilus", - "location": "scallop", - "tool": "abalone", + "project": "octopus", + "location": "oyster", + "tool": "nudibranch", + } + path = GeneratorsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "cuttlefish" + location = "mussel" + app = "winkle" + tool = "nautilus" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = GeneratorsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "scallop", + "location": "abalone", + "app": "squid", + "tool": "clam", } path = GeneratorsClient.tool_path(**expected) @@ -6462,8 +6555,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "whelk" + location = "octopus" + app = "oyster" + toolset = "nudibranch" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = GeneratorsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "toolset": "nautilus", + } + path = GeneratorsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "squid" + billing_account = "scallop" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -6473,7 +6597,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "clam", + "billing_account": "abalone", } path = GeneratorsClient.common_billing_account_path(**expected) @@ -6483,7 +6607,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "whelk" + folder = "squid" expected = "folders/{folder}".format( folder=folder, ) @@ -6493,7 +6617,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "octopus", + "folder": "clam", } path = GeneratorsClient.common_folder_path(**expected) @@ -6503,7 +6627,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "oyster" + organization = "whelk" expected = "organizations/{organization}".format( organization=organization, ) @@ -6513,7 +6637,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "nudibranch", + "organization": "octopus", } path = GeneratorsClient.common_organization_path(**expected) @@ -6523,7 +6647,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "cuttlefish" + project = "oyster" expected = "projects/{project}".format( project=project, ) @@ -6533,7 +6657,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "mussel", + "project": "nudibranch", } path = GeneratorsClient.common_project_path(**expected) @@ -6543,8 +6667,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "winkle" - location = "nautilus" + project = "cuttlefish" + location = "mussel" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -6555,8 +6679,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "scallop", - "location": "abalone", + "project": "winkle", + "location": "nautilus", } path = GeneratorsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py index 962ac7ab2177..58e9ee94e9ea 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2/test_participants.py @@ -9518,10 +9518,36 @@ def test_parse_answer_record_path(): assert expected == actual -def test_context_path(): +def test_app_path(): project = "oyster" - session = "nudibranch" - context = "cuttlefish" + location = "nudibranch" + app = "cuttlefish" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = ParticipantsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "mussel", + "location": "winkle", + "app": "nautilus", + } + path = ParticipantsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = ParticipantsClient.parse_app_path(path) + assert expected == actual + + +def test_context_path(): + project = "scallop" + session = "abalone" + context = "squid" expected = "projects/{project}/agent/sessions/{session}/contexts/{context}".format( project=project, session=session, @@ -9533,9 +9559,9 @@ def test_context_path(): def test_parse_context_path(): expected = { - "project": "mussel", - "session": "winkle", - "context": "nautilus", + "project": "clam", + "session": "whelk", + "context": "octopus", } path = ParticipantsClient.context_path(**expected) @@ -9545,8 +9571,8 @@ def test_parse_context_path(): def test_intent_path(): - project = "scallop" - intent = "abalone" + project = "oyster" + intent = "nudibranch" expected = "projects/{project}/agent/intents/{intent}".format( project=project, intent=intent, @@ -9557,8 +9583,8 @@ def test_intent_path(): def test_parse_intent_path(): expected = { - "project": "squid", - "intent": "clam", + "project": "cuttlefish", + "intent": "mussel", } path = ParticipantsClient.intent_path(**expected) @@ -9568,9 +9594,9 @@ def test_parse_intent_path(): def test_message_path(): - project = "whelk" - conversation = "octopus" - message = "oyster" + project = "winkle" + conversation = "nautilus" + message = "scallop" expected = ( "projects/{project}/conversations/{conversation}/messages/{message}".format( project=project, @@ -9584,9 +9610,9 @@ def test_message_path(): def test_parse_message_path(): expected = { - "project": "nudibranch", - "conversation": "cuttlefish", - "message": "mussel", + "project": "abalone", + "conversation": "squid", + "message": "clam", } path = ParticipantsClient.message_path(**expected) @@ -9596,9 +9622,9 @@ def test_parse_message_path(): def test_participant_path(): - project = "winkle" - conversation = "nautilus" - participant = "scallop" + project = "whelk" + conversation = "octopus" + participant = "oyster" expected = "projects/{project}/conversations/{conversation}/participants/{participant}".format( project=project, conversation=conversation, @@ -9610,9 +9636,9 @@ def test_participant_path(): def test_parse_participant_path(): expected = { - "project": "abalone", - "conversation": "squid", - "participant": "clam", + "project": "nudibranch", + "conversation": "cuttlefish", + "participant": "mussel", } path = ParticipantsClient.participant_path(**expected) @@ -9622,9 +9648,9 @@ def test_parse_participant_path(): def test_phrase_set_path(): - project = "whelk" - location = "octopus" - phrase_set = "oyster" + project = "winkle" + location = "nautilus" + phrase_set = "scallop" expected = "projects/{project}/locations/{location}/phraseSets/{phrase_set}".format( project=project, location=location, @@ -9636,9 +9662,9 @@ def test_phrase_set_path(): def test_parse_phrase_set_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "phrase_set": "mussel", + "project": "abalone", + "location": "squid", + "phrase_set": "clam", } path = ParticipantsClient.phrase_set_path(**expected) @@ -9648,9 +9674,9 @@ def test_parse_phrase_set_path(): def test_session_entity_type_path(): - project = "winkle" - session = "nautilus" - entity_type = "scallop" + project = "whelk" + session = "octopus" + entity_type = "oyster" expected = ( "projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}".format( project=project, @@ -9664,9 +9690,9 @@ def test_session_entity_type_path(): def test_parse_session_entity_type_path(): expected = { - "project": "abalone", - "session": "squid", - "entity_type": "clam", + "project": "nudibranch", + "session": "cuttlefish", + "entity_type": "mussel", } path = ParticipantsClient.session_entity_type_path(**expected) @@ -9676,9 +9702,9 @@ def test_parse_session_entity_type_path(): def test_tool_path(): - project = "whelk" - location = "octopus" - tool = "oyster" + project = "winkle" + location = "nautilus" + tool = "scallop" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -9690,9 +9716,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "tool": "mussel", + "project": "abalone", + "location": "squid", + "tool": "clam", + } + path = ParticipantsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = ParticipantsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "whelk" + location = "octopus" + app = "oyster" + tool = "nudibranch" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = ParticipantsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "tool": "nautilus", } path = ParticipantsClient.tool_path(**expected) @@ -9701,8 +9756,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "scallop" + location = "abalone" + app = "squid" + toolset = "clam" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = ParticipantsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "whelk", + "location": "octopus", + "app": "oyster", + "toolset": "nudibranch", + } + path = ParticipantsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = ParticipantsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -9712,7 +9798,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "mussel", } path = ParticipantsClient.common_billing_account_path(**expected) @@ -9722,7 +9808,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -9732,7 +9818,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nautilus", } path = ParticipantsClient.common_folder_path(**expected) @@ -9742,7 +9828,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -9752,7 +9838,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "abalone", } path = ParticipantsClient.common_organization_path(**expected) @@ -9762,7 +9848,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -9772,7 +9858,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "clam", } path = ParticipantsClient.common_project_path(**expected) @@ -9782,8 +9868,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -9794,8 +9880,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "oyster", + "location": "nudibranch", } path = ParticipantsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py index 521093b9d3b0..b82178d6c654 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_answer_records.py @@ -3815,6 +3815,9 @@ def test_update_answer_record_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -3825,6 +3828,9 @@ def test_update_answer_record_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -4858,10 +4864,36 @@ def test_parse_answer_record_path(): assert expected == actual -def test_context_path(): +def test_app_path(): project = "oyster" - session = "nudibranch" - context = "cuttlefish" + location = "nudibranch" + app = "cuttlefish" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = AnswerRecordsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "mussel", + "location": "winkle", + "app": "nautilus", + } + path = AnswerRecordsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = AnswerRecordsClient.parse_app_path(path) + assert expected == actual + + +def test_context_path(): + project = "scallop" + session = "abalone" + context = "squid" expected = "projects/{project}/agent/sessions/{session}/contexts/{context}".format( project=project, session=session, @@ -4873,9 +4905,9 @@ def test_context_path(): def test_parse_context_path(): expected = { - "project": "mussel", - "session": "winkle", - "context": "nautilus", + "project": "clam", + "session": "whelk", + "context": "octopus", } path = AnswerRecordsClient.context_path(**expected) @@ -4885,9 +4917,9 @@ def test_parse_context_path(): def test_document_path(): - project = "scallop" - knowledge_base = "abalone" - document = "squid" + project = "oyster" + knowledge_base = "nudibranch" + document = "cuttlefish" expected = "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format( project=project, knowledge_base=knowledge_base, @@ -4899,9 +4931,9 @@ def test_document_path(): def test_parse_document_path(): expected = { - "project": "clam", - "knowledge_base": "whelk", - "document": "octopus", + "project": "mussel", + "knowledge_base": "winkle", + "document": "nautilus", } path = AnswerRecordsClient.document_path(**expected) @@ -4911,8 +4943,8 @@ def test_parse_document_path(): def test_intent_path(): - project = "oyster" - intent = "nudibranch" + project = "scallop" + intent = "abalone" expected = "projects/{project}/agent/intents/{intent}".format( project=project, intent=intent, @@ -4923,8 +4955,8 @@ def test_intent_path(): def test_parse_intent_path(): expected = { - "project": "cuttlefish", - "intent": "mussel", + "project": "squid", + "intent": "clam", } path = AnswerRecordsClient.intent_path(**expected) @@ -4934,9 +4966,9 @@ def test_parse_intent_path(): def test_tool_path(): - project = "winkle" - location = "nautilus" - tool = "scallop" + project = "whelk" + location = "octopus" + tool = "oyster" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -4948,9 +4980,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "abalone", - "location": "squid", - "tool": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "tool": "mussel", + } + path = AnswerRecordsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = AnswerRecordsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "winkle" + location = "nautilus" + app = "scallop" + tool = "abalone" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = AnswerRecordsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "squid", + "location": "clam", + "app": "whelk", + "tool": "octopus", } path = AnswerRecordsClient.tool_path(**expected) @@ -4959,8 +5020,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "oyster" + location = "nudibranch" + app = "cuttlefish" + toolset = "mussel" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = AnswerRecordsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "winkle", + "location": "nautilus", + "app": "scallop", + "toolset": "abalone", + } + path = AnswerRecordsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = AnswerRecordsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "whelk" + billing_account = "squid" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -4970,7 +5062,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "octopus", + "billing_account": "clam", } path = AnswerRecordsClient.common_billing_account_path(**expected) @@ -4980,7 +5072,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "oyster" + folder = "whelk" expected = "folders/{folder}".format( folder=folder, ) @@ -4990,7 +5082,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nudibranch", + "folder": "octopus", } path = AnswerRecordsClient.common_folder_path(**expected) @@ -5000,7 +5092,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "cuttlefish" + organization = "oyster" expected = "organizations/{organization}".format( organization=organization, ) @@ -5010,7 +5102,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "mussel", + "organization": "nudibranch", } path = AnswerRecordsClient.common_organization_path(**expected) @@ -5020,7 +5112,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "winkle" + project = "cuttlefish" expected = "projects/{project}".format( project=project, ) @@ -5030,7 +5122,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "nautilus", + "project": "mussel", } path = AnswerRecordsClient.common_project_path(**expected) @@ -5040,8 +5132,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "scallop" - location = "abalone" + project = "winkle" + location = "nautilus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -5052,8 +5144,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "squid", - "location": "clam", + "project": "scallop", + "location": "abalone", } path = AnswerRecordsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py index 5ab875a76843..0bc929fb9e1a 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversation_profiles.py @@ -1971,6 +1971,7 @@ def test_get_conversation_profile(request_type, transport: str = "grpc"): call.return_value = conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -1987,6 +1988,7 @@ def test_get_conversation_profile(request_type, transport: str = "grpc"): assert isinstance(response, conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -2127,6 +2129,7 @@ async def test_get_conversation_profile_async( conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -2144,6 +2147,7 @@ async def test_get_conversation_profile_async( assert isinstance(response, conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -2330,6 +2334,7 @@ def test_create_conversation_profile(request_type, transport: str = "grpc"): call.return_value = gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -2346,6 +2351,7 @@ def test_create_conversation_profile(request_type, transport: str = "grpc"): assert isinstance(response, gcd_conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -2486,6 +2492,7 @@ async def test_create_conversation_profile_async( gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -2503,6 +2510,7 @@ async def test_create_conversation_profile_async( assert isinstance(response, gcd_conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -2707,6 +2715,7 @@ def test_update_conversation_profile(request_type, transport: str = "grpc"): call.return_value = gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -2723,6 +2732,7 @@ def test_update_conversation_profile(request_type, transport: str = "grpc"): assert isinstance(response, gcd_conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -2859,6 +2869,7 @@ async def test_update_conversation_profile_async( gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -2876,6 +2887,7 @@ async def test_update_conversation_profile_async( assert isinstance(response, gcd_conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -5910,6 +5922,7 @@ async def test_get_conversation_profile_empty_call_grpc_asyncio(): conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -5943,6 +5956,7 @@ async def test_create_conversation_profile_empty_call_grpc_asyncio(): gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -5976,6 +5990,7 @@ async def test_update_conversation_profile_empty_call_grpc_asyncio(): gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -6265,6 +6280,7 @@ def test_get_conversation_profile_rest_call_success(request_type): return_value = conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -6286,6 +6302,7 @@ def test_get_conversation_profile_rest_call_success(request_type): assert isinstance(response, conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -6408,6 +6425,7 @@ def test_create_conversation_profile_rest_call_success(request_type): "display_name": "display_name_value", "create_time": {"seconds": 751, "nanos": 543}, "update_time": {}, + "use_bidi_streaming": True, "automated_agent_config": { "agent": "agent_value", "session_ttl": {"seconds": 751, "nanos": 543}, @@ -6475,6 +6493,7 @@ def test_create_conversation_profile_rest_call_success(request_type): "message_analysis_config": { "enable_entity_extraction": True, "enable_sentiment_analysis": True, + "enable_sentiment_analysis_v3": True, }, }, "human_agent_handoff_config": { @@ -6600,6 +6619,7 @@ def get_message_fields(field): return_value = gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -6621,6 +6641,7 @@ def get_message_fields(field): assert isinstance(response, gcd_conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" @@ -6751,6 +6772,7 @@ def test_update_conversation_profile_rest_call_success(request_type): "display_name": "display_name_value", "create_time": {"seconds": 751, "nanos": 543}, "update_time": {}, + "use_bidi_streaming": True, "automated_agent_config": { "agent": "agent_value", "session_ttl": {"seconds": 751, "nanos": 543}, @@ -6818,6 +6840,7 @@ def test_update_conversation_profile_rest_call_success(request_type): "message_analysis_config": { "enable_entity_extraction": True, "enable_sentiment_analysis": True, + "enable_sentiment_analysis_v3": True, }, }, "human_agent_handoff_config": { @@ -6943,6 +6966,7 @@ def get_message_fields(field): return_value = gcd_conversation_profile.ConversationProfile( name="name_value", display_name="display_name_value", + use_bidi_streaming=True, language_code="language_code_value", time_zone="time_zone_value", security_settings="security_settings_value", @@ -6964,6 +6988,7 @@ def get_message_fields(field): assert isinstance(response, gcd_conversation_profile.ConversationProfile) assert response.name == "name_value" assert response.display_name == "display_name_value" + assert response.use_bidi_streaming is True assert response.language_code == "language_code_value" assert response.time_zone == "time_zone_value" assert response.security_settings == "security_settings_value" diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py index bdaf51c03f25..85af8b858da7 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_conversations.py @@ -71,12 +71,16 @@ from google.cloud.dialogflow_v2beta1.types import ( agent_coaching_instruction, audio_config, + ces_app, + ces_tool, conversation, conversation_profile, generator, participant, session, + tool, tool_call, + toolset, ) from google.cloud.dialogflow_v2beta1.types import conversation as gcd_conversation @@ -8742,7 +8746,133 @@ def test_create_conversation_rest_call_success(request_type): {"mime_type": "mime_type_value", "content": b"content_blob"} ], }, + "initial_conversation_profile": { + "name": "name_value", + "display_name": "display_name_value", + "create_time": {}, + "update_time": {}, + "use_bidi_streaming": True, + "automated_agent_config": { + "agent": "agent_value", + "session_ttl": {"seconds": 751, "nanos": 543}, + }, + "human_agent_assistant_config": { + "notification_config": {"topic": "topic_value", "message_format": 1}, + "human_agent_suggestion_config": { + "feature_configs": [ + { + "suggestion_feature": {"type_": 1}, + "enable_event_based_suggestion": True, + "disable_agent_query_logging": True, + "enable_query_suggestion_when_no_answer": True, + "enable_conversation_augmented_query": True, + "enable_query_suggestion_only": True, + "enable_response_debug_info": True, + "rai_settings": { + "rai_category_configs": [ + {"category": 1, "sensitivity_level": 1} + ] + }, + "suggestion_trigger_settings": { + "no_small_talk": True, + "only_end_user": True, + }, + "query_config": { + "knowledge_base_query_source": { + "knowledge_bases": [ + "knowledge_bases_value1", + "knowledge_bases_value2", + ] + }, + "document_query_source": { + "documents": [ + "documents_value1", + "documents_value2", + ] + }, + "dialogflow_query_source": { + "agent": "agent_value", + "human_agent_side_config": {"agent": "agent_value"}, + }, + "max_results": 1207, + "confidence_threshold": 0.2106, + "context_filter_settings": { + "drop_handoff_messages": True, + "drop_virtual_agent_messages": True, + "drop_ivr_messages": True, + }, + "sections": {"section_types": [1]}, + "context_size": 1311, + }, + "conversation_model_config": { + "model": "model_value", + "baseline_model_version": "baseline_model_version_value", + }, + "conversation_process_config": { + "recent_sentences_count": 2352 + }, + } + ], + "group_suggestion_responses": True, + "generators": ["generators_value1", "generators_value2"], + "disable_high_latency_features_sync_delivery": True, + "skip_empty_event_based_suggestion": True, + "use_unredacted_conversation_data": True, + "enable_async_tool_call": True, + }, + "end_user_suggestion_config": {}, + "message_analysis_config": { + "enable_entity_extraction": True, + "enable_sentiment_analysis": True, + "enable_sentiment_analysis_v3": True, + }, + }, + "human_agent_handoff_config": { + "live_person_config": {"account_number": "account_number_value"}, + "salesforce_live_agent_config": { + "organization_id": "organization_id_value", + "deployment_id": "deployment_id_value", + "button_id": "button_id_value", + "endpoint_domain": "endpoint_domain_value", + }, + }, + "notification_config": {}, + "logging_config": {"enable_stackdriver_logging": True}, + "new_message_event_notification_config": {}, + "new_recognition_result_notification_config": {}, + "stt_config": { + "speech_model_variant": 1, + "model": "model_value", + "phrase_sets": ["phrase_sets_value1", "phrase_sets_value2"], + "audio_encoding": 1, + "sample_rate_hertz": 1817, + "language_code": "language_code_value", + "enable_word_info": True, + "use_timeout_based_endpointing": True, + }, + "language_code": "language_code_value", + "time_zone": "time_zone_value", + "security_settings": "security_settings_value", + "tts_config": { + "speaking_rate": 0.1373, + "pitch": 0.536, + "volume_gain_db": 0.1467, + "effects_profile_id": [ + "effects_profile_id_value1", + "effects_profile_id_value2", + ], + "voice": {"name": "name_value", "ssml_gender": 1}, + "pronunciations": [ + { + "phrase": "phrase_value", + "phonetic_encoding": 1, + "pronunciation": "pronunciation_value", + } + ], + }, + }, "ingested_context_references": {}, + "initial_generator_contexts": {}, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -11527,9 +11657,35 @@ def test_parse_answer_record_path(): assert expected == actual -def test_conversation_path(): +def test_app_path(): project = "cuttlefish" - conversation = "mussel" + location = "mussel" + app = "winkle" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = ConversationsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "nautilus", + "location": "scallop", + "app": "abalone", + } + path = ConversationsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationsClient.parse_app_path(path) + assert expected == actual + + +def test_conversation_path(): + project = "squid" + conversation = "clam" expected = "projects/{project}/conversations/{conversation}".format( project=project, conversation=conversation, @@ -11540,8 +11696,8 @@ def test_conversation_path(): def test_parse_conversation_path(): expected = { - "project": "winkle", - "conversation": "nautilus", + "project": "whelk", + "conversation": "octopus", } path = ConversationsClient.conversation_path(**expected) @@ -11551,9 +11707,9 @@ def test_parse_conversation_path(): def test_conversation_model_path(): - project = "scallop" - location = "abalone" - conversation_model = "squid" + project = "oyster" + location = "nudibranch" + conversation_model = "cuttlefish" expected = "projects/{project}/locations/{location}/conversationModels/{conversation_model}".format( project=project, location=location, @@ -11567,9 +11723,9 @@ def test_conversation_model_path(): def test_parse_conversation_model_path(): expected = { - "project": "clam", - "location": "whelk", - "conversation_model": "octopus", + "project": "mussel", + "location": "winkle", + "conversation_model": "nautilus", } path = ConversationsClient.conversation_model_path(**expected) @@ -11579,8 +11735,8 @@ def test_parse_conversation_model_path(): def test_conversation_profile_path(): - project = "oyster" - conversation_profile = "nudibranch" + project = "scallop" + conversation_profile = "abalone" expected = "projects/{project}/conversationProfiles/{conversation_profile}".format( project=project, conversation_profile=conversation_profile, @@ -11593,8 +11749,8 @@ def test_conversation_profile_path(): def test_parse_conversation_profile_path(): expected = { - "project": "cuttlefish", - "conversation_profile": "mussel", + "project": "squid", + "conversation_profile": "clam", } path = ConversationsClient.conversation_profile_path(**expected) @@ -11604,9 +11760,9 @@ def test_parse_conversation_profile_path(): def test_cx_security_settings_path(): - project = "winkle" - location = "nautilus" - security_settings = "scallop" + project = "whelk" + location = "octopus" + security_settings = "oyster" expected = "projects/{project}/locations/{location}/securitySettings/{security_settings}".format( project=project, location=location, @@ -11620,9 +11776,9 @@ def test_cx_security_settings_path(): def test_parse_cx_security_settings_path(): expected = { - "project": "abalone", - "location": "squid", - "security_settings": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "security_settings": "mussel", } path = ConversationsClient.cx_security_settings_path(**expected) @@ -11632,10 +11788,10 @@ def test_parse_cx_security_settings_path(): def test_data_store_path(): - project = "whelk" - location = "octopus" - collection = "oyster" - data_store = "nudibranch" + project = "winkle" + location = "nautilus" + collection = "scallop" + data_store = "abalone" expected = "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}".format( project=project, location=location, @@ -11650,10 +11806,10 @@ def test_data_store_path(): def test_parse_data_store_path(): expected = { - "project": "cuttlefish", - "location": "mussel", - "collection": "winkle", - "data_store": "nautilus", + "project": "squid", + "location": "clam", + "collection": "whelk", + "data_store": "octopus", } path = ConversationsClient.data_store_path(**expected) @@ -11663,9 +11819,9 @@ def test_parse_data_store_path(): def test_document_path(): - project = "scallop" - knowledge_base = "abalone" - document = "squid" + project = "oyster" + knowledge_base = "nudibranch" + document = "cuttlefish" expected = "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format( project=project, knowledge_base=knowledge_base, @@ -11677,9 +11833,9 @@ def test_document_path(): def test_parse_document_path(): expected = { - "project": "clam", - "knowledge_base": "whelk", - "document": "octopus", + "project": "mussel", + "knowledge_base": "winkle", + "document": "nautilus", } path = ConversationsClient.document_path(**expected) @@ -11689,9 +11845,9 @@ def test_parse_document_path(): def test_generator_path(): - project = "oyster" - location = "nudibranch" - generator = "cuttlefish" + project = "scallop" + location = "abalone" + generator = "squid" expected = "projects/{project}/locations/{location}/generators/{generator}".format( project=project, location=location, @@ -11703,9 +11859,9 @@ def test_generator_path(): def test_parse_generator_path(): expected = { - "project": "mussel", - "location": "winkle", - "generator": "nautilus", + "project": "clam", + "location": "whelk", + "generator": "octopus", } path = ConversationsClient.generator_path(**expected) @@ -11715,8 +11871,8 @@ def test_parse_generator_path(): def test_knowledge_base_path(): - project = "scallop" - knowledge_base = "abalone" + project = "oyster" + knowledge_base = "nudibranch" expected = "projects/{project}/knowledgeBases/{knowledge_base}".format( project=project, knowledge_base=knowledge_base, @@ -11727,8 +11883,8 @@ def test_knowledge_base_path(): def test_parse_knowledge_base_path(): expected = { - "project": "squid", - "knowledge_base": "clam", + "project": "cuttlefish", + "knowledge_base": "mussel", } path = ConversationsClient.knowledge_base_path(**expected) @@ -11738,9 +11894,9 @@ def test_parse_knowledge_base_path(): def test_message_path(): - project = "whelk" - conversation = "octopus" - message = "oyster" + project = "winkle" + conversation = "nautilus" + message = "scallop" expected = ( "projects/{project}/conversations/{conversation}/messages/{message}".format( project=project, @@ -11754,9 +11910,9 @@ def test_message_path(): def test_parse_message_path(): expected = { - "project": "nudibranch", - "conversation": "cuttlefish", - "message": "mussel", + "project": "abalone", + "conversation": "squid", + "message": "clam", } path = ConversationsClient.message_path(**expected) @@ -11766,9 +11922,9 @@ def test_parse_message_path(): def test_phrase_set_path(): - project = "winkle" - location = "nautilus" - phrase_set = "scallop" + project = "whelk" + location = "octopus" + phrase_set = "oyster" expected = "projects/{project}/locations/{location}/phraseSets/{phrase_set}".format( project=project, location=location, @@ -11780,9 +11936,9 @@ def test_phrase_set_path(): def test_parse_phrase_set_path(): expected = { - "project": "abalone", - "location": "squid", - "phrase_set": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "phrase_set": "mussel", } path = ConversationsClient.phrase_set_path(**expected) @@ -11792,9 +11948,9 @@ def test_parse_phrase_set_path(): def test_tool_path(): - project = "whelk" - location = "octopus" - tool = "oyster" + project = "winkle" + location = "nautilus" + tool = "scallop" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -11806,9 +11962,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "tool": "mussel", + "project": "abalone", + "location": "squid", + "tool": "clam", + } + path = ConversationsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "whelk" + location = "octopus" + app = "oyster" + tool = "nudibranch" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = ConversationsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "tool": "nautilus", } path = ConversationsClient.tool_path(**expected) @@ -11817,8 +12002,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "scallop" + location = "abalone" + app = "squid" + toolset = "clam" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = ConversationsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "whelk", + "location": "octopus", + "app": "oyster", + "toolset": "nudibranch", + } + path = ConversationsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = ConversationsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -11828,7 +12044,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "mussel", } path = ConversationsClient.common_billing_account_path(**expected) @@ -11838,7 +12054,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -11848,7 +12064,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nautilus", } path = ConversationsClient.common_folder_path(**expected) @@ -11858,7 +12074,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -11868,7 +12084,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "abalone", } path = ConversationsClient.common_organization_path(**expected) @@ -11878,7 +12094,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -11888,7 +12104,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "clam", } path = ConversationsClient.common_project_path(**expected) @@ -11898,8 +12114,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -11910,8 +12126,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "oyster", + "location": "nudibranch", } path = ConversationsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generator_evaluations.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generator_evaluations.py index b9aa48361e8b..187b51bf57cf 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generator_evaluations.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generator_evaluations.py @@ -75,10 +75,14 @@ ) from google.cloud.dialogflow_v2beta1.types import ( agent_coaching_instruction, + ces_app, + ces_tool, generator, generator_evaluation, operations, + tool, tool_call, + toolset, ) from google.cloud.dialogflow_v2beta1.types import ( generator_evaluation as gcd_generator_evaluation, @@ -4320,6 +4324,9 @@ def test_create_generator_evaluation_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -4330,6 +4337,9 @@ def test_create_generator_evaluation_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -4360,6 +4370,19 @@ def test_create_generator_evaluation_rest_call_success(request_type): "enable_deduping": True, "similarity_threshold": 0.21630000000000002, }, + "toolset_tools": [ + { + "toolset": "toolset_value", + "operation_id": "operation_id_value", + "confirmation_requirement": 1, + } + ], + "ces_tool_specs": [ + {"ces_tool": "ces_tool_value", "confirmation_requirement": 1} + ], + "ces_app_specs": [ + {"ces_app": "ces_app_value", "confirmation_requirement": 1} + ], }, "summarization_metrics": { "summarization_evaluation_results": [ @@ -5926,10 +5949,36 @@ def test_generator_evaluations_grpc_lro_async_client(): assert transport.operations_client is transport.operations_client -def test_generator_path(): +def test_app_path(): project = "squid" location = "clam" - generator = "whelk" + app = "whelk" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = GeneratorEvaluationsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "octopus", + "location": "oyster", + "app": "nudibranch", + } + path = GeneratorEvaluationsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorEvaluationsClient.parse_app_path(path) + assert expected == actual + + +def test_generator_path(): + project = "cuttlefish" + location = "mussel" + generator = "winkle" expected = "projects/{project}/locations/{location}/generators/{generator}".format( project=project, location=location, @@ -5941,9 +5990,9 @@ def test_generator_path(): def test_parse_generator_path(): expected = { - "project": "octopus", - "location": "oyster", - "generator": "nudibranch", + "project": "nautilus", + "location": "scallop", + "generator": "abalone", } path = GeneratorEvaluationsClient.generator_path(**expected) @@ -5953,10 +6002,10 @@ def test_parse_generator_path(): def test_generator_evaluation_path(): - project = "cuttlefish" - location = "mussel" - generator = "winkle" - evaluation = "nautilus" + project = "squid" + location = "clam" + generator = "whelk" + evaluation = "octopus" expected = "projects/{project}/locations/{location}/generators/{generator}/evaluations/{evaluation}".format( project=project, location=location, @@ -5971,10 +6020,10 @@ def test_generator_evaluation_path(): def test_parse_generator_evaluation_path(): expected = { - "project": "scallop", - "location": "abalone", - "generator": "squid", - "evaluation": "clam", + "project": "oyster", + "location": "nudibranch", + "generator": "cuttlefish", + "evaluation": "mussel", } path = GeneratorEvaluationsClient.generator_evaluation_path(**expected) @@ -5984,9 +6033,9 @@ def test_parse_generator_evaluation_path(): def test_tool_path(): - project = "whelk" - location = "octopus" - tool = "oyster" + project = "winkle" + location = "nautilus" + tool = "scallop" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -5998,9 +6047,9 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nudibranch", - "location": "cuttlefish", - "tool": "mussel", + "project": "abalone", + "location": "squid", + "tool": "clam", } path = GeneratorEvaluationsClient.tool_path(**expected) @@ -6009,8 +6058,68 @@ def test_parse_tool_path(): assert expected == actual +def test_tool_path(): + project = "whelk" + location = "octopus" + app = "oyster" + tool = "nudibranch" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = GeneratorEvaluationsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "tool": "nautilus", + } + path = GeneratorEvaluationsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorEvaluationsClient.parse_tool_path(path) + assert expected == actual + + +def test_toolset_path(): + project = "scallop" + location = "abalone" + app = "squid" + toolset = "clam" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = GeneratorEvaluationsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "whelk", + "location": "octopus", + "app": "oyster", + "toolset": "nudibranch", + } + path = GeneratorEvaluationsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorEvaluationsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "winkle" + billing_account = "cuttlefish" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -6020,7 +6129,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nautilus", + "billing_account": "mussel", } path = GeneratorEvaluationsClient.common_billing_account_path(**expected) @@ -6030,7 +6139,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "scallop" + folder = "winkle" expected = "folders/{folder}".format( folder=folder, ) @@ -6040,7 +6149,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "abalone", + "folder": "nautilus", } path = GeneratorEvaluationsClient.common_folder_path(**expected) @@ -6050,7 +6159,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "squid" + organization = "scallop" expected = "organizations/{organization}".format( organization=organization, ) @@ -6060,7 +6169,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "clam", + "organization": "abalone", } path = GeneratorEvaluationsClient.common_organization_path(**expected) @@ -6070,7 +6179,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "whelk" + project = "squid" expected = "projects/{project}".format( project=project, ) @@ -6080,7 +6189,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "octopus", + "project": "clam", } path = GeneratorEvaluationsClient.common_project_path(**expected) @@ -6090,8 +6199,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "oyster" - location = "nudibranch" + project = "whelk" + location = "octopus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -6102,8 +6211,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "cuttlefish", - "location": "mussel", + "project": "oyster", + "location": "nudibranch", } path = GeneratorEvaluationsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generators.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generators.py index 9ae10e043497..21f57d2708dd 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generators.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_generators.py @@ -70,8 +70,12 @@ ) from google.cloud.dialogflow_v2beta1.types import ( agent_coaching_instruction, + ces_app, + ces_tool, generator, + tool, tool_call, + toolset, ) from google.cloud.dialogflow_v2beta1.types import generator as gcd_generator @@ -4635,6 +4639,9 @@ def test_create_generator_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -4645,6 +4652,9 @@ def test_create_generator_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -4675,6 +4685,17 @@ def test_create_generator_rest_call_success(request_type): "enable_deduping": True, "similarity_threshold": 0.21630000000000002, }, + "toolset_tools": [ + { + "toolset": "toolset_value", + "operation_id": "operation_id_value", + "confirmation_requirement": 1, + } + ], + "ces_tool_specs": [ + {"ces_tool": "ces_tool_value", "confirmation_requirement": 1} + ], + "ces_app_specs": [{"ces_app": "ces_app_value", "confirmation_requirement": 1}], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -5340,6 +5361,9 @@ def test_update_generator_rest_call_success(request_type): { "tool_call": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "tool_display_name": "tool_display_name_value", "tool_display_details": "tool_display_details_value", "action": "action_value", @@ -5350,6 +5374,9 @@ def test_update_generator_rest_call_success(request_type): }, "tool_call_result": { "tool": "tool_value", + "ces_tool": "ces_tool_value", + "ces_toolset": "ces_toolset_value", + "ces_app": "ces_app_value", "action": "action_value", "error": {"message": "message_value"}, "raw_content": b"raw_content_blob", @@ -5380,6 +5407,17 @@ def test_update_generator_rest_call_success(request_type): "enable_deduping": True, "similarity_threshold": 0.21630000000000002, }, + "toolset_tools": [ + { + "toolset": "toolset_value", + "operation_id": "operation_id_value", + "confirmation_requirement": 1, + } + ], + "ces_tool_specs": [ + {"ces_tool": "ces_tool_value", "confirmation_requirement": 1} + ], + "ces_app_specs": [{"ces_app": "ces_app_value", "confirmation_requirement": 1}], } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -6414,10 +6452,36 @@ def test_generators_transport_channel_mtls_with_adc(transport_class): assert transport.grpc_channel == mock_grpc_channel -def test_generator_path(): +def test_app_path(): project = "squid" location = "clam" - generator = "whelk" + app = "whelk" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = GeneratorsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "octopus", + "location": "oyster", + "app": "nudibranch", + } + path = GeneratorsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorsClient.parse_app_path(path) + assert expected == actual + + +def test_generator_path(): + project = "cuttlefish" + location = "mussel" + generator = "winkle" expected = "projects/{project}/locations/{location}/generators/{generator}".format( project=project, location=location, @@ -6429,9 +6493,9 @@ def test_generator_path(): def test_parse_generator_path(): expected = { - "project": "octopus", - "location": "oyster", - "generator": "nudibranch", + "project": "nautilus", + "location": "scallop", + "generator": "abalone", } path = GeneratorsClient.generator_path(**expected) @@ -6441,9 +6505,9 @@ def test_parse_generator_path(): def test_tool_path(): - project = "cuttlefish" - location = "mussel" - tool = "winkle" + project = "squid" + location = "clam" + tool = "whelk" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -6455,9 +6519,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "nautilus", - "location": "scallop", - "tool": "abalone", + "project": "octopus", + "location": "oyster", + "tool": "nudibranch", + } + path = GeneratorsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "cuttlefish" + location = "mussel" + app = "winkle" + tool = "nautilus" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = GeneratorsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "scallop", + "location": "abalone", + "app": "squid", + "tool": "clam", } path = GeneratorsClient.tool_path(**expected) @@ -6466,8 +6559,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "whelk" + location = "octopus" + app = "oyster" + toolset = "nudibranch" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = GeneratorsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "cuttlefish", + "location": "mussel", + "app": "winkle", + "toolset": "nautilus", + } + path = GeneratorsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = GeneratorsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "squid" + billing_account = "scallop" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -6477,7 +6601,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "clam", + "billing_account": "abalone", } path = GeneratorsClient.common_billing_account_path(**expected) @@ -6487,7 +6611,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "whelk" + folder = "squid" expected = "folders/{folder}".format( folder=folder, ) @@ -6497,7 +6621,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "octopus", + "folder": "clam", } path = GeneratorsClient.common_folder_path(**expected) @@ -6507,7 +6631,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "oyster" + organization = "whelk" expected = "organizations/{organization}".format( organization=organization, ) @@ -6517,7 +6641,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "nudibranch", + "organization": "octopus", } path = GeneratorsClient.common_organization_path(**expected) @@ -6527,7 +6651,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "cuttlefish" + project = "oyster" expected = "projects/{project}".format( project=project, ) @@ -6537,7 +6661,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "mussel", + "project": "nudibranch", } path = GeneratorsClient.common_project_path(**expected) @@ -6547,8 +6671,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "winkle" - location = "nautilus" + project = "cuttlefish" + location = "mussel" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -6559,8 +6683,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "scallop", - "location": "abalone", + "project": "winkle", + "location": "nautilus", } path = GeneratorsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py index 856c7716eec0..f75afdb95b0e 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_participants.py @@ -10970,10 +10970,36 @@ def test_parse_answer_record_path(): assert expected == actual -def test_context_path(): +def test_app_path(): project = "oyster" - session = "nudibranch" - context = "cuttlefish" + location = "nudibranch" + app = "cuttlefish" + expected = "projects/{project}/locations/{location}/apps/{app}".format( + project=project, + location=location, + app=app, + ) + actual = ParticipantsClient.app_path(project, location, app) + assert expected == actual + + +def test_parse_app_path(): + expected = { + "project": "mussel", + "location": "winkle", + "app": "nautilus", + } + path = ParticipantsClient.app_path(**expected) + + # Check that the path construction is reversible. + actual = ParticipantsClient.parse_app_path(path) + assert expected == actual + + +def test_context_path(): + project = "scallop" + session = "abalone" + context = "squid" expected = "projects/{project}/agent/sessions/{session}/contexts/{context}".format( project=project, session=session, @@ -10985,9 +11011,9 @@ def test_context_path(): def test_parse_context_path(): expected = { - "project": "mussel", - "session": "winkle", - "context": "nautilus", + "project": "clam", + "session": "whelk", + "context": "octopus", } path = ParticipantsClient.context_path(**expected) @@ -10997,9 +11023,9 @@ def test_parse_context_path(): def test_document_path(): - project = "scallop" - knowledge_base = "abalone" - document = "squid" + project = "oyster" + knowledge_base = "nudibranch" + document = "cuttlefish" expected = "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format( project=project, knowledge_base=knowledge_base, @@ -11011,9 +11037,9 @@ def test_document_path(): def test_parse_document_path(): expected = { - "project": "clam", - "knowledge_base": "whelk", - "document": "octopus", + "project": "mussel", + "knowledge_base": "winkle", + "document": "nautilus", } path = ParticipantsClient.document_path(**expected) @@ -11023,8 +11049,8 @@ def test_parse_document_path(): def test_intent_path(): - project = "oyster" - intent = "nudibranch" + project = "scallop" + intent = "abalone" expected = "projects/{project}/agent/intents/{intent}".format( project=project, intent=intent, @@ -11035,8 +11061,8 @@ def test_intent_path(): def test_parse_intent_path(): expected = { - "project": "cuttlefish", - "intent": "mussel", + "project": "squid", + "intent": "clam", } path = ParticipantsClient.intent_path(**expected) @@ -11046,9 +11072,9 @@ def test_parse_intent_path(): def test_message_path(): - project = "winkle" - conversation = "nautilus" - message = "scallop" + project = "whelk" + conversation = "octopus" + message = "oyster" expected = ( "projects/{project}/conversations/{conversation}/messages/{message}".format( project=project, @@ -11062,9 +11088,9 @@ def test_message_path(): def test_parse_message_path(): expected = { - "project": "abalone", - "conversation": "squid", - "message": "clam", + "project": "nudibranch", + "conversation": "cuttlefish", + "message": "mussel", } path = ParticipantsClient.message_path(**expected) @@ -11074,9 +11100,9 @@ def test_parse_message_path(): def test_participant_path(): - project = "whelk" - conversation = "octopus" - participant = "oyster" + project = "winkle" + conversation = "nautilus" + participant = "scallop" expected = "projects/{project}/conversations/{conversation}/participants/{participant}".format( project=project, conversation=conversation, @@ -11088,9 +11114,9 @@ def test_participant_path(): def test_parse_participant_path(): expected = { - "project": "nudibranch", - "conversation": "cuttlefish", - "participant": "mussel", + "project": "abalone", + "conversation": "squid", + "participant": "clam", } path = ParticipantsClient.participant_path(**expected) @@ -11100,9 +11126,9 @@ def test_parse_participant_path(): def test_phrase_set_path(): - project = "winkle" - location = "nautilus" - phrase_set = "scallop" + project = "whelk" + location = "octopus" + phrase_set = "oyster" expected = "projects/{project}/locations/{location}/phraseSets/{phrase_set}".format( project=project, location=location, @@ -11114,9 +11140,9 @@ def test_phrase_set_path(): def test_parse_phrase_set_path(): expected = { - "project": "abalone", - "location": "squid", - "phrase_set": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "phrase_set": "mussel", } path = ParticipantsClient.phrase_set_path(**expected) @@ -11126,9 +11152,9 @@ def test_parse_phrase_set_path(): def test_session_entity_type_path(): - project = "whelk" - session = "octopus" - entity_type = "oyster" + project = "winkle" + session = "nautilus" + entity_type = "scallop" expected = ( "projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}".format( project=project, @@ -11142,9 +11168,9 @@ def test_session_entity_type_path(): def test_parse_session_entity_type_path(): expected = { - "project": "nudibranch", - "session": "cuttlefish", - "entity_type": "mussel", + "project": "abalone", + "session": "squid", + "entity_type": "clam", } path = ParticipantsClient.session_entity_type_path(**expected) @@ -11154,9 +11180,9 @@ def test_parse_session_entity_type_path(): def test_tool_path(): - project = "winkle" - location = "nautilus" - tool = "scallop" + project = "whelk" + location = "octopus" + tool = "oyster" expected = "projects/{project}/locations/{location}/tools/{tool}".format( project=project, location=location, @@ -11168,9 +11194,38 @@ def test_tool_path(): def test_parse_tool_path(): expected = { - "project": "abalone", - "location": "squid", - "tool": "clam", + "project": "nudibranch", + "location": "cuttlefish", + "tool": "mussel", + } + path = ParticipantsClient.tool_path(**expected) + + # Check that the path construction is reversible. + actual = ParticipantsClient.parse_tool_path(path) + assert expected == actual + + +def test_tool_path(): + project = "winkle" + location = "nautilus" + app = "scallop" + tool = "abalone" + expected = "projects/{project}/locations/{location}/apps/{app}/tools/{tool}".format( + project=project, + location=location, + app=app, + tool=tool, + ) + actual = ParticipantsClient.tool_path(project, location, app, tool) + assert expected == actual + + +def test_parse_tool_path(): + expected = { + "project": "squid", + "location": "clam", + "app": "whelk", + "tool": "octopus", } path = ParticipantsClient.tool_path(**expected) @@ -11179,8 +11234,39 @@ def test_parse_tool_path(): assert expected == actual +def test_toolset_path(): + project = "oyster" + location = "nudibranch" + app = "cuttlefish" + toolset = "mussel" + expected = ( + "projects/{project}/locations/{location}/apps/{app}/toolsets/{toolset}".format( + project=project, + location=location, + app=app, + toolset=toolset, + ) + ) + actual = ParticipantsClient.toolset_path(project, location, app, toolset) + assert expected == actual + + +def test_parse_toolset_path(): + expected = { + "project": "winkle", + "location": "nautilus", + "app": "scallop", + "toolset": "abalone", + } + path = ParticipantsClient.toolset_path(**expected) + + # Check that the path construction is reversible. + actual = ParticipantsClient.parse_toolset_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "whelk" + billing_account = "squid" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -11190,7 +11276,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "octopus", + "billing_account": "clam", } path = ParticipantsClient.common_billing_account_path(**expected) @@ -11200,7 +11286,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "oyster" + folder = "whelk" expected = "folders/{folder}".format( folder=folder, ) @@ -11210,7 +11296,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "nudibranch", + "folder": "octopus", } path = ParticipantsClient.common_folder_path(**expected) @@ -11220,7 +11306,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "cuttlefish" + organization = "oyster" expected = "organizations/{organization}".format( organization=organization, ) @@ -11230,7 +11316,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "mussel", + "organization": "nudibranch", } path = ParticipantsClient.common_organization_path(**expected) @@ -11240,7 +11326,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "winkle" + project = "cuttlefish" expected = "projects/{project}".format( project=project, ) @@ -11250,7 +11336,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "nautilus", + "project": "mussel", } path = ParticipantsClient.common_project_path(**expected) @@ -11260,8 +11346,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "scallop" - location = "abalone" + project = "winkle" + location = "nautilus" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -11272,8 +11358,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "squid", - "location": "clam", + "project": "scallop", + "location": "abalone", } path = ParticipantsClient.common_location_path(**expected) diff --git a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_phone_numbers.py b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_phone_numbers.py index e797629dbffb..6e4419232527 100644 --- a/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_phone_numbers.py +++ b/packages/google-cloud-dialogflow/tests/unit/gapic/dialogflow_v2beta1/test_phone_numbers.py @@ -45,6 +45,7 @@ import google.auth import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore +import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore from google.api_core import ( client_options, gapic_v1, @@ -4249,6 +4250,11 @@ def test_update_phone_number_rest_call_success(request_type): "phone_number": "phone_number_value", "conversation_profile": "conversation_profile_value", "lifecycle_state": 1, + "allowed_sip_trunks": { + "sip_trunks": ["sip_trunks_value1", "sip_trunks_value2"], + "carrier_ids": ["carrier_ids_value1", "carrier_ids_value2"], + }, + "purge_time": {"seconds": 751, "nanos": 543}, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -5568,8 +5574,34 @@ def test_parse_phone_number_path(): assert expected == actual +def test_sip_trunk_path(): + project = "oyster" + location = "nudibranch" + siptrunk = "cuttlefish" + expected = "projects/{project}/locations/{location}/sipTrunks/{siptrunk}".format( + project=project, + location=location, + siptrunk=siptrunk, + ) + actual = PhoneNumbersClient.sip_trunk_path(project, location, siptrunk) + assert expected == actual + + +def test_parse_sip_trunk_path(): + expected = { + "project": "mussel", + "location": "winkle", + "siptrunk": "nautilus", + } + path = PhoneNumbersClient.sip_trunk_path(**expected) + + # Check that the path construction is reversible. + actual = PhoneNumbersClient.parse_sip_trunk_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "oyster" + billing_account = "scallop" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -5579,7 +5611,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "nudibranch", + "billing_account": "abalone", } path = PhoneNumbersClient.common_billing_account_path(**expected) @@ -5589,7 +5621,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "cuttlefish" + folder = "squid" expected = "folders/{folder}".format( folder=folder, ) @@ -5599,7 +5631,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "mussel", + "folder": "clam", } path = PhoneNumbersClient.common_folder_path(**expected) @@ -5609,7 +5641,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "winkle" + organization = "whelk" expected = "organizations/{organization}".format( organization=organization, ) @@ -5619,7 +5651,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "nautilus", + "organization": "octopus", } path = PhoneNumbersClient.common_organization_path(**expected) @@ -5629,7 +5661,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "scallop" + project = "oyster" expected = "projects/{project}".format( project=project, ) @@ -5639,7 +5671,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "abalone", + "project": "nudibranch", } path = PhoneNumbersClient.common_project_path(**expected) @@ -5649,8 +5681,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "squid" - location = "clam" + project = "cuttlefish" + location = "mussel" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -5661,8 +5693,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "whelk", - "location": "octopus", + "project": "winkle", + "location": "nautilus", } path = PhoneNumbersClient.common_location_path(**expected)