@butlerbot/sdk 0.0.12 → 0.0.13
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.
|
@@ -102,8 +102,11 @@ export declare class Conversation {
|
|
|
102
102
|
fetchState(): Promise<ConversationStateResponse>;
|
|
103
103
|
/** Fetches the conversation progress stream from the server */
|
|
104
104
|
fetchProgressStream(cb: (chunk: RequestResponse) => any): EventSource;
|
|
105
|
-
/**
|
|
106
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Fetches the conversation progress from the server
|
|
107
|
+
* Returns undefined if no active turn progress
|
|
108
|
+
*/
|
|
109
|
+
fetchProgress(): Promise<RequestResponse[] | undefined>;
|
|
107
110
|
/** Sends a message into the conversation */
|
|
108
111
|
send(message: string, cb: (chunk: RequestResponse) => any, options?: DialogueRequestOptions): EventSource;
|
|
109
112
|
}
|
|
@@ -170,7 +170,10 @@ class Conversation {
|
|
|
170
170
|
const url = (0, url_formatter_1.formatURL)(this.endpoints.progressStream, { chatId: this.convoId }, { apiKey: this.apiKey, debug: this.debug });
|
|
171
171
|
return this.handleSSE(url, cb);
|
|
172
172
|
}
|
|
173
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* Fetches the conversation progress from the server
|
|
175
|
+
* Returns undefined if no active turn progress
|
|
176
|
+
*/
|
|
174
177
|
fetchProgress() {
|
|
175
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
176
179
|
if (!this.convoId)
|
|
@@ -182,7 +185,7 @@ class Conversation {
|
|
|
182
185
|
throw new Error(`Failed to fetch conversation progress: ${response.status} ${response.statusText} - ${errorText}`);
|
|
183
186
|
}
|
|
184
187
|
if (response.status === 204)
|
|
185
|
-
return
|
|
188
|
+
return undefined; // No content
|
|
186
189
|
const data = yield response.json();
|
|
187
190
|
return data.events;
|
|
188
191
|
});
|