feat(artifacts): add LocalFileArtifactService for local file system storage #2408
+908
−6
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.
This adds a new LocalFileArtifactService implementation that stores artifacts
on the local file system instead of cloud storage or memory, providing developers
with a local persistence option for development, testing, and deployment scenarios.
Key features:
Changes:
Testing Plan
Unit Tests
All unit tests pass with comprehensive coverage:
Standalone Tests (24 tests):
Integration Tests (24 additional tests):
Test Results:
Note: The 1 warning is a pre-existing Pydantic warning unrelated to this change.
Code Quality:
Manual E2E Testing
The LocalFileArtifactService can be manually tested by:
Basic Usage:
Directory Structure Verification:
After saving artifacts, verify correct file system layout:
./test_artifacts/{app}/{user}/{session}/{filename}/{version}
./test_artifacts/{app}/{user}/user/{filename}/{version}
{path}.metadata.json
alongside each artifactIntegration Testing:
Can be used as drop-in replacement for other artifact services in any
existing ADK application or workflow.
This implementation maintains full API compatibility with existing artifact
services while providing local file system persistence capabilities.