Add support for JSON values in additionalParams

This commit is contained in:
kwaroran
2024-03-20 21:06:30 +09:00
parent 5bede2b90a
commit 895543355f
2 changed files with 7 additions and 4 deletions

View File

@@ -631,10 +631,13 @@ export async function requestChatDataMain(arg:requestDataArgument, model:'model'
key = key.replace('header::', '')
headers[key] = value
}
else if(value.startsWith('json::')){
value = value.replace('json::', '')
try {
body[key] = JSON.parse(value)
} catch (error) {}
}
else if(isNaN(parseFloat(value))){
if(value.startsWith('"') && value.endsWith('"')){
value = value.slice(1, -1)
}
body[key] = value
}
else{