Merge pull request #3162 from alexdenton123/patch-1 Update index.js

050f485a5b9cdb36c4021fcd6949fc0824b1b762

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +10 -0Ignore whitespace
public/scripts/extensions/expressions/index.js+10 -0
@@ -697,6 +697,11 @@ async function moduleWorker() {
697 return;697 return;
698 }698 }
699699
700 // If using LLM api then check if streamingProcessor is finished to avoid sending multiple requests to the API
701 if (extension_settings.expressions.api === EXPRESSION_API.llm && context.streamingProcessor && !context.streamingProcessor.isFinished) {
702 return;
703 }
704
700 // API is busy705 // API is busy
701 if (inApiCall) {706 if (inApiCall) {
702 console.debug('Classification API is busy');707 console.debug('Classification API is busy');
@@ -995,6 +1000,11 @@ function sampleClassifyText(text) {
995 // Replace macros, remove asterisks and quotes1000 // Replace macros, remove asterisks and quotes
996 let result = substituteParams(text).replace(/[*"]/g, '');1001 let result = substituteParams(text).replace(/[*"]/g, '');
9971002
1003 // If using LLM api there is no need to check length of characters
1004 if (extension_settings.expressions.api === EXPRESSION_API.llm) {
1005 return result.trim();
1006 }
1007
998 const SAMPLE_THRESHOLD = 500;1008 const SAMPLE_THRESHOLD = 500;
999 const HALF_SAMPLE_THRESHOLD = SAMPLE_THRESHOLD / 2;1009 const HALF_SAMPLE_THRESHOLD = SAMPLE_THRESHOLD / 2;
10001010