Merge branch 'staging' of https://github.com/Yokayo/SillyTavern into staging

This commit is contained in:
Yokayo 2024-11-06 01:33:27 +07:00
commit 88ad22196c
4 changed files with 10 additions and 13 deletions

View File

@ -2800,6 +2800,8 @@
<option value="claude-3-5-sonnet-latest">claude-3-5-sonnet-latest</option>
<option value="claude-3-5-sonnet-20241022">claude-3-5-sonnet-20241022</option>
<option value="claude-3-5-sonnet-20240620">claude-3-5-sonnet-20240620</option>
<option value="claude-3-5-haiku-latest">claude-3-5-haiku-latest</option>
<option value="claude-3-5-haiku-20241022">claude-3-5-haiku-20241022</option>
<option value="claude-3-opus-20240229">claude-3-opus-20240229</option>
<option value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</option>
<option value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>

View File

@ -46,6 +46,8 @@
<option data-type="anthropic" value="claude-3-5-sonnet-latest">claude-3-5-sonnet-latest</option>
<option data-type="anthropic" value="claude-3-5-sonnet-20241022">claude-3-5-sonnet-20241022</option>
<option data-type="anthropic" value="claude-3-5-sonnet-20240620">claude-3-5-sonnet-20240620</option>
<option data-type="anthropic" value="claude-3-5-haiku-latest">claude-3-5-haiku-latest</option>
<option data-type="anthropic" value="claude-3-5-haiku-20241022">claude-3-5-haiku-20241022</option>
<option data-type="anthropic" value="claude-3-opus-20240229">claude-3-opus-20240229</option>
<option data-type="anthropic" value="claude-3-sonnet-20240229">claude-3-sonnet-20240229</option>
<option data-type="anthropic" value="claude-3-haiku-20240307">claude-3-haiku-20240307</option>

View File

@ -1813,6 +1813,10 @@ async function sendOpenAIRequest(type, messages, signal) {
biasCache = logit_bias;
}
if (Object.keys(logit_bias).length === 0) {
logit_bias = undefined;
}
if (isScale && oai_settings.use_alt_scale) {
return sendAltScaleRequest(messages, logit_bias, signal, type);
}

View File

@ -1046,20 +1046,9 @@ router.post('/generate', jsonParser, function (request, response) {
const responseText = await errorResponse.text();
const errorData = tryParse(responseText);
const statusMessages = {
400: 'Bad request',
401: 'Unauthorized',
402: 'Credit limit reached',
403: 'Forbidden',
404: 'Not found',
429: 'Too many requests',
451: 'Unavailable for legal reasons',
502: 'Bad gateway',
};
const message = errorData?.error?.message || statusMessages[errorResponse.status] || 'Unknown error occurred';
const message = errorResponse.statusText || 'Unknown error occurred';
const quota_error = errorResponse.status === 429 && errorData?.error?.type === 'insufficient_quota';
console.log(message);
console.log(message, responseText);
if (!response.headersSent) {
response.send({ error: { message }, quota_error: quota_error });