@d-id/client-sdk 1.0.6 → 1.0.8

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,26 +1,25 @@
1
- import { ExtendedTextToSpeechProviders, StreamTextToSpeechProviders } from '../../tts';
1
+ import { StreamTextToSpeechProviders } from '../../tts';
2
+ import { Knowledge } from './knowledge';
2
3
  import { LLM } from './llm';
3
4
  import { Presenter } from './presenter';
4
5
  export interface Agent {
5
6
  id: string;
6
- tags?: string[];
7
- owner_id: string;
8
- use_case?: string;
9
- created_at: string;
10
- modified_at: string;
11
- knowledge_id: string;
12
- voice_provider: ExtendedTextToSpeechProviders;
7
+ username?: string;
8
+ presenter: Presenter;
13
9
  llm?: LLM;
14
- presenter?: Presenter;
10
+ knowledge?: Knowledge;
11
+ use_case?: string;
12
+ tags?: string[];
15
13
  access?: 'private' | 'pending-public' | 'unlisted' | 'rejected' | 'public';
14
+ preview_name?: string;
16
15
  preview_description?: string;
17
16
  preview_thumbnail?: string;
18
- preview_name: string;
19
17
  }
20
18
  export type AgentPayload = Omit<Agent, 'type' | 'created_at' | 'modified_at' | 'id' | 'owner_id' | 'idle_video_url'>;
21
19
  export interface IChatPayload {
22
20
  voice: StreamTextToSpeechProviders;
21
+ message: string;
23
22
  streamId: string;
24
23
  sessionId: string;
25
- userQuery: string;
24
+ knowledgeId: string;
26
25
  }
@@ -0,0 +1,10 @@
1
+ export type KnowledgeProvider = 'pinecone' | 'redis';
2
+ export interface KnowledgeEmbedder {
3
+ provider: string;
4
+ model: string;
5
+ }
6
+ export interface Knowledge {
7
+ id: string;
8
+ provider: KnowledgeProvider;
9
+ embedder?: KnowledgeEmbedder;
10
+ }
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  function k(r) {
2
2
  return r.type === "bearer" ? "Bearer " + r.token : r.type === "basic" ? "Basic " + btoa(`${r.username}:${r.password}`) : "Client-Key " + r.clientKey;
3
3
  }
