struct

Anthropic::FileListResponse

Inherits JSON::Serializable < Struct < Value < Object

Response from listing files

Constructors

new(data : Array(FileMetadata), next_page : String | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

auto_paging_all(client : Client, beta : Bool = true, ids : Array(String) | Nil = nil, limit : Int32 = 20, scope_id : String | Nil = nil, betas : Array(String) = [] of String, workspace_id : String | Nil = nil) : Array(FileMetadata)

Fetch all files across all pages

Pass the same filters the first page was listed with so follow-up pages stay in scope; beta selects which resource paginates.

all_files = client.beta.files.list.auto_paging_all(client)
all_files = client.files.list(limit: 50).auto_paging_all(client, beta: false, limit: 50)
Source
data

Array of file metadata objects

Source
next_page

Opaque cursor for the next page, if any

Source