Chat Completion: switch to async token handling

This commit is contained in:
Cohee
2024-10-12 01:07:36 +03:00
parent b0d0f2111b
commit 8e082e622b
2 changed files with 104 additions and 62 deletions

View File

@ -315,7 +315,7 @@ class PromptManager {
*/
init(moduleConfiguration, serviceSettings) {
this.configuration = Object.assign(this.configuration, moduleConfiguration);
this.tokenHandler = this.tokenHandler || new TokenHandler();
this.tokenHandler = this.tokenHandler || new TokenHandler(() => { throw new Error('Token handler not set'); });
this.serviceSettings = serviceSettings;
this.containerElement = document.getElementById(this.configuration.containerIdentifier);