File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const openai = new OpenAIApi(configuration);
1111
1212const MAX_TOKENS = 2049 ;
1313const RESPONSE_TOKENS = 64 ;
14+ const MAX_GENERATED_CONTENT_LEN = Math . floor ( ( MAX_TOKENS - RESPONSE_TOKENS ) / 2 ) ; // make it cheaper
1415const BANNED_PATTERNS = / [ ` \[ \] { } \( \) ] | h t t p / g;
1516const COOLDOWN = 20 ;
1617const GRZESIU_DELAY = 1500 ;
@@ -87,7 +88,7 @@ const generateGrzesiuPrompt = async (username: string, question: string) => {
8788 const txt = uniqueLines . reduce ( ( txt , line ) => {
8889 const newTxt = txt + `${ GRZESIU_NAME } : ` + line + '\n' ;
8990 const fullConvo = getFullConvo ( newTxt , username , question ) ;
90- return fullConvo . length <= MAX_TOKENS - RESPONSE_TOKENS ? newTxt : txt ;
91+ return fullConvo . length <= MAX_GENERATED_CONTENT_LEN ? newTxt : txt ;
9192 } , '' ) ;
9293 return getFullConvo ( txt , username , question ) ;
9394} ;
You can’t perform that action at this time.
0 commit comments