[example] add modifyRequestChat
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
//@use editProcess
|
//@use editProcess
|
||||||
//@use editDisplay
|
//@use editDisplay
|
||||||
//@use onButtonClick
|
//@use onButtonClick
|
||||||
|
//@use modifyRequestChat
|
||||||
|
|
||||||
|
|
||||||
async function editInput(text){
|
async function editInput(text){
|
||||||
@@ -45,6 +45,14 @@ async function onButtonClick(code){
|
|||||||
return
|
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(){
|
async function showcase(){
|
||||||
//this is a function for just introducing the apis.
|
//this is a function for just introducing the apis.
|
||||||
|
|||||||
Reference in New Issue
Block a user