[feat] add autofill option
This commit is contained in:
@@ -53,6 +53,9 @@
|
|||||||
<div class="flex items-center mt-4">
|
<div class="flex items-center mt-4">
|
||||||
<Check bind:check={$DataBase.usePlainFetch} name="Force Plain Fetch"/>
|
<Check bind:check={$DataBase.usePlainFetch} name="Force Plain Fetch"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="flex items-center mt-4">
|
||||||
|
<Check bind:check={$DataBase.autofillRequestUrl} name="Autofill Request URL"/>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
alertMd(getRequestLog())
|
alertMd(getRequestLog())
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
|
|||||||
replacerURL = replacerURL.replace("risu::", '')
|
replacerURL = replacerURL.replace("risu::", '')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aiModel === 'reverse_proxy'){
|
if(aiModel === 'reverse_proxy' && db.autofillRequestUrl){
|
||||||
if(replacerURL.endsWith('v1')){
|
if(replacerURL.endsWith('v1')){
|
||||||
replacerURL += '/chat/completions'
|
replacerURL += '/chat/completions'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -315,6 +315,7 @@ export function setDatabase(data:Database){
|
|||||||
data.NAIsettings.cfg_scale ??= 1
|
data.NAIsettings.cfg_scale ??= 1
|
||||||
data.NAIsettings.mirostat_tau ??= 0
|
data.NAIsettings.mirostat_tau ??= 0
|
||||||
data.NAIsettings.mirostat_lr ??= 1
|
data.NAIsettings.mirostat_lr ??= 1
|
||||||
|
data.autofillRequestUrl ??= true
|
||||||
changeLanguage(data.language)
|
changeLanguage(data.language)
|
||||||
DataBase.set(data)
|
DataBase.set(data)
|
||||||
}
|
}
|
||||||
@@ -484,6 +485,8 @@ export interface Database{
|
|||||||
freeApi:boolean
|
freeApi:boolean
|
||||||
}
|
}
|
||||||
localStopStrings?:string[]
|
localStopStrings?:string[]
|
||||||
|
autofillRequestUrl:boolean
|
||||||
|
customProxyRequestModel:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface customscript{
|
export interface customscript{
|
||||||
|
|||||||
Reference in New Issue
Block a user