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

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

Overview

See Also:

  • Stagehand::Models::SessionExecuteResponse::Data#result

Defined Under Namespace

Classes: Action, Usage

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(type:, action: nil, instruction: nil, page_text: nil, page_url: nil, reasoning: nil, task_completed: nil, time_ms: nil) ⇒ Object

Parameters:

  • type (String) —

    Type of action taken

  • action (String) (defaults to: nil)
  • instruction (String) (defaults to: nil)
  • page_text (String) (defaults to: nil)
  • page_url (String) (defaults to: nil)
  • reasoning (String) (defaults to: nil) —

    Agent's reasoning for taking this action

  • task_completed (Boolean) (defaults to: nil)
  • time_ms (Float) (defaults to: nil) —

    Time taken for this action in ms



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

Instance Attribute Details

#actions ⇒ Array<Stagehand::Models::SessionExecuteResponse::Data::Result::Action>



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

required :actions,
-> { Stagehand::Internal::Type::ArrayOf[Stagehand::Models::SessionExecuteResponse::Data::Result::Action] }

#completed ⇒ Boolean

Whether the agent finished its task

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

required :completed, Stagehand::Internal::Type::Boolean

#message ⇒ String

Summary of what the agent accomplished

Parameters:

  • value (String)

Returns:

  • (String)


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

required :message, String

#metadata ⇒ Hash{Symbol=>Object}?

Parameters:

  • (::Hash[Symbol, top])

Returns:

  • (Hash{Symbol=>Object}, nil)


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

optional :metadata, Stagehand::Internal::Type::HashOf[Stagehand::Internal::Type::Unknown]

#success ⇒ Boolean

Whether the agent completed successfully

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

required :success, Stagehand::Internal::Type::Boolean

#usage ⇒ Stagehand::Models::SessionExecuteResponse::Data::Result::Usage?



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

optional :usage, -> { Stagehand::Models::SessionExecuteResponse::Data::Result::Usage }

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


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

def to_hash: -> {