// 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.v1;

import "google/api/field_behavior.proto";

option go_package = "cloud.google.com/go/ces/apiv1/cespb;cespb";
option java_multiple_files = true;
option java_outer_classname = "FakesProto";
option java_package = "com.google.cloud.ces.v1";

// A code block to be executed instead of a real tool call.
message CodeBlock {
  // Required. Python code which will be invoked in tool fake mode.
  // Expected Python function signature -
  // To catch all tool calls:
  //   def fake_tool_call(tool: Tool, input: dict[str, Any],
  //     callback_context: CallbackContext) -> Optional[dict[str, Any]]:
  // To catch a specific tool call:
  //   def fake_{tool_id}(tool: Tool, input: dict[str, Any],
  //     callback_context: CallbackContext) -> Optional[dict[str, Any]]:
  // If the function returns None, the real tool will be invoked instead.
  string python_code = 1 [(google.api.field_behavior) = REQUIRED];
}

// Configuration for tool behavior in fake mode.
message ToolFakeConfig {
  // The response is either static or it is provided by a python function.
  oneof tool_response {
    // Optional. Code block which will be executed instead of a real tool call.
    CodeBlock code_block = 1 [(google.api.field_behavior) = OPTIONAL];
  }

  // Optional. Whether the tool is using fake mode.
  bool enable_fake_mode = 2 [(google.api.field_behavior) = OPTIONAL];
}
