Skip to content
Permalink
Browse files

feat(dialogflow): add `MediaContent`, `BrowseCarouselCard`, `ColumnPr…

…operties`in v2; add `SpeechContext`, `SpeechWordInfo`in v2; add `enable_word_info`, `speech_contexts`,`model` to InputAudioConfig in v2; add `subtitles` to `Intent.Message.ListSelect` in `v2beta1`; add `language_code` to `ListKnowledgeBase` in v2beta1; add `webhook_headers` to `QueryParameters` in v2beta1 (#175)
  • Loading branch information
busunkim96 committed Feb 14, 2020
1 parent 94e0252 commit 713846b7ed99eaf78cdf383aa9d39b43731b9a0d
Showing with 3,113 additions and 740 deletions.
  1. +12 −1 dialogflow_v2/__init__.py
  2. +1 −1 dialogflow_v2/gapic/agents_client.py
  3. +1 −1 dialogflow_v2/gapic/contexts_client.py
  4. +4 −4 dialogflow_v2/gapic/entity_types_client.py
  5. +86 −9 dialogflow_v2/gapic/enums.py
  6. +12 −18 dialogflow_v2/gapic/intents_client.py
  7. +1 −1 dialogflow_v2/gapic/session_entity_types_client.py
  8. +1 −1 dialogflow_v2/gapic/sessions_client.py
  9. +1 −1 dialogflow_v2/gapic/transports/agents_grpc_transport.py
  10. +1 −1 dialogflow_v2/gapic/transports/contexts_grpc_transport.py
  11. +1 −1 dialogflow_v2/gapic/transports/entity_types_grpc_transport.py
  12. +1 −1 dialogflow_v2/gapic/transports/intents_grpc_transport.py
  13. +1 −1 dialogflow_v2/gapic/transports/session_entity_types_grpc_transport.py
  14. +1 −1 dialogflow_v2/gapic/transports/sessions_grpc_transport.py
  15. +28 −25 dialogflow_v2/proto/agent_pb2.py
  16. +354 −29 dialogflow_v2/proto/audio_config_pb2.py
  17. +5 −1 dialogflow_v2/proto/context_pb2.py
  18. +10 −9 dialogflow_v2/proto/entity_type_pb2.py
  19. +6 −4 dialogflow_v2/proto/entity_type_pb2_grpc.py
  20. +1,377 −139 dialogflow_v2/proto/intent_pb2.py
  21. +21 −21 dialogflow_v2/proto/session_entity_type_pb2.py
  22. +128 −61 dialogflow_v2/proto/session_pb2.py
  23. +15 −2 dialogflow_v2/proto/webhook_pb2.py
  24. +3 −1 dialogflow_v2/types.py
  25. +12 −1 dialogflow_v2beta1/__init__.py
  26. +1 −1 dialogflow_v2beta1/gapic/agents_client.py
  27. +1 −1 dialogflow_v2beta1/gapic/contexts_client.py
  28. +1 −1 dialogflow_v2beta1/gapic/documents_client.py
  29. +4 −4 dialogflow_v2beta1/gapic/entity_types_client.py
  30. +9 −9 dialogflow_v2beta1/gapic/enums.py
  31. +12 −18 dialogflow_v2beta1/gapic/intents_client.py
  32. +1 −1 dialogflow_v2beta1/gapic/knowledge_bases_client.py
  33. +1 −1 dialogflow_v2beta1/gapic/session_entity_types_client.py
  34. +1 −1 dialogflow_v2beta1/gapic/sessions_client.py
  35. +1 −1 dialogflow_v2beta1/gapic/transports/agents_grpc_transport.py
  36. +1 −1 dialogflow_v2beta1/gapic/transports/contexts_grpc_transport.py
  37. +1 −1 dialogflow_v2beta1/gapic/transports/documents_grpc_transport.py
  38. +1 −1 dialogflow_v2beta1/gapic/transports/entity_types_grpc_transport.py
  39. +1 −1 dialogflow_v2beta1/gapic/transports/intents_grpc_transport.py
  40. +1 −1 dialogflow_v2beta1/gapic/transports/knowledge_bases_grpc_transport.py
  41. +1 −1 dialogflow_v2beta1/gapic/transports/session_entity_types_grpc_transport.py
  42. +1 −1 dialogflow_v2beta1/gapic/transports/sessions_grpc_transport.py
  43. +45 −31 dialogflow_v2beta1/proto/audio_config_pb2.py
  44. +5 −1 dialogflow_v2beta1/proto/context_pb2.py
  45. +29 −26 dialogflow_v2beta1/proto/document_pb2.py
  46. +6 −5 dialogflow_v2beta1/proto/entity_type_pb2.py
  47. +4 −4 dialogflow_v2beta1/proto/entity_type_pb2_grpc.py
  48. +176 −145 dialogflow_v2beta1/proto/intent_pb2.py
  49. +41 −17 dialogflow_v2beta1/proto/knowledge_base_pb2.py
  50. +4 −4 dialogflow_v2beta1/proto/session_entity_type_pb2.py
  51. +171 −62 dialogflow_v2beta1/proto/session_pb2.py
  52. +15 −2 dialogflow_v2beta1/proto/webhook_pb2.py
  53. +1 −1 dialogflow_v2beta1/types.py
  54. +4 −0 docs/_static/custom.css
  55. +50 −0 docs/_templates/layout.html
  56. +3 −2 noxfile.py
  57. +1 −0 setup.cfg
  58. +372 −6 synth.metadata
  59. +20 −9 synth.py
  60. +1 −1 tests/unit/gapic/v2/test_agents_client_v2.py
  61. +1 −1 tests/unit/gapic/v2/test_contexts_client_v2.py
  62. +1 −1 tests/unit/gapic/v2/test_entity_types_client_v2.py
  63. +7 −15 tests/unit/gapic/v2/test_intents_client_v2.py
  64. +1 −1 tests/unit/gapic/v2/test_session_entity_types_client_v2.py
  65. +1 −1 tests/unit/gapic/v2/test_sessions_client_v2.py
  66. +1 −1 tests/unit/gapic/v2beta1/test_agents_client_v2beta1.py
  67. +1 −1 tests/unit/gapic/v2beta1/test_contexts_client_v2beta1.py
  68. +1 −1 tests/unit/gapic/v2beta1/test_documents_client_v2beta1.py
  69. +1 −1 tests/unit/gapic/v2beta1/test_entity_types_client_v2beta1.py
  70. +7 −15 tests/unit/gapic/v2beta1/test_intents_client_v2beta1.py
  71. +19 −4 tests/unit/gapic/v2beta1/test_knowledge_bases_client_v2beta1.py
  72. +1 −1 tests/unit/gapic/v2beta1/test_session_entity_types_client_v2beta1.py
  73. +1 −1 tests/unit/gapic/v2beta1/test_sessions_client_v2beta1.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@


from __future__ import absolute_import
import sys
import warnings

from dialogflow_v2 import types
from dialogflow_v2.gapic import agents_client
@@ -27,6 +29,15 @@
from dialogflow_v2.gapic import sessions_client


if sys.version_info[:2] == (2, 7):
message = (
"A future version of this library will drop support for Python 2.7."
"More details about Python 2 support for Google Cloud Client Libraries"
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
)
warnings.warn(message, DeprecationWarning)


class AgentsClient(agents_client.AgentsClient):
__doc__ = agents_client.AgentsClient.__doc__
enums = enums
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -68,12 +68,12 @@ class EntityTypesClient(object):
common data types such as date, time, currency, and so on. A system
entity is represented by the ``EntityType`` type.
- **Developer** - entities that are defined by you that represent
- **Custom** - entities that are defined by you that represent
actionable data that is meaningful to your application. For example,
you could define a ``pizza.sauce`` entity for red or white pizza
sauce, a ``pizza.cheese`` entity for the different types of cheese on
a pizza, a ``pizza.topping`` entity for different toppings, and so
on. A developer entity is represented by the ``EntityType`` type.
on. A custom entity is represented by the ``EntityType`` type.
- **User** - entities that are built for an individual user such as
favorites, preferences, playlists, and so on. A user entity is
@@ -1138,7 +1138,7 @@ def batch_delete_entities(
Args:
parent (str): Required. The name of the entity type to delete entries for. Format:
``projects/<Project ID>/agent/entityTypes/<Entity Type ID>``.
entity_values (list[str]): Required. The canonical ``values`` of the entities to delete. Note that
entity_values (list[str]): Required. The reference ``values`` of the entities to delete. Note that
these are not fully-qualified names, i.e. they don't start with
``projects/<Project ID>``.
language_code (str): Optional. The language of entity synonyms defined in ``entities``. If
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -103,7 +103,7 @@ class OutputAudioEncoding(enum.IntEnum):
OUTPUT_AUDIO_ENCODING_UNSPECIFIED (int): Not specified.
OUTPUT_AUDIO_ENCODING_LINEAR_16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM).
Audio content returned as LINEAR16 also contains a WAV header.
OUTPUT_AUDIO_ENCODING_MP3 (int): MP3 audio.
OUTPUT_AUDIO_ENCODING_MP3 (int): MP3 audio at 32kbps.
OUTPUT_AUDIO_ENCODING_OGG_OPUS (int): Opus encoded audio wrapped in an ogg container. The result will be a
file which can be played natively on Android, and in browsers (at least
Chrome and Firefox). The quality of the encoding is considerably higher
@@ -206,7 +206,7 @@ class MatchMode(enum.IntEnum):
MATCH_MODE_HYBRID (int): Best for agents with a small number of examples in intents and/or wide
use of templates syntax and composite entities.
MATCH_MODE_ML_ONLY (int): Can be used for agents with a large number of examples in intents,
especially the ones using @sys.any or very large developer entities.
especially the ones using @sys.any or very large custom entities.
"""

MATCH_MODE_UNSPECIFIED = 0
@@ -252,9 +252,9 @@ class Kind(enum.IntEnum):
Attributes:
KIND_UNSPECIFIED (int): Not specified. This value should be never used.
KIND_MAP (int): Map entity types allow mapping of a group of synonyms to a canonical
KIND_MAP (int): Map entity types allow mapping of a group of synonyms to a reference
value.
KIND_LIST (int): List entity types contain a set of entries that do not map to canonical
KIND_LIST (int): List entity types contain a set of entries that do not map to reference
values. However, list entity types can contain references to other entity
types (with or without aliases).
KIND_REGEXP (int): Regexp entity types allow to specify regular expressions in entries
@@ -393,6 +393,83 @@ class Platform(enum.IntEnum):
ACTIONS_ON_GOOGLE = 8
GOOGLE_HANGOUTS = 11

class MediaContent(object):
class ResponseMediaType(enum.IntEnum):
"""
Format of response media type.
Attributes:
RESPONSE_MEDIA_TYPE_UNSPECIFIED (int): Unspecified.
AUDIO (int): Response media type is audio.
"""

RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0
AUDIO = 1

class BrowseCarouselCard(object):
class ImageDisplayOptions(enum.IntEnum):
"""
Image display options for Actions on Google. This should be used for
when the image's aspect ratio does not match the image container's
aspect ratio.
Attributes:
IMAGE_DISPLAY_OPTIONS_UNSPECIFIED (int): Fill the gaps between the image and the image container with gray
bars.
GRAY (int): Fill the gaps between the image and the image container with gray
bars.
WHITE (int): Fill the gaps between the image and the image container with white
bars.
CROPPED (int): Image is scaled such that the image width and height match or exceed
the container dimensions. This may crop the top and bottom of the
image if the scaled image height is greater than the container
height, or crop the left and right of the image if the scaled image
width is greater than the container width. This is similar to "Zoom
Mode" on a widescreen TV when playing a 4:3 video.
BLURRED_BACKGROUND (int): Pad the gaps between image and image frame with a blurred copy of the
same image.
"""

IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0
GRAY = 1
WHITE = 2
CROPPED = 3
BLURRED_BACKGROUND = 4

class BrowseCarouselCardItem(object):
class OpenUrlAction(object):
class UrlTypeHint(enum.IntEnum):
"""
Type of the URI.
Attributes:
URL_TYPE_HINT_UNSPECIFIED (int): Unspecified
AMP_ACTION (int): Url would be an amp action
AMP_CONTENT (int): URL that points directly to AMP content, or to a canonical URL
which refers to AMP content via <link rel="amphtml">.
"""

URL_TYPE_HINT_UNSPECIFIED = 0
AMP_ACTION = 1
AMP_CONTENT = 2

class ColumnProperties(object):
class HorizontalAlignment(enum.IntEnum):
"""
Text alignments within a cell.
Attributes:
HORIZONTAL_ALIGNMENT_UNSPECIFIED (int): Text is aligned to the leading edge of the column.
LEADING (int): Text is aligned to the leading edge of the column.
CENTER (int): Text is centered in the column.
TRAILING (int): Text is aligned to the trailing edge of the column.
"""

HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0
LEADING = 1
CENTER = 2
TRAILING = 3


class SessionEntityType(object):
class EntityOverrideMode(enum.IntEnum):
@@ -402,16 +479,16 @@ class EntityOverrideMode(enum.IntEnum):
Attributes:
ENTITY_OVERRIDE_MODE_UNSPECIFIED (int): Not specified. This value should be never used.
ENTITY_OVERRIDE_MODE_OVERRIDE (int): The collection of session entities overrides the collection of entities
in the corresponding developer entity type.
in the corresponding custom entity type.
ENTITY_OVERRIDE_MODE_SUPPLEMENT (int): The collection of session entities extends the collection of entities in
the corresponding developer entity type.
the corresponding custom entity type.
Note: Even in this override mode calls to ``ListSessionEntityTypes``,
``GetSessionEntityType``, ``CreateSessionEntityType`` and
``UpdateSessionEntityType`` only return the additional entities added in
this session entity type. If you want to get the supplemented list,
please call ``EntityTypes.GetEntityType`` on the developer entity type
and merge.
please call ``EntityTypes.GetEntityType`` on the custom entity type and
merge.
"""

ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -541,7 +541,7 @@ def create_intent(
def update_intent(
self,
intent,
language_code,
language_code=None,
update_mask=None,
intent_view=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
@@ -559,10 +559,7 @@ def update_intent(
>>> # TODO: Initialize `intent`:
>>> intent = {}
>>>
>>> # TODO: Initialize `language_code`:
>>> language_code = ''
>>>
>>> response = client.update_intent(intent, language_code)
>>> response = client.update_intent(intent)
Args:
intent (Union[dict, ~google.cloud.dialogflow_v2.types.Intent]): Required. The intent to update.
@@ -704,9 +701,9 @@ def delete_intent(
def batch_update_intents(
self,
parent,
language_code,
intent_batch_uri=None,
intent_batch_inline=None,
language_code=None,
update_mask=None,
intent_view=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
@@ -725,10 +722,7 @@ def batch_update_intents(
>>>
>>> parent = client.project_agent_path('[PROJECT]')
>>>
>>> # TODO: Initialize `language_code`:
>>> language_code = ''
>>>
>>> response = client.batch_update_intents(parent, language_code)
>>> response = client.batch_update_intents(parent)
>>>
>>> def callback(operation_future):
... # Handle result.
@@ -742,19 +736,19 @@ def batch_update_intents(
Args:
parent (str): Required. The name of the agent to update or create intents in. Format:
``projects/<Project ID>/agent``.
language_code (str): Optional. The language of training phrases, parameters and rich messages
defined in ``intents``. If not specified, the agent's default language
is used. `Many
languages <https://cloud.google.com/dialogflow/docs/reference/language>`__
are supported. Note: languages must be enabled in the agent before they
can be used.
intent_batch_uri (str): The URI to a Google Cloud Storage file containing intents to update or
create. The file format can either be a serialized proto (of IntentBatch
type) or JSON object. Note: The URI must start with "gs://".
intent_batch_inline (Union[dict, ~google.cloud.dialogflow_v2.types.IntentBatch]): The collection of intents to update or create.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.dialogflow_v2.types.IntentBatch`
language_code (str): Optional. The language of training phrases, parameters and rich messages
defined in ``intents``. If not specified, the agent's default language
is used. `Many
languages <https://cloud.google.com/dialogflow/docs/reference/language>`__
are supported. Note: languages must be enabled in the agent before they
can be used.
update_mask (Union[dict, ~google.cloud.dialogflow_v2.types.FieldMask]): Optional. The mask to control which fields get updated.
If a dict is provided, it must be of the same form as the protobuf
@@ -798,9 +792,9 @@ def batch_update_intents(

request = intent_pb2.BatchUpdateIntentsRequest(
parent=parent,
language_code=language_code,
intent_batch_uri=intent_batch_uri,
intent_batch_inline=intent_batch_inline,
language_code=language_code,
update_mask=update_mask,
intent_view=intent_view,
)
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

0 comments on commit 713846b

Please sign in to comment.
You can’t perform that action at this time.