ソースを参照

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;
}

読み込み中…
キャンセル
保存