Add logit_bias supports for gpt-4-turbo
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { get } from "svelte/store";
|
||||
noimport { get } from "svelte/store";
|
||||
import type { MultiModal, OpenAIChat, OpenAIChatFull } from ".";
|
||||
import { DataBase, setDatabase, type character } from "../storage/database";
|
||||
import { pluginProcess } from "../plugins/plugins";
|
||||
@@ -469,8 +469,16 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
||||
|
||||
if(supportsInlayImage()){
|
||||
// inlay models doesn't support logit_bias
|
||||
// @ts-ignore
|
||||
delete body.logit_bias
|
||||
// gpt-4-turbo supports both logit_bias and inlay image
|
||||
if(!(
|
||||
aiModel.startsWith('gpt4_turbo') ||
|
||||
(aiModel == 'reverse_proxy' && (
|
||||
db.proxyRequestModel?.startsWith('gpt4_turbo') ||
|
||||
(db.proxyRequestModel === 'custom' && db.customProxyRequestModel.startsWith('gpt-4-turbo'))
|
||||
)))){
|
||||
// @ts-ignore
|
||||
delete body.logit_bias
|
||||
}
|
||||
}
|
||||
|
||||
let replacerURL = aiModel === 'openrouter' ? "https://openrouter.ai/api/v1/chat/completions" :
|
||||
|
||||
Reference in New Issue
Block a user