feat: add fileData support to GcsArtifactService#476
Open
serdnam wants to merge 3 commits into
Open
Conversation
`GcsArtifactService` wrote `customMetadata` flat as a sibling of `contentType` in `file.save()`'s options, but the SDK requires custom key-value pairs to be nested under `metadata.metadata`. Custom metadata values were being silently dropped by GCS and never round-tripped. The test mock hid this by using the same wrong shape in both write and read..
Add fileData (URI reference) support to GcsArtifactService and InMemoryArtifactService based on the Python ADK implementation. These artifact services now accept `Part.fileData` as a third content type, storing the provided URI as a zero-byte GCS blob with appropiate metadata, or just the reference held in memory.
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
Some problems with the
GcsArtifactServiceimplementation:Storageinstance it creates is not configurable through the constructor.fileDataPart support.Solution:
The following changes were implemented:
Storageinstance created byGcsArtifactServiceconfigurable though the constructor. (Parity withpython-adk).fileDataparts, referencing the Python ADK implementation using ADK-specific metadata keys.fileDatasupport was also added toInMemoryArtifactService.Testing Plan
I added and ran tests locally and they have passed. I have also tested the changes in a separate project that uses the ADK.
Some unrelated E2E tests are failing because I don't have the proper credentials set up, all other tests pass.
Unit Tests:
Manual End-to-End (E2E) Tests:
Instantiate and use the GcsArtifactService by itself or through runner calls. Validate metadata keys and round-trip behavior.
Checklist
Additional context
The Python ADK has this concept of
artifact://references which seems to be related to the session rewinding feature, that was not implemented here.