Class: Anthropic::Models::Beta::BetaResponseTool

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/beta_response_tool.rb,
sig/anthropic/models/beta/beta_response_tool.rbs

Defined Under Namespace

Modules: AllowedCaller, Type

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(input_schema:, name:, allowed_callers: nil, defer_loading: nil, description: nil, eager_input_streaming: nil, input_examples: nil, strict: nil, type: nil) ⇒ void

A custom tool definition, as sent.

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

Parameters:



# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 75

Instance Attribute Details

#allowed_callersArray<Symbol, Anthropic::Models::Beta::BetaResponseTool::AllowedCaller>?



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

optional :allowed_callers,
-> { Anthropic::Internal::Type::ArrayOf[enum: Anthropic::Beta::BetaResponseTool::AllowedCaller] }

#defer_loadingBoolean?

If true, tool will not be included in initial system prompt. Only loaded when returned via tool_reference from tool search.

Parameters:

Returns:



35
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 35

optional :defer_loading, Anthropic::Internal::Type::Boolean

#descriptionString?

Description of what this tool does.

Tool descriptions should be as detailed as possible. The more information that the model has about what the tool is and how to use it, the better it will perform. You can use natural language descriptions to reinforce important aspects of the tool input JSON schema.

Parameters:

  • (String)

Returns:

  • (String, nil)


46
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 46

optional :description, String

#eager_input_streamingBoolean?

Enable eager input streaming for this tool. When true, tool input parameters will be streamed incrementally as they are generated, and types will be inferred on-the-fly rather than buffering the full JSON output. When false, streaming is disabled for this tool even if the fine-grained-tool-streaming beta is active. When null (default), uses the default behavior based on beta headers.

Parameters:

Returns:



56
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 56

optional :eager_input_streaming, Anthropic::Internal::Type::Boolean, nil?: true

#input_examplesArray<Hash{Symbol=>Object}>?

Returns:

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


61
62
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 61

optional :input_examples,
Anthropic::Internal::Type::ArrayOf[Anthropic::Internal::Type::HashOf[Anthropic::Internal::Type::Unknown]]

#input_schemaAnthropic::Models::Beta::BetaResponseToolInputSchema

JSON schema for this tool's input.

This defines the shape of the input that your tool accepts and that the model will produce.

Parameters:

  • value (Anthropic::Beta::BetaResponseToolInputSchema)

Returns:



14
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 14

required :input_schema, -> { Anthropic::Beta::BetaResponseToolInputSchema }

#nameString

Name of the tool.

This is how the tool will be called by the model and in tool_use blocks.

Parameters:

  • value (String)

Returns:

  • (String)


22
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 22

required :name, String

#strictBoolean?

When true, guarantees schema validation on tool names and inputs

Parameters:

Returns:



68
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 68

optional :strict, Anthropic::Internal::Type::Boolean

#typeSymbol, ...

Parameters:

  • value (Anthropic::Models::Beta::BetaResponseTool::type_, nil)

Returns:



73
# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 73

optional :type, enum: -> { Anthropic::Beta::BetaResponseTool::Type }, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/anthropic/models/beta/beta_response_tool.rb', line 114

Instance Method Details

#to_hash{

Returns:

  • ({)


64
# File 'sig/anthropic/models/beta/beta_response_tool.rbs', line 64

def to_hash: -> {