Update web-app/src/lib/completion.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
38bdfd51ba
commit
ce9c8fe1cf
@ -187,9 +187,10 @@ export const sendCompletion = async (
|
||||
if (!secretKey) {
|
||||
throw new Error('Encryption key unavailable: cannot decrypt API key.')
|
||||
}
|
||||
const apiKey = provider.api_key
|
||||
? decryptApiKey(provider.api_key, secretKey)
|
||||
: (secretKey ?? '')
|
||||
if (!provider.api_key) {
|
||||
throw new Error('API key is missing for the selected provider.');
|
||||
}
|
||||
const apiKey = decryptApiKey(provider.api_key, secretKey);
|
||||
|
||||
const tokenJS = new TokenJS({
|
||||
apiKey,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user