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) {
|
if (!secretKey) {
|
||||||
throw new Error('Encryption key unavailable: cannot decrypt API key.')
|
throw new Error('Encryption key unavailable: cannot decrypt API key.')
|
||||||
}
|
}
|
||||||
const apiKey = provider.api_key
|
if (!provider.api_key) {
|
||||||
? decryptApiKey(provider.api_key, secretKey)
|
throw new Error('API key is missing for the selected provider.');
|
||||||
: (secretKey ?? '')
|
}
|
||||||
|
const apiKey = decryptApiKey(provider.api_key, secretKey);
|
||||||
|
|
||||||
const tokenJS = new TokenJS({
|
const tokenJS = new TokenJS({
|
||||||
apiKey,
|
apiKey,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user