Skip to content

fix: [Orchestration] prompts with template references - #1035

Open
n-o-u-r-h-a-n wants to merge 4 commits into
mainfrom
fix-prompt-template-reference
Open

n-o-u-r-h-a-n wants to merge 4 commits into
mainfrom
fix-prompt-template-reference

Conversation

@n-o-u-r-h-a-n

@n-o-u-r-h-a-n n-o-u-r-h-a-n commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Context

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

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

var prompt = new OrchestrationPrompt("Foo bar");

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

In this case, the prompt message Foo bar is simply ignored without warning or error.

The above code should throw an exception due to improper use.

Feature scope:

  • bug fixed and test created

Definition of Done

  • Functionality scope stated & covered
  • Tests cover the scope above
  • Relevant E2E tests are green (at least locally)
  • Error handling created / updated & covered by the tests above
  • Aligned changes with the JavaScript SDK
  • Documentation updated
  • Release notes updated

@n-o-u-r-h-a-n

Copy link
Copy Markdown
Contributor Author

The backlog item included //TODO: extend this ticket to also cover orchestration config ref

However, after investigation there is no a current bug in orchestration config reference as prompt is embedded in the reference and there exists no public API to inject a user message into the prompt.

@CharlesDuboisSAP CharlesDuboisSAP left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We would prefer to have the v2 API restrict inputing a prompt with a prompt reference rather than throwing.

@n-o-u-r-h-a-n

Copy link
Copy Markdown
Contributor Author

We would prefer to have the v2 API restrict inputing a prompt with a prompt reference rather than throwing.

Here is the new PR which introduces the new v2 api.

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.

3 participants