Class: Anthropic::Models::DocumentBlock

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

Defined Under Namespace

Modules: Source

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(citations:, source:, title:, type: :document) ⇒ DocumentBlock

Returns a new instance of DocumentBlock.

Parameters:



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

Instance Attribute Details

#citations ⇒ Anthropic::Models::CitationsConfig?

Citation configuration for the document

Parameters:

Returns:



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

required :citations, -> { Anthropic::CitationsConfig }, nil?: true

#source ⇒ Anthropic::Models::Base64PDFSource, Anthropic::Models::PlainTextSource

Parameters:

  • value (Anthropic::Models::DocumentBlock::source)

Returns:



15
# File 'lib/anthropic/models/document_block.rb', line 15

required :source, union: -> { Anthropic::DocumentBlock::Source }

#title ⇒ String?

The title of the document

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


21
# File 'lib/anthropic/models/document_block.rb', line 21

required :title, String, nil?: true

#type ⇒ Symbol, :document

Parameters:

  • value (:document)

Returns:

  • (Symbol, :document)


26
# File 'lib/anthropic/models/document_block.rb', line 26

required :type, const: :document

Instance Method Details

#to_hash ⇒ { citations: Anthropic::CitationsConfig?, source: Anthropic::Models::DocumentBlock::source, title: String?, type: :document }

Returns:



27
28
29
30
31
32
# File 'sig/anthropic/models/document_block.rbs', line 27

def to_hash: -> {
  citations: Anthropic::CitationsConfig?,
  source: Anthropic::Models::DocumentBlock::source,
  title: String?,
  type: :document
}