commented out mock functions
This commit is contained in:
parent
1cc1ea4a88
commit
5b4cd31152
1 changed files with 11 additions and 11 deletions
|
|
@ -23,19 +23,19 @@
|
||||||
import { OpenAI } from '../js/api/openai.js';
|
import { OpenAI } from '../js/api/openai.js';
|
||||||
|
|
||||||
//========================== for testing
|
//========================== for testing
|
||||||
const MOCK_TOKENS = ['Good', ' morning', ' Mr', ' Plop', 'py', ',', 'and', ' I', ' said', '\n', '"', 'Good', ' morn', 'ing', ' Mrs',' Plop', 'py', ,'"', '\n', 'Oh', ' how', ' the', ' win', 'ter', ' even', 'ings', ' must', ' just', ' fly'];
|
// const MOCK_TOKENS = ['Good', ' morning', ' Mr', ' Plop', 'py', ',', 'and', ' I', ' said', '\n', '"', 'Good', ' morn', 'ing', ' Mrs',' Plop', 'py', ,'"', '\n', 'Oh', ' how', ' the', ' win', 'ter', ' even', 'ings', ' must', ' just', ' fly'];
|
||||||
|
|
||||||
function mockDelay(ms) {
|
// function mockDelay(ms) {
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
// return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
}
|
// }
|
||||||
|
|
||||||
async function processMockTokens() {
|
// async function processMockTokens() {
|
||||||
for (const token of MOCK_TOKENS) {
|
// for (const token of MOCK_TOKENS) {
|
||||||
await mockDelay(Math.random() * 50 + 50); // Random delay between 100ms and 150ms
|
// await mockDelay(Math.random() * 50 + 50); // Random delay between 100ms and 150ms
|
||||||
postMessage({ type: 'newToken', payload: { token } });
|
// postMessage({ type: 'newToken', payload: { token } });
|
||||||
}
|
// }
|
||||||
postMessage({ type: 'tokensDone' });
|
// postMessage({ type: 'tokensDone' });
|
||||||
}
|
// }
|
||||||
//========================== for testing - END
|
//========================== for testing - END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue