@sinequa/assistant 3.7.4 → 3.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2181,6 +2181,7 @@ class ChatComponent extends AbstractFacet {
2181
2181
  this._previousQuery = JSON.parse(JSON.stringify(this.query)); // Initialize the previous query
2182
2182
  this._handleChanges();
2183
2183
  this._addScrollListener();
2184
+ this._addResetActionStateListener();
2184
2185
  this.firstChangesHandled = true;
2185
2186
  }
2186
2187
  }
@@ -2189,12 +2190,6 @@ class ChatComponent extends AbstractFacet {
2189
2190
  throw error;
2190
2191
  }
2191
2192
  })).subscribe());
2192
- this._sub.add(combineLatest([
2193
- this.chatService.streaming$,
2194
- this.chatService.stoppingGeneration$
2195
- ]).pipe(map(([streaming, stoppingGeneration]) => !!(streaming || stoppingGeneration))).subscribe((result) => {
2196
- this._resetChatAction.disabled = result;
2197
- }));
2198
2193
  }
2199
2194
  ngOnChanges(changes) {
2200
2195
  this.changes$.next(changes);
@@ -2367,6 +2362,22 @@ class ChatComponent extends AbstractFacet {
2367
2362
  this.cdr.detectChanges();
2368
2363
  }));
2369
2364
  }
2365
+ /**
2366
+ * Initializes a listener that updates the disabled state of the reset chat action
2367
+ * based on the streaming and stopping generation states from the chat service.
2368
+ *
2369
+ * The listener combines the `streaming$` and `stoppingGeneration$` observables
2370
+ * from the chat service, and determines if either of them is active. If either
2371
+ * is active, the reset chat action is disabled.
2372
+ */
2373
+ _addResetActionStateListener() {
2374
+ this._sub.add(combineLatest([
2375
+ this.chatService.streaming$,
2376
+ this.chatService.stoppingGeneration$
2377
+ ]).pipe(map(([streaming, stoppingGeneration]) => !!(streaming || stoppingGeneration))).subscribe((result) => {
2378
+ this._resetChatAction.disabled = result;
2379
+ }));
2380
+ }
2370
2381
  /**
2371
2382
  * Get the model description based on the defaultValues service_id and model_id
2372
2383
  */