// Copyright 2026 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.

syntax = "proto3";

package google.cloud.ces.v1beta;

import "google/api/field_behavior.proto";

option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb";
option java_multiple_files = true;
option java_outer_classname = "GoogleSearchToolProto";
option java_package = "com.google.cloud.ces.v1beta";

// Represents a tool to perform Google web searches for grounding.
// See
// https://cloud.google.com/customer-engagement-ai/conversational-agents/ps/tool#google-search.
message GoogleSearchTool {
  // Prompt settings used by the model when processing or summarizing the
  // google search results.
  message PromptConfig {
    // Optional. Defines the prompt used for the system instructions when
    // interacting with the agent in chat conversations. If not set, default
    // prompt will be used.
    string text_prompt = 1 [(google.api.field_behavior) = OPTIONAL];

    // Optional. Defines the prompt used for the system instructions when
    // interacting with the agent in voice conversations. If not set, default
    // prompt will be used.
    string voice_prompt = 2 [(google.api.field_behavior) = OPTIONAL];
  }

  // Required. The name of the tool.
  string name = 1 [(google.api.field_behavior) = REQUIRED];

  // Optional. Description of the tool's purpose.
  string description = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Content will be fetched directly from these URLs for context and
  // grounding. Example: "https://example.com/path.html". A maximum of 20 URLs
  // are allowed.
  repeated string context_urls = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Specifies domains to restrict search results to.
  // Example: "example.com", "another.site". A maximum of 20 domains can be
  // specified.
  repeated string preferred_domains = 6
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. List of domains to be excluded from the search results.
  // Example: "example.com".
  // A maximum of 2000 domains can be excluded.
  repeated string exclude_domains = 4 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Prompt instructions passed to planner on how the search results
  // should be processed for text and voice.
  PromptConfig prompt_config = 5 [(google.api.field_behavior) = OPTIONAL];
}
