Skip to content

Conversation

@Jonas-Isr
Copy link
Member

@Jonas-Isr Jonas-Isr commented Mar 3, 2025

Context

AI/ai-sdk-java-backlog#184.

This PR enables users to consume pre-made prompt templates from the prompt registry of AI Core. Users can either reference a template via id, or via scenario, name, and version.

There is already a convenience layer to reference templates from #341 :

var template = TemplateConfig.reference().byId("21cb1358-0bf1-4f43-870b-00f14d0f9f16");
var configWithTemplate = config.withTemplateConfig(template);

var inputParams = Map.of("language", "Italian", "input", "cloud ERP systems");
var prompt = new OrchestrationPrompt(inputParams);

var result = client.chatCompletion(prompt, configWithTemplate);

Or, using scenario, name, and version to reference a template:

var template = TemplateConfig.reference().byScenario("test").name("test").version("0.0.1");

Feature scope:

  • Enable consumption of prompt templates
  • Add documentation (also for using convenience layer)

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 Mar 3, 2025
@Jonas-Isr Jonas-Isr added the please-review Request to review a pull-request label Mar 3, 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.

LGTM

@Jonas-Isr Jonas-Isr merged commit 8fefe94 into main Mar 4, 2025
6 checks passed
@Jonas-Isr Jonas-Isr deleted the orch-with-templates-from-registry branch March 4, 2025 09:14
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.

3 participants