Set default penalty params to null when unspecified #37
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.
The LangChain JS library sets some default values for presence and frequency penalties if we don't set them as part of the OpenAI client. As a result, we end up with a non-required numeric value (0) that we did not intend to put there, which heavily degrades the model responses on tgi containers. These changes override the defaults set by the client so that the values are either the numeric value we set, including 0, otherwise they will be null. I validated that this happens by setting and unsetting the values in the model kwargs of the Chat UI and checked the request data from the network tab of my browser. Now, by default, these values won't be set unless we want them to be.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.