mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[GH-ISSUE #18283] feat: Add hash field to FileMetadataResponse model #57217
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Stoyan-Zlatev on GitHub (Oct 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/18283
Check Existing Issues
Problem Description
Request to Extend
/api/v1/knowledge/{id}Response to Include File HashesHi Team,
I’d like to request an enhancement to the
/api/v1/knowledge/{id}endpoint. Currently, when retrieving knowledge records, the endpoint returns file metadata without the hash value, whereas the/api/v1/files/{id}endpoint includes the file hash.Background
I am developing custom logic for file synchronization. Rather than deleting and reuploading files, my approach involves comparing hash values to efficiently sync files and directories. This method is significantly faster and more efficient.
Proposed Change
Current Behavior:
/api/v1/knowledge/{id}returns a list of files without the associated hash value./api/v1/files/{id}returns the hash value for the file.Requested Update:
/api/v1/knowledge/{id}by including the hash value for each file listed.FileMetadataResponsemodel so that when the/api/v1/knowledge/{id}endpoint is used, the returned file metadata includes the hash.Benefits
Efficiency:
By comparing file hashes, we can synchronize changes without re-uploading entire files, saving time and bandwidth.
Consistency:
Aligns the
/api/v1/knowledge/{id}and/api/v1/files/{id}endpoints, ensuring a uniform data structure for file metadata.Enhanced Functionality:
Enables more robust file synchronization logic across our system.
I believe this adjustment will greatly improve our file syncing mechanism and overall API efficiency. Please let me know if you need additional details or have any questions regarding this proposal.

Desired Solution you'd like
Add new field
hashto FileMetadataResponse model and the relevant methodsAlternatives Considered
No response
Additional Context
No response