# Interface CodeBlockOrBuilder (0.9.0)

0.9.0 (latest) 0.7.0 0.4.0 0.3.0 0.1.0

    public interface CodeBlockOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getPythonCode()

    public abstract String getPythonCode()

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];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The pythonCode. |

### getPythonCodeBytes()

    public abstract ByteString getPythonCodeBytes()

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];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for pythonCode. |