Class: Google::Apis::CesV1::CodeBlock

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/ces_v1/classes.rb,
lib/google/apis/ces_v1/representations.rb,
lib/google/apis/ces_v1/representations.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CodeBlock

Returns a new instance of CodeBlock.



1663
1664
1665
# File 'lib/google/apis/ces_v1/classes.rb', line 1663

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#python_codeString

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. Corresponds to the JSON property pythonCode

Returns:

  • (String)


1661
1662
1663
# File 'lib/google/apis/ces_v1/classes.rb', line 1661

def python_code
  @python_code
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1668
1669
1670
# File 'lib/google/apis/ces_v1/classes.rb', line 1668

def update!(**args)
  @python_code = args[:python_code] if args.key?(:python_code)
end