@butlerbot/sdk 0.0.10-alpha → 0.0.10-alpha.0

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.
@@ -1,3 +1,4 @@
1
+ import { EventSource } from "eventsource";
1
2
  import { CONFIG } from "../config";
2
3
  import { RequestResponseV4 } from "../types/type_registry";
3
4
  import { ConversationStateResponse } from "../types/state/convo_state_response";
@@ -94,8 +95,8 @@ export declare class Conversation {
94
95
  /** Fetches the conversation state from the server, including message history and metadata */
95
96
  fetchState(): Promise<ConversationStateResponse>;
96
97
  /** Fetches the conversation stream from the server */
97
- fetchStream(cb: (chunk: RequestResponse) => any): void;
98
+ fetchStream(cb: (chunk: RequestResponse) => any): EventSource;
98
99
  /** Sends a message into the conversation */
99
- send(message: string, cb: (chunk: RequestResponse) => any, options?: DialogueRequestOptions): void;
100
+ send(message: string, cb: (chunk: RequestResponse) => any, options?: DialogueRequestOptions): EventSource;
100
101
  }
101
102
  export {};
@@ -135,6 +135,7 @@ class Conversation {
135
135
  if (this.debug)
136
136
  console.warn(`[Stream Error: ${url}]`, event);
137
137
  });
138
+ return sse;
138
139
  }
139
140
  // GETTERS
140
141
  /** Fetches the conversation state from the server, including message history and metadata */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@butlerbot/sdk",
3
- "version": "0.0.10-alpha",
3
+ "version": "0.0.10-alpha.0",
4
4
  "description": "The official ButlerBot SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",