Skip to content

Commit ba80e9b

Browse files
Google APIscopybara-github
authored andcommitted
feat: add support for defining custom actions in code. See https://cloud.google.com/dialogflow/cx/docs/concept/playbook/code-block for more information
feat: Service Account Auth in Tools and Webhooks PiperOrigin-RevId: 830582229
1 parent 91e4279 commit ba80e9b

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

google/cloud/dialogflow/cx/v3beta1/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ proto_library(
2929
"audio_config.proto",
3030
"bigquery_export.proto",
3131
"changelog.proto",
32+
"code_block.proto",
3233
"conversation_history.proto",
3334
"data_store_connection.proto",
3435
"deployment.proto",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package google.cloud.dialogflow.cx.v3beta1;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.Dialogflow.Cx.V3Beta1";
22+
option go_package = "cloud.google.com/go/dialogflow/cx/apiv3beta1/cxpb;cxpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "CodeBlockProto";
25+
option java_package = "com.google.cloud.dialogflow.cx.v3beta1";
26+
option objc_class_prefix = "DF";
27+
28+
// Represents a code block.
29+
message CodeBlock {
30+
// Optional. Source code of the block in Python.
31+
string code = 1 [(google.api.field_behavior) = OPTIONAL];
32+
}

google/cloud/dialogflow/cx/v3beta1/playbook.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
2323
import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto";
24+
import "google/cloud/dialogflow/cx/v3beta1/code_block.proto";
2425
import "google/cloud/dialogflow/cx/v3beta1/example.proto";
2526
import "google/cloud/dialogflow/cx/v3beta1/fulfillment.proto";
2627
import "google/cloud/dialogflow/cx/v3beta1/generative_settings.proto";
@@ -363,6 +364,19 @@ message Playbook {
363364
(google.api.resource_reference) = { type: "dialogflow.googleapis.com/Tool" }
364365
];
365366

367+
// Optional. Output only. Names of inline actions scoped to this playbook.
368+
// These actions are in addition to those belonging to referenced tools, child
369+
// playbooks, and flows, e.g. actions that are defined in the playbook's code
370+
// block.
371+
repeated string inline_actions = 22 [
372+
(google.api.field_behavior) = OPTIONAL,
373+
(google.api.field_behavior) = OUTPUT_ONLY
374+
];
375+
376+
// Optional. The playbook's scoped code block, which may implement handlers
377+
// and actions.
378+
CodeBlock code_block = 21 [(google.api.field_behavior) = OPTIONAL];
379+
366380
// Optional. Llm model settings for the playbook.
367381
LlmModelSettings llm_model_settings = 14
368382
[(google.api.field_behavior) = OPTIONAL];

google/cloud/dialogflow/cx/v3beta1/tool.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,20 @@ message Tool {
591591
];
592592
}
593593

594+
// Configuration for authentication using a service account.
595+
message ServiceAccountAuthConfig {
596+
// Required. The email address of the service account used to authenticate
597+
// the tool call. Dialogflow uses this service account to exchange an
598+
// access token and the access token is then sent in the `Authorization`
599+
// header of the tool request.
600+
//
601+
// The service account must have the
602+
// `roles/iam.serviceAccountTokenCreator` role granted to the
603+
// [Dialogflow service
604+
// agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent).
605+
string service_account = 1 [(google.api.field_behavior) = REQUIRED];
606+
}
607+
594608
// The auth configuration.
595609
oneof auth_config {
596610
// Config for API key auth.
@@ -606,6 +620,9 @@ message Tool {
606620

607621
// Config for bearer token auth.
608622
BearerTokenConfig bearer_token_config = 4;
623+
624+
// Configuration for service account authentication.
625+
ServiceAccountAuthConfig service_account_auth_config = 5;
609626
}
610627
}
611628

google/cloud/dialogflow/cx/v3beta1/webhook.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,20 @@ message Webhook {
165165
ACCESS_TOKEN = 3;
166166
}
167167

168+
// Configuration for authentication using a service account.
169+
message ServiceAccountAuthConfig {
170+
// Required. The email address of the service account used to authenticate
171+
// the webhook call. Dialogflow uses this service account to exchange an
172+
// access token and the access token is then sent in the `Authorization`
173+
// header of the webhook request.
174+
//
175+
// The service account must have the
176+
// `roles/iam.serviceAccountTokenCreator` role granted to the
177+
// [Dialogflow service
178+
// agent](https://cloud.google.com/iam/docs/service-agents#dialogflow-service-agent).
179+
string service_account = 1 [(google.api.field_behavior) = REQUIRED];
180+
}
181+
168182
// Represents the type of webhook configuration.
169183
enum WebhookType {
170184
// Default value. This value is unused.
@@ -263,6 +277,10 @@ message Webhook {
263277
ServiceAgentAuth service_agent_auth = 12
264278
[(google.api.field_behavior) = OPTIONAL];
265279

280+
// Optional. Configuration for service account authentication.
281+
ServiceAccountAuthConfig service_account_auth_config = 18
282+
[(google.api.field_behavior) = OPTIONAL];
283+
266284
// Optional. Type of the webhook.
267285
WebhookType webhook_type = 6 [(google.api.field_behavior) = OPTIONAL];
268286

0 commit comments

Comments
 (0)