-
Notifications
You must be signed in to change notification settings - Fork 16
feat: [Orchestration] Support Fallback Modules #743
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
base: main
Are you sure you want to change the base?
Conversation
| val requestConfig = | ||
| OrchestrationConfig.create().modules(moduleConfigs).stream( | ||
| configs[0].getGlobalStreamOptions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stream options are taken from the first config only. (I don't think there is a way to change this.)
| public OrchestrationChatResponse chatCompletion( | ||
| @Nonnull final OrchestrationPrompt prompt, @Nonnull final OrchestrationModuleConfig config) | ||
| @Nonnull final OrchestrationPrompt prompt, | ||
| @Nonnull final OrchestrationModuleConfig... configs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Major)
I think we can't allow for empty array chatCompletion(prompt) right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eieiei, you are right! I fixed it :)
Context
AI/ai-sdk-java-backlog#342
This PR introduces support for using fallback modules when using orchestration chat completion. Instead of a single
OrchestrationModuleConfigobject, users can now add multiple of these module configs to a chat completion call (streaming or non-streaming). The configs are tried in the order they are given and if a call with a config failed, the next in line is used as fallback.This PR also introduces a convenience layer to do this:
In the above example, the call with
brokenConfigwill return an error so another call withworkingConfigis performed and the (positive) result of this call is returned.Feature scope:
Definition of Done
Aligned changes with the JavaScript SDK