4
- function m(r, o = "https://api.d-id.com") {
4
+ function m(r, a = "https://api.d-id.com") {
5
5
  const n = async (e, t) => {
6
- const s = await fetch(o + (e != null && e.startsWith("/") ? e : `/${e}`), {
6
+ const i = await fetch(a + (e != null && e.startsWith("/") ? e : `/${e}`), {
7
7
  ...t,
8
8
  headers: {
9
9
  ...t == null ? void 0 : t.headers,
@@ -11,15 +11,15 @@ function m(r, o = "https://api.d-id.com") {
11
11
  "Content-Type": "application/json"
12
12
  }
13
13
  });
14
- if (!s.ok) {
15
- let c = await s.text().catch(() => "Failed to fetch");
14
+ if (!i.ok) {
15
+ let c = await i.text().catch(() => "Failed to fetch");
16
16
  try {
17
- c = JSON.parse(c), c.description && (c = c.description);
17
+ c = JSON.parse(c), c.description && (c = c.description, typeof c.description == "object" && (c = JSON.stringify(c.description)));
18
18
  } catch {
19
19
  }
20
20
  throw new Error(c);
21
21
  }
22
- return s.json();
22
+ return i.json();
23
23
  };
24
24
  return {
25
25
  get(e, t) {
@@ -28,31 +28,31 @@ function m(r, o = "https://api.d-id.com") {
28
28
  method: "GET"
29
29
  });
30
30
  },
31
- post(e, t, s) {
31
+ post(e, t, i) {
32
32
  return n(e, {
33
- ...s,
33
+ ...i,
34
34
  body: JSON.stringify(t),
35
35
  method: "POST"
36
36
  });
37
37
  },
38
- delete(e, t, s) {
38
+ delete(e, t, i) {
39
39
  return n(e, {
40
- ...s,
40
+ ...i,
41
41
  body: JSON.stringify(t),
42
42
  method: "DELETE"
43
43
  });
44
44
  },
45
- patch(e, t, s) {
45
+ patch(e, t, i) {
46
46
  return n(e, {
47
- ...s,
47
+ ...i,
48
48
  body: JSON.stringify(t),
49
49
  method: "PATCH"
50
50
  });
51
51
  }
52
52
  };
53
53
  }
54
- function K(r, o = "https://api.d-id.com") {
55
- const n = m(r, `${o}/knowledge`);
54
+ function D(r, a = "https://api.d-id.com") {
55
+ const n = m(r, `${a}/knowledge`);
56
56
  return {
57
57
  createKnowledge(e) {
58
58
  return n.post("/", e);
@@ -88,8 +88,8 @@ function K(r, o = "https://api.d-id.com") {
88
88
  }
89
89
  };
90
90
  }
91
- function O(r, o = "https://api.d-id.com") {
92
- const n = m(r, `${o}/agents`);
91
+ function K(r, a = "https://api.d-id.com") {
92
+ const n = m(r, `${a}/agents`);
93
93
  return {
94
94
  create(e) {
95
95
  return n.post("/", e);
@@ -111,8 +111,8 @@ function O(r, o = "https://api.d-id.com") {
111
111
  }
112
112
  };
113
113
  }
114
- function A(r, o) {
115
- const n = m(r, o);
114
+ function A(r, a) {
115
+ const n = m(r, a);
116
116
  return {
117
117
  createStream(e) {
118
118
  return n.post("/clips/streams", {
@@ -121,22 +121,22 @@ function A(r, o) {
121
121
  compatibility_mode: e.compatibility_mode
122
122
  });
123
123
  },
124
- startConnection(e, t, s) {
124
+ startConnection(e, t, i) {
125
125
  return n.post(`/clips/streams/${e}/sdp`, {
126
- session_id: s,
126
+ session_id: i,
127
127
  answer: t
128
128
  });
129
129
  },
130
- addIceCandidate(e, t, s) {
130
+ addIceCandidate(e, t, i) {
131
131
  return n.post(`/clips/streams/${e}/ice`, {
132
- session_id: s,
132
+ session_id: i,
133
133
  ...t
134
134
  });
135
135
  },
136
- sendStreamRequest(e, t, s) {
136
+ sendStreamRequest(e, t, i) {
137
137
  return n.post(`/clips/streams/${e}`, {
138
138
  session_id: t,
139
- ...s
139
+ ...i
140
140
  });
141
141
  },
142
142
  close(e, t) {
@@ -146,8 +146,8 @@ function A(r, o) {
146
146
  }
147
147
  };
148
148
  }
149
- function T(r, o) {
150
- const n = m(r, o);
149
+ function O(r, a) {
150
+ const n = m(r, a);
151
151
  return {
152
152
  createStream(e) {
153
153
  return n.post("/talks/streams", {
@@ -157,22 +157,22 @@ function T(r, o) {
157
157
  config: e.config
158
158
  });
159
159
  },
160
- startConnection(e, t, s) {
160
+ startConnection(e, t, i) {
161
161
  return n.post(`/talks/streams/${e}/sdp`, {
162
- session_id: s,
162
+ session_id: i,
163
163
  answer: t
164
164
  });
165
165
  },
166
- addIceCandidate(e, t, s) {
166
+ addIceCandidate(e, t, i) {
167
167
  return n.post(`/talks/streams/${e}/ice`, {
168
- session_id: s,
168
+ session_id: i,
169
169
  ...t
170
170
  });
171
171
  },
172
- sendStreamRequest(e, t, s) {
172
+ sendStreamRequest(e, t, i) {
173
173
  return n.post(`/talks/streams/${e}`, {
174
174
  session_id: t,
175
- ...s
175
+ ...i
176
176
  });
177
177
  },
178
178
  close(e, t) {
@@ -182,61 +182,61 @@ function T(r, o) {
182
182
  }
183
183
  };
184
184
  }
185
- var p = /* @__PURE__ */ ((r) => (r.Idle = "IDLE", r.Streaming = "STREAMING", r))(p || {}), f = /* @__PURE__ */ ((r) => (r.Clip = "clip", r.Talk = "talk", r))(f || {});
185
+ var p = /* @__PURE__ */ ((r) => (r.Idle = "IDLE", r.Streaming = "STREAMING", r))(p || {}), w = /* @__PURE__ */ ((r) => (r.Clip = "clip", r.Talk = "talk", r))(w || {});
186
186
  let $ = !1;
187
- const d = (r, o) => $ && console.log(r, o), D = (window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection).bind(window);
187
+ const d = (r, a) => $ && console.log(r, a), T = (window.RTCPeerConnection || window.webkitRTCPeerConnection || window.mozRTCPeerConnection).bind(window);
188
188
  async function R(r, {
189
- debug: o = !1,
189
+ debug: a = !1,
190
190
  callbacks: n,
191
191
  auth: e,
192
192
  baseURL: t = "https://api.d-id.com"
193
193
  }) {
194
- $ = o;
195
- let s = null;
194
+ $ = a;
195
+ let i = null;
196
196
  const {
197
197
  startConnection: c,
198
198
  sendStreamRequest: g,
199
199
  close: h,
200
200
  createStream: S,
201
- addIceCandidate: _
202
- } = r.videoType === f.Clip ? A(e, t) : T(e, t), {
201
+ addIceCandidate: y
202
+ } = r.videoType === w.Clip ? A(e, t) : O(e, t), {
203
203
  id: u,
204
- offer: y,
204
+ offer: _,
205
205
  ice_servers: I,
206
206
  session_id: l
207
- } = await S(r), a = new D({
207
+ } = await S(r), o = new T({
208
208
  iceServers: I
209
- }), C = a.createDataChannel("JanusDataChannel");
209
+ }), C = o.createDataChannel("JanusDataChannel");
210
210
  if (!l)
211
211
  throw new Error("Could not create session_id");
212
- a.onicecandidate = (i) => {
213
- d("peerConnection.onicecandidate", i), i.candidate && i.candidate.sdpMid && i.candidate.sdpMLineIndex !== null && _(u, {
214
- candidate: i.candidate.candidate,
215
- sdpMid: i.candidate.sdpMid,
216
- sdpMLineIndex: i.candidate.sdpMLineIndex
212
+ o.onicecandidate = (s) => {
213
+ d("peerConnection.onicecandidate", s), s.candidate && s.candidate.sdpMid && s.candidate.sdpMLineIndex !== null && y(u, {
214
+ candidate: s.candidate.candidate,
215
+ sdpMid: s.candidate.sdpMid,
216
+ sdpMLineIndex: s.candidate.sdpMLineIndex
217
217
  }, l);
218
- }, a.oniceconnectionstatechange = () => {
219
- d("peerConnection.oniceconnectionstatechange => " + a.iceConnectionState), n.onConnectionStateChange(a.iceConnectionState);
220
- }, a.ontrack = (i) => {
221
- d("peerConnection.ontrack", i), s = i.streams[0], n.onSrcObjectReady(s);
222
- }, C.onmessage = (i) => {
223
- C.readyState === "open" && n.onStreamingStateChange(i.data === "stream/done" ? p.Idle : p.Streaming);
224
- }, await a.setRemoteDescription(y), d("set remote description OK");
225
- const w = await a.createAnswer();
226
- return d("create answer OK"), await a.setLocalDescription(w), d("set local description OK"), await c(u, w, l), d("start connection OK"), {
227
- speak(i) {
228
- return g(u, l, i);
218
+ }, o.oniceconnectionstatechange = () => {
219
+ d("peerConnection.oniceconnectionstatechange => " + o.iceConnectionState), n.onConnectionStateChange(o.iceConnectionState);
220
+ }, o.ontrack = (s) => {
221
+ d("peerConnection.ontrack", s), i = s.streams[0], n.onSrcObjectReady(i);
222
+ }, C.onmessage = (s) => {
223
+ C.readyState === "open" && n.onStreamingStateChange(s.data === "stream/done" ? p.Idle : p.Streaming);
224
+ }, await o.setRemoteDescription(_), d("set remote description OK");
225
+ const f = await o.createAnswer();
226
+ return d("create answer OK"), await o.setLocalDescription(f), d("set local description OK"), await c(u, f, l), d("start connection OK"), {
227
+ speak(s) {
228
+ return g(u, l, s);
229
229
  },
230
230
  async terminate() {
231
- u && (s && (s.getTracks().forEach((i) => i.stop()), s = null), a && (a.close(), a.oniceconnectionstatechange = null, a.onnegotiationneeded = null, a.onicecandidate = null, a.ontrack = null), await h(u, l), n.onConnectionStateChange("closed"), n.onStreamingStateChange(p.Idle));
231
+ u && (i && (i.getTracks().forEach((s) => s.stop()), i = null), o && (o.close(), o.oniceconnectionstatechange = null, o.onnegotiationneeded = null, o.onicecandidate = null, o.ontrack = null), await h(u, l), n.onConnectionStateChange("closed"), n.onStreamingStateChange(p.Idle));
232
232
  },
233
233
  sessionId: l,
234
234
  streamId: u
235
235
  };
236
236
  }
237
237
  export {
238
- O as createAgentsApi,
238
+ K as createAgentsApi,
239
239
  m as createClient,
240
- K as createKnowledgeApi,
240
+ D as createKnowledgeApi,
241
241
  R as createStreamingManager
242
242
  };
@@ -1 +1 @@
1
- (function(c,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(c=typeof globalThis<"u"?globalThis:c||self,m(c.index={}))})(this,function(c){"use strict";function m(r){return r.type==="bearer"?"Bearer "+r.token:r.type==="basic"?"Basic "+btoa(`${r.username}:${r.password}`):"Client-Key "+r.clientKey}function g(r,o="https://api.d-id.com"){const n=async(e,t)=>{const i=await fetch(o+(e!=null&&e.startsWith("/")?e:`/${e}`),{...t,headers:{...t==null?void 0:t.headers,Authorization:m(r),"Content-Type":"application/json"}});if(!i.ok){let d=await i.text().catch(()=>"Failed to fetch");try{d=JSON.parse(d),d.description&&(d=d.description)}catch{}throw new Error(d)}return i.json()};return{get(e,t){return n(e,{...t,method:"GET"})},post(e,t,i){return n(e,{...i,body:JSON.stringify(t),method:"POST"})},delete(e,t,i){return n(e,{...i,body:JSON.stringify(t),method:"DELETE"})},patch(e,t,i){return n(e,{...i,body:JSON.stringify(t),method:"PATCH"})}}}function y(r,o="https://api.d-id.com"){const n=g(r,`${o}/knowledge`);return{createKnowledge(e){return n.post("/",e)},getKnowledgeBase(){return n.get("/")},getKnowledge(e){return n.get(`/${e}`)},deleteKnowledge(e){return n.delete(`/${e}`)},createDocument(e,t){return n.post(`/${e}/documents`,t)},deleteDocument(e,t){return n.delete(`/${e}/documents/${t}`)},getDocuments(e){return n.get(`/${e}/documents`)},getDocument(e,t){return n.get(`/${e}/documents/${t}`)},getRecords(e,t){return n.get(`/${e}/documents/${t}/records`)},query(e,t){return n.post(`/${e}/query`,{query:t})}}}function _(r,o="https://api.d-id.com"){const n=g(r,`${o}/agents`);return{create(e){return n.post("/",e)},getAgents(e){return n.get(`/${e?`?tag=${e}`:""}`)},getById(e){return n.get(`/${e}`)},delete(e){return n.delete(`/${e}`)},update(e,t){return n.patch(`/${e}`,t)},chat(e,t){return n.post(`/${e}/chat`,t)}}}function A(r,o){const n=g(r,o);return{createStream(e){return n.post("/clips/streams",{driver_id:e.driver_id,presenter_id:e.presenter_id,compatibility_mode:e.compatibility_mode})},startConnection(e,t,i){return n.post(`/clips/streams/${e}/sdp`,{session_id:i,answer:t})},addIceCandidate(e,t,i){return n.post(`/clips/streams/${e}/ice`,{session_id:i,...t})},sendStreamRequest(e,t,i){return n.post(`/clips/streams/${e}`,{session_id:t,...i})},close(e,t){return n.delete(`/clips/streams/${e}`,{session_id:t})}}}function I(r,o){const n=g(r,o);return{createStream(e){return n.post("/talks/streams",{source_url:e.source_url,driver_url:e.driver_url,face:e.face,config:e.config})},startConnection(e,t,i){return n.post(`/talks/streams/${e}/sdp`,{session_id:i,answer:t})},addIceCandidate(e,t,i){return n.post(`/talks/streams/${e}/ice`,{session_id:i,...t})},sendStreamRequest(e,t,i){return n.post(`/talks/streams/${e}`,{session_id:t,...i})},close(e,t){return n.delete(`/talks/streams/${e}`,{session_id:t})}}}var f=(r=>(r.Idle="IDLE",r.Streaming="STREAMING",r))(f||{}),C=(r=>(r.Clip="clip",r.Talk="talk",r))(C||{});let w=!1;const u=(r,o)=>w&&console.log(r,o),T=(window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection).bind(window);async function k(r,{debug:o=!1,callbacks:n,auth:e,baseURL:t="https://api.d-id.com"}){w=o;let i=null;const{startConnection:d,sendStreamRequest:h,close:K,createStream:O,addIceCandidate:b}=r.videoType===C.Clip?A(e,t):I(e,t),{id:l,offer:D,ice_servers:M,session_id:p}=await O(r),a=new T({iceServers:M}),$=a.createDataChannel("JanusDataChannel");if(!p)throw new Error("Could not create session_id");a.onicecandidate=s=>{u("peerConnection.onicecandidate",s),s.candidate&&s.candidate.sdpMid&&s.candidate.sdpMLineIndex!==null&&b(l,{candidate:s.candidate.candidate,sdpMid:s.candidate.sdpMid,sdpMLineIndex:s.candidate.sdpMLineIndex},p)},a.oniceconnectionstatechange=()=>{u("peerConnection.oniceconnectionstatechange => "+a.iceConnectionState),n.onConnectionStateChange(a.iceConnectionState)},a.ontrack=s=>{u("peerConnection.ontrack",s),i=s.streams[0],n.onSrcObjectReady(i)},$.onmessage=s=>{$.readyState==="open"&&n.onStreamingStateChange(s.data==="stream/done"?f.Idle:f.Streaming)},await a.setRemoteDescription(D),u("set remote description OK");const S=await a.createAnswer();return u("create answer OK"),await a.setLocalDescription(S),u("set local description OK"),await d(l,S,p),u("start connection OK"),{speak(s){return h(l,p,s)},async terminate(){l&&(i&&(i.getTracks().forEach(s=>s.stop()),i=null),a&&(a.close(),a.oniceconnectionstatechange=null,a.onnegotiationneeded=null,a.onicecandidate=null,a.ontrack=null),await K(l,p),n.onConnectionStateChange("closed"),n.onStreamingStateChange(f.Idle))},sessionId:p,streamId:l}}c.createAgentsApi=_,c.createClient=g,c.createKnowledgeApi=y,c.createStreamingManager=k,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(d,m){typeof exports=="object"&&typeof module<"u"?m(exports):typeof define=="function"&&define.amd?define(["exports"],m):(d=typeof globalThis<"u"?globalThis:d||self,m(d.index={}))})(this,function(d){"use strict";function m(r){return r.type==="bearer"?"Bearer "+r.token:r.type==="basic"?"Basic "+btoa(`${r.username}:${r.password}`):"Client-Key "+r.clientKey}function g(r,a="https://api.d-id.com"){const n=async(e,t)=>{const i=await fetch(a+(e!=null&&e.startsWith("/")?e:`/${e}`),{...t,headers:{...t==null?void 0:t.headers,Authorization:m(r),"Content-Type":"application/json"}});if(!i.ok){let c=await i.text().catch(()=>"Failed to fetch");try{c=JSON.parse(c),c.description&&(c=c.description,typeof c.description=="object"&&(c=JSON.stringify(c.description)))}catch{}throw new Error(c)}return i.json()};return{get(e,t){return n(e,{...t,method:"GET"})},post(e,t,i){return n(e,{...i,body:JSON.stringify(t),method:"POST"})},delete(e,t,i){return n(e,{...i,body:JSON.stringify(t),method:"DELETE"})},patch(e,t,i){return n(e,{...i,body:JSON.stringify(t),method:"PATCH"})}}}function y(r,a="https://api.d-id.com"){const n=g(r,`${a}/knowledge`);return{createKnowledge(e){return n.post("/",e)},getKnowledgeBase(){return n.get("/")},getKnowledge(e){return n.get(`/${e}`)},deleteKnowledge(e){return n.delete(`/${e}`)},createDocument(e,t){return n.post(`/${e}/documents`,t)},deleteDocument(e,t){return n.delete(`/${e}/documents/${t}`)},getDocuments(e){return n.get(`/${e}/documents`)},getDocument(e,t){return n.get(`/${e}/documents/${t}`)},getRecords(e,t){return n.get(`/${e}/documents/${t}/records`)},query(e,t){return n.post(`/${e}/query`,{query:t})}}}function _(r,a="https://api.d-id.com"){const n=g(r,`${a}/agents`);return{create(e){return n.post("/",e)},getAgents(e){return n.get(`/${e?`?tag=${e}`:""}`)},getById(e){return n.get(`/${e}`)},delete(e){return n.delete(`/${e}`)},update(e,t){return n.patch(`/${e}`,t)},chat(e,t){return n.post(`/${e}/chat`,t)}}}function A(r,a){const n=g(r,a);return{createStream(e){return n.post("/clips/streams",{driver_id:e.driver_id,presenter_id:e.presenter_id,compatibility_mode:e.compatibility_mode})},startConnection(e,t,i){return n.post(`/clips/streams/${e}/sdp`,{session_id:i,answer:t})},addIceCandidate(e,t,i){return n.post(`/clips/streams/${e}/ice`,{session_id:i,...t})},sendStreamRequest(e,t,i){return n.post(`/clips/streams/${e}`,{session_id:t,...i})},close(e,t){return n.delete(`/clips/streams/${e}`,{session_id:t})}}}function I(r,a){const n=g(r,a);return{createStream(e){return n.post("/talks/streams",{source_url:e.source_url,driver_url:e.driver_url,face:e.face,config:e.config})},startConnection(e,t,i){return n.post(`/talks/streams/${e}/sdp`,{session_id:i,answer:t})},addIceCandidate(e,t,i){return n.post(`/talks/streams/${e}/ice`,{session_id:i,...t})},sendStreamRequest(e,t,i){return n.post(`/talks/streams/${e}`,{session_id:t,...i})},close(e,t){return n.delete(`/talks/streams/${e}`,{session_id:t})}}}var f=(r=>(r.Idle="IDLE",r.Streaming="STREAMING",r))(f||{}),C=(r=>(r.Clip="clip",r.Talk="talk",r))(C||{});let w=!1;const u=(r,a)=>w&&console.log(r,a),T=(window.RTCPeerConnection||window.webkitRTCPeerConnection||window.mozRTCPeerConnection).bind(window);async function O(r,{debug:a=!1,callbacks:n,auth:e,baseURL:t="https://api.d-id.com"}){w=a;let i=null;const{startConnection:c,sendStreamRequest:h,close:b,createStream:k,addIceCandidate:K}=r.videoType===C.Clip?A(e,t):I(e,t),{id:l,offer:D,ice_servers:M,session_id:p}=await k(r),o=new T({iceServers:M}),$=o.createDataChannel("JanusDataChannel");if(!p)throw new Error("Could not create session_id");o.onicecandidate=s=>{u("peerConnection.onicecandidate",s),s.candidate&&s.candidate.sdpMid&&s.candidate.sdpMLineIndex!==null&&K(l,{candidate:s.candidate.candidate,sdpMid:s.candidate.sdpMid,sdpMLineIndex:s.candidate.sdpMLineIndex},p)},o.oniceconnectionstatechange=()=>{u("peerConnection.oniceconnectionstatechange => "+o.iceConnectionState),n.onConnectionStateChange(o.iceConnectionState)},o.ontrack=s=>{u("peerConnection.ontrack",s),i=s.streams[0],n.onSrcObjectReady(i)},$.onmessage=s=>{$.readyState==="open"&&n.onStreamingStateChange(s.data==="stream/done"?f.Idle:f.Streaming)},await o.setRemoteDescription(D),u("set remote description OK");const S=await o.createAnswer();return u("create answer OK"),await o.setLocalDescription(S),u("set local description OK"),await c(l,S,p),u("start connection OK"),{speak(s){return h(l,p,s)},async terminate(){l&&(i&&(i.getTracks().forEach(s=>s.stop()),i=null),o&&(o.close(),o.oniceconnectionstatechange=null,o.onnegotiationneeded=null,o.onicecandidate=null,o.ontrack=null),await b(l,p),n.onConnectionStateChange("closed"),n.onStreamingStateChange(f.Idle))},sessionId:p,streamId:l}}d.createAgentsApi=_,d.createClient=g,d.createKnowledgeApi=y,d.createStreamingManager=O,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@d-id/client-sdk",
3
3
  "private": false,
4
- "version": "1.0.6",
4
+ "version": "1.0.8",
5
5
  "type": "module",
6
6
  "description": "d-id client sdk",
7
7
  "repository": {