Skip to content

feat: support partial translation via apply_to array #768

Merged
n-o-u-r-h-a-n merged 46 commits intomainfrom
support-partial-translation
Mar 5, 2026
Merged

feat: support partial translation via apply_to array #768
n-o-u-r-h-a-n merged 46 commits intomainfrom
support-partial-translation

Conversation

@n-o-u-r-h-a-n
Copy link
Contributor

@n-o-u-r-h-a-n n-o-u-r-h-a-n commented Feb 25, 2026

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:

  • TranslationApplyToSelector a new class was created as a convenience builder for SAPDocumentTranslationApplyToSelector.
  • Sample code was updated.
  • Translation test was updated in OrchestrationTest.
    • New tests were added in OrchestrationModuleConfigTest to cover the new class methods.

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

Copy link
Contributor

@CharlesDuboisSAP CharlesDuboisSAP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

n-o-u-r-h-a-n and others added 26 commits February 25, 2026 11:58
…es/OrchestrationService.java

Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>
…o support-partial-translation

# Conflicts:
#	orchestration/src/main/java/com/sap/ai/sdk/orchestration/TranslationConfig.java
#	orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfigTest.java
Copy link
Member

@Jonas-Isr Jonas-Isr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good overall. Mostly smaller stuff I noticed 🙂

Copy link
Member

@Jonas-Isr Jonas-Isr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good :)

@n-o-u-r-h-a-n n-o-u-r-h-a-n requested a review from Jonas-Isr March 5, 2026 09:29
Copy link
Member

@Jonas-Isr Jonas-Isr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@n-o-u-r-h-a-n n-o-u-r-h-a-n merged commit 34ce6ac into main Mar 5, 2026
6 checks passed
@n-o-u-r-h-a-n n-o-u-r-h-a-n deleted the support-partial-translation branch March 5, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants