Create a content block referencing an uploaded file for use in messages.
Details
Creates a document content block that references a previously uploaded file.
Pass this to chat$chat() to include the document in your conversation.
When citations = TRUE, Claude's response will include citation blocks
referencing specific passages.
API Reference: https://platform.claude.com/docs/en/build-with-claude/files
Examples
if (FALSE) { # \dontrun{
# Upload and reference file
file <- claude_file_upload("report.pdf")
chat <- claude_new()
chat$chat(
claude_file_content(file$id, title = "Q4 Report"),
"What are the key findings?"
)
# With citations enabled
chat$chat(
claude_file_content(file$id, citations = TRUE),
"Cite specific sections about revenue growth"
)
} # }
