Skip to content

Commit

Permalink
feat: added dialogflow_assist_answer (#641)
Browse files Browse the repository at this point in the history
* feat: added dialogflow_assist_answer
feat: added session_ttl
feat: added human_agent_side_config
feat: added suggestion_input
feat: added suggest_dialogflow_assists_response
feat: added suggest_entity_extraction_response

PiperOrigin-RevId: 542021587

Source-Link: googleapis/googleapis@f40416d

Source-Link: googleapis/googleapis-gen@04ca491
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDRjYTQ5MWRlYzhmMzUxNzNlZTU5OWQ3ZWQwNzkzNmI0MDg2ZTk2ZCJ9

* 🦉 Updates from OwlBot post-processor

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

* feat: added dialogflow_assist_answer
feat: added session_ttl
feat: added human_agent_side_config
feat: added suggestion_input
feat: added suggest_dialogflow_assists_response
feat: added suggest_entity_extraction_response

PiperOrigin-RevId: 542024928

Source-Link: googleapis/googleapis@06f7999

Source-Link: googleapis/googleapis-gen@0f124f3
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGYxMjRmM2MzN2I1YTYwNDk5MDZhOTUxNGNkOTk0ZGFmMDczZGMwMSJ9

* 🦉 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 Jun 21, 2023
1 parent 04eb594 commit 9309987
Show file tree
Hide file tree
Showing 24 changed files with 1,142 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ class AnswerFeedback(proto.Message):
clicked (bool):
Indicates whether the answer/item was clicked
by the human agent or not. Default to false.
For knowledge search, the answer record is
considered to be clicked if the answer was
copied or any URI was clicked.
For knowledge search and knowledge assist, the
answer record is considered to be clicked if the
answer was copied or any URI was clicked.
click_time (google.protobuf.timestamp_pb2.Timestamp):
Time when the answer/item was clicked.
displayed (bool):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ class SuggestConversationSummaryRequest(proto.Message):
[latest_message] to use as context when compiling the
suggestion. By default 500 and at most 1000.
assist_query_params (google.cloud.dialogflow_v2.types.AssistQueryParameters):
Parameters for a human assist query.
Parameters for a human assist query. Only
used for POC/demo purpose.
"""

conversation: str = proto.Field(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from typing import MutableMapping, MutableSequence

from google.protobuf import duration_pb2 # type: ignore
from google.protobuf import field_mask_pb2 # type: ignore
from google.protobuf import timestamp_pb2 # type: ignore
import proto # type: ignore
Expand Down Expand Up @@ -351,12 +352,24 @@ class AutomatedAgentConfig(proto.Message):
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment ID or '-'>``.
If environment is not specified, the default ``draft``
environment is used.
session_ttl (google.protobuf.duration_pb2.Duration):
Optional. Sets Dialogflow CX session life
time. By default, a Dialogflow CX session
remains active and its data is stored for 30
minutes after the last request is sent for the
session. This value should be no longer than 1
day.
"""

agent: str = proto.Field(
proto.STRING,
number=1,
)
session_ttl: duration_pb2.Duration = proto.Field(
proto.MESSAGE,
number=3,
message=duration_pb2.Duration,
)


class HumanAgentAssistantConfig(proto.Message):
Expand Down Expand Up @@ -539,7 +552,8 @@ class SuggestionQueryConfig(proto.Message):
that all suggestions are returned.
Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY,
SMART_COMPOSE.
SMART_COMPOSE, KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST,
ENTITY_EXTRACTION.
context_filter_settings (google.cloud.dialogflow_v2.types.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings):
Determines how recent conversation context is
filtered when generating suggestions. If
Expand Down Expand Up @@ -589,7 +603,7 @@ class DialogflowQuerySource(proto.Message):
agent (str):
Required. The name of a Dialogflow virtual agent used for
end user side intent detection and suggestion. Format:
``projects/<Project Number/ ID>/locations/<Location ID>/agent``.
``projects/<Project ID>/locations/<Location ID>/agent``.
When multiple agents are allowed in the same Dialogflow
project.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Document(proto.Message):
If a reload fails with internal errors, the system will try
to reload the document on the next day. If a reload fails
with non-retriable errors (e.g. PERMISION_DENIED), the
with non-retriable errors (e.g. PERMISSION_DENIED), the
system will not try to reload the document anymore. You need
to manually reload the document successfully by calling
``ReloadDocument`` and clear the errors.
Expand Down Expand Up @@ -399,8 +399,8 @@ class ImportDocumentsRequest(proto.Message):
Format:
``projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>``.
gcs_source (google.cloud.dialogflow_v2.types.GcsSources):
The Google Cloud Storage location for the documents. The
path can include a wildcard.
Optional. The Google Cloud Storage location for the
documents. The path can include a wildcard.
These URIs may have the forms
``gs://<bucket-name>/<object-name>``.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,13 @@
CompileSuggestionRequest,
CompileSuggestionResponse,
CreateParticipantRequest,
DialogflowAssistAnswer,
DtmfParameters,
FaqAnswer,
GetParticipantRequest,
InputTextConfig,
IntentInput,
IntentSuggestion,
ListParticipantsRequest,
ListParticipantsResponse,
ListSuggestionsRequest,
Expand All @@ -229,10 +232,12 @@
StreamingAnalyzeContentResponse,
SuggestArticlesRequest,
SuggestArticlesResponse,
SuggestDialogflowAssistsResponse,
SuggestFaqAnswersRequest,
SuggestFaqAnswersResponse,
Suggestion,
SuggestionFeature,
SuggestionInput,
SuggestionResult,
SuggestSmartRepliesRequest,
SuggestSmartRepliesResponse,
Expand Down Expand Up @@ -359,6 +364,7 @@
"DeleteVersionRequest",
"DetectIntentRequest",
"DetectIntentResponse",
"DialogflowAssistAnswer",
"Document",
"DocumentsClient",
"DtmfParameters",
Expand Down Expand Up @@ -407,6 +413,8 @@
"InputTextConfig",
"Intent",
"IntentBatch",
"IntentInput",
"IntentSuggestion",
"IntentView",
"IntentsClient",
"KnowledgeAnswers",
Expand Down Expand Up @@ -484,12 +492,14 @@
"SuggestArticlesResponse",
"SuggestConversationSummaryRequest",
"SuggestConversationSummaryResponse",
"SuggestDialogflowAssistsResponse",
"SuggestFaqAnswersRequest",
"SuggestFaqAnswersResponse",
"SuggestSmartRepliesRequest",
"SuggestSmartRepliesResponse",
"Suggestion",
"SuggestionFeature",
"SuggestionInput",
"SuggestionResult",
"SynthesizeSpeechConfig",
"TelephonyDtmf",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ class AnswerRecordsAsyncClient:
parse_answer_record_path = staticmethod(
AnswerRecordsClient.parse_answer_record_path
)
context_path = staticmethod(AnswerRecordsClient.context_path)
parse_context_path = staticmethod(AnswerRecordsClient.parse_context_path)
document_path = staticmethod(AnswerRecordsClient.document_path)
parse_document_path = staticmethod(AnswerRecordsClient.parse_document_path)
intent_path = staticmethod(AnswerRecordsClient.intent_path)
parse_intent_path = staticmethod(AnswerRecordsClient.parse_intent_path)
common_billing_account_path = staticmethod(
AnswerRecordsClient.common_billing_account_path
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,67 @@ def parse_answer_record_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def context_path(
project: str,
session: str,
context: str,
) -> str:
"""Returns a fully-qualified context string."""
return "projects/{project}/agent/sessions/{session}/contexts/{context}".format(
project=project,
session=session,
context=context,
)

@staticmethod
def parse_context_path(path: str) -> Dict[str, str]:
"""Parses a context path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/agent/sessions/(?P<session>.+?)/contexts/(?P<context>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def document_path(
project: str,
knowledge_base: str,
document: str,
) -> str:
"""Returns a fully-qualified document string."""
return "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format(
project=project,
knowledge_base=knowledge_base,
document=document,
)

@staticmethod
def parse_document_path(path: str) -> Dict[str, str]:
"""Parses a document path into its component segments."""
m = re.match(
r"^projects/(?P<project>.+?)/knowledgeBases/(?P<knowledge_base>.+?)/documents/(?P<document>.+?)$",
path,
)
return m.groupdict() if m else {}

@staticmethod
def intent_path(
project: str,
intent: str,
) -> str:
"""Returns a fully-qualified intent string."""
return "projects/{project}/agent/intents/{intent}".format(
project=project,
intent=intent,
)

@staticmethod
def parse_intent_path(path: str) -> Dict[str, str]:
"""Parses a intent path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/agent/intents/(?P<intent>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(
billing_account: str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ async def sample_list_environments():
Required. The agent to list all environments from.
Format:
- ``projects/<Project Number / ID>/agent``
- ``projects/<Project Number / ID>/locations/<Location ID>/agent``
- ``projects/<Project ID>/agent``
- ``projects/<Project ID>/locations/<Location ID>/agent``
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ def sample_list_environments():
Required. The agent to list all environments from.
Format:
- ``projects/<Project Number / ID>/agent``
- ``projects/<Project Number / ID>/locations/<Location ID>/agent``
- ``projects/<Project ID>/agent``
- ``projects/<Project ID>/locations/<Location ID>/agent``
This corresponds to the ``parent`` field
on the ``request`` instance; if ``request`` is provided, this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@
CompileSuggestionRequest,
CompileSuggestionResponse,
CreateParticipantRequest,
DialogflowAssistAnswer,
DtmfParameters,
FaqAnswer,
GetParticipantRequest,
InputTextConfig,
IntentInput,
IntentSuggestion,
ListParticipantsRequest,
ListParticipantsResponse,
ListSuggestionsRequest,
Expand All @@ -199,10 +202,12 @@
StreamingAnalyzeContentResponse,
SuggestArticlesRequest,
SuggestArticlesResponse,
SuggestDialogflowAssistsResponse,
SuggestFaqAnswersRequest,
SuggestFaqAnswersResponse,
Suggestion,
SuggestionFeature,
SuggestionInput,
SuggestionResult,
SuggestSmartRepliesRequest,
SuggestSmartRepliesResponse,
Expand Down Expand Up @@ -396,10 +401,13 @@
"CompileSuggestionRequest",
"CompileSuggestionResponse",
"CreateParticipantRequest",
"DialogflowAssistAnswer",
"DtmfParameters",
"FaqAnswer",
"GetParticipantRequest",
"InputTextConfig",
"IntentInput",
"IntentSuggestion",
"ListParticipantsRequest",
"ListParticipantsResponse",
"ListSuggestionsRequest",
Expand All @@ -414,10 +422,12 @@
"StreamingAnalyzeContentResponse",
"SuggestArticlesRequest",
"SuggestArticlesResponse",
"SuggestDialogflowAssistsResponse",
"SuggestFaqAnswersRequest",
"SuggestFaqAnswersResponse",
"Suggestion",
"SuggestionFeature",
"SuggestionInput",
"SuggestionResult",
"SuggestSmartRepliesRequest",
"SuggestSmartRepliesResponse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ class AgentAssistantRecord(proto.Message):
faq_answer (google.cloud.dialogflow_v2beta1.types.FaqAnswer):
Output only. The FAQ answer.
This field is a member of `oneof`_ ``answer``.
dialogflow_assist_answer (google.cloud.dialogflow_v2beta1.types.DialogflowAssistAnswer):
Output only. The Dialogflow assist answer.
This field is a member of `oneof`_ ``answer``.
"""

Expand All @@ -139,6 +143,12 @@ class AgentAssistantRecord(proto.Message):
oneof="answer",
message=participant.FaqAnswer,
)
dialogflow_assist_answer: participant.DialogflowAssistAnswer = proto.Field(
proto.MESSAGE,
number=7,
oneof="answer",
message=participant.DialogflowAssistAnswer,
)


class AnswerFeedback(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class BatchCreateMessagesRequest(proto.Message):
message. Format:
``projects/<Project ID>/locations/<Location ID>/conversations/<Conversation ID>``.
requests (MutableSequence[google.cloud.dialogflow_v2beta1.types.CreateMessageRequest]):
Required. A maximum of 1000 Messages can be created in a
Required. A maximum of 300 messages can be created in a
batch. [CreateMessageRequest.message.send_time][] is
required. All created messages will have identical
[Message.create_time][google.cloud.dialogflow.v2beta1.Message.create_time].
Expand Down Expand Up @@ -510,7 +510,8 @@ class SuggestConversationSummaryRequest(proto.Message):
[latest_message] to use as context when compiling the
suggestion. By default 500 and at most 1000.
assist_query_params (google.cloud.dialogflow_v2beta1.types.AssistQueryParameters):
Parameters for a human assist query.
Parameters for a human assist query. Only
used for POC/demo purpose.
"""

conversation: str = proto.Field(
Expand Down
Loading

0 comments on commit 9309987

Please sign in to comment.