fix: [PromptRegistry] Export templates as byte[] over File #667
Merged
fix: [PromptRegistry] Export templates as byte[] over File #667
byte[] over File #667Conversation
newtork
reviewed
Nov 25, 2025
| */ | ||
| @Nonnull | ||
| public File exportOrchestrationConfig( | ||
| public byte[] exportOrchestrationConfig( |
Contributor
There was a problem hiding this comment.
(Comment)
After discussion we aligned on byte[] to be used over File.
Because the latter would require life-cycle handling, i.e. deletion after usage.
newtork
reviewed
Nov 25, 2025
| public OrchestrationConfigPostResponse importOrchestrationConfig( | ||
| @Nullable final String aiResourceGroup, @Nullable final File _file) | ||
| @Nullable final String aiResourceGroup, | ||
| @Nullable final org.springframework.core.io.Resource _file) |
Contributor
There was a problem hiding this comment.
(Comment)
Usage of org.springframework.core.io.Resource was a compromise. In the future we may find a way to offer File or byte[] as argument without compilation to fail. Since this is generated code we do not offer hard API contract. The argument type here may be affected by breaking changes in the future - e.g. when migrating away from RestTemplate / Spring classes.
8 tasks
Member
Author
|
Blocked until release of Cloud SDK 5.25.0 |
…yte-array-over-files
6110299 to
9867a40
Compare
Contributor
|
We'll need a release note. |
newtork
approved these changes
Dec 30, 2025
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.
Context
AI/ai-sdk-java-backlog#239.
Alternate:
Fileconverter inresttemplate#660Related:
Prerequisite to merge:
(...Continuing on the problem of
exportPromptTemplate()method calls fail asFiletype is unsupported)We can swap out the
Filewithbyte[]using<typeMappings>feature in (now upcoming) the Cloud SDK v5.25.0But purely using
<typeMappings>will failimportPromptTemplate()as its internal logic cannot handlebyte[]. Therefore, we also enable<useAbstractionForFiles>true</useAbstractionForFIles>, soorg.springframework.core.io.ResourcereplaceFiletypes request.Feature scope:
exportPromptTemplate()returns withbyte[]importPromptTemplate()acceptsorg.springframework.core.io.ResourceDefinition of Done
Error handling created / updated & covered by the tests aboveAligned changes with the JavaScript SDKDocumentation updated