Skip to content

Conversation

@Jonas-Isr
Copy link
Member

@Jonas-Isr Jonas-Isr commented Dec 23, 2025

Context

The PR enables the management of Orchestration Configs in prompt registry (create, delete, list via generated code and new client) as well as convenience to use these Orchestration Configs in the OrchestrationClient.

Sample of new convenience:

// create OrchestrationPrompt (for placeholder values and history) with already existing convenience
List<Message> history = List.of(new SystemMessage("System Message"));
OrchestrationPrompt prompt = new OrchestrationPrompt(Map.of("placeholder", "value")).messageHistory(history);

// create (newly added) OrchestrationConfigReference to refer to saved Orchestration config
OrchestrationConfigReference reference =
    OrchestrationConfigReference.fromScenario("scenario").name("name").version("0.0.1");

// use OrchestrationClient todo chat completion with the referenced config
OrchestrationChatResponse response = client.executeRequestFromReference(prompt, reference);

Feature scope:

  • add new OchestrationConfigClient in prompt registry
    • unit and e2e tests for generated code and new client in prompt registry
  • convenience for use with OrchestrationClient
    • unit and e2e tests for new convenience

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

@Jonas-Isr Jonas-Isr self-assigned this Dec 23, 2025
@Jonas-Isr Jonas-Isr added the please-review Request to review a pull-request label Dec 23, 2025
Comment on lines +134 to +137
if (!prompt.getMessages().isEmpty()) {
log.debug(
"Messages in prompts are ignored when using Orchestration configs via reference. Change the Orchestration config instead.");
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This could also throw instead of just logging. Was not sure which is better.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give a code sample that triggers this warning?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will be triggered e.g. by

var reference = OrchestrationConfigReference.fromId("test-id");
var prompt = new OrchestrationPrompt("Your message here.");
var response = client.executeRequestFromReference(prompt, reference);

Copy link
Contributor

Choose a reason for hiding this comment

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

warn would be better, debug is disabled most of the time.
Example: we use <root level="INFO"/> for our dependencies.

Comment on lines +180 to +182
public OrchestrationChatResponse executeRequestFromReference(
@Nullable final OrchestrationPrompt prompt,
@Nonnull final OrchestrationConfigReference reference) {
Copy link
Member Author

@Jonas-Isr Jonas-Isr Dec 23, 2025

Choose a reason for hiding this comment

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

We could add

public OrchestrationChatResponse executeRequestFromReference(
      @Nonnull final OrchestrationConfigReference reference) {...}

as well for even more convenience? (The prompt is used to forward placeholder values and the message history, so it is not always needed but probably in most actual use cases).

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not a fan of either method option. Also not liking existing executeRequest siblings.

To me this method looks similar to "normal" use-case

public OrchestrationChatResponse chatCompletion(
@Nonnull final OrchestrationPrompt prompt, @Nonnull final OrchestrationModuleConfig config)

As a user i would assume methods have similar signature whether they use an explicit orchestration config, or an implicit config.

Or is the semantic usage different (enough) to justify a different name schema?

Comment on lines +15 to +18
@Value
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Beta
public class OrchestrationConfigReference {
Copy link
Member Author

Choose a reason for hiding this comment

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

I decided against making this a sealed interface plus two permitted classes because I felt that would be a bit of an overkill for such little logic. Would be interested in your thoughts about that.

*
* @since 1.14.0
*/
public class OrchestrationConfigClient extends OrchestrationConfigsApi {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Major/Discussion)

I don't think we want to extend a custom class from generated code. Did we do that before? Is there no other way to apply mixins? Otherwise this has a code smell; we're introducing hand-written public API code for the sake of a workaround.

Copy link
Contributor

Choose a reason for hiding this comment

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

We did that in PromptClient and GroundingClient. It's only to add mix-ins.

*/
@Nonnull
public static Builder fromScenario(@Nonnull final String scenario) {
return new Builder(scenario);
Copy link
Contributor

Choose a reason for hiding this comment

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

(Minor)

You could've turned this into a currying builder, when the classes were interfaces.

return (name) -> (version) -> new OrchestrationConfigReference(null, scenario, name, version);

@Value
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Beta
public class OrchestrationConfigReference {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Minor)

We could reduce future maintenance if the getters were package scoped(?)

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.

Looking good 😎

Comment on lines +679 to +686
private void ensureOrchestrationConfigExists() {
final OrchestrationConfigClient orchConfigClient = new OrchestrationConfigClient();
if (!orchConfigExists("test-config-for-OrchestrationTest", orchConfigClient)) {
final OrchestrationConfigPostRequest postRequest =
OrchestrationConfigPostRequest.create()
.name("test-config-for-OrchestrationTest")
.version("0.0.1")
.scenario("sdk-test-scenario")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private void ensureOrchestrationConfigExists() {
final OrchestrationConfigClient orchConfigClient = new OrchestrationConfigClient();
if (!orchConfigExists("test-config-for-OrchestrationTest", orchConfigClient)) {
final OrchestrationConfigPostRequest postRequest =
OrchestrationConfigPostRequest.create()
.name("test-config-for-OrchestrationTest")
.version("0.0.1")
.scenario("sdk-test-scenario")
private void ensureOrchestrationConfigExists(final String scenario, final String name) {
final OrchestrationConfigClient orchConfigClient = new OrchestrationConfigClient();
if (!orchConfigExists("test-config-for-OrchestrationTest", orchConfigClient)) {
final OrchestrationConfigPostRequest postRequest =
OrchestrationConfigPostRequest.create()
.name(name)
.version("0.0.1")
.scenario(scenario)

Comment on lines +668 to +676
ensureOrchestrationConfigExists();
final var testReference =
OrchestrationConfigReference.fromScenario("sdk-test-scenario")
.name("test-config-for-OrchestrationTest")
.version("0.0.1");
final List<Message> history = List.of(new SystemMessage("Start every sentence with an emoji."));
final OrchestrationPrompt testPrompt =
new OrchestrationPrompt(Map.of("phrase", "Hello World")).messageHistory(history);
return client.executeRequestFromReference(testPrompt, testReference);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ensureOrchestrationConfigExists();
final var testReference =
OrchestrationConfigReference.fromScenario("sdk-test-scenario")
.name("test-config-for-OrchestrationTest")
.version("0.0.1");
final List<Message> history = List.of(new SystemMessage("Start every sentence with an emoji."));
final OrchestrationPrompt testPrompt =
new OrchestrationPrompt(Map.of("phrase", "Hello World")).messageHistory(history);
return client.executeRequestFromReference(testPrompt, testReference);
// Could also be enums that are reused in PromptRegistryController
val scenario = "sdk-test-paraphrase";
val name = "create-3-paraphrases-of-sentence";
ensureOrchestrationConfigExists(scenario, name);
final var configReference =
OrchestrationConfigReference.fromScenario(scenario)
.name(name)
.version("0.0.1");
final List<Message> history = List.of(new SystemMessage("Start every sentence with an emoji."));
final OrchestrationPrompt prompt =
new OrchestrationPrompt(Map.of("phrase", "Hello World")).messageHistory(history);
return client.executeRequestFromReference(prompt, configReference);

The current names make it hard to understand what is happening.


- [Orchestration] Added new models for `OrchestrationAiModel`: `SAP_ABAP_1`, `SONAR`,`SONAR_PRO`, `GEMINI_2_5_FLASH_LITE`, `CLAUDE_4_5_HAIKU`, `GPT_REALTIME`.
- [Orchestration] Added new models for `OrchestrationAiModel`: `SAP_ABAP_1`, `SONAR`,`SONAR_PRO`, `GEMINI_2_5_FLASH_LITE`, `CLAUDE_4_5_HAIKU`, `GPT_REALTIME`, `COHERE_COMMAND_A_REASONING`, `NOVA_PREMIER`, `COHERE_RERANKER`.
- [Orchestration] Configs stored in prompt registry can now be used for Orchestration calls via reference.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [Orchestration] Configs stored in prompt registry can now be used for Orchestration calls via reference.
- [Orchestration] Configs stored in prompt registry can now be used for Orchestration calls via reference `OrchestrationClient.executeRequestFromReference()`.

Either the added function or a link to the docs would be nice.

- [Orchestration] Convenience for adding the `metadata_params` option to grounding calls.
- [Orchestration] Added new models for `OrchestrationAiModel`: `COHERE_COMMAND_A_REASONING`, `NOVA_PREMIER`, `COHERE_RERANKER`.
- [Orchestration] Deprecated `DEEPSEEK_R1` model from `OrchestrationAiModel` with no replacement.
- [Prompt Registry] Added support to manage Orchestration configs stored in Prompt Registry.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [Prompt Registry] Added support to manage Orchestration configs stored in Prompt Registry.
- [Prompt Registry] Added support to manage Orchestration configs stored in Prompt Registry `OrchestrationConfigClient`.

Either the added class or a link to the docs would be nice.

Comment on lines +134 to +137
if (!prompt.getMessages().isEmpty()) {
log.debug(
"Messages in prompts are ignored when using Orchestration configs via reference. Change the Orchestration config instead.");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give a code sample that triggers this warning?

"Create {{?number}} paraphrases of {{?phrase}}"))
.role(UserChatMessage.RoleEnum.USER))
.defaults(Map.of("number", "3")))
.model(LLMModelDetails.create().name("gpt-4.1-nano")))));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.model(LLMModelDetails.create().name("gpt-4.1-nano")))));
.model(LLMModelDetails.create().name(GPT_41_NANO.getName())))));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please-review Request to review a pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants