@butlerbot/sdk 0.0.6-alpha.3 → 0.0.6-alpha.5
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/config.js
CHANGED
|
@@ -144,8 +144,11 @@ class Conversation {
|
|
|
144
144
|
/** Sends a message into the conversation */
|
|
145
145
|
send(message, cb, options) {
|
|
146
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
-
const
|
|
148
|
-
)
|
|
147
|
+
const payload = Object.assign(Object.assign({ message }, this.options), options // overwrite convos for this call
|
|
148
|
+
);
|
|
149
|
+
if (this.convoId)
|
|
150
|
+
payload.chatId = this.convoId;
|
|
151
|
+
const url = this.formatURL(this.endpoints.conversation, payload);
|
|
149
152
|
const sse = new eventsource_1.EventSource(url);
|
|
150
153
|
sse.addEventListener("message", (event) => {
|
|
151
154
|
const data = JSON.parse(event.data);
|
|
@@ -173,12 +173,16 @@ export type MessagePayload = {
|
|
|
173
173
|
message: string;
|
|
174
174
|
/** The UUID of this message */
|
|
175
175
|
messageId: string;
|
|
176
|
+
/** Whether this message chunk is the final one */
|
|
177
|
+
completed: boolean;
|
|
176
178
|
};
|
|
177
179
|
export type ReasoningPayload = {
|
|
178
180
|
/** The reasoning content */
|
|
179
181
|
reasoning: string;
|
|
180
182
|
/** The UUID of this reasoning */
|
|
181
183
|
reasoningId: string;
|
|
184
|
+
/** Whether this reasoning chunk is the final one */
|
|
185
|
+
completed: boolean;
|
|
182
186
|
};
|
|
183
187
|
export type FilePayload = {
|
|
184
188
|
/** The file URL */
|
|
@@ -221,19 +225,14 @@ export type BaseResponseMetadata = {
|
|
|
221
225
|
};
|
|
222
226
|
export type MessageEvent = {
|
|
223
227
|
type: "message";
|
|
224
|
-
payload: MessagePayload
|
|
225
|
-
messageId: string;
|
|
226
|
-
completed: boolean;
|
|
227
|
-
};
|
|
228
|
+
payload: MessagePayload;
|
|
228
229
|
metadata: BaseResponseMetadata & {
|
|
229
230
|
display?: DisplayEntity;
|
|
230
231
|
};
|
|
231
232
|
};
|
|
232
233
|
export type ReasoningEvent = {
|
|
233
234
|
type: "reasoning";
|
|
234
|
-
payload: ReasoningPayload
|
|
235
|
-
completed: boolean;
|
|
236
|
-
};
|
|
235
|
+
payload: ReasoningPayload;
|
|
237
236
|
metadata: BaseResponseMetadata;
|
|
238
237
|
};
|
|
239
238
|
export type FileEvent = {
|