Anthropic::DocumentContent
Inherits JSON::Serializable < Struct < Value < Object
Document content block
Constructors
file(file_id : String, title : String | Nil = nil, context : String | Nil = nil, citations : Bool = false, cache_control : CacheControl | Nil = nil) : self
Create a document from an uploaded file ID with optional citations
# Upload a file first
file = client.beta.files.upload(Path["document.pdf"])
# Reference it in a message
doc = Anthropic::DocumentContent.file(file.id, title: "My Document", citations: true)
new(pull : JSON::PullParser)
Sourcenew(source : DocumentSource, title : String | Nil = nil, context : String | Nil = nil, citations : CitationConfig | Nil = nil, cache_control : CacheControl | Nil = nil)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
Sourcepdf(data : String, title : String | Nil = nil, context : String | Nil = nil, citations : Bool = false, cache_control : CacheControl | Nil = nil) : self
Create a document from base64-encoded PDF with optional citations
Instance methods
cache_control
Sourcecitations
Sourcecontext
Sourcesource
Sourcetitle
Sourcetype
Source