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

feat(dialogflow): add MediaContent, BrowseCarouselCard, ColumnPropertiesin v2; add SpeechContext, SpeechWordInfoin 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

Merged
merged 5 commits into from
Feb 14, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dialogflow_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dialogflow_v2/gapic/entity_types_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
93 changes: 85 additions & 8 deletions dialogflow_v2/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand All @@ -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
Expand Down
Loading