Skip to content

Commit aeba59e

Browse files
docs: added notes to train agent prior to sending queries fix: added resource reference to agent_version (#829)
PiperOrigin-RevId: 380595849 Source-Link: googleapis/googleapis@5fe3c63 Source-Link: googleapis/googleapis-gen@a2b223a
1 parent 9a7885e commit aeba59e

File tree

11 files changed

+217
-111
lines changed

11 files changed

+217
-111
lines changed

packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/agent.proto

+16-5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ service Agents {
5252
}
5353

5454
// Creates/updates the specified agent.
55+
//
56+
// Note: You should always train an agent prior to sending it queries. See the
57+
// [training
58+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
5559
rpc SetAgent(SetAgentRequest) returns (Agent) {
5660
option (google.api.http) = {
5761
post: "/v2/{agent.parent=projects/*}/agent"
@@ -94,7 +98,10 @@ service Agents {
9498

9599
// Trains the specified agent.
96100
//
97-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
101+
//
102+
// Note: You should always train an agent prior to sending it queries. See the
103+
// [training
104+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
98105
rpc TrainAgent(TrainAgentRequest) returns (google.longrunning.Operation) {
99106
option (google.api.http) = {
100107
post: "/v2/{parent=projects/*}/agent:train"
@@ -112,8 +119,6 @@ service Agents {
112119
}
113120

114121
// Exports the specified agent to a ZIP file.
115-
//
116-
// Operation <response: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]>
117122
rpc ExportAgent(ExportAgentRequest) returns (google.longrunning.Operation) {
118123
option (google.api.http) = {
119124
post: "/v2/{parent=projects/*}/agent:export"
@@ -140,9 +145,12 @@ service Agents {
140145
// call [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the operation it returns in order to train
141146
// explicitly.
142147
//
143-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
144148
// An operation which tracks when importing is complete. It only tracks
145149
// when the draft agent is updated not when it is done training.
150+
//
151+
// Note: You should always train an agent prior to sending it queries. See the
152+
// [training
153+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
146154
rpc ImportAgent(ImportAgentRequest) returns (google.longrunning.Operation) {
147155
option (google.api.http) = {
148156
post: "/v2/{parent=projects/*}/agent:import"
@@ -167,9 +175,12 @@ service Agents {
167175
// completed yet. Please call [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the operation it
168176
// returns in order to train explicitly.
169177
//
170-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
171178
// An operation which tracks when restoring is complete. It only tracks
172179
// when the draft agent is updated not when it is done training.
180+
//
181+
// Note: You should always train an agent prior to sending it queries. See the
182+
// [training
183+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
173184
rpc RestoreAgent(RestoreAgentRequest) returns (google.longrunning.Operation) {
174185
option (google.api.http) = {
175186
post: "/v2/{parent=projects/*}/agent:restore"

packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/audio_config.proto

+30-30
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,6 @@ option java_outer_classname = "AudioConfigProto";
2929
option java_package = "com.google.cloud.dialogflow.v2";
3030
option objc_class_prefix = "DF";
3131

32-
// Hints for the speech recognizer to help with recognition in a specific
33-
// conversation state.
34-
message SpeechContext {
35-
// Optional. A list of strings containing words and phrases that the speech
36-
// recognizer should recognize with higher likelihood.
37-
//
38-
// This list can be used to:
39-
//
40-
// * improve accuracy for words and phrases you expect the user to say,
41-
// e.g. typical commands for your Dialogflow agent
42-
// * add additional words to the speech recognizer vocabulary
43-
// * ...
44-
//
45-
// See the [Cloud Speech
46-
// documentation](https://cloud.google.com/speech-to-text/quotas) for usage
47-
// limits.
48-
repeated string phrases = 1;
49-
50-
// Optional. Boost for this context compared to other contexts:
51-
//
52-
// * If the boost is positive, Dialogflow will increase the probability that
53-
// the phrases in this context are recognized over similar sounding phrases.
54-
// * If the boost is unspecified or non-positive, Dialogflow will not apply
55-
// any boost.
56-
//
57-
// Dialogflow recommends that you use boosts in the range (0, 20] and that you
58-
// find a value that fits your use case with binary search.
59-
float boost = 2;
60-
}
61-
6232
// Audio encoding of the audio content sent in the conversational query request.
6333
// Refer to the
6434
// [Cloud Speech API
@@ -108,6 +78,36 @@ enum AudioEncoding {
10878
AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7;
10979
}
11080

81+
// Hints for the speech recognizer to help with recognition in a specific
82+
// conversation state.
83+
message SpeechContext {
84+
// Optional. A list of strings containing words and phrases that the speech
85+
// recognizer should recognize with higher likelihood.
86+
//
87+
// This list can be used to:
88+
//
89+
// * improve accuracy for words and phrases you expect the user to say,
90+
// e.g. typical commands for your Dialogflow agent
91+
// * add additional words to the speech recognizer vocabulary
92+
// * ...
93+
//
94+
// See the [Cloud Speech
95+
// documentation](https://cloud.google.com/speech-to-text/quotas) for usage
96+
// limits.
97+
repeated string phrases = 1;
98+
99+
// Optional. Boost for this context compared to other contexts:
100+
//
101+
// * If the boost is positive, Dialogflow will increase the probability that
102+
// the phrases in this context are recognized over similar sounding phrases.
103+
// * If the boost is unspecified or non-positive, Dialogflow will not apply
104+
// any boost.
105+
//
106+
// Dialogflow recommends that you use boosts in the range (0, 20] and that you
107+
// find a value that fits your use case with binary search.
108+
float boost = 2;
109+
}
110+
111111
// Information for a word recognized by the speech recognizer.
112112
message SpeechWordInfo {
113113
// The word this info is for.

packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/entity_type.proto

+28-7
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ service EntityTypes {
6464
}
6565

6666
// Creates an entity type in the specified agent.
67+
//
68+
// Note: You should always train an agent prior to sending it queries. See the
69+
// [training
70+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
6771
rpc CreateEntityType(CreateEntityTypeRequest) returns (EntityType) {
6872
option (google.api.http) = {
6973
post: "/v2/{parent=projects/*/agent}/entityTypes"
@@ -78,6 +82,10 @@ service EntityTypes {
7882
}
7983

8084
// Updates the specified entity type.
85+
//
86+
// Note: You should always train an agent prior to sending it queries. See the
87+
// [training
88+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
8189
rpc UpdateEntityType(UpdateEntityTypeRequest) returns (EntityType) {
8290
option (google.api.http) = {
8391
patch: "/v2/{entity_type.name=projects/*/agent/entityTypes/*}"
@@ -92,6 +100,10 @@ service EntityTypes {
92100
}
93101

94102
// Deletes the specified entity type.
103+
//
104+
// Note: You should always train an agent prior to sending it queries. See the
105+
// [training
106+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
95107
rpc DeleteEntityType(DeleteEntityTypeRequest) returns (google.protobuf.Empty) {
96108
option (google.api.http) = {
97109
delete: "/v2/{name=projects/*/agent/entityTypes/*}"
@@ -104,7 +116,10 @@ service EntityTypes {
104116

105117
// Updates/Creates multiple entity types in the specified agent.
106118
//
107-
// Operation <response: [BatchUpdateEntityTypesResponse][google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse]>
119+
//
120+
// Note: You should always train an agent prior to sending it queries. See the
121+
// [training
122+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
108123
rpc BatchUpdateEntityTypes(BatchUpdateEntityTypesRequest) returns (google.longrunning.Operation) {
109124
option (google.api.http) = {
110125
post: "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate"
@@ -122,7 +137,9 @@ service EntityTypes {
122137

123138
// Deletes entity types in the specified agent.
124139
//
125-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
140+
// Note: You should always train an agent prior to sending it queries. See the
141+
// [training
142+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
126143
rpc BatchDeleteEntityTypes(BatchDeleteEntityTypesRequest) returns (google.longrunning.Operation) {
127144
option (google.api.http) = {
128145
post: "/v2/{parent=projects/*/agent}/entityTypes:batchDelete"
@@ -141,7 +158,9 @@ service EntityTypes {
141158

142159
// Creates multiple new entities in the specified entity type.
143160
//
144-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
161+
// Note: You should always train an agent prior to sending it queries. See the
162+
// [training
163+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
145164
rpc BatchCreateEntities(BatchCreateEntitiesRequest) returns (google.longrunning.Operation) {
146165
option (google.api.http) = {
147166
post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate"
@@ -163,8 +182,9 @@ service EntityTypes {
163182
// method does not affect entities in the entity type that aren't explicitly
164183
// specified in the request.
165184
//
166-
//
167-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
185+
// Note: You should always train an agent prior to sending it queries. See the
186+
// [training
187+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
168188
rpc BatchUpdateEntities(BatchUpdateEntitiesRequest) returns (google.longrunning.Operation) {
169189
option (google.api.http) = {
170190
post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate"
@@ -184,8 +204,9 @@ service EntityTypes {
184204

185205
// Deletes entities in the specified entity type.
186206
//
187-
//
188-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
207+
// Note: You should always train an agent prior to sending it queries. See the
208+
// [training
209+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
189210
rpc BatchDeleteEntities(BatchDeleteEntitiesRequest) returns (google.longrunning.Operation) {
190211
option (google.api.http) = {
191212
post: "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete"

packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/environment.proto

+7-2
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,17 @@ message Environment {
173173
// The maximum length is 500 characters. If exceeded, the request is rejected.
174174
string description = 2 [(google.api.field_behavior) = OPTIONAL];
175175

176-
// Optional. The agent version loaded into this environment.
176+
// Required. The agent version loaded into this environment.
177177
// Supported formats:
178178
// - `projects/<Project ID>/agent/versions/<Version ID>`
179179
// - `projects/<Project ID>/locations/<Location ID>/agent/versions/<Version
180180
// ID>`
181-
string agent_version = 3 [(google.api.field_behavior) = OPTIONAL];
181+
string agent_version = 3 [
182+
(google.api.field_behavior) = OPTIONAL,
183+
(google.api.resource_reference) = {
184+
type: "dialogflow.googleapis.com/Version"
185+
}
186+
];
182187

183188
// Output only. The state of this environment. This field is read-only, i.e., it cannot be
184189
// set by create and update methods.

packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/intent.proto

+20-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ service Intents {
7474
}
7575

7676
// Creates an intent in the specified agent.
77+
//
78+
// Note: You should always train an agent prior to sending it queries. See the
79+
// [training
80+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
7781
rpc CreateIntent(CreateIntentRequest) returns (Intent) {
7882
option (google.api.http) = {
7983
post: "/v2/{parent=projects/*/agent}/intents"
@@ -88,6 +92,10 @@ service Intents {
8892
}
8993

9094
// Updates the specified intent.
95+
//
96+
// Note: You should always train an agent prior to sending it queries. See the
97+
// [training
98+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
9199
rpc UpdateIntent(UpdateIntentRequest) returns (Intent) {
92100
option (google.api.http) = {
93101
patch: "/v2/{intent.name=projects/*/agent/intents/*}"
@@ -102,6 +110,10 @@ service Intents {
102110
}
103111

104112
// Deletes the specified intent and its direct or indirect followup intents.
113+
//
114+
// Note: You should always train an agent prior to sending it queries. See the
115+
// [training
116+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
105117
rpc DeleteIntent(DeleteIntentRequest) returns (google.protobuf.Empty) {
106118
option (google.api.http) = {
107119
delete: "/v2/{name=projects/*/agent/intents/*}"
@@ -114,7 +126,10 @@ service Intents {
114126

115127
// Updates/Creates multiple intents in the specified agent.
116128
//
117-
// Operation <response: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]>
129+
//
130+
// Note: You should always train an agent prior to sending it queries. See the
131+
// [training
132+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
118133
rpc BatchUpdateIntents(BatchUpdateIntentsRequest) returns (google.longrunning.Operation) {
119134
option (google.api.http) = {
120135
post: "/v2/{parent=projects/*/agent}/intents:batchUpdate"
@@ -134,7 +149,10 @@ service Intents {
134149

135150
// Deletes intents in the specified agent.
136151
//
137-
// Operation <response: [google.protobuf.Empty][google.protobuf.Empty]>
152+
//
153+
// Note: You should always train an agent prior to sending it queries. See the
154+
// [training
155+
// documentation](https://cloud.google.com/dialogflow/es/docs/training).
138156
rpc BatchDeleteIntents(BatchDeleteIntentsRequest) returns (google.longrunning.Operation) {
139157
option (google.api.http) = {
140158
post: "/v2/{parent=projects/*/agent}/intents:batchDelete"

packages/google-cloud-dialogflow/protos/protos.d.ts

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)