Class: Stagehand::Models::SessionExtractParams::Options

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/stagehand/models/session_extract_params.rb

Defined Under Namespace

Modules: Model

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(ignore_selectors: nil, model: nil, selector: nil, timeout: nil) ⇒ Object

Parameters:

  • ignore_selectors (Array<String>) (defaults to: nil)

    Selectors for elements and subtrees that should be excluded from extraction

  • model (Stagehand::Models::ModelConfig, String) (defaults to: nil)

    Model configuration object or model name string (e.g., ‘openai/gpt-5-nano’)

  • selector (String) (defaults to: nil)

    CSS selector to scope extraction to a specific element

  • timeout (Float) (defaults to: nil)

    Timeout in ms for the extraction



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/stagehand/models/session_extract_params.rb', line 62

class Options < Stagehand::Internal::Type::BaseModel
  # @!attribute ignore_selectors
  #   Selectors for elements and subtrees that should be excluded from extraction
  #
  #   @return [Array<String>, nil]
  optional :ignore_selectors, Stagehand::Internal::Type::ArrayOf[String], api_name: :ignoreSelectors

  # @!attribute model
  #   Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
  #
  #   @return [Stagehand::Models::ModelConfig, String, nil]
  optional :model, union: -> { Stagehand::SessionExtractParams::Options::Model }

  # @!attribute selector
  #   CSS selector to scope extraction to a specific element
  #
  #   @return [String, nil]
  optional :selector, String

  # @!attribute timeout
  #   Timeout in ms for the extraction
  #
  #   @return [Float, nil]
  optional :timeout, Float

  # @!method initialize(ignore_selectors: nil, model: nil, selector: nil, timeout: nil)
  #   @param ignore_selectors [Array<String>] Selectors for elements and subtrees that should be excluded from extraction
  #
  #   @param model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
  #
  #   @param selector [String] CSS selector to scope extraction to a specific element
  #
  #   @param timeout [Float] Timeout in ms for the extraction

  # Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
  #
  # @see Stagehand::Models::SessionExtractParams::Options#model
  module Model
    extend Stagehand::Internal::Type::Union

    variant -> { Stagehand::ModelConfig }

    variant String

    # @!method self.variants
    #   @return [Array(Stagehand::Models::ModelConfig, String)]
  end
end

Instance Attribute Details

#ignore_selectorsArray<String>?

Selectors for elements and subtrees that should be excluded from extraction

Returns:

  • (Array<String>, nil)


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

optional :ignore_selectors, Stagehand::Internal::Type::ArrayOf[String], api_name: :ignoreSelectors

#modelStagehand::Models::ModelConfig, ...

Model configuration object or model name string (e.g., ‘openai/gpt-5-nano’)

Returns:



73
# File 'lib/stagehand/models/session_extract_params.rb', line 73

optional :model, union: -> { Stagehand::SessionExtractParams::Options::Model }

#selectorString?

CSS selector to scope extraction to a specific element

Returns:

  • (String, nil)


79
# File 'lib/stagehand/models/session_extract_params.rb', line 79

optional :selector, String

#timeoutFloat?

Timeout in ms for the extraction

Returns:

  • (Float, nil)


85
# File 'lib/stagehand/models/session_extract_params.rb', line 85

optional :timeout, Float