Class: Anthropic::Models::BrowserJavascriptExecToolUseBlock

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/browser_javascript_exec_tool_use_block.rb,
sig/anthropic/models/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(id:, caller_:, input:, name: :javascript_exec, toolset_name: :browser, type: :tool_use) ⇒ BrowserJavascriptExecToolUseBlock

Some parameter documentations has been truncated, see Anthropic::Models::BrowserJavascriptExecToolUseBlock for more details.

Parameters:



# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 41

Instance Attribute Details

#caller_ ⇒ Anthropic::Models::DirectCaller, ...

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



16
# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 16

required :caller_, union: -> { Anthropic::ToolUseCaller }, api_name: :caller

#id ⇒ String

Parameters:

  • value (String)

Returns:

  • (String)


9
# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 9

required :id, String

#input ⇒ Anthropic::Models::BrowserJavascriptExecInput

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.



24
# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 24

required :input, -> { Anthropic::BrowserJavascriptExecInput }

#name ⇒ Symbol, :javascript_exec

Parameters:

  • value (:javascript_exec)

Returns:

  • (Symbol, :javascript_exec)


29
# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 29

required :name, const: :javascript_exec

#toolset_name ⇒ Symbol, :browser

Parameters:

  • value (:browser)

Returns:

  • (Symbol, :browser)


34
# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 34

required :toolset_name, const: :browser

#type ⇒ Symbol, :tool_use

Parameters:

  • value (:tool_use)

Returns:

  • (Symbol, :tool_use)


39
# File 'lib/anthropic/models/browser_javascript_exec_tool_use_block.rb', line 39

required :type, const: :tool_use

Instance Method Details

#to_hash ⇒ { id: String, caller_: Anthropic::Models::tool_use_caller, input: Anthropic::BrowserJavascriptExecInput, name: :javascript_exec, toolset_name: :browser, type: :tool_use }

Returns:



35
36
37
38
39
40
41
42
# File 'sig/anthropic/models/browser_javascript_exec_tool_use_block.rbs', line 35

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