emanate-ai-chat-lib 0.1.2 → 0.1.3

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,7 +711,9 @@
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
- return this.http.post(this.config.apiUrl + "/ProcessInquiry", request, { headers: headers })
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 })
715
717
  .pipe(operators.timeout(this.config.timeout || 30000), operators.catchError(function (error) {
716
718
  console.log('ProcessInquiry API not available, returning demo response:', error);
717
719
  // Return a mock response for demo purposes