ToolFakeConfig

Configuration for tool behavior in fake mode.

JSON representation
{
  "enableFakeMode": boolean,

  // Union field tool_response can be only one of the following:
  "codeBlock": {
    object (CodeBlock)
  }
  // End of list of possible types for union field tool_response.
}
Fields
enableFakeMode

boolean

Optional. Whether the tool is using fake mode.

Union field tool_response. The response is either static or it is provided by a python function. tool_response can be only one of the following:
codeBlock

object (CodeBlock)

Optional. Code block which will be executed instead of a real tool call.

CodeBlock

A code block to be executed instead of a real tool call.

JSON representation
{
  "pythonCode": string
}
Fields
pythonCode

string

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_{toolId}(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.