Class CodeBlock.Builder (0.1.0)

public static final class CodeBlock.Builder extends GeneratedMessage.Builder<CodeBlock.Builder> implements CodeBlockOrBuilder

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

Protobuf type google.cloud.ces.v1.CodeBlock

Implements

CodeBlockOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public CodeBlock build()
Returns
Type Description
CodeBlock

buildPartial()

public CodeBlock buildPartial()
Returns
Type Description
CodeBlock

clear()

public CodeBlock.Builder clear()
Returns
Type Description
CodeBlock.Builder
Overrides

clearPythonCode()

public CodeBlock.Builder clearPythonCode()

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
CodeBlock.Builder

This builder for chaining.

getDefaultInstanceForType()

public CodeBlock getDefaultInstanceForType()
Returns
Type Description
CodeBlock

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getPythonCode()

public 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
String

The pythonCode.

getPythonCodeBytes()

public 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
ByteString

The bytes for pythonCode.

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodeBlock other)

public CodeBlock.Builder mergeFrom(CodeBlock other)
Parameter
Name Description
other CodeBlock
Returns
Type Description
CodeBlock.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CodeBlock.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CodeBlock.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CodeBlock.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CodeBlock.Builder
Overrides

setPythonCode(String value)

public CodeBlock.Builder setPythonCode(String value)

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

Parameter
Name Description
value String

The pythonCode to set.

Returns
Type Description
CodeBlock.Builder

This builder for chaining.

setPythonCodeBytes(ByteString value)

public CodeBlock.Builder setPythonCodeBytes(ByteString value)

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

Parameter
Name Description
value ByteString

The bytes for pythonCode to set.

Returns
Type Description
CodeBlock.Builder

This builder for chaining.