Skip to content
This repository was archived by the owner on Dec 17, 2023. It is now read-only.

Commit 73ddd4e

Browse files
feat: added dialogflow_assist_answer (#641)
* 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: https://github.com/googleapis/googleapis-gen/commit/04ca491dec8f35173ee599d7ed07936b4086e96d 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: https://github.com/googleapis/googleapis-gen/commit/0f124f3c37b5a6049906a9514cd994daf073dc01 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>
1 parent 5dae890 commit 73ddd4e

24 files changed

+1142
-68
lines changed

google/cloud/dialogflow_v2/types/answer_record.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ class AnswerFeedback(proto.Message):
222222
clicked (bool):
223223
Indicates whether the answer/item was clicked
224224
by the human agent or not. Default to false.
225-
For knowledge search, the answer record is
226-
considered to be clicked if the answer was
227-
copied or any URI was clicked.
225+
For knowledge search and knowledge assist, the
226+
answer record is considered to be clicked if the
227+
answer was copied or any URI was clicked.
228228
click_time (google.protobuf.timestamp_pb2.Timestamp):
229229
Time when the answer/item was clicked.
230230
displayed (bool):

google/cloud/dialogflow_v2/types/conversation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ class SuggestConversationSummaryRequest(proto.Message):
438438
[latest_message] to use as context when compiling the
439439
suggestion. By default 500 and at most 1000.
440440
assist_query_params (google.cloud.dialogflow_v2.types.AssistQueryParameters):
441-
Parameters for a human assist query.
441+
Parameters for a human assist query. Only
442+
used for POC/demo purpose.
442443
"""
443444

444445
conversation: str = proto.Field(

google/cloud/dialogflow_v2/types/conversation_profile.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from typing import MutableMapping, MutableSequence
1919

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

356364
agent: str = proto.Field(
357365
proto.STRING,
358366
number=1,
359367
)
368+
session_ttl: duration_pb2.Duration = proto.Field(
369+
proto.MESSAGE,
370+
number=3,
371+
message=duration_pb2.Duration,
372+
)
360373

361374

362375
class HumanAgentAssistantConfig(proto.Message):
@@ -539,7 +552,8 @@ class SuggestionQueryConfig(proto.Message):
539552
that all suggestions are returned.
540553
541554
Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY,
542-
SMART_COMPOSE.
555+
SMART_COMPOSE, KNOWLEDGE_SEARCH, KNOWLEDGE_ASSIST,
556+
ENTITY_EXTRACTION.
543557
context_filter_settings (google.cloud.dialogflow_v2.types.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings):
544558
Determines how recent conversation context is
545559
filtered when generating suggestions. If
@@ -589,7 +603,7 @@ class DialogflowQuerySource(proto.Message):
589603
agent (str):
590604
Required. The name of a Dialogflow virtual agent used for
591605
end user side intent detection and suggestion. Format:
592-
``projects/<Project Number/ ID>/locations/<Location ID>/agent``.
606+
``projects/<Project ID>/locations/<Location ID>/agent``.
593607
When multiple agents are allowed in the same Dialogflow
594608
project.
595609
"""

google/cloud/dialogflow_v2/types/document.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Document(proto.Message):
109109
110110
If a reload fails with internal errors, the system will try
111111
to reload the document on the next day. If a reload fails
112-
with non-retriable errors (e.g. PERMISION_DENIED), the
112+
with non-retriable errors (e.g. PERMISSION_DENIED), the
113113
system will not try to reload the document anymore. You need
114114
to manually reload the document successfully by calling
115115
``ReloadDocument`` and clear the errors.
@@ -399,8 +399,8 @@ class ImportDocumentsRequest(proto.Message):
399399
Format:
400400
``projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>``.
401401
gcs_source (google.cloud.dialogflow_v2.types.GcsSources):
402-
The Google Cloud Storage location for the documents. The
403-
path can include a wildcard.
402+
Optional. The Google Cloud Storage location for the
403+
documents. The path can include a wildcard.
404404
405405
These URIs may have the forms
406406
``gs://<bucket-name>/<object-name>``.

google/cloud/dialogflow_v2beta1/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,13 @@
211211
CompileSuggestionRequest,
212212
CompileSuggestionResponse,
213213
CreateParticipantRequest,
214+
DialogflowAssistAnswer,
214215
DtmfParameters,
215216
FaqAnswer,
216217
GetParticipantRequest,
217218
InputTextConfig,
219+
IntentInput,
220+
IntentSuggestion,
218221
ListParticipantsRequest,
219222
ListParticipantsResponse,
220223
ListSuggestionsRequest,
@@ -229,10 +232,12 @@
229232
StreamingAnalyzeContentResponse,
230233
SuggestArticlesRequest,
231234
SuggestArticlesResponse,
235+
SuggestDialogflowAssistsResponse,
232236
SuggestFaqAnswersRequest,
233237
SuggestFaqAnswersResponse,
234238
Suggestion,
235239
SuggestionFeature,
240+
SuggestionInput,
236241
SuggestionResult,
237242
SuggestSmartRepliesRequest,
238243
SuggestSmartRepliesResponse,
@@ -359,6 +364,7 @@
359364
"DeleteVersionRequest",
360365
"DetectIntentRequest",
361366
"DetectIntentResponse",
367+
"DialogflowAssistAnswer",
362368
"Document",
363369
"DocumentsClient",
364370
"DtmfParameters",
@@ -407,6 +413,8 @@
407413
"InputTextConfig",
408414
"Intent",
409415
"IntentBatch",
416+
"IntentInput",
417+
"IntentSuggestion",
410418
"IntentView",
411419
"IntentsClient",
412420
"KnowledgeAnswers",
@@ -484,12 +492,14 @@
484492
"SuggestArticlesResponse",
485493
"SuggestConversationSummaryRequest",
486494
"SuggestConversationSummaryResponse",
495+
"SuggestDialogflowAssistsResponse",
487496
"SuggestFaqAnswersRequest",
488497
"SuggestFaqAnswersResponse",
489498
"SuggestSmartRepliesRequest",
490499
"SuggestSmartRepliesResponse",
491500
"Suggestion",
492501
"SuggestionFeature",
502+
"SuggestionInput",
493503
"SuggestionResult",
494504
"SynthesizeSpeechConfig",
495505
"TelephonyDtmf",

google/cloud/dialogflow_v2beta1/services/answer_records/async_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ class AnswerRecordsAsyncClient:
7070
parse_answer_record_path = staticmethod(
7171
AnswerRecordsClient.parse_answer_record_path
7272
)
73+
context_path = staticmethod(AnswerRecordsClient.context_path)
74+
parse_context_path = staticmethod(AnswerRecordsClient.parse_context_path)
75+
document_path = staticmethod(AnswerRecordsClient.document_path)
76+
parse_document_path = staticmethod(AnswerRecordsClient.parse_document_path)
77+
intent_path = staticmethod(AnswerRecordsClient.intent_path)
78+
parse_intent_path = staticmethod(AnswerRecordsClient.parse_intent_path)
7379
common_billing_account_path = staticmethod(
7480
AnswerRecordsClient.common_billing_account_path
7581
)

google/cloud/dialogflow_v2beta1/services/answer_records/client.py

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,67 @@ def parse_answer_record_path(path: str) -> Dict[str, str]:
202202
)
203203
return m.groupdict() if m else {}
204204

