-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Grouping of BYOK custom models in model picker #1111
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
Conversation
|
@microsoft-github-policy-service agree company="GitHub" |
| // Let's cache the results across extension activations | ||
| const baseCount = await this._promptBaseCountCache.getBaseCount(endpoint); | ||
| let multiplierString = endpoint.multiplier !== undefined ? `${endpoint.multiplier}x` : undefined; | ||
| let modelDetail = endpoint.multiplier !== undefined ? `${endpoint.multiplier}x` : undefined; |
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.
this was renamed to make it easier to follow the code. Its assigned to field details below.
| modelDescription = endpoint.customModel.keyName; | ||
| modelCategory = { label: localize('languageModelHeader.custom_models', "Custom Models"), order: 1 }; | ||
|
|
||
| modelName = endpoint.name.replace(` · ${endpoint.customModel.keyName}`, ''); |
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.
In Copilot API, the name is added as:
Name: fmt.Sprintf("%s · %s", m.DisplayName, m.Key.Name),
So in here, if keyName is part of the string we remove it, since we add it already to the modelDescription.
We can clean this away in a future release if we update the API to only send the modelName.
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.
Pull Request Overview
This PR implements grouping and structured data handling for Bring Your Own Key (BYOK) custom models in the model picker interface. The changes enhance the user experience by properly categorizing and displaying custom models with appropriate metadata.
Key Changes
- Added structured data support for custom models with
ICustomModelinterface containing key name and owner name - Implemented special UI treatment for custom models with dedicated category grouping and modified display names
- Extended existing model metadata interfaces to accommodate custom model information
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/platform/networking/common/networking.ts |
Defines new ICustomModel interface and adds optional customModel field to IChatEndpoint |
src/platform/endpoint/node/chatEndpoint.ts |
Implements custom model property assignment from API response metadata |
src/platform/endpoint/common/endpointProvider.ts |
Extends API response interface to include optional custom model metadata |
src/extension/conversation/vscode-node/languageModelAccess.ts |
Implements UI logic for custom model grouping and display formatting |
| modelDescription = customModel.keyName; | ||
| modelCategory = { label: localize('languageModelHeader.custom_models', "Custom Models"), order: 1 }; | ||
|
|
||
| modelName = endpoint.name.replace(` · ${customModel.keyName}`, ''); |
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.
Can we convince CAPI to not append key names like this? If they're worried about older clients than an API version would make sense here. I really dislike arbitrary string manipulation
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.
yeah I will do the change in CAPI as soon as this update goes out instead! good call, keep this clean!
only a select few preview user got BYOK yet. We can ask them to update the plugin, rather than maintain the old style.
Pull Request is not mergeable
This add new grouping and using structured data for Bring Your Own Key.
Issue:
Using the spike branch as starting point: 87451aa#diff-bcf7cff25eec039e0563b151a1299f0ad1f483594076c6bb649e2132e57d07e8