@butlerbot/sdk 0.0.11 → 0.0.12
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.
|
@@ -176,11 +176,13 @@ class Conversation {
|
|
|
176
176
|
if (!this.convoId)
|
|
177
177
|
throw new Error("Conversation ID is not set");
|
|
178
178
|
const url = (0, url_formatter_1.formatURL)(this.endpoints.progress, { chatId: this.convoId }, { apiKey: this.apiKey, debug: this.debug });
|
|
179
|
-
const response = yield fetch(url
|
|
179
|
+
const response = yield fetch(url);
|
|
180
180
|
if (!response.ok) {
|
|
181
181
|
const errorText = yield response.text();
|
|
182
182
|
throw new Error(`Failed to fetch conversation progress: ${response.status} ${response.statusText} - ${errorText}`);
|
|
183
183
|
}
|
|
184
|
+
if (response.status === 204)
|
|
185
|
+
return []; // No content, return empty array
|
|
184
186
|
const data = yield response.json();
|
|
185
187
|
return data.events;
|
|
186
188
|
});
|