Просмотр исходного кода

Merge pull request #394 from samhvw8/fix/api-config-vscode-lm

fix(vscode-lm) fix api-config profile update for vscode lm
Matt Rubens 11 месяцев назад
Родитель
Сommit
5de419532c
1 измененных файлов с 9 добавлено и 5 удалено
  1. 9 5
      webview-ui/src/components/settings/ApiOptions.tsx

+ 9 - 5
webview-ui/src/components/settings/ApiOptions.tsx

@@ -639,12 +639,16 @@ const ApiOptions = ({ apiErrorMessage, modelIdErrorMessage }: ApiOptionsProps) =
 									`${apiConfiguration.vsCodeLmModelSelector.vendor ?? ""}/${apiConfiguration.vsCodeLmModelSelector.family ?? ""}` :
 									""}
 								onChange={(value: unknown) => {
-									const valueStr = (value as DropdownOption).value;
+									const valueStr = (value as DropdownOption)?.value;
+									if (!valueStr) {
+										return
+									}
 									const [vendor, family] = valueStr.split('/');
-									setApiConfiguration({
-										...apiConfiguration,
-										vsCodeLmModelSelector: valueStr ? { vendor, family } : undefined
-									});
+									handleInputChange("vsCodeLmModelSelector")({
+										target: {
+											value: { vendor, family } 
+										}
+									})
 								}}
 								style={{ width: "100%" }}
 								options={[