Skip to content

fix(input): handle correctly case where we pass by string list as inputs #5521

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

mudler
Copy link
Owner

@mudler mudler commented May 29, 2025

Description

This pull request refactors type handling and improves type safety in the mergeOpenAIRequestAndBackendConfig function within core/http/middleware/request.go. The changes focus on replacing interface{} with the more modern any type and enhancing the processing of nested data structures.

Type handling improvements:

  • Replaced interface{} with any for 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:

  • Enhanced the handling of nested slices by adding support for int, float64, and string types 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))
  • Updated logic to append string values to config.InputStrings in addition to handling numeric types for config.InputToken. ([core/http/middleware/request.goL386-R405](https://github.com/mudler/LocalAI/pull/5521/files#diff-953fd8ea90e198b803c88d4a658f3844ff95756ca4fa73658d8dda4e4827faf0L386-R405))

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Copy link

netlify bot commented May 29, 2025

Deploy Preview for localai ready!

Name Link
🔨 Latest commit c2e8bba
🔍 Latest deploy log https://app.netlify.com/projects/localai/deploys/68389f778b6f02000822042a
😎 Deploy Preview https://deploy-preview-5521--localai.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mudler mudler added the bug Something isn't working label May 29, 2025
@mudler mudler force-pushed the fix/handle_strings_inputs branch from 7dd4be3 to c2e8bba Compare May 29, 2025 17:55
@mudler mudler merged commit 0870bf5 into master May 29, 2025
24 of 28 checks passed
@mudler mudler deleted the fix/handle_strings_inputs branch May 29, 2025 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant