Skip to content
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

🦙 refactor: Normalize Ollama Config Names #4657

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

danny-avila
Copy link
Owner

Summary

Closes #4654

I standardized the Ollama endpoint name normalization across endpoint and model configurations, improving code consistency and maintainability.

  • Moved normalizeEndpointName function from loadConfigModels.js to handleText.js for centralized access
  • Added JSDoc documentation to normalizeEndpointName function to clarify its purpose and parameters
  • Implemented name normalization in loadConfigEndpoints.js to match the behavior in loadConfigModels.js
  • Destructured configName from endpoint object and applied normalization before use
  • Reordered exports in handleText.js for better readability
  • Removed duplicate imports across files

Testing

To test these changes:

  1. Configure custom Ollama endpoints with varying name cases (e.g., "ollama", "Ollama", "OLLAMA")
  2. Verify all variations are normalized correctly in both endpoint and model configurations
  3. Ensure existing endpoint functionality remains intact
  4. Check that the normalized names are consistently used throughout the application

Test Configuration:

  • Custom Ollama endpoint configurations
  • Various case variations of "ollama" in endpoint names

@danny-avila danny-avila merged commit d60a0af into main Nov 7, 2024
2 checks passed
@danny-avila danny-avila deleted the fix/ollama-name-normalization branch November 7, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Ollama models missing from selection list if name is capitalized
1 participant