@butlerbot/sdk 0.0.1-alpha3 → 0.0.1-alpha4
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.
|
@@ -42,6 +42,9 @@ class Conversation {
|
|
|
42
42
|
const sse = new eventsource_1.EventSource(url);
|
|
43
43
|
sse.addEventListener("message", (event) => {
|
|
44
44
|
const data = JSON.parse(event.data);
|
|
45
|
+
const convoId = data.success ? data.data.convoId : undefined;
|
|
46
|
+
if (convoId)
|
|
47
|
+
this.convoId = convoId; // update convo id from response
|
|
45
48
|
cb(data);
|
|
46
49
|
if (data.data.quitStream)
|
|
47
50
|
sse.close();
|
|
@@ -22,6 +22,8 @@ export type RequestSucessResponse = {
|
|
|
22
22
|
data: {
|
|
23
23
|
/** The AI's response */
|
|
24
24
|
response: AIResponse;
|
|
25
|
+
/** The convoId, passed in most responses */
|
|
26
|
+
convoId?: string;
|
|
25
27
|
} & RequestBaseResponsePayload;
|
|
26
28
|
};
|
|
27
29
|
export type RequestResponse = RequestFailResponse | RequestSucessResponse;
|