Commit 7cdc9c1
Display copilot multipliers in model list (#1567)
* debug: temporary log file to make sure how is the response
* feat(providers): add model billing multiplier support
Expose the 'multiplier' field from model billing configuration into the
provider definitions. This change allows the plugin to track and display
usage cost multipliers for specific LLM models.
Changes include:
- Updating providers.lua to pull 'multiplier' from billing data.
- Updating init.lua to propagate the multiplier to the model selection UI.
- Adding a visual indicator in the model picker to show the multiplier.
Notable behavior change:
The model selection menu will now display billing multipliers, such as
'[x2]', next to supported models.
Testing:
Verify the model selector displays the multiplier correctly when a model
has billing information defined:
:lua print(vim.inspect(require('CopilotChat.config.providers').copilot))
Check that models without billing info remain unaffected.
* feat(model): add fallback indicator for missing multipliers
Update the model selection interface to explicitly display 'x not
specified' when a model multiplier is undefined.
Previously, missing multipliers resulted in no indicator being shown.
This change ensures visual consistency in the status line or UI components
that list model configurations.
Notable change:
- The string 'x not specified' will now appear in the indicators table
when a multiplier is nil.
Testing:
- Open the model selection menu and verify that models without a
defined multiplier now show the fallback text instead of being empty.
* refactor(config): remove debug logging and clean up UI helpers
Refactored the provider and UI logic for model selection.
What changed:
- Removed the log.info call for Copilot models in providers.lua as it
added unnecessary noise to the logs.
- Simplified the 'select_model' logic in init.lua by removing the
conditional fallback for missing multipliers.
Notable behavior changes:
- Models without a multiplier will no longer show 'x not specified' in the
picker list.
Testing:
- Check that the model picker still renders correctly.
- Verify that logs are clean during model fetching.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent 137d3bc commit 7cdc9c1
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
655 | 655 | | |
656 | 656 | | |
657 | 657 | | |
| 658 | + | |
658 | 659 | | |
659 | 660 | | |
660 | 661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
346 | 347 | | |
347 | 348 | | |
348 | 349 | | |
| |||
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| |||
0 commit comments