-
-
Notifications
You must be signed in to change notification settings - Fork 366
feat: map-based LLM provider config with pricing dialog #3492
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8439a43
feat: add map-based LLM provider configuration
JanCizmar 3db281f
feat: add LLM provider pricing info dialog
JanCizmar bbb89dc
feat: add pricing info and description text to LLM provider dialog
JanCizmar 40ea4aa
style: fix prettier formatting in LlmProviderPricingDialog
JanCizmar 574930f
fix: address review feedback for LLM provider pricing
JanCizmar fbeb54c
fix: use explicit T components for static key extraction
JanCizmar 48a5e82
fix: address PR review — deduplicate ProviderWithPricing type, extrac…
JanCizmar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Spring Boot official documentation: how are environment variable names derived from kebab-case@ConfigurationPropertiesnames, and how are Map keys bound from environment variables?💡 Result:
Deriving environment-variable names from canonical (
kebab-case) property namesSpring Boot recommends using the canonical form for property names (lowercase kebab-case, with
.for nesting). To convert a canonical property name to an environment variable name, Spring Boot documents these rules: replace.with_, remove-, then uppercase. For example,spring.main.log-startup-infobecomesSPRING_MAIN_LOGSTARTUPINFO. [1]Binding
Mapkeys from environment variablesWhen binding from environment variables, Spring Boot lowercases the environment variable name before binding. This usually doesn’t matter, except for
Mapbindings:Mapkeys produced from env vars are always lowercase. Example: if you have@ConfigurationProperties("my.props")with aMap<String,String> values, then settingMY_PROPS_VALUES_KEY=valueresults invaluescontaining{"key"="value"}(and ifMY_PROPS_VALUES_KEY=VALUE, the key is still"key"but the value is"VALUE"). [1]Source: Spring Boot Reference Guide → Externalized Configuration → “Binding From Environment Variables” and “Binding Maps From Environment Variables”. [1]
🏁 Script executed:
cat -n backend/data/src/main/kotlin/io/tolgee/configuration/tolgee/machineTranslation/LlmProperties.kt | head -100Repository: tolgee/tolgee-platform
Length of output: 4100
🏁 Script executed:
Repository: tolgee/tolgee-platform
Length of output: 3757
🏁 Script executed:
Repository: tolgee/tolgee-platform
Length of output: 1531
🏁 Script executed:
rg -A 5 "TOLGEE_LLM_PROVIDER_DEFAULTS" --type kt --type javaRepository: tolgee/tolgee-platform
Length of output: 92
🏁 Script executed:
rg -A 5 "TOLGEE_LLM_PROVIDER_DEFAULTS"Repository: tolgee/tolgee-platform
Length of output: 1294
🏁 Script executed:
Repository: tolgee/tolgee-platform
Length of output: 48
Fix the
provider-defaultsenv-var example.Spring Boot derives env-var names by replacing
.with_, removing-entirely, and uppercasing. For the canonical propertytolgee.llm.provider-defaults.gpt-5-mini.type, the correct env-var isTOLGEE_LLM_PROVIDERDEFAULTSGPT5MINITYPE(no underscores between parts). Additionally, Map keys bound from env vars are always lowercased, so the map key would begpt5mini, notgpt-5-mini. The documented formTOLGEE_LLM_PROVIDER_DEFAULTS_GPT_5_MINI_TYPEdoes not follow these rules and will fail to bind to the intended map entry.🤖 Prompt for AI Agents