diff --git a/src/etc/example-char.js b/src/etc/example-char.js index 3d6cc3e8..a73971fb 100644 --- a/src/etc/example-char.js +++ b/src/etc/example-char.js @@ -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.