Преглед изворни кода

Fixes #2940 relaxes OpenAI key validation

main
Eric Amodio пре 1 година
родитељ
комит
00c9e6611e
2 измењених фајлова са 3 додато и 2 уклоњено
  1. +1
    -0
      CHANGELOG.md
  2. +2
    -2
      src/ai/openaiProvider.ts

+ 1
- 0
CHANGELOG.md Прегледај датотеку

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Fixed
- Fixes [#2940](https://github.com/gitkraken/vscode-gitlens/issues/2940) - Can't use Azure OpenAI model because i can't save the openai key because of the verification
- Fixes [#2928](https://github.com/gitkraken/vscode-gitlens/issues/2928) - Apply Changes should create new files when needed
- Fixes [#2896](https://github.com/gitkraken/vscode-gitlens/issues/2896) - Repositories view stuck in loading state
- Fixes issue with "View as [List|Tree]" toggle not working in the _Commit Details_ view

+ 2
- 2
src/ai/openaiProvider.ts Прегледај датотеку

@ -174,7 +174,7 @@ async function getApiKey(storage: Storage): Promise {
disposables.push(
input.onDidHide(() => resolve(undefined)),
input.onDidChangeValue(value => {
if (value && !/sk-[a-zA-Z0-9]{32}/.test(value)) {
if (value && !/(?:sk-)?[a-zA-Z0-9]{32}/.test(value)) {
input.validationMessage = 'Please enter a valid OpenAI API key';
return;
}
@ -182,7 +182,7 @@ async function getApiKey(storage: Storage): Promise {
}),
input.onDidAccept(() => {
const value = input.value.trim();
if (!value || !/sk-[a-zA-Z0-9]{32}/.test(value)) {
if (!value || !/(?:sk-)?[a-zA-Z0-9]{32}/.test(value)) {
input.validationMessage = 'Please enter a valid OpenAI API key';
return;
}

Loading…
Откажи
Сачувај