@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.
@@ -2169,6 +2169,7 @@ class ChatComponent extends AbstractFacet {
2169
2169
  this._previousQuery = JSON.parse(JSON.stringify(this.query)); // Initialize the previous query
2170
2170
  this._handleChanges();
2171
2171
  this._addScrollListener();
2172
+ this._addResetActionStateListener();
2172
2173
  this.firstChangesHandled = true;
2173
2174
  }
2174
2175
  }
@@ -2177,12 +2178,6 @@ class ChatComponent extends AbstractFacet {
2177
2178
  throw error;
2178
2179
  }
2179
2180
  })).subscribe());
2180
- this._sub.add(combineLatest([
2181
- this.chatService.streaming$,
2182
- this.chatService.stoppingGeneration$
2183
- ]).pipe(map(([streaming, stoppingGeneration]) => !!(streaming || stoppingGeneration))).subscribe((result) => {
2184
- this._resetChatAction.disabled = result;
2185
- }));
2186
2181
  }
2187
2182
  ngOnChanges(changes) {
2188
2183
  this.changes$.next(changes);
@@ -2352,6 +2347,22 @@ class ChatComponent extends AbstractFacet {
2352
2347
  this.cdr.detectChanges();
2353
2348
  }));
2354
2349
  }
2350
+ /**
2351
+ * Initializes a listener that updates the disabled state of the reset chat action
2352
+ * based on the streaming and stopping generation states from the chat service.
2353
+ *
2354
+ * The listener combines the `streaming$` and `stoppingGeneration$` observables
2355
+ * from the chat service, and determines if either of them is active. If either
2356
+ * is active, the reset chat action is disabled.
2357
+ */
2358
+ _addResetActionStateListener() {
2359
+ this._sub.add(combineLatest([
2360
+ this.chatService.streaming$,
2361
+ this.chatService.stoppingGeneration$
2362
+ ]).pipe(map(([streaming, stoppingGeneration]) => !!(streaming || stoppingGeneration))).subscribe((result) => {
2363
+ this._resetChatAction.disabled = result;
2364
+ }));
2365
+ }
2355
2366
  /**
2356
2367
  * Get the model description based on the defaultValues service_id and model_id
2357
2368
  */