@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.
- package/dist/ApiClient.d.ts +1 -0
- package/dist/ApiClient.d.ts.map +1 -1
- package/dist/CyberneticClient.d.ts.map +1 -1
- package/dist/CyberneticSessionStorage.d.ts +3 -0
- package/dist/CyberneticSessionStorage.d.ts.map +1 -1
- package/dist/cybernetic-chatbot-client-full.esm.js +8 -5
- package/dist/cybernetic-chatbot-client-full.esm.js.map +1 -1
- package/dist/cybernetic-chatbot-client-full.min.js +1 -1
- package/dist/cybernetic-chatbot-client-full.min.js.map +1 -1
- package/dist/cybernetic-chatbot-client-full.umd.js +8 -5
- package/dist/cybernetic-chatbot-client-full.umd.js.map +1 -1
- package/dist/cybernetic-chatbot-client.esm.js +8 -5
- package/dist/cybernetic-chatbot-client.esm.js.map +1 -1
- package/dist/cybernetic-chatbot-client.min.js +1 -1
- package/dist/cybernetic-chatbot-client.min.js.map +1 -1
- package/dist/cybernetic-chatbot-client.umd.js +8 -5
- package/dist/cybernetic-chatbot-client.umd.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -86,6 +86,7 @@ class ApiClient {
|
|
|
86
86
|
let fullText = '';
|
|
87
87
|
let sources = [];
|
|
88
88
|
let sessionId;
|
|
89
|
+
let messageId;
|
|
89
90
|
try {
|
|
90
91
|
while (true) {
|
|
91
92
|
const { done, value } = await reader.read();
|
|
@@ -114,6 +115,7 @@ class ApiClient {
|
|
|
114
115
|
else if (data.sessionId !== undefined) {
|
|
115
116
|
// Done event
|
|
116
117
|
sessionId = data.sessionId;
|
|
118
|
+
messageId = data.messageId;
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
catch {
|
|
@@ -122,7 +124,7 @@ class ApiClient {
|
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
|
-
options.onComplete?.({ fullText, sessionId, sources });
|
|
127
|
+
options.onComplete?.({ fullText, sessionId, messageId, sources });
|
|
126
128
|
}
|
|
127
129
|
catch (error) {
|
|
128
130
|
options.onError?.(error);
|
|
@@ -2955,7 +2957,7 @@ class CyberneticClient {
|
|
|
2955
2957
|
this.sessionStorage.saveSessionId(response.sessionId);
|
|
2956
2958
|
}
|
|
2957
2959
|
this.sessionStorage.addMessage({ role: 'user', content: message });
|
|
2958
|
-
this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
|
|
2960
|
+
this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: response.sources || [] });
|
|
2959
2961
|
return {
|
|
2960
2962
|
reply: processedReply,
|
|
2961
2963
|
confidence: 'high',
|
|
@@ -3032,7 +3034,7 @@ class CyberneticClient {
|
|
|
3032
3034
|
if (response.sessionId) {
|
|
3033
3035
|
this.sessionStorage.saveSessionId(response.sessionId);
|
|
3034
3036
|
}
|
|
3035
|
-
this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
|
|
3037
|
+
this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: response.sources });
|
|
3036
3038
|
callbacks.onComplete?.({
|
|
3037
3039
|
...response,
|
|
3038
3040
|
reply: processedReply
|
|
@@ -3089,13 +3091,14 @@ class CyberneticClient {
|
|
|
3089
3091
|
if (data.sessionId) {
|
|
3090
3092
|
this.sessionStorage.saveSessionId(data.sessionId);
|
|
3091
3093
|
}
|
|
3092
|
-
this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high' });
|
|
3094
|
+
this.sessionStorage.addMessage({ role: 'assistant', content: processedReply, confidence: 'high', sources: data.sources || [] });
|
|
3093
3095
|
callbacks.onComplete?.({
|
|
3094
3096
|
reply: processedReply,
|
|
3095
3097
|
confidence: 'high',
|
|
3096
3098
|
sources: data.sources || [],
|
|
3097
3099
|
offline: false,
|
|
3098
|
-
sessionId: data.sessionId
|
|
3100
|
+
sessionId: data.sessionId,
|
|
3101
|
+
messageId: data.messageId
|
|
3099
3102
|
});
|
|
3100
3103
|
},
|
|
3101
3104
|
onError: (error) => {
|