Conversation
Adds a new query endpoint to retrieve the file creation timestamp in nanoseconds and its age in seconds.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new endpoint get_creation_timestamp_ns to retrieve file creation timestamps and age information for files in the canister. The implementation provides both timestamp in nanoseconds and age in seconds for existing files.
- Adds new API endpoint
get_creation_timestamp_nsfor querying file creation timestamps - Updates error handling to use consistent error response format across file operations
- Refactors helper function location from utils to files module for better organization
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/llama_cpp.did |
Adds new API types and service definition for timestamp functionality |
src/files.h |
Declares new endpoint function and moves helper function from utils |
src/files.cpp |
Implements timestamp retrieval logic and updates error handling |
test/test_files.py |
Adds comprehensive test coverage for the new endpoint |
src/utils.h |
Removes helper function declaration (moved to files.h) |
src/utils.cpp |
Removes helper function implementation (moved to files.cpp) |
src/db_chats.cpp |
Adds include for files.h |
native/test_files.cpp |
Updates expected response format for existing test |
README.md |
Updates documentation with new endpoint usage examples |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Endpoint to get file creation timestamp & age of a file (or directory) in the canister