feat: [OpenAI] Tool Choice Convenience#330
Merged
Conversation
b3ead80 to
f33bfad
Compare
24812d8 to
f294360
Compare
…nai-conv-api-toolChoice # Conflicts: # sample-code/spring-app/src/test/java/com/sap/ai/sdk/app/services/OpenAiServiceV2.java
CharlesDuboisSAP
approved these changes
Feb 25, 2025
|
|
||
| /** Option to control which tool is invoked by the model. */ | ||
| @Nullable ChatCompletionToolChoiceOption toolChoice; | ||
| @With(AccessLevel.PRIVATE) |
Contributor
There was a problem hiding this comment.
This is a breaking change, It's fine because we didn't release but be careful with those lombok annotations, they can create too much public API
newtork
reviewed
Feb 26, 2025
| * @return the current OpenAiChatCompletionRequest instance. | ||
| */ | ||
| @Nonnull | ||
| public OpenAiChatCompletionRequest withToolChoiceNone() { |
Contributor
There was a problem hiding this comment.
(Comment)
Not a huge fan of having these duplicate methods signatures, only differing by an apparent argument - that actually is not a real method argument. Apart from the String based variant.
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
AI/ai-sdk-java-backlog#172.
Convenience request class contains fields of generated model types. Ideally, we want to limit scenarios the user would have to deal with generated model classes.
Tool choice convenience is lets the user to set the strategy for tools usage/selection.
Feature scope:
Definition of Done
Aligned changes with the JavaScript SDK