emanate-ai-chat-lib 0.1.4 → 0.1.5

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.
@@ -711,9 +711,7 @@
711
711
  };
712
712
  AiAgentService.prototype.processInquiry = function (request) {
713
713
  var headers = new i1.HttpHeaders(Object.assign({ 'Content-Type': 'application/json' }, (this.config.appKey && { 'x-api-key': this.config.appKey })));
714
- // Clean the request object to remove undefined/null values and ensure conversationId is a string
715
- var cleanedRequest = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (request.query && { query: request.query })), (request.conversationId && { conversationId: String(request.conversationId) })), (request.userId && { userId: request.userId })), (request.userName && { userName: request.userName })), (request.appSource && { appSource: request.appSource }));
716
- return this.http.post(this.config.apiUrl + "/ProcessInquiry", cleanedRequest, { headers: headers })
714
+ return this.http.post(this.config.apiUrl + "/ProcessInquiry", request, { headers: headers })
717
715
  .pipe(operators.timeout(this.config.timeout || 30000), operators.catchError(function (error) {
718
716
  console.log('ProcessInquiry API not available, returning demo response:', error);
719
717
  // Return a mock response for demo purposes
@@ -1052,7 +1050,7 @@
1052
1050
  this.authorName = '';
1053
1051
  this.intent = '';
1054
1052
  this.isLoading = true;
1055
- var request = Object.assign(Object.assign(Object.assign(Object.assign({ query: inquiry }, (this.conversationId && { conversationId: String(this.conversationId) })), (this.userId && { userId: this.userId })), (this.userName && { userName: this.userName })), (this.appSource && { appSource: this.appSource }));
1053
+ var request = Object.assign(Object.assign(Object.assign(Object.assign({ query: inquiry }, (this.conversationId !== undefined && this.conversationId !== null ? { conversationId: String(this.conversationId) } : {})), (this.userId !== undefined && this.userId !== null ? { userId: this.userId } : {})), (this.userName !== undefined && this.userName !== null ? { userName: this.userName } : {})), (this.appSource !== undefined && this.appSource !== null ? { appSource: this.appSource } : {}));
1056
1054
  this.aiAgentService.processInquiry(request)
1057
1055
  .pipe(operators.takeUntil(this.destroy$))
1058
1056
  .subscribe({