[feat] add autofill option

This commit is contained in:
kwaroran
2023-09-23 16:18:20 +09:00
parent a7aea17c98
commit 4a34dc3e23
3 changed files with 7 additions and 1 deletions

View File

@@ -53,6 +53,9 @@
<div class="flex items-center mt-4">
<Check bind:check={$DataBase.usePlainFetch} name="Force Plain Fetch"/>
</div>
<div class="flex items-center mt-4">
<Check bind:check={$DataBase.autofillRequestUrl} name="Autofill Request URL"/>
</div>
<button
on:click={async () => {
alertMd(getRequestLog())

View File

@@ -201,7 +201,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
replacerURL = replacerURL.replace("risu::", '')
}
if(aiModel === 'reverse_proxy'){
if(aiModel === 'reverse_proxy' && db.autofillRequestUrl){
if(replacerURL.endsWith('v1')){
replacerURL += '/chat/completions'
}

View File

@@ -315,6 +315,7 @@ export function setDatabase(data:Database){
data.NAIsettings.cfg_scale ??= 1
data.NAIsettings.mirostat_tau ??= 0
data.NAIsettings.mirostat_lr ??= 1
data.autofillRequestUrl ??= true
changeLanguage(data.language)
DataBase.set(data)
}
@@ -484,6 +485,8 @@ export interface Database{
freeApi:boolean
}
localStopStrings?:string[]
autofillRequestUrl:boolean
customProxyRequestModel:string
}
export interface customscript{