Skip to content

Commit

Permalink
feat: extended StreamingListCallCompanionEvents timeout to 600 seconds (
Browse files Browse the repository at this point in the history
#634)

* feat: extended StreamingListCallCompanionEvents timeout to 600 seconds
feat: added debug info for StreamingDetectIntent
feat: added GenerateStatelessSummary method

PiperOrigin-RevId: 530102437

Source-Link: googleapis/googleapis@cea4ed9

Source-Link: googleapis/googleapis-gen@624b26c
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjI0YjI2YzA5OWZiMmM2MDE3NDFkNzc0MDE1NTAyYmVmOTllMWJlYSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: extended StreamingListCallCompanionEvents timeout to 600 seconds
feat: added debug info for StreamingDetectIntent
feat: added GenerateStatelessSummary method

PiperOrigin-RevId: 530104294

Source-Link: googleapis/googleapis@92bec94

Source-Link: googleapis/googleapis-gen@69bf7b3
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjliZjdiM2Q1NDFkMWEyZjRiMzBkMjlhZGQ4YWViZTRlMmFkMTNjNSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored May 8, 2023
1 parent a207cf8 commit 139fb65
Show file tree
Hide file tree
Showing 39 changed files with 3,443 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@
Conversation,
ConversationPhoneNumber,
CreateConversationRequest,
GenerateStatelessSummaryRequest,
GenerateStatelessSummaryResponse,
GetConversationRequest,
ListConversationsRequest,
ListConversationsResponse,
Expand Down Expand Up @@ -322,6 +324,7 @@
UpdateParticipantRequest,
)
from google.cloud.dialogflow_v2.types.session import (
CloudConversationDebuggingInfo,
DetectIntentRequest,
DetectIntentResponse,
EventInput,
Expand Down Expand Up @@ -443,6 +446,8 @@
"Conversation",
"ConversationPhoneNumber",
"CreateConversationRequest",
"GenerateStatelessSummaryRequest",
"GenerateStatelessSummaryResponse",
"GetConversationRequest",
"ListConversationsRequest",
"ListConversationsResponse",
Expand Down Expand Up @@ -595,6 +600,7 @@
"SuggestSmartRepliesRequest",
"SuggestSmartRepliesResponse",
"UpdateParticipantRequest",
"CloudConversationDebuggingInfo",
"DetectIntentRequest",
"DetectIntentResponse",
"EventInput",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
Conversation,
ConversationPhoneNumber,
CreateConversationRequest,
GenerateStatelessSummaryRequest,
GenerateStatelessSummaryResponse,
GetConversationRequest,
ListConversationsRequest,
ListConversationsResponse,
Expand Down Expand Up @@ -273,6 +275,7 @@
UpdateParticipantRequest,
)
from .types.session import (
CloudConversationDebuggingInfo,
DetectIntentRequest,
DetectIntentResponse,
EventInput,
Expand Down Expand Up @@ -353,6 +356,7 @@
"BatchUpdateIntentsResponse",
"ClearSuggestionFeatureConfigOperationMetadata",
"ClearSuggestionFeatureConfigRequest",
"CloudConversationDebuggingInfo",
"CompleteConversationRequest",
"Context",
"ContextsClient",
Expand Down Expand Up @@ -424,6 +428,8 @@
"FulfillmentsClient",
"GcsDestination",
"GcsSources",
"GenerateStatelessSummaryRequest",
"GenerateStatelessSummaryResponse",
"GetAgentRequest",
"GetContextRequest",
"GetConversationDatasetRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,11 @@
"create_conversation"
]
},
"GenerateStatelessSummary": {
"methods": [
"generate_stateless_summary"
]
},
"GetConversation": {
"methods": [
"get_conversation"
Expand Down Expand Up @@ -739,6 +744,11 @@
"create_conversation"
]
},
"GenerateStatelessSummary": {
"methods": [
"generate_stateless_summary"
]
},
"GetConversation": {
"methods": [
"get_conversation"
Expand Down Expand Up @@ -774,6 +784,11 @@
"create_conversation"
]
},
"GenerateStatelessSummary": {
"methods": [
"generate_stateless_summary"
]
},
"GetConversation": {
"methods": [
"get_conversation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,36 @@ class ConversationsAsyncClient:
DEFAULT_ENDPOINT = ConversationsClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = ConversationsClient.DEFAULT_MTLS_ENDPOINT

agent_path = staticmethod(ConversationsClient.agent_path)
parse_agent_path = staticmethod(ConversationsClient.parse_agent_path)
answer_record_path = staticmethod(ConversationsClient.answer_record_path)
parse_answer_record_path = staticmethod(
ConversationsClient.parse_answer_record_path
)
conversation_path = staticmethod(ConversationsClient.conversation_path)
parse_conversation_path = staticmethod(ConversationsClient.parse_conversation_path)
conversation_model_path = staticmethod(ConversationsClient.conversation_model_path)
parse_conversation_model_path = staticmethod(
ConversationsClient.parse_conversation_model_path
)
conversation_profile_path = staticmethod(
ConversationsClient.conversation_profile_path
)
parse_conversation_profile_path = staticmethod(
ConversationsClient.parse_conversation_profile_path
)
cx_security_settings_path = staticmethod(
ConversationsClient.cx_security_settings_path
)
parse_cx_security_settings_path = staticmethod(
ConversationsClient.parse_cx_security_settings_path
)
document_path = staticmethod(ConversationsClient.document_path)
parse_document_path = staticmethod(ConversationsClient.parse_document_path)
knowledge_base_path = staticmethod(ConversationsClient.knowledge_base_path)
parse_knowledge_base_path = staticmethod(
ConversationsClient.parse_knowledge_base_path
)
message_path = staticmethod(ConversationsClient.message_path)
parse_message_path = staticmethod(ConversationsClient.parse_message_path)
common_billing_account_path = staticmethod(
Expand Down Expand Up @@ -939,6 +957,104 @@ async def sample_suggest_conversation_summary():
# Done; return the response.
return response

async def generate_stateless_summary(
self,
request: Optional[
Union[conversation.GenerateStatelessSummaryRequest, dict]
] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> conversation.GenerateStatelessSummaryResponse:
r"""Generates and returns a summary for a conversation
that does not have a resource created for it.
.. code-block:: python
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dialogflow_v2
async def sample_generate_stateless_summary():
# Create a client
client = dialogflow_v2.ConversationsAsyncClient()
# Initialize request argument(s)
stateless_conversation = dialogflow_v2.MinimalConversation()
stateless_conversation.messages.content = "content_value"
stateless_conversation.parent = "parent_value"
conversation_profile = dialogflow_v2.ConversationProfile()
conversation_profile.display_name = "display_name_value"
request = dialogflow_v2.GenerateStatelessSummaryRequest(
stateless_conversation=stateless_conversation,
conversation_profile=conversation_profile,
)
# Make the request
response = await client.generate_stateless_summary(request=request)
# Handle the response
print(response)
Args:
request (Optional[Union[google.cloud.dialogflow_v2.types.GenerateStatelessSummaryRequest, dict]]):
The request object. The request message for
[Conversations.GenerateStatelessSummary][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSummary].
retry (google.api_core.retry.Retry): Designation of what errors, if any,
should be retried.
timeout (float): The timeout for this request.
metadata (Sequence[Tuple[str, str]]): Strings which should be
sent along with the request as metadata.
Returns:
google.cloud.dialogflow_v2.types.GenerateStatelessSummaryResponse:
The response message for
[Conversations.GenerateStatelessSummary][google.cloud.dialogflow.v2.Conversations.GenerateStatelessSummary].
"""
# Create or coerce a protobuf request object.
request = conversation.GenerateStatelessSummaryRequest(request)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.generate_stateless_summary,
default_timeout=None,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata(
(
(
"stateless_conversation.parent",
request.stateless_conversation.parent,
),
)
),
)

# Send the request.
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response

async def list_operations(
self,
request: Optional[operations_pb2.ListOperationsRequest] = None,
Expand Down
Loading

0 comments on commit 139fb65

Please sign in to comment.