fix(input): handle correctly case where we pass by string list as inputs#5521
Merged
Conversation
✅ Deploy Preview for localai ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
7dd4be3 to
c2e8bba
Compare
1 task
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.
Description
This pull request refactors type handling and improves type safety in the
mergeOpenAIRequestAndBackendConfigfunction withincore/http/middleware/request.go. The changes focus on replacinginterface{}with the more modernanytype and enhancing the processing of nested data structures.Type handling improvements:
interface{}withanyfor better readability and alignment with Go's modern conventions. ([core/http/middleware/request.goL386-R405](https://github.com/mudler/LocalAI/pull/5521/files#diff-953fd8ea90e198b803c88d4a658f3844ff95756ca4fa73658d8dda4e4827faf0L386-R405))Nested data structure processing:
int,float64, andstringtypes within the inner loop. This ensures that all valid input types are processed correctly. ([core/http/middleware/request.goL386-R405](https://github.com/mudler/LocalAI/pull/5521/files#diff-953fd8ea90e198b803c88d4a658f3844ff95756ca4fa73658d8dda4e4827faf0L386-R405))stringvalues toconfig.InputStringsin addition to handling numeric types forconfig.InputToken. ([core/http/middleware/request.goL386-R405](https://github.com/mudler/LocalAI/pull/5521/files#diff-953fd8ea90e198b803c88d4a658f3844ff95756ca4fa73658d8dda4e4827faf0L386-R405))Notes for Reviewers
Signed commits