Class: Stagehand::Models::SessionExecuteResponse::Data::Result::Action

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stagehand/models/session_execute_response.rb,
sig/stagehand/models/session_execute_response.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(actions:, completed:, message:, success:, metadata: nil, usage: nil) ⇒ Object

Parameters:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/stagehand/models/session_execute_response.rb', line 92

class Action < Stagehand::Internal::Type::BaseModel
  # @!attribute type
  #   Type of action taken
  #
  #   @return [String]
  required :type, String

  # @!attribute action
  #
  #   @return [String, nil]
  optional :action, String

  # @!attribute instruction
  #
  #   @return [String, nil]
  optional :instruction, String

  # @!attribute page_text
  #
  #   @return [String, nil]
  optional :page_text, String, api_name: :pageText

  # @!attribute page_url
  #
  #   @return [String, nil]
  optional :page_url, String, api_name: :pageUrl

  # @!attribute reasoning
  #   Agent's reasoning for taking this action
  #
  #   @return [String, nil]
  optional :reasoning, String

  # @!attribute task_completed
  #
  #   @return [Boolean, nil]
  optional :task_completed, Stagehand::Internal::Type::Boolean, api_name: :taskCompleted

  # @!attribute time_ms
  #   Time taken for this action in ms
  #
  #   @return [Float, nil]
  optional :time_ms, Float, api_name: :timeMs

  # @!method initialize(type:, action: nil, instruction: nil, page_text: nil, page_url: nil, reasoning: nil, task_completed: nil, time_ms: nil)
  #   @param type [String] Type of action taken
  #
  #   @param action [String]
  #
  #   @param instruction [String]
  #
  #   @param page_text [String]
  #
  #   @param page_url [String]
  #
  #   @param reasoning [String] Agent's reasoning for taking this action
  #
  #   @param task_completed [Boolean]
  #
  #   @param time_ms [Float] Time taken for this action in ms
end

Instance Attribute Details

#action ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


102
# File 'lib/stagehand/models/session_execute_response.rb', line 102

optional :action, String

#instruction ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


107
# File 'lib/stagehand/models/session_execute_response.rb', line 107

optional :instruction, String

#page_text ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


112
# File 'lib/stagehand/models/session_execute_response.rb', line 112

optional :page_text, String, api_name: :pageText

#page_url ⇒ String?

Parameters:

  • (String)

Returns:

  • (String, nil)


117
# File 'lib/stagehand/models/session_execute_response.rb', line 117

optional :page_url, String, api_name: :pageUrl

#reasoning ⇒ String?

Agent's reasoning for taking this action

Parameters:

  • (String)

Returns:

  • (String, nil)


123
# File 'lib/stagehand/models/session_execute_response.rb', line 123

optional :reasoning, String

#task_completed ⇒ Boolean?

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


128
# File 'lib/stagehand/models/session_execute_response.rb', line 128

optional :task_completed, Stagehand::Internal::Type::Boolean, api_name: :taskCompleted

#time_ms ⇒ Float?

Time taken for this action in ms

Parameters:

  • (Float)

Returns:

  • (Float, nil)


134
# File 'lib/stagehand/models/session_execute_response.rb', line 134

optional :time_ms, Float, api_name: :timeMs

#type ⇒ String

Type of action taken

Parameters:

  • value (String)

Returns:

  • (String)


97
# File 'lib/stagehand/models/session_execute_response.rb', line 97

required :type, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


147
# File 'sig/stagehand/models/session_execute_response.rbs', line 147

def to_hash: -> {