205+
@staticmethod
206+
def context_path(
207+
project: str,
208+
session: str,
209+
context: str,
210+
) -> str:
211+
"""Returns a fully-qualified context string."""
212+
return "projects/{project}/agent/sessions/{session}/contexts/{context}".format(
213+
project=project,
214+
session=session,
215+
context=context,
216+
)
217+
218+
@staticmethod
219+
def parse_context_path(path: str) -> Dict[str, str]:
220+
"""Parses a context path into its component segments."""
221+
m = re.match(
222+
r"^projects/(?P<project>.+?)/agent/sessions/(?P<session>.+?)/contexts/(?P<context>.+?)$",
223+
path,
224+
)
225+
return m.groupdict() if m else {}
226+
227+
@staticmethod
228+
def document_path(
229+
project: str,
230+
knowledge_base: str,
231+
document: str,
232+
) -> str:
233+
"""Returns a fully-qualified document string."""
234+
return "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}".format(
235+
project=project,
236+
knowledge_base=knowledge_base,
237+
document=document,
238+
)
239+
240+
@staticmethod
241+
def parse_document_path(path: str) -> Dict[str, str]:
242+
"""Parses a document path into its component segments."""
243+
m = re.match(
244+
r"^projects/(?P<project>.+?)/knowledgeBases/(?P<knowledge_base>.+?)/documents/(?P<document>.+?)$",
245+
path,
246+
)
247+
return m.groupdict() if m else {}
248+
249+
@staticmethod
250+
def intent_path(
251+
project: str,
252+
intent: str,
253+
) -> str:
254+
"""Returns a fully-qualified intent string."""
255+
return "projects/{project}/agent/intents/{intent}".format(
256+
project=project,
257+
intent=intent,
258+
)
259+
260+
@staticmethod
261+
def parse_intent_path(path: str) -> Dict[str, str]:
262+
"""Parses a intent path into its component segments."""
263+
m = re.match(r"^projects/(?P<project>.+?)/agent/intents/(?P<intent>.+?)$", path)
264+
return m.groupdict() if m else {}
265+
205266
@staticmethod
206267
def common_billing_account_path(
207268
billing_account: str,

google/cloud/dialogflow_v2beta1/services/environments/async_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ async def sample_list_environments():
267267
Required. The agent to list all environments from.
268268
Format:
269269
270-
- ``projects/<Project Number / ID>/agent``
271-
- ``projects/<Project Number / ID>/locations/<Location ID>/agent``
270+
- ``projects/<Project ID>/agent``
271+
- ``projects/<Project ID>/locations/<Location ID>/agent``
272272
273273
This corresponds to the ``parent`` field
274274
on the ``request`` instance; if ``request`` is provided, this

google/cloud/dialogflow_v2beta1/services/environments/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ def sample_list_environments():
525525
Required. The agent to list all environments from.
526526
Format:
527527
528-
- ``projects/<Project Number / ID>/agent``
529-
- ``projects/<Project Number / ID>/locations/<Location ID>/agent``
528+
- ``projects/<Project ID>/agent``
529+
- ``projects/<Project ID>/locations/<Location ID>/agent``
530530
531531
This corresponds to the ``parent`` field
532532
on the ``request`` instance; if ``request`` is provided, this

google/cloud/dialogflow_v2beta1/types/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,13 @@
181181
CompileSuggestionRequest,
182182
CompileSuggestionResponse,
183183
CreateParticipantRequest,
184+
DialogflowAssistAnswer,
184185
DtmfParameters,
185186
FaqAnswer,
186187
GetParticipantRequest,
187188
InputTextConfig,
189+
IntentInput,
190+
IntentSuggestion,
188191
ListParticipantsRequest,
189192
ListParticipantsResponse,
190193
ListSuggestionsRequest,
@@ -199,10 +202,12 @@
199202
StreamingAnalyzeContentResponse,
200203
SuggestArticlesRequest,
201204
SuggestArticlesResponse,
205+
SuggestDialogflowAssistsResponse,
202206
SuggestFaqAnswersRequest,
203207
SuggestFaqAnswersResponse,
204208
Suggestion,
205209
SuggestionFeature,
210+
SuggestionInput,
206211
SuggestionResult,
207212
SuggestSmartRepliesRequest,
208213
SuggestSmartRepliesResponse,
@@ -396,10 +401,13 @@
396401
"CompileSuggestionRequest",
397402
"CompileSuggestionResponse",
398403
"CreateParticipantRequest",
404+
"DialogflowAssistAnswer",
399405
"DtmfParameters",
400406
"FaqAnswer",
401407
"GetParticipantRequest",
402408
"InputTextConfig",
409+
"IntentInput",
410+
"IntentSuggestion",
403411
"ListParticipantsRequest",
404412
"ListParticipantsResponse",
405413
"ListSuggestionsRequest",
@@ -414,10 +422,12 @@
414422
"StreamingAnalyzeContentResponse",
415423
"SuggestArticlesRequest",
416424
"SuggestArticlesResponse",
425+
"SuggestDialogflowAssistsResponse",
417426
"SuggestFaqAnswersRequest",
418427
"SuggestFaqAnswersResponse",
419428
"Suggestion",
420429
"SuggestionFeature",
430+
"SuggestionInput",
421431
"SuggestionResult",
422432
"SuggestSmartRepliesRequest",
423433
"SuggestSmartRepliesResponse",

0 commit comments

Comments
 (0)