Class: Google::ADK::ReadonlyContext

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

Overview

Read-only context for accessing state

Direct Known Subclasses

CallbackContext

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(invocation_id:, agent_name:, state:) ⇒ ReadonlyContext

Initialize readonly context

Parameters:

  • invocation_id (String)

    Unique invocation ID

  • agent_name (String)

    Current agent name

  • state (Hash)

    Current state (will be frozen)



53
54
55
56
57
# File 'lib/google/adk/context.rb', line 53

def initialize(invocation_id:, agent_name:, state:)
  @invocation_id = invocation_id
  @agent_name = agent_name
  @state = state.freeze
end

Instance Attribute Details

#agent_nameObject (readonly)

Returns the value of attribute agent_name.



46
47
48
# File 'lib/google/adk/context.rb', line 46

def agent_name
  @agent_name
end

#invocation_idObject (readonly)

Returns the value of attribute invocation_id.



46
47
48
# File 'lib/google/adk/context.rb', line 46

def invocation_id
  @invocation_id
end

#stateObject (readonly)

Returns the value of attribute state.



46
47
48
# File 'lib/google/adk/context.rb', line 46

def state
  @state
end