ToolFakeConfig

Configuration for tool behavior in fake mode.

JSON representation
{
  "enableFakeMode": boolean,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "codeBlock": {
    object (CodeBlock)
  }
  // End of mutually exclusive fields.
}
Fields
enableFakeMode

boolean

Optional. Whether the tool is using fake mode.

The response is either static or it is provided by a python function. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
codeBlock

object (CodeBlock)

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

End of mutually exclusive fields.

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.