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 type { MultiModal, OpenAIChat, OpenAIChatFull } from ".";
|
||||||
import { DataBase, setDatabase, type character } from "../storage/database";
|
import { DataBase, setDatabase, type character } from "../storage/database";
|
||||||
import { pluginProcess } from "../plugins/plugins";
|
import { pluginProcess } from "../plugins/plugins";
|
||||||
@@ -469,8 +469,16 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
|
|
||||||
if(supportsInlayImage()){
|
if(supportsInlayImage()){
|
||||||
// inlay models doesn't support logit_bias
|
// inlay models doesn't support logit_bias
|
||||||
// @ts-ignore
|
// gpt-4-turbo supports both logit_bias and inlay image
|
||||||
delete body.logit_bias
|
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" :
|
let replacerURL = aiModel === 'openrouter' ? "https://openrouter.ai/api/v1/chat/completions" :
|
||||||
|
|||||||
Reference in New Issue
Block a user