Code clean-up

This commit is contained in:
Cohee1207 2023-08-19 18:51:20 +03:00
parent 438c78574f
commit e77cded357

View File

@ -1080,8 +1080,8 @@ async function sendOpenAIRequest(type, openai_msgs_tosend, signal) {
const isScale = oai_settings.chat_completion_source == chat_completion_sources.SCALE;
const isAI21 = oai_settings.chat_completion_source == chat_completion_sources.AI21;
const isTextCompletion = oai_settings.chat_completion_source == chat_completion_sources.OPENAI && (oai_settings.openai_model.startsWith('text-') || oai_settings.openai_model.startsWith('code-'));
const stream = type !== 'quiet' && oai_settings.stream_openai && !isScale && !isAI21;
const isQuiet = type === 'quiet';
const stream = oai_settings.stream_openai && !isQuiet && !isScale && !isAI21;
if (isAI21) {
const joinedMsgs = openai_msgs_tosend.reduce((acc, obj) => {
@ -2836,8 +2836,8 @@ async function onConnectButtonClick(e) {
await writeSecret(SECRET_KEYS.AI21, api_key_ai21);
}
if (!secret_state[SECRET_KEYS.AI21] && !oai_settings.reverse_proxy) {
console.log('No secret key saved for Claude');
if (!secret_state[SECRET_KEYS.AI21]) {
console.log('No secret key saved for AI21');
return;
}
}