mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
add logsprobs support for custom OpenAI APIs
This commit is contained in:
@ -1617,7 +1617,7 @@ async function sendOpenAIRequest(type, messages, signal) {
|
||||
}
|
||||
|
||||
// Add logprobs request (currently OpenAI only, max 5 on their side)
|
||||
if (useLogprobs && isOAI) {
|
||||
if (useLogprobs && (isOAI || isCustom)) {
|
||||
generate_data['logprobs'] = 5;
|
||||
}
|
||||
|
||||
@ -1768,6 +1768,7 @@ function parseChatCompletionLogprobs(data) {
|
||||
|
||||
switch (oai_settings.chat_completion_source) {
|
||||
case chat_completion_sources.OPENAI:
|
||||
case chat_completion_sources.CUSTOM:
|
||||
if (!data.choices?.length) {
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user