Skip to content

Commit

Permalink
feat: Add the enable_partial_automated_agent_reply flag (#11766)
Browse files Browse the repository at this point in the history
BEGIN_COMMIT_OVERRIDE
feat: Add the enable_partial_automated_agent_reply flag
feat: Remove backend API deadline
END_COMMIT_OVERRIDE

- [ ] Regenerate this pull request now.

chore: remove extraneous backend config

PiperOrigin-RevId: 569315665

Source-Link:
googleapis/googleapis@a24bc56

Source-Link:
googleapis/googleapis-gen@afd0643
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6ImFmZDA2NDM2NWY5YTI2NmIzMjk1MDA2ODA1NGIzYzJjNWRhMzc0YmQifQ==

BEGIN_NESTED_COMMIT
feat: Add the enable_partial_automated_agent_reply flag
feat: Remove backend API deadline

PiperOrigin-RevId: 568908437

Source-Link:
googleapis/googleapis@56f0766

Source-Link:
googleapis/googleapis-gen@5949657
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRpYWxvZ2Zsb3cvLk93bEJvdC55YW1sIiwiaCI6IjU5NDk2NTc1MTlmOGYwYjc1MmUwZTg4N2M2MWU3MzdlYjViN2JiMjIifQ==
END_NESTED_COMMIT

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: ohmayr <omairnaveed@ymail.com>
  • Loading branch information
3 people authored Sep 30, 2023
1 parent 64cb74e commit 2996e9b
Show file tree
Hide file tree
Showing 409 changed files with 54,166 additions and 32 deletions.
4 changes: 2 additions & 2 deletions packages/google-cloud-dialogflow/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system- -- -k <name of test>
$ nox -s system-3.11 -- -k <name of test>


.. note::

System tests are only configured to run under Python.
System tests are only configured to run under Python 3.8, 3.9, 3.10 and 3.11.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.24.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.24.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,27 @@ class StreamingAnalyzeContentRequest(proto.Message):
Note: this field should only be used if you are
connecting to a Dialogflow CX agent.
enable_extended_streaming (bool):
Optional. Enable full bidirectional streaming. You can keep
streaming the audio until timeout, and there's no need to
half close the stream to get the response.
Restrictions:
- Timeout: 3 mins.
- Audio Encoding: only supports
[AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_LINEAR_16]
and
[AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2.AudioEncoding.AUDIO_ENCODING_MULAW]
- Lifecycle: conversation should be in ``Assist Stage``, go
to [Conversation.CreateConversation][] for more
information.
InvalidArgument Error will be returned if the one of
restriction checks failed.
You can find more details in
https://cloud.google.com/agent-assist/docs/extended-streaming
enable_partial_automated_agent_reply (bool):
Enable partial virtual agent responses. If this flag is not
enabled, response stream still contains only one final
Expand Down Expand Up @@ -766,6 +787,10 @@ class StreamingAnalyzeContentRequest(proto.Message):
number=13,
message=struct_pb2.Struct,
)
enable_extended_streaming: bool = proto.Field(
proto.BOOL,
number=11,
)
enable_partial_automated_agent_reply: bool = proto.Field(
proto.BOOL,
number=12,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.24.1" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,27 @@ class StreamingAnalyzeContentRequest(proto.Message):
Note: this field should only be used if you are connecting
to a Dialogflow CX agent.
enable_extended_streaming (bool):
Optional. Enable full bidirectional streaming. You can keep
streaming the audio until timeout, and there's no need to
half close the stream to get the response.
Restrictions:
- Timeout: 3 mins.
- Audio Encoding: only supports
[AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2beta1.AudioEncoding.AUDIO_ENCODING_LINEAR_16]
and
[AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2beta1.AudioEncoding.AUDIO_ENCODING_MULAW]
- Lifecycle: conversation should be in ``Assist Stage``, go
to [Conversation.CreateConversation][] for more
information.
InvalidArgument Error will be returned if the one of
restriction checks failed.
You can find more details in
https://cloud.google.com/agent-assist/docs/extended-streaming
enable_partial_automated_agent_reply (bool):
Enable partial virtual agent responses. If this flag is not
enabled, response stream still contains only one final
Expand Down Expand Up @@ -1215,6 +1236,10 @@ class StreamingAnalyzeContentRequest(proto.Message):
proto.STRING,
number=15,
)
enable_extended_streaming: bool = proto.Field(
proto.BOOL,
number=11,
)
enable_partial_automated_agent_reply: bool = proto.Field(
proto.BOOL,
number=12,
Expand Down
23 changes: 1 addition & 22 deletions packages/google-cloud-dialogflow/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
UNIT_TEST_EXTRAS = []
UNIT_TEST_EXTRAS_BY_PYTHON = {}

SYSTEM_TEST_PYTHON_VERSIONS = []
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
"mock",
"pytest",
Expand Down Expand Up @@ -405,24 +405,3 @@ def prerelease_deps(session):
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")

session.run("py.test", "tests/unit")

system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")

# Only run system tests if found.
if os.path.exists(system_test_path):
session.run(
"py.test",
"--verbose",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_path,
*session.posargs,
)
if os.path.exists(system_test_folder_path):
session.run(
"py.test",
"--verbose",
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for DeleteAgent
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dialogflow


# [START dialogflow_v2_generated_Agents_DeleteAgent_async]
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dialogflow_v2


async def sample_delete_agent():
# Create a client
client = dialogflow_v2.AgentsAsyncClient()

# Initialize request argument(s)
request = dialogflow_v2.DeleteAgentRequest(
parent="parent_value",
)

# Make the request
await client.delete_agent(request=request)


# [END dialogflow_v2_generated_Agents_DeleteAgent_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for DeleteAgent
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dialogflow


# [START dialogflow_v2_generated_Agents_DeleteAgent_sync]
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dialogflow_v2


def sample_delete_agent():
# Create a client
client = dialogflow_v2.AgentsClient()

# Initialize request argument(s)
request = dialogflow_v2.DeleteAgentRequest(
parent="parent_value",
)

# Make the request
client.delete_agent(request=request)


# [END dialogflow_v2_generated_Agents_DeleteAgent_sync]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for ExportAgent
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dialogflow


# [START dialogflow_v2_generated_Agents_ExportAgent_async]
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dialogflow_v2


async def sample_export_agent():
# Create a client
client = dialogflow_v2.AgentsAsyncClient()

# Initialize request argument(s)
request = dialogflow_v2.ExportAgentRequest(
parent="parent_value",
agent_uri="agent_uri_value",
)

# Make the request
operation = client.export_agent(request=request)

print("Waiting for operation to complete...")

response = (await operation).result()

# Handle the response
print(response)

# [END dialogflow_v2_generated_Agents_ExportAgent_async]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated code. DO NOT EDIT!
#
# Snippet for ExportAgent
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-dialogflow


# [START dialogflow_v2_generated_Agents_ExportAgent_sync]
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import dialogflow_v2


def sample_export_agent():
# Create a client
client = dialogflow_v2.AgentsClient()

# Initialize request argument(s)
request = dialogflow_v2.ExportAgentRequest(
parent="parent_value",
agent_uri="agent_uri_value",
)

# Make the request
operation = client.export_agent(request=request)

print("Waiting for operation to complete...")

response = operation.result()

# Handle the response
print(response)

# [END dialogflow_v2_generated_Agents_ExportAgent_sync]
Loading

0 comments on commit 2996e9b

Please sign in to comment.