feat: support partial translation via apply_to array #768
Open
n-o-u-r-h-a-n wants to merge 21 commits intomainfrom
Open
feat: support partial translation via apply_to array #768n-o-u-r-h-a-n wants to merge 21 commits intomainfrom
n-o-u-r-h-a-n wants to merge 21 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Make sure the API that you write is fluent.
Not readable doesn't flow:
.withApplyTo(
List.of(
TranslationApplyToSelector.placeholders(List.of("exam_type", "topic")),
TranslationApplyToSelector.templateRoles(TemplateRole.ASSISTANT)))Readable and flows:
.applyToPlaceholders("exam_type", "topic")
.applyToTemplateRoles(TemplateRole.ASSISTANT)
orchestration/src/main/java/com/sap/ai/sdk/orchestration/TranslationApplyToSelector.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ApplyTo.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ApplyTo.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/ApplyTo.java
Outdated
Show resolved
Hide resolved
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java
Show resolved
Hide resolved
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java
Outdated
Show resolved
Hide resolved
sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/services/OrchestrationService.java
Outdated
Show resolved
Hide resolved
| @@ -29,13 +31,21 @@ class Input implements TranslationConfig { | |||
|
|
|||
| @With String sourceLanguage; | |||
Contributor
There was a problem hiding this comment.
Mistake from your old PR:
sourceLanguage isn't being used and applied.
You should fix it and improve the unit test to make sure it is being used and applied.
Contributor
Author
There was a problem hiding this comment.
It's used in OrchestrationService class and all other test classes.What do you mean exactly?
sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
Outdated
Show resolved
Hide resolved
sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
Outdated
Show resolved
Hide resolved
…es/OrchestrationService.java Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>
…o support-partial-translation
…o support-partial-translation
…o support-partial-translation
…o support-partial-translation
…o support-partial-translation
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#341.
Apply_to array is now supported instead of being set to null to support partial translation of the user's prompt.
Feature scope:
Definition of Done
Aligned changes with the JavaScript SDK