Class: Anthropic::Models::Beta::BetaDocumentBlock

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

Returns a new instance of BetaDocumentBlock.

Parameters:



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

Instance Attribute Details

#citations ⇒ Anthropic::Models::Beta::BetaCitationConfig?

Citation configuration for the document

Parameters:

  • value (Anthropic::Beta::BetaCitationConfig, nil)

Returns:



11
# File 'lib/anthropic/models/beta/beta_document_block.rb', line 11

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

#source ⇒ Anthropic::Models::Beta::BetaBase64PDFSource, Anthropic::Models::Beta::BetaPlainTextSource

Parameters:

  • value (Anthropic::Models::Beta::BetaDocumentBlock::source)

Returns:



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

required :source, union: -> { Anthropic::Beta::BetaDocumentBlock::Source }

#title ⇒ String?

The title of the document

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :title, String, nil?: true

#type ⇒ Symbol, :document

Parameters:

  • value (:document)

Returns:

  • (Symbol, :document)


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

required :type, const: :document

Instance Method Details

#to_hash ⇒ { citations: Anthropic::Beta::BetaCitationConfig?, source: Anthropic::Models::Beta::BetaDocumentBlock::source, title: String?, type: :document }

Returns:

  • ({ citations: Anthropic::Beta::BetaCitationConfig?, source: Anthropic::Models::Beta::BetaDocumentBlock::source, title: String?, type: :document })


30
31
32
33
34
35
# File 'sig/anthropic/models/beta/beta_document_block.rbs', line 30

def to_hash: -> {
  citations: Anthropic::Beta::BetaCitationConfig?,
  source: Anthropic::Models::Beta::BetaDocumentBlock::source,
  title: String?,
  type: :document
}