@yushaw/sanqian-chat 0.2.30 → 0.2.32
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/renderer/index.js
CHANGED
|
@@ -5991,7 +5991,7 @@ function createIpcAdapter() {
|
|
|
5991
5991
|
onEvent({ ...event, stream_id: streamId });
|
|
5992
5992
|
});
|
|
5993
5993
|
try {
|
|
5994
|
-
|
|
5994
|
+
const streamPromise = api.stream({
|
|
5995
5995
|
streamId,
|
|
5996
5996
|
messages,
|
|
5997
5997
|
conversationId,
|
|
@@ -5999,6 +5999,11 @@ function createIpcAdapter() {
|
|
|
5999
5999
|
attachedResources: options?.attachedResources,
|
|
6000
6000
|
sessionResources: options?.sessionResources
|
|
6001
6001
|
});
|
|
6002
|
+
void streamPromise.catch((e) => {
|
|
6003
|
+
streamCallbacks.delete(streamId);
|
|
6004
|
+
const errorMessage = e instanceof Error ? e.message : "Stream error";
|
|
6005
|
+
onEvent({ type: "error", error: errorMessage, stream_id: streamId });
|
|
6006
|
+
});
|
|
6002
6007
|
return {
|
|
6003
6008
|
cancel: async () => {
|
|
6004
6009
|
await api.cancelStream({ streamId });
|
package/dist/renderer/index.mjs
CHANGED
|
@@ -5903,7 +5903,7 @@ function createIpcAdapter() {
|
|
|
5903
5903
|
onEvent({ ...event, stream_id: streamId });
|
|
5904
5904
|
});
|
|
5905
5905
|
try {
|
|
5906
|
-
|
|
5906
|
+
const streamPromise = api.stream({
|
|
5907
5907
|
streamId,
|
|
5908
5908
|
messages,
|
|
5909
5909
|
conversationId,
|
|
@@ -5911,6 +5911,11 @@ function createIpcAdapter() {
|
|
|
5911
5911
|
attachedResources: options?.attachedResources,
|
|
5912
5912
|
sessionResources: options?.sessionResources
|
|
5913
5913
|
});
|
|
5914
|
+
void streamPromise.catch((e) => {
|
|
5915
|
+
streamCallbacks.delete(streamId);
|
|
5916
|
+
const errorMessage = e instanceof Error ? e.message : "Stream error";
|
|
5917
|
+
onEvent({ type: "error", error: errorMessage, stream_id: streamId });
|
|
5918
|
+
});
|
|
5914
5919
|
return {
|
|
5915
5920
|
cancel: async () => {
|
|
5916
5921
|
await api.cancelStream({ streamId });
|