@decartai/sdk 0.0.36 → 0.0.37

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.
@@ -54,7 +54,7 @@ type RealTimeClient = {
54
54
  on: <K extends keyof Events>(event: K, listener: (data: Events[K]) => void) => void;
55
55
  off: <K extends keyof Events>(event: K, listener: (data: Events[K]) => void) => void;
56
56
  sessionId: string;
57
- setImage: (image: Blob | File | string) => Promise<void>;
57
+ setImage: (image: Blob | File | string | null) => Promise<void>;
58
58
  playAudio?: (audio: Blob | File | ArrayBuffer) => Promise<void>;
59
59
  };
60
60
  //#endregion
@@ -100,6 +100,7 @@ const createRealTimeClient = (opts) => {
100
100
  off: eventEmitter.off,
101
101
  sessionId,
102
102
  setImage: async (image) => {
103
+ if (image === null) return webrtcManager.setImage(null);
103
104
  let imageBase64;
104
105
  if (typeof image === "string") {
105
106
  let url = null;
@@ -132,6 +132,7 @@ var WebRTCConnection = class {
132
132
  /**
133
133
  * Send an image to the server (e.g., as a reference for inference).
134
134
  * Can be called after connection is established.
135
+ * Pass null to clear the reference image.
135
136
  */
136
137
  async setImageBase64(imageBase64) {
137
138
  return new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decartai/sdk",
3
- "version": "0.0.36",
3
+ "version": "0.0.37",
4
4
  "description": "Decart's JavaScript SDK",
5
5
  "type": "module",
6
6
  "license": "MIT",