-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added Orchestration LLM Config Convenience #152
Conversation
sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
...le-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Show resolved
Hide resolved
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.
Also, I think its a bit weird that we don't use our own, central interface for this. Any reason not to?
# Conflicts: # orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java # sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java # sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
The AiModel interface is only there to cache deployments and Orchestration does not use deployments, so it is unrelated. |
But this is implemented by |
# Conflicts: # orchestration/src/test/java/com/sap/ai/sdk/orchestration/OrchestrationUnitTest.java # sample-code/spring-app/src/main/java/com/sap/ai/sdk/app/controllers/OrchestrationController.java # sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/controllers/OrchestrationTest.java
The cache is the only user of this |
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.
- Removed unavailable models (like embeddings)
- OrchestrationAiModel mow implements AiModel
- Changed withLlmConfig parameter to OrchestrationAiModel
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationAiModel.java
Show resolved
Hide resolved
orchestration/src/main/java/com/sap/ai/sdk/orchestration/OrchestrationModuleConfig.java
Outdated
Show resolved
Hide resolved
…strationModuleConfig.java
@Value | ||
@With | ||
@AllArgsConstructor | ||
public class OrchestrationAiModel { |
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.
👍
OrchestrationAiModel(@Nonnull final String modelName) { | ||
setModelName(modelName); | ||
setModelParams(Map.of()); | ||
this(modelName, Map.of(), "latest"); |
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.
(Question)
Is latest
always supported by orchestration?
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.
from my testing and understanding, yes
OrchestrationAiModel customGPT4O = | ||
OrchestrationAiModel.GPT_4O | ||
.withModelParams( | ||
Map.of( | ||
"max_tokens", 50, | ||
"temperature", 0.1, | ||
"frequency_penalty", 0, | ||
"presence_penalty", 0)); | ||
"presence_penalty", 0)) | ||
.withModelVersion("2024-05-13"); |
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.
(Minor/Question)
Could/should we shorten the method names...?
OrchestrationAiModel.GPT_4O
- .withModelParams(...)
- .withModelVersion("2024-05-13");
+ .withParams(...)
+ .withVersion("2024-05-13");
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.
We can discuss here:
#170
Context
AI/ai-sdk-java-backlog#105.
As an orchestration user, I want to have a convenient way of configuring which LLM to use, and with which hyper parameters.
Feature scope:
OrchestrationAiModel
extendsLLMModuleConfig
Definition of Done
Aligned changes with the JavaScript SDKRelease notes updated