Class: Stagehand::Models::SessionExecuteParams::AgentConfig

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

Defined Under Namespace

Modules: ExecutionModel, Mode, Model, Provider

Instance Attribute Summary collapse

Class Method 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(cua: nil, execution_model: nil, mode: nil, model: nil, provider: nil, system_prompt: nil) ⇒ Object

Some parameter documentations has been truncated, see Stagehand::Models::SessionExecuteParams::AgentConfig for more details.

Parameters:



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
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/stagehand/models/session_execute_params.rb', line 63

class AgentConfig < Stagehand::Internal::Type::BaseModel
  # @!attribute cua
  #   Deprecated. Use mode: 'cua' instead. If both are provided, mode takes
  #   precedence.
  #
  #   @return [Boolean, nil]
  optional :cua, Stagehand::Internal::Type::Boolean

  # @!attribute execution_model
  #   Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
  #   tool execution (observe/act calls within agent tools). If not specified,
  #   inherits from the main model configuration.
  #
  #   @return [Stagehand::Models::ModelConfig, String, nil]
  optional :execution_model,
           union: -> { Stagehand::SessionExecuteParams::AgentConfig::ExecutionModel },
           api_name: :executionModel

  # @!attribute mode
  #   Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
  #
  #   @return [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Mode, nil]
  optional :mode, enum: -> { Stagehand::SessionExecuteParams::AgentConfig::Mode }

  # @!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::SessionExecuteParams::AgentConfig::Model }

  # @!attribute provider
  #   AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)
  #
  #   @return [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Provider, nil]
  optional :provider, enum: -> { Stagehand::SessionExecuteParams::AgentConfig::Provider }

  # @!attribute system_prompt
  #   Custom system prompt for the agent
  #
  #   @return [String, nil]
  optional :system_prompt, String, api_name: :systemPrompt

  # @!method initialize(cua: nil, execution_model: nil, mode: nil, model: nil, provider: nil, system_prompt: nil)
  #   Some parameter documentations has been truncated, see
  #   {Stagehand::Models::SessionExecuteParams::AgentConfig} for more details.
  #
  #   @param cua [Boolean] Deprecated. Use mode: 'cua' instead. If both are provided, mode takes precedence
  #
  #   @param execution_model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
  #
  #   @param mode [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Mode] Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
  #
  #   @param model [Stagehand::Models::ModelConfig, String] Model configuration object or model name string (e.g., 'openai/gpt-5-nano')
  #
  #   @param provider [Symbol, Stagehand::Models::SessionExecuteParams::AgentConfig::Provider] AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)
  #
  #   @param system_prompt [String] Custom system prompt for the agent

  # Model configuration object or model name string (e.g., 'openai/gpt-5-nano') for
  # tool execution (observe/act calls within agent tools). If not specified,
  # inherits from the main model configuration.
  #
  # @see Stagehand::Models::SessionExecuteParams::AgentConfig#execution_model
  module ExecutionModel
    extend Stagehand::Internal::Type::Union

    variant -> { Stagehand::ModelConfig }

    variant String

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

  # Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.
  #
  # @see Stagehand::Models::SessionExecuteParams::AgentConfig#mode
  module Mode
    extend Stagehand::Internal::Type::Enum

    DOM = :dom
    HYBRID = :hybrid
    CUA = :cua

    # @!method self.values
    #   @return [Array<Symbol>]
  end

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

    variant -> { Stagehand::ModelConfig }

    variant String

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

  # AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)
  #
  # @see Stagehand::Models::SessionExecuteParams::AgentConfig#provider
  module Provider
    extend Stagehand::Internal::Type::Enum

    OPENAI = :openai
    ANTHROPIC = :anthropic
    GOOGLE = :google
    MICROSOFT = :microsoft
    BEDROCK = :bedrock

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#cuaBoolean?

Deprecated. Use mode: ‘cua’ instead. If both are provided, mode takes precedence.

Returns:

  • (Boolean, nil)


69
# File 'lib/stagehand/models/session_execute_params.rb', line 69

optional :cua, Stagehand::Internal::Type::Boolean

#execution_modelStagehand::Models::ModelConfig, ...

Model configuration object or model name string (e.g., ‘openai/gpt-5-nano’) for tool execution (observe/act calls within agent tools). If not specified, inherits from the main model configuration.

Returns:



77
78
79
# File 'lib/stagehand/models/session_execute_params.rb', line 77

optional :execution_model,
union: -> { Stagehand::SessionExecuteParams::AgentConfig::ExecutionModel },
api_name: :executionModel

#modeSymbol, ...

Tool mode for the agent (dom, hybrid, cua). If set, overrides cua.



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

optional :mode, enum: -> { Stagehand::SessionExecuteParams::AgentConfig::Mode }

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

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

Returns:



91
# File 'lib/stagehand/models/session_execute_params.rb', line 91

optional :model, union: -> { Stagehand::SessionExecuteParams::AgentConfig::Model }

#providerSymbol, ...

AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)



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

optional :provider, enum: -> { Stagehand::SessionExecuteParams::AgentConfig::Provider }

#system_promptString?

Custom system prompt for the agent

Returns:

  • (String, nil)


103
# File 'lib/stagehand/models/session_execute_params.rb', line 103

optional :system_prompt, String, api_name: :systemPrompt

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/stagehand/models/session_execute_params.rb', line 147

.variantsArray(Stagehand::Models::ModelConfig, String)

Returns:



# File 'lib/stagehand/models/session_execute_params.rb', line 133