Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [google-cloud-dialogflow] created new boolean fields in conversation dataset for zone isolation and zone separation compliance status #13107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.32.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.32.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ async def sample_streaming_analyze_content():

# Initialize request argument(s)
audio_config = dialogflow_v2.InputAudioConfig()
audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
audio_config.sample_rate_hertz = 1817
audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,7 @@ def sample_streaming_analyze_content():

# Initialize request argument(s)
audio_config = dialogflow_v2.InputAudioConfig()
audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
audio_config.sample_rate_hertz = 1817
audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ async def sample_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down Expand Up @@ -472,7 +472,7 @@ async def sample_streaming_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ def sample_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down Expand Up @@ -944,7 +944,7 @@ def sample_streaming_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class AudioEncoding(proto.Enum):
5574. In other words, each RTP header is replaced with a
single byte containing the block length. Only Speex wideband
is supported. ``sample_rate_hertz`` must be 16000.
AUDIO_ENCODING_ALAW (8):
8-bit samples that compand 13-bit audio
samples using G.711 PCMU/a-law.
"""
AUDIO_ENCODING_UNSPECIFIED = 0
AUDIO_ENCODING_LINEAR_16 = 1
Expand All @@ -159,6 +162,7 @@ class AudioEncoding(proto.Enum):
AUDIO_ENCODING_AMR_WB = 5
AUDIO_ENCODING_OGG_OPUS = 6
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7
AUDIO_ENCODING_ALAW = 8


class SpeechModelVariant(proto.Enum):
Expand Down Expand Up @@ -258,13 +262,17 @@ class OutputAudioEncoding(proto.Enum):
OUTPUT_AUDIO_ENCODING_MULAW (5):
8-bit samples that compand 14-bit audio
samples using G.711 PCMU/mu-law.
OUTPUT_AUDIO_ENCODING_ALAW (6):
8-bit samples that compand 13-bit audio
samples using G.711 PCMU/a-law.
"""
OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0
OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1
OUTPUT_AUDIO_ENCODING_MP3 = 2
OUTPUT_AUDIO_ENCODING_MP3_64_KBPS = 4
OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3
OUTPUT_AUDIO_ENCODING_MULAW = 5
OUTPUT_AUDIO_ENCODING_ALAW = 6


class SpeechContext(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ class ConversationDataset(proto.Message):
ImportConversationData on a dataset that already has data is not
allowed).


.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes:
name (str):
Output only. ConversationDataset resource name. Format:
Expand All @@ -112,6 +115,17 @@ class ConversationDataset(proto.Message):
conversation_count (int):
Output only. The number of conversations this
conversation dataset contains.
satisfies_pzi (bool):
Output only. A read only boolean field
reflecting Zone Isolation status of the dataset.

This field is a member of `oneof`_ ``_satisfies_pzi``.
satisfies_pzs (bool):
Output only. A read only boolean field
reflecting Zone Separation status of the
dataset.

This field is a member of `oneof`_ ``_satisfies_pzs``.
"""

name: str = proto.Field(
Expand Down Expand Up @@ -145,6 +159,16 @@ class ConversationDataset(proto.Message):
proto.INT64,
number=7,
)
satisfies_pzi: bool = proto.Field(
proto.BOOL,
number=8,
optional=True,
)
satisfies_pzs: bool = proto.Field(
proto.BOOL,
number=9,
optional=True,
)


class CreateConversationDatasetRequest(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.32.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def sample_streaming_analyze_content():

# Initialize request argument(s)
audio_config = dialogflow_v2.InputAudioConfig()
audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
audio_config.sample_rate_hertz = 1817
audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def sample_streaming_analyze_content():

# Initialize request argument(s)
audio_config = dialogflow_v2.InputAudioConfig()
audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
audio_config.sample_rate_hertz = 1817
audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def sample_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def sample_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def sample_streaming_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def sample_streaming_detect_intent():

# Initialize request argument(s)
query_input = dialogflow_v2.QueryInput()
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"
query_input.audio_config.audio_encoding = "AUDIO_ENCODING_ALAW"
query_input.audio_config.sample_rate_hertz = 1817
query_input.audio_config.language_code = "language_code_value"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-dialogflow",
"version": "2.32.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-dialogflow",
"version": "2.32.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1641,6 +1641,8 @@ def test_get_conversation_dataset(request_type, transport: str = "grpc"):
display_name="display_name_value",
description="description_value",
conversation_count=1955,
satisfies_pzi=True,
satisfies_pzs=True,
)
response = client.get_conversation_dataset(request)

Expand All @@ -1656,6 +1658,8 @@ def test_get_conversation_dataset(request_type, transport: str = "grpc"):
assert response.display_name == "display_name_value"
assert response.description == "description_value"
assert response.conversation_count == 1955
assert response.satisfies_pzi is True
assert response.satisfies_pzs is True


def test_get_conversation_dataset_empty_call():
Expand Down Expand Up @@ -1769,6 +1773,8 @@ async def test_get_conversation_dataset_empty_call_async():
display_name="display_name_value",
description="description_value",
conversation_count=1955,
satisfies_pzi=True,
satisfies_pzs=True,
)
)
response = await client.get_conversation_dataset()
Expand Down Expand Up @@ -1844,6 +1850,8 @@ async def test_get_conversation_dataset_async(
display_name="display_name_value",
description="description_value",
conversation_count=1955,
satisfies_pzi=True,
satisfies_pzs=True,
)
)
response = await client.get_conversation_dataset(request)
Expand All @@ -1860,6 +1868,8 @@ async def test_get_conversation_dataset_async(
assert response.display_name == "display_name_value"
assert response.description == "description_value"
assert response.conversation_count == 1955
assert response.satisfies_pzi is True
assert response.satisfies_pzs is True


@pytest.mark.asyncio
Expand Down Expand Up @@ -3336,6 +3346,8 @@ def test_create_conversation_dataset_rest(request_type):
"input_config": {"gcs_source": {"uris": ["uris_value1", "uris_value2"]}},
"conversation_info": {"language_code": "language_code_value"},
"conversation_count": 1955,
"satisfies_pzi": True,
"satisfies_pzs": True,
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -3740,6 +3752,8 @@ def test_get_conversation_dataset_rest(request_type):
display_name="display_name_value",
description="description_value",
conversation_count=1955,
satisfies_pzi=True,
satisfies_pzs=True,
)

# Wrap the value into a proper Response obj
Expand All @@ -3759,6 +3773,8 @@ def test_get_conversation_dataset_rest(request_type):
assert response.display_name == "display_name_value"
assert response.description == "description_value"
assert response.conversation_count == 1955
assert response.satisfies_pzi is True
assert response.satisfies_pzs is True


def test_get_conversation_dataset_rest_use_cached_wrapped_rpc():
Expand Down
Loading