[example] add modifyRequestChat

This commit is contained in:
kwaroran
2023-12-02 23:43:14 +09:00
parent 3d22247d0a
commit 229d33fa06

View File

@@ -5,7 +5,7 @@
//@use editProcess
//@use editDisplay
//@use onButtonClick
//@use modifyRequestChat
async function editInput(text){
@@ -45,6 +45,14 @@ async function onButtonClick(code){
return
}
async function modifyRequestChat(chat){
//modifyRequestChat is a callable function that is called when before request.
//the first argument is the chat array. chat array is almost same as OpenAI's chat array.
//unlike editProcess, its called after other fixes is done, and its only called once, with the whole chat array.
//the chat array would replaced to return value and used in request.
return chat
}
async function showcase(){
//this is a function for just introducing the apis.