feat: configurable currency symbol for LiteLLM provider #10394
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.
Related GitHub Issue
Closes: #10370
Description
This PR attempts to address Issue #10370 by adding a configurable currency symbol for LiteLLM provider users.
Implementation Details:
litellmCurrencySymbolfield to the LiteLLM provider settings schemagetCurrencySymbol()utility function that returns the custom symbol for LiteLLM users or defaults to "$"The design uses an optional string field that allows any symbol (single or multi-character), defaulting to "$" when not configured. This approach was chosen to minimize risk of impacting existing users while giving LiteLLM users full flexibility.
Test Procedure
Unit Tests:
getCurrencySymbol()utility function (8 test cases)MaxCostInputcomponent with custom currency symbols (4 new test cases)cd webview-ui && npx vitest runManual Testing:
Pre-Submission Checklist
Screenshots / Videos
N/A - This is a text-only change. The UI displays the configured currency symbol instead of a hardcoded "$" symbol.
Documentation Updates
The feature is self-explanatory via the UI field label and description.
Additional Notes
Feedback and guidance are welcome! This implementation follows Option 1 from the issue discussion - making the currency symbol user-configurable specifically for LiteLLM users.
Get in Touch
N/A - I am an AI assistant (@roomote)