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

Commit

Permalink
docs: recommend AnalyzeContent for future users (#743)
Browse files Browse the repository at this point in the history
* docs: recommend AnalyzeContent for future users

PiperOrigin-RevId: 401877120

Source-Link: googleapis/googleapis@9af371c

Source-Link: googleapis/googleapis-gen@0db2e0b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMGRiMmUwYjg2NTY2ODFmYjEwZjE4NmY0NGU4NzQ0MGJhM2U5ZDg3MyJ9

* 🦉 Updates from OwlBot

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: fix duplicate deprecate annotation

* Update owlbot.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Neenu1995 <neenushaji@google.com>
Co-authored-by: Neenu Shaji <Neenu1995@users.noreply.github.com>
  • Loading branch information
4 people committed Oct 21, 2021
1 parent 55bd28f commit 866ca0f
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 64 deletions.
Expand Up @@ -148,6 +148,12 @@ public SessionsStub getStub() {
* method is not idempotent, because it may cause contexts and session entity types to be updated,
* which in turn might affect results of future queries.
*
* <p>If you might use [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) or other CCAI
* products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] instead of
* `DetectIntent`. `AnalyzeContent` has additional functionality for Agent Assist and other CCAI
* products.
*
* <p>Note: Always use agent versions for production traffic. See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
*
Expand Down Expand Up @@ -200,6 +206,12 @@ public final DetectIntentResponse detectIntent(SessionName session, QueryInput q
* method is not idempotent, because it may cause contexts and session entity types to be updated,
* which in turn might affect results of future queries.
*
* <p>If you might use [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) or other CCAI
* products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] instead of
* `DetectIntent`. `AnalyzeContent` has additional functionality for Agent Assist and other CCAI
* products.
*
* <p>Note: Always use agent versions for production traffic. See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
*
Expand Down Expand Up @@ -249,6 +261,12 @@ public final DetectIntentResponse detectIntent(String session, QueryInput queryI
* method is not idempotent, because it may cause contexts and session entity types to be updated,
* which in turn might affect results of future queries.
*
* <p>If you might use [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) or other CCAI
* products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] instead of
* `DetectIntent`. `AnalyzeContent` has additional functionality for Agent Assist and other CCAI
* products.
*
* <p>Note: Always use agent versions for production traffic. See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
*
Expand Down Expand Up @@ -282,6 +300,12 @@ public final DetectIntentResponse detectIntent(DetectIntentRequest request) {
* method is not idempotent, because it may cause contexts and session entity types to be updated,
* which in turn might affect results of future queries.
*
* <p>If you might use [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) or other CCAI
* products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] instead of
* `DetectIntent`. `AnalyzeContent` has additional functionality for Agent Assist and other CCAI
* products.
*
* <p>Note: Always use agent versions for production traffic. See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
*
Expand Down Expand Up @@ -315,6 +339,12 @@ public final UnaryCallable<DetectIntentRequest, DetectIntentResponse> detectInte
* structured, actionable data as a result. This method is only available via the gRPC API (not
* REST).
*
* <p>If you might use [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) or other CCAI
* products now or in the future, consider using
* [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent]
* instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has additional functionality for
* Agent Assist and other CCAI products.
*
* <p>Note: Always use agent versions for production traffic. See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
*
Expand Down
Expand Up @@ -190,6 +190,12 @@ public abstract static class SessionsImplBase implements io.grpc.BindableService
* as a result. This method is not idempotent, because it may cause contexts
* and session entity types to be updated, which in turn might affect
* results of future queries.
* If you might use
* [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
* or other CCAI products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]
* instead of `DetectIntent`. `AnalyzeContent` has additional
* functionality for Agent Assist and other CCAI products.
* Note: Always use agent versions for production traffic.
* See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand All @@ -210,6 +216,12 @@ public void detectIntent(
* Processes a natural language query in audio format in a streaming fashion
* and returns structured, actionable data as a result. This method is only
* available via the gRPC API (not REST).
* If you might use
* [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
* or other CCAI products now or in the future, consider using
* [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent]
* instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has
* additional functionality for Agent Assist and other CCAI products.
* Note: Always use agent versions for production traffic.
* See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand Down Expand Up @@ -273,6 +285,12 @@ protected SessionsStub build(io.grpc.Channel channel, io.grpc.CallOptions callOp
* as a result. This method is not idempotent, because it may cause contexts
* and session entity types to be updated, which in turn might affect
* results of future queries.
* If you might use
* [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
* or other CCAI products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]
* instead of `DetectIntent`. `AnalyzeContent` has additional
* functionality for Agent Assist and other CCAI products.
* Note: Always use agent versions for production traffic.
* See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand All @@ -295,6 +313,12 @@ public void detectIntent(
* Processes a natural language query in audio format in a streaming fashion
* and returns structured, actionable data as a result. This method is only
* available via the gRPC API (not REST).
* If you might use
* [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
* or other CCAI products now or in the future, consider using
* [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent]
* instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has
* additional functionality for Agent Assist and other CCAI products.
* Note: Always use agent versions for production traffic.
* See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand Down Expand Up @@ -340,6 +364,12 @@ protected SessionsBlockingStub build(io.grpc.Channel channel, io.grpc.CallOption
* as a result. This method is not idempotent, because it may cause contexts
* and session entity types to be updated, which in turn might affect
* results of future queries.
* If you might use
* [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
* or other CCAI products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]
* instead of `DetectIntent`. `AnalyzeContent` has additional
* functionality for Agent Assist and other CCAI products.
* Note: Always use agent versions for production traffic.
* See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand Down Expand Up @@ -380,6 +410,12 @@ protected SessionsFutureStub build(io.grpc.Channel channel, io.grpc.CallOptions
* as a result. This method is not idempotent, because it may cause contexts
* and session entity types to be updated, which in turn might affect
* results of future queries.
* If you might use
* [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
* or other CCAI products now or in the future, consider using
* [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]
* instead of `DetectIntent`. `AnalyzeContent` has additional
* functionality for Agent Assist and other CCAI products.
* Note: Always use agent versions for production traffic.
* See [Versions and
* environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand Down
129 changes: 65 additions & 64 deletions owlbot.py
Expand Up @@ -19,75 +19,76 @@
for library in s.get_staging_dirs():
# put any special-case replacements here
# TODO: remove this for the next major version bump
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static String formatProjectName',
'public static String formatProjectAgentName'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static String formatProjectLocationName',
'public static String formatProjectLocationAgentName'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'ProjectBuilder',
'ProjectAgentBuilder'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'ProjectLocationBuilder',
'ProjectLocationAgentBuilder'
)
if 'formatProjectAgentName' not in open('owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java').read():
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static String formatProjectName',
'public static String formatProjectAgentName'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static String formatProjectLocationName',
'public static String formatProjectLocationAgentName'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'ProjectBuilder',
'ProjectAgentBuilder'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'ProjectLocationBuilder',
'ProjectLocationAgentBuilder'
)

DEPRECATION_JAVADOC = """Please use {{@link #{new_method}()}} instead"""
DEPRECATION_JAVADOC = """Please use {{@link #{new_method}()}} instead"""


java.copy_and_rename_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectName(String project)',
'ofProjectName',
'ofProjectAgentName'
)
java.deprecate_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectAgentName(String project)',
DEPRECATION_JAVADOC.format(new_method='ofProjectName')
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'return ofProjectName',
'return ofProjectAgentName'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'return ofProjectLocationName',
'return ofProjectLocationAgentName'
)
java.copy_and_rename_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectLocationName(String project, String location)',
'ofProjectLocationName',
'ofProjectLocationAgentName'
)
java.deprecate_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectLocationAgentName(String project, String location)',
DEPRECATION_JAVADOC.format(new_method='ofProjectLocationName')
)
java.copy_and_rename_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectName(String project)',
'ofProjectName',
'ofProjectAgentName'
)
java.deprecate_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectAgentName(String project)',
DEPRECATION_JAVADOC.format(new_method='ofProjectName')
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'return ofProjectName',
'return ofProjectAgentName'
)
s.replace(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'return ofProjectLocationName',
'return ofProjectLocationAgentName'
)
java.copy_and_rename_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectLocationName(String project, String location)',
'ofProjectLocationName',
'ofProjectLocationAgentName'
)
java.deprecate_method(
'owl-bot-staging/v2beta1/proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/AgentName.java',
'public static AgentName ofProjectLocationAgentName(String project, String location)',
DEPRECATION_JAVADOC.format(new_method='ofProjectLocationName')
)

s.replace(
[
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/AgentsClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/EnvironmentsClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/EntityTypesClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/IntentsClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/VersionsClientTest.java'
s.replace(
[
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/AgentsClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/EnvironmentsClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/EntityTypesClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/IntentsClientTest.java',
'owl-bot-staging/v2beta1/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2beta1/VersionsClientTest.java'

],
'ofProjectName',
'ofProjectAgentName'
)
],
'ofProjectName',
'ofProjectAgentName'
)
s.move(library)

s.remove_staging_dirs()
Expand Down
Expand Up @@ -62,6 +62,13 @@ service Sessions {
// and session entity types to be updated, which in turn might affect
// results of future queries.
//
// If you might use
// [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
// or other CCAI products now or in the future, consider using
// [AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]
// instead of `DetectIntent`. `AnalyzeContent` has additional
// functionality for Agent Assist and other CCAI products.
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand Down Expand Up @@ -89,6 +96,13 @@ service Sessions {
// and returns structured, actionable data as a result. This method is only
// available via the gRPC API (not REST).
//
// If you might use
// [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa)
// or other CCAI products now or in the future, consider using
// [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent]
// instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has
// additional functionality for Agent Assist and other CCAI products.
//
// Note: Always use agent versions for production traffic.
// See [Versions and
// environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
Expand Down

0 comments on commit 866ca0f

Please sign in to comment.