Uploads a file from the local filesystem to an assistant for processing. The assistant will process the file for use in RAG operations.
Value
List with http response, content (file details), and status_code. Content includes: - id: File UUID - name: File name - status: File status ("Processing" initially, then "Available" or "Failed") - size: File size in bytes - metadata: File metadata - created_on: Creation timestamp - updated_on: Last update timestamp - percent_done: Processing progress
Details
Supported file types include: PDF, TXT, MD, JSON, and more.
File processing may take several minutes depending on file size.
Use assistant_describe_file() to check processing status.
Examples
if (FALSE) { # \dontrun{
# Upload a file
assistant_upload_file("my-assistant", "/path/to/document.pdf")
# Upload with metadata
assistant_upload_file(
assistant_name = "my-assistant",
file_path = "/path/to/document.pdf",
metadata = list(company = "acme", document_type = "report")
)
# Upload PDF with multimodal processing (for images in PDF)
assistant_upload_file(
assistant_name = "my-assistant",
file_path = "/path/to/document.pdf",
multimodal = TRUE
)
} # }