@astermind/cybernetic-chatbot-client 2.2.62 → 2.2.72

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.
@@ -88,6 +88,7 @@
88
88
  let fullText = '';
89
89
  let sources = [];
90
90
  let sessionId;
91
+ let messageId;
91
92
  try {
92
93
  while (true) {
93
94
  const { done, value } = await reader.read();
@@ -116,6 +117,7 @@
116
117
  else if (data.sessionId !== undefined) {
117
118
  // Done event
118
119
  sessionId = data.sessionId;
120
+ messageId = data.messageId;
119
121
  }
120
122
  }
121
123
  catch {
@@ -124,7 +126,7 @@
124
126
  }
125
127
  }
126
128
  }
127
- options.onComplete?.({ fullText, sessionId, sources });
129
+ options.onComplete?.({ fullText, sessionId, messageId, sources });
128
130
  }
129
131
  catch (error) {
130
132
  options.onError?.(error);
@@ -2957,7 +2959,7 @@ LJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==
2957
2959
  this.sessionStorage.saveSessionId(response.sessionId);
2958
2960
  }
2959
2961
  this.sessionStorage.addMessage({ role: 'user', content: message });
2960
- this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
2962
+ this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: response.sources || [] });
2961
2963
  return {
2962
2964
  reply: processedReply,
2963
2965
  confidence: 'high',
@@ -3034,7 +3036,7 @@ LJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==
3034
3036
  if (response.sessionId) {
3035
3037
  this.sessionStorage.saveSessionId(response.sessionId);
3036
3038
  }
3037
- this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
3039
+ this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: response.sources });
3038
3040
  callbacks.onComplete?.({
3039
3041
  ...response,
3040
3042
  reply: processedReply
@@ -3091,13 +3093,14 @@ LJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==
3091
3093
  if (data.sessionId) {
3092
3094
  this.sessionStorage.saveSessionId(data.sessionId);
3093
3095
  }
3094
- this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
3096
+ this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: data.sources || [] });
3095
3097
  callbacks.onComplete?.({
3096
3098
  reply: processedReply,
3097
3099
  confidence: 'high',
3098
3100
  sources: data.sources || [],
3099
3101
  offline: false,
3100
- sessionId: data.sessionId
3102
+ sessionId: data.sessionId,
3103
+ messageId: data.messageId
3101
3104
  });
3102
3105
  },
3103
3106
  onError: (error) => {