Class: Anthropic::Models::Beta::BetaBrowserJavascriptExecToolUseBlock

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb,
sig/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.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 ⇒ BetaBrowserJavascriptExecToolUseBlock

Returns a new instance of BetaBrowserJavascriptExecToolUseBlock.

Parameters:

  • id: (String)
  • input: (Anthropic::Beta::BetaBrowserJavascriptExecInput)
  • caller_: (Anthropic::Models::Beta::beta_tool_use_caller)
  • name: (:javascript_exec)
  • toolset_name: (:browser)
  • type: (:tool_use)


33
34
35
36
37
38
39
40
# File 'sig/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rbs', line 33

def initialize: (
  id: String,
  input: Anthropic::Beta::BetaBrowserJavascriptExecInput,
  ?caller_: Anthropic::Models::Beta::beta_tool_use_caller,
  ?name: :javascript_exec,
  ?toolset_name: :browser,
  ?type: :tool_use
) -> void

Instance Attribute Details

#caller_ ⇒ Anthropic::Models::Beta::BetaDirectCaller, ...

Which party invoked the tool call: the model directly, or a server tool on its behalf.



40
# File 'lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb', line 40

optional :caller_, union: -> { Anthropic::Beta::BetaToolUseCaller }, api_name: :caller

#id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb', line 10

required :id, String

#input ⇒ Anthropic::Models::Beta::BetaBrowserJavascriptExecInput

Execute JavaScript in the page context and return the value of the last expression. The code runs with access to the DOM, window, and page variables. Write the expression you want evaluated — do NOT use return.

Parameters:

  • value (Anthropic::Beta::BetaBrowserJavascriptExecInput)

Returns:



18
# File 'lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb', line 18

required :input, -> { Anthropic::Beta::BetaBrowserJavascriptExecInput }

#name ⇒ Symbol, :javascript_exec

Parameters:

  • value (:javascript_exec)

Returns:

  • (Symbol, :javascript_exec)


23
# File 'lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb', line 23

required :name, const: :javascript_exec

#toolset_name ⇒ Symbol, :browser

Parameters:

  • value (:browser)

Returns:

  • (Symbol, :browser)


28
# File 'lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb', line 28

required :toolset_name, const: :browser

#type ⇒ Symbol, :tool_use

Parameters:

  • value (:tool_use)

Returns:

  • (Symbol, :tool_use)


33
# File 'lib/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rb', line 33

required :type, const: :tool_use

Instance Method Details

#to_hash ⇒ { id: String, input: Anthropic::Beta::BetaBrowserJavascriptExecInput, name: :javascript_exec, toolset_name: :browser, type: :tool_use, caller_: Anthropic::Models::Beta::beta_tool_use_caller }

Returns:

  • ({ id: String, input: Anthropic::Beta::BetaBrowserJavascriptExecInput, name: :javascript_exec, toolset_name: :browser, type: :tool_use, caller_: Anthropic::Models::Beta::beta_tool_use_caller })


42
43
44
45
46
47
48
49
# File 'sig/anthropic/models/beta/beta_browser_javascript_exec_tool_use_block.rbs', line 42

def to_hash: -> {
  id: String,
  input: Anthropic::Beta::BetaBrowserJavascriptExecInput,
  name: :javascript_exec,
  toolset_name: :browser,
  type: :tool_use,
  caller_: Anthropic::Models::Beta::beta_tool_use_caller
}