Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Orchestration Prompt #140

Merged
merged 18 commits into from
Nov 8, 2024
Merged

feat: Orchestration Prompt #140

merged 18 commits into from
Nov 8, 2024

Conversation

MatKuhr
Copy link
Member

@MatKuhr MatKuhr commented Nov 5, 2024

Context

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

This PR introduces OrchestrationPrompt to allow for more convenient orchestration usage.

Soft prerequisite: #141

API Improvement

Before:

LLMModuleConfig llmConfig;
ChatMessage userMessage;

var template = TemplatingModuleConfig.create().template(userMessage);
var config = ModuleConfigs.create().llmModuleConfig(llmConfig).templatingModuleConfig(template);

var request =
    CompletionPostRequest.create()
        .orchestrationConfig(OrchestrationConfig.create().moduleConfigurations(config));

new OrchestrationClient().chatCompletion(request);

After:

LLMModuleConfig llmConfig;
ChatMessage userMessage;

var prompt = new OrchestrationPrompt(userMessage);
var config = new OrchestrationModuleConfig().withLlmConfig(llmConfig);

new OrchestrationClient().chatCompletion(prompt, config);

Feature scope:

  • OrchestrationPrompt with convenience overloads for string and varargs
  • Reusable OrchestrationModuleConfig object

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

pom.xml Outdated
@@ -73,7 +73,7 @@
<enforcer.skipBanGeneratedModulesReference>false</enforcer.skipBanGeneratedModulesReference>
<!-- Test coverage -->
<coverage.instruction>74%</coverage.instruction>
<coverage.branch>68%</coverage.branch>
<coverage.branch>60%</coverage.branch>
Copy link
Member Author

Choose a reason for hiding this comment

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

temporary, will be increased again after tests have been refactored in a separate PR

@MatKuhr MatKuhr added the please-review Request to review a pull-request label Nov 5, 2024
@MatKuhr MatKuhr marked this pull request as ready for review November 5, 2024 13:33
Co-authored-by: Charles Dubois <103174266+CharlesDuboisSAP@users.noreply.github.com>
@MatKuhr MatKuhr enabled auto-merge (squash) November 8, 2024 14:16
@MatKuhr MatKuhr merged commit 0c4d933 into main Nov 8, 2024
5 checks passed
@MatKuhr MatKuhr deleted the feat/orchestration-prompt branch November 8, 2024 14:21
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