files
Classes
FileMeta
Bases: BaseModel
Metadata information for a file.
This model is flexible and allows extra fields, but defines common metadata fields used by the system.
- Code Reference models files Classes FileModelResponse Attributes meta
FileModelResponse
Bases: BaseModel
Response model for file operations, containing file details and metadata.
- Code Reference routers files Classes FilesClient Functions
Attributes
data
Additional data associated with the file, such as processing status or extracted content.
Dict Fields
status(str, optional): Processing status of the file - 'pending', 'completed', or 'failed'error(str, optional): Error message if file processing failedcontent(str, optional): Extracted text content from the file
The data dictionary stores file processing metadata and content. During file upload, the status starts as 'pending', changes to 'completed' when processing succeeds, or 'failed' with an error message when processing fails. The content field contains the extracted text from the file after successful processing.
FileMetadataResponse
Bases: BaseModel
Simplified response model focusing on file metadata.
Attributes
meta
File metadata dictionary.
Dict Fields
name(str, optional): Original name of the filecontent_type(str, optional): MIME type of the file (e.g., 'application/pdf', 'image/png')size(int, optional): Size of the file in bytesdata(dict, optional): Additional metadata associated with the file
FileModel
Bases: BaseModel
Complete internal representation of a file in the system.
- Code Reference
Attributes
data
Additional data associated with the file, including processing status and extracted content.
Dict Fields
status(str, optional): Processing status of the file - 'pending', 'completed', or 'failed'error(str, optional): Error message if file processing failedcontent(str, optional): Extracted text content from the file
meta
File metadata containing information about the file.
Dict Fields
name(str, optional): Original name of the file as uploadedcontent_type(str, optional): MIME type of the file (e.g., 'application/pdf', 'image/png', 'text/plain')size(int, optional): Size of the file in bytesdata(dict, optional): Additional metadata associated with the file, can contain custom key-value pairscollection_name(str, optional): Knowledge base collection name this file belongs to, used for access control
The meta dictionary stores core file attributes and can be extended with additional custom metadata. Common usage includes file identification, content type handling, and knowledge base association.
access_control
Access control rules for the file.
Dict Fields
read(dict, optional): Read access permissionsgroup_ids(list[str], optional): List of group IDs that have read accessuser_ids(list[str], optional): List of user IDs that have read access
write(dict, optional): Write access permissionsgroup_ids(list[str], optional): List of group IDs that have write accessuser_ids(list[str], optional): List of user IDs that have write access
Controls which users and groups can read or write to the file. If None, access follows default system permissions.