languageModels.ts ×8

Frontier kind: Joint frontier

unlabeled · c_ef37ced009f4

1 test · 32247 LOC · 158 files · introduces 1 test · 43 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges43 lines · 1 files
Tests
1 test

Contains — complete concept membership

All code (extent)
3272 ranges32247 lines · 158 files · Browse complete extent
All tests (intent)
1 testBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 43 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/chat/common/languageModels.ts 43 introduced LOC · 8 ranges

Open complete file

1585
1586 async renameLanguageModelsProviderGroup(vendorId: string, providerGroupName: string): Promise<void> {
1587 > const vendor = this.getVendors().find(({ vendor }) => vendor === vendorId); languageModels.ts
1588 > if (!vendor) {
1589 throw new Error(`Vendor ${vendorId} not found.`);
1590 }
1592 > const languageModelProviderGroups = this._languageModelsConfigurationService.getLanguageModelsProviderGroups();
1593 > const existing = languageModelProviderGroups.find(group => group.vendor === vendorId && group.name === providerGroupName);
1594 > if (!existing) {
1595 throw new Error(`Language model provider group ${providerGroupName} for vendor ${vendorId} not found.`);
1596 }
1598 > const name = await this.promptForName(languageModelProviderGroups, vendor, existing);
1599 > if (!name || name === existing.name) {
1600 return;
1601 }
1603 > await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(existing, { ...existing, name });
1604 > }
1605
1606 async updateLanguageModelsProviderGroupApiKey(vendorId: string, providerGroupName: string): Promise<void> {
1815
1816 private async promptForName(languageModelProviderGroups: readonly ILanguageModelsProviderGroup[], vendor: IUserFriendlyLanguageModel, existing: ILanguageModelsProviderGroup | undefined): Promise<string | undefined> {
1817 > let providerGroupName = existing?.name; languageModels.ts
1818 > if (!providerGroupName) {
1819 providerGroupName = vendor.displayName;
1820 let count = 1;
1824 }
1825 }
1827 > let result: string | undefined;
1828 > const disposables = new DisposableStore();
1829 > try {
1830 > await new Promise<void>(resolve => {
1831 > const inputBox = disposables.add(this._quickInputService.createInputBox());
1832 > inputBox.title = localize('configureLanguageModelGroup', "Group Name");
1833 > inputBox.placeholder = localize('languageModelGroupName', "Enter a name for the group");
1834 > inputBox.value = providerGroupName;
1835 > inputBox.ignoreFocusOut = true;
1836 >
1837 > disposables.add(inputBox.onDidChangeValue(value => {
1838 > if (!value) {
1839 inputBox.validationMessage = localize('enterName', "Please enter a name");
1840 inputBox.severity = Severity.Error;
1841 return;
1842 }
1843 > if (languageModelProviderGroups.some(group => group !== existing && group.vendor === vendor.vendor && group.name === value)) { languageModels.ts
1844 inputBox.validationMessage = localize('nameExists', "A language models group with this name already exists");
1845 inputBox.severity = Severity.Error;
1846 return;
1847 }
1848 > inputBox.validationMessage = undefined; languageModels.ts
1849 > inputBox.severity = Severity.Ignore;
1850 > }));
1851 > disposables.add(inputBox.onDidAccept(async () => {
1852 > result = inputBox.value;
1853 > inputBox.hide();
1854 > }));
1855 > disposables.add(inputBox.onDidHide(() => resolve()));
1856 > inputBox.show();
1857 > });
1858 > } finally {
1859 > disposables.dispose();
1860 > }
1861 > return result;
1862 > }
1863
1864 private async promptForConfiguration(groupName: string, configuration: IJSONSchema, existing: IStringDictionary<unknown> | undefined): Promise<IStringDictionary<unknown> | undefined> {