@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);
@@ -2948,7 +2950,7 @@ LJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==
2948
2950
  this.sessionStorage.saveSessionId(response.sessionId);
2949
2951
  }
2950
2952
  this.sessionStorage.addMessage({ role: 'user', content: message });
2951
- this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
2953
+ this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: response.sources || [] });
2952
2954
  return {
2953
2955
  reply: processedReply,
2954
2956
  confidence: 'high',
@@ -3025,7 +3027,7 @@ LJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==
3025
3027
  if (response.sessionId) {
3026
3028
  this.sessionStorage.saveSessionId(response.sessionId);
3027
3029
  }
3028
- this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
3030
+ this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: response.sources });
3029
3031
  callbacks.onComplete?.({
3030
3032
  ...response,
3031
3033
  reply: processedReply
@@ -3082,13 +3084,14 @@ LJ5AZXvOhHaXdHzMuYKX5BpK4w7TqbPvJ6QPvKmLKvHh1VKcUJ6mJQgJJw==
3082
3084
  if (data.sessionId) {
3083
3085
  this.sessionStorage.saveSessionId(data.sessionId);
3084
3086
  }
3085
- this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
3087
+ this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: data.sources || [] });
3086
3088
  callbacks.onComplete?.({
3087
3089
  reply: processedReply,
3088
3090
  confidence: 'high',
3089
3091
  sources: data.sources || [],
3090
3092
  offline: false,
3091
- sessionId: data.sessionId
3093
+ sessionId: data.sessionId,
3094
+ messageId: data.messageId
3092
3095
  });
3093
3096
  },
3094
3097
  onError: (error) => {