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

@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
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 😎

# Conflicts:
#	docs/release_notes.md
#	sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/PromptRegistryController.java
#	sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/PromptRegistryTest.java
* parameters.
*/
@Nonnull
OrchestrationPrompt templateParameters(@Nonnull final Map<String, String> templateParameters) {
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 need this to be able to set the template parameters in OrchestrationConfigReference.templateParameters()

@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Getter(AccessLevel.PACKAGE)
@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 put the prompt needed to call a config by reference into this class now to make it more convenient for the user.

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.

LGTM

@Beta
@Nonnull
public OrchestrationChatResponse chatCompletionUsingReference(
@Nonnull final OrchestrationConfigReference reference) {
Copy link
Contributor

Choose a reason for hiding this comment

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

(Question/Major)

I'm confused. Wouldn't we want (optional) prompt arguments?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we expect the usage via prompt-parameters

Copy link
Member Author

Choose a reason for hiding this comment

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

All the necessary (and possible) options are now stored in the OrchestrationConfigReference object.

public OrchestrationConfigReference templateParameters(
@Nonnull final Map<String, String> templateParameters) {
prompt.templateParameters(templateParameters);
return this;
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 are using shallow-immutability then? Can be acceptable, just a little surprising to me.

.templateParameters(params);
final var response = client.chatCompletionUsingReference(reference);

final String expectedRequest = fileLoaderStr.apply("orchConfigByRequestHistoryParams.json");
Copy link
Contributor

Choose a reason for hiding this comment

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

(Comment)

Looks good!

.addMixIn(OutputFilterConfig.class, JacksonMixin.OutputFilter.class)
.addMixIn(InputFilterConfig.class, JacksonMixin.InputFilter.class);
Iterables.filter(rt.getMessageConverters(), MappingJackson2YamlHttpMessageConverter.class)
.forEach(converter -> converter.setObjectMapper(yamlMapper));
Copy link
Contributor

Choose a reason for hiding this comment

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

(Question)

Why do we need a MappingJackson2YamlHttpMessageConverter?

.template(
UserChatMessage.create()
.content(
new UserChatMessageContent.InnerString("message"))
Copy link
Contributor

Choose a reason for hiding this comment

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

(Minor)

Please fix format.

Can we avoid this helper method? We should not attempt hiding complexity in our demo app.

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