Class: Anthropic::Helpers::InputSchema::ArrayOf
- Inherits:
-
Internal::Type::ArrayOf
- Object
- Internal::Type::ArrayOf
- Anthropic::Helpers::InputSchema::ArrayOf
- Includes:
- JsonSchemaConverter
- Defined in:
- lib/anthropic/helpers/input_schema/array_of.rb
Overview
Constant Summary
Constants included from JsonSchemaConverter
JsonSchemaConverter::NO_REF, JsonSchemaConverter::POINTERS
Instance Method Summary collapse
Methods included from JsonSchemaConverter
assoc_meta!, cache_def!, to_json_schema, to_json_schema_inner, to_nilable
Methods inherited from Internal::Type::ArrayOf
#==, #===, [], #coerce, #dump, #hash, #initialize, #inspect, #to_sorbet_type
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info
Constructor Details
This class inherits a constructor from Anthropic::Internal::Type::ArrayOf
Instance Method Details
#to_json_schema_inner(state:) ⇒ Hash{Symbol=>Object}
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/anthropic/helpers/input_schema/array_of.rb', line 25 def to_json_schema_inner(state:) Anthropic::Helpers::InputSchema::JsonSchemaConverter.cache_def!(state, type: self) do state.fetch(:path) << "[]" items = Anthropic::Helpers::InputSchema::JsonSchemaConverter.to_json_schema_inner( item_type, state: state ) items = Anthropic::Helpers::InputSchema::JsonSchemaConverter.to_nilable(items) if nilable? Anthropic::Helpers::InputSchema::JsonSchemaConverter.(items, meta: @meta) {type: "array", items: items} end end |