[feat] oai seed

This commit is contained in:
kwaroran
2023-11-07 05:21:56 +09:00
parent c5b4bf959a
commit 859db3ab2d
4 changed files with 15 additions and 2 deletions

View File

@@ -183,7 +183,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
db.cipherChat = false
const body = ({
let body = ({
model: aiModel === 'openrouter' ? db.openrouterRequestModel :
requestModel === 'gpt35' ? 'gpt-3.5-turbo'
: requestModel === 'gpt35_0613' ? 'gpt-3.5-turbo-0613'
@@ -205,9 +205,14 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
presence_penalty: arg.PresensePenalty || (db.PresensePenalty / 100),
frequency_penalty: arg.frequencyPenalty || (db.frequencyPenalty / 100),
logit_bias: bias,
stream: false
stream: false,
seed: db.generationSeed
})
if(body.seed === -1){
delete body.seed
}
let replacerURL = aiModel === 'openrouter' ? "https://openrouter.ai/api/v1/chat/completions" :
(aiModel === 'reverse_proxy') ? (db.forceReplaceUrl) : ('https://api.openai.com/v1/chat/completions')

View File

@@ -317,6 +317,7 @@ export function setDatabase(data:Database){
data.NAIsettings.mirostat_lr ??= 1
data.autofillRequestUrl ??= true
data.customProxyRequestModel ??= ''
data.generationSeed ??= -1
changeLanguage(data.language)
DataBase.set(data)
}
@@ -489,6 +490,7 @@ export interface Database{
localStopStrings?:string[]
autofillRequestUrl:boolean
customProxyRequestModel:string
generationSeed:number
}
export interface customscript{