Class: Google::ADK::FunctionCall

Inherits:
Object
  • Object
show all
Defined in:
lib/google/adk/events.rb

Overview

Represents a function call in an event

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name:, arguments:) ⇒ FunctionCall

Initialize a function call

Parameters:

  • id (String) (defaults to: nil)

    Unique identifier for the call (optional)

  • name (String)

    Function name

  • arguments (Hash)

    Function arguments



18
19
20
21
22
# File 'lib/google/adk/events.rb', line 18

def initialize(id: nil, name:, arguments:)
  @id = id || "call-#{SecureRandom.uuid}"
  @name = name
  @arguments = arguments
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



11
12
13
# File 'lib/google/adk/events.rb', line 11

def arguments
  @arguments
end

#idObject (readonly)

Returns the value of attribute id.



11
12
13
# File 'lib/google/adk/events.rb', line 11

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/google/adk/events.rb', line 11

def name
  @name
end

Instance Method Details

#to_hHash

Convert to hash

Returns:

  • (Hash)

    Hash representation



27
28
29
30
31
32
33
# File 'lib/google/adk/events.rb', line 27

def to_h
  {
    id: @id,
    name: @name,
    arguments: @arguments
  }
end