@d-id/client-sdk 3.0.0-staging.419 → 3.0.0-staging.420
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/README.md +4 -4
- package/dist/{index-D-HEM_62.js → index-BrPt8AuN.js} +5 -5
- package/dist/index-BrPt8AuN.js.map +1 -0
- package/dist/index.d.ts +172 -199
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{livekit-manager-BY7TXE80.js → livekit-manager-me8pKdKj.js} +2 -2
- package/dist/{livekit-manager-BY7TXE80.js.map → livekit-manager-me8pKdKj.js.map} +1 -1
- package/package.json +1 -1
- package/dist/index-D-HEM_62.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
|
-
The D-ID Agents SDK embeds an agent you built in D-ID Studio
|
|
9
|
+
The D-ID Agents SDK embeds an agent you built in D-ID Studio or with the Agents API into a web application. Create an `AgentManager` for the agent, `connect()`, then `chat()` to have the agent answer with its own LLM or `speak()` to have it say exactly what you give it. The SDK opens the video session (WebRTC, or LiveKit for Expressive agents), keeps the chat transcript and retries a failed connection.
|
|
10
10
|
|
|
11
11
|
**Please note:** This SDK is designed for front-end development only. The creation of Agents and Knowledge bases should be handled through the [Agents API](https://docs.d-id.com/docs/agent-quickstart) or directly within the [D-ID Studio](https://studio.d-id.com/agents).
|
|
12
12
|
|
|
@@ -30,7 +30,7 @@ const agentManager = await sdk.createAgentManager('agt_fumf1234', {
|
|
|
30
30
|
auth: { type: 'key', clientKey: 'YOUR_CLIENT_KEY' },
|
|
31
31
|
callbacks: {
|
|
32
32
|
onSrcObjectReady: stream => (videoElement.srcObject = stream),
|
|
33
|
-
onNewMessage: messages => console.log(messages[messages.length - 1]
|
|
33
|
+
onNewMessage: messages => console.log(messages[messages.length - 1]?.content),
|
|
34
34
|
},
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -49,9 +49,9 @@ The full API reference — every method, callback, option and type, generated fr
|
|
|
49
49
|
The guides:
|
|
50
50
|
|
|
51
51
|
- [Getting started](https://sdk.d-id.com/documents/Getting_started.html) — credentials, the first connection, `chat()` and `speak()`, disconnecting.
|
|
52
|
-
- [Chat modes](https://sdk.d-id.com/documents/Chat_modes.html) —
|
|
52
|
+
- [Chat modes](https://sdk.d-id.com/documents/Chat_modes.html) — conversation, scripted speech or chat off, and what each one creates on the wire.
|
|
53
53
|
- [Client tools](https://sdk.d-id.com/documents/Client_tools.html) — running your own functions when the agent's LLM calls them.
|
|
54
|
-
- [Expressive
|
|
54
|
+
- [Expressive agents](https://sdk.d-id.com/documents/Expressive_agents.html) — microphone, camera, speech-to-text, interrupts and data-channel messages.
|
|
55
55
|
- [Handling errors](https://sdk.d-id.com/documents/Handling_errors.html) — which failures reject, which reach `onError`, and what to log.
|
|
56
56
|
- [Migration guide](https://sdk.d-id.com/documents/Migration_guide.html) — every breaking change from 2.x.
|
|
57
57
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var It = Object.defineProperty;
|
|
2
2
|
var Et = (e, t, r) => t in e ? It(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
3
|
var x = (e, t, r) => Et(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
-
var Re = /* @__PURE__ */ ((e) => (e.Chat = "lk.chat", e.Speak = "did.speak", e.Interrupt = "did.interrupt", e.SttLanguage = "did.stt-language", e.Presentation = "did.presentation", e))(Re || {}), L = /* @__PURE__ */ ((e) => (e.Functional = "Functional", e.TextOnly = "TextOnly", e.Maintenance = "Maintenance", e.Playground = "Playground", e.DirectPlayback = "DirectPlayback", e.Off = "Off", e))(L || {}), F = /* @__PURE__ */ ((e) => (e.Embed = "embed", e.Query = "query", e.Partial = "partial", e.Answer = "answer", e.Transcribe = "transcribe", e.Complete = "done", e))(F || {}), pe = /* @__PURE__ */ ((e) => (e.Clip = "clip", e.Talk = "talk", e.Expressive = "expressive", e))(pe || {}), C = /* @__PURE__ */ ((e) => (e.Start = "START", e.Stop = "STOP", e))(C || {}), me = /* @__PURE__ */ ((e) => (e.Strong = "STRONG", e.Weak = "WEAK", e.Unknown = "UNKNOWN", e))(me || {}), ye = /* @__PURE__ */ ((e) => (e.Idle = "IDLE", e.Loading = "LOADING", e.Talking = "TALKING", e.ToolActive = "TOOL_ACTIVE", e))(ye || {}), T = /* @__PURE__ */ ((e) => (e.ChatAnswer = "chat/answer", e.ChatPartial = "chat/partial", e.ChatAudioTranscribed = "chat/audio-transcribed", e.StreamDone = "stream/done", e.StreamStarted = "stream/started", e.StreamFailed = "stream/error", e.StreamReady = "stream/ready", e.StreamInterrupt = "stream/interrupt", e.StreamVideoCreated = "stream-video/started", e.StreamVideoDone = "stream-video/done", e.StreamVideoError = "stream-video/error", e.StreamVideoRejected = "stream-video/rejected", e.ToolCallStarted = "tool-call/started", e.ToolCallDone = "tool-call/done", e.ToolCallError = "tool-call/error", e.TurnStarted = "turn/started", e.TurnEnded = "turn/ended", e))(T || {}), Le = /* @__PURE__ */ ((e) => (e.Started = "tool-call/started", e.Done = "tool-call/done", e.Error = "tool-call/error", e))(Le || {}), Tt = /* @__PURE__ */ ((e) => (e.Presentation = "did.presentation", e))(Tt || {}), I = /* @__PURE__ */ ((e) => (e.New = "new", e.Fail = "fail", e.Connected = "connected", e.Connecting = "connecting", e.Closed = "closed", e.Completed = "completed", e.Disconnecting = "disconnecting", e.Disconnected = "disconnected", e))(I || {}), H = /* @__PURE__ */ ((e) => (e.Legacy = "legacy", e.Fluent = "fluent", e))(H || {}), ge = /* @__PURE__ */ ((e) => (e.Ok = "ok", e.UnknownError = "unknown_error", e.NetworkIssue = "network_issue", e.MessageLimit = "message_limit", e.TimeLimit = "time_limit", e.Inactivity = "inactivity", e.EndedByAgent = "ended_by_agent", e))(ge || {}), Oe = /* @__PURE__ */ ((e) => (e.Livekit = "livekit", e))(Oe || {}), kt = /* @__PURE__ */ ((e) => (e.Amazon = "amazon", e.AzureOpenAi = "azure-openai", e.Microsoft = "microsoft", e.Elevenlabs = "elevenlabs", e))(kt || {}), _t = /* @__PURE__ */ ((e) => (e.Public = "public", e.Premium = "premium", e.Private = "private", e))(_t || {});
|
|
4
|
+
var Re = /* @__PURE__ */ ((e) => (e.Chat = "lk.chat", e.Speak = "did.speak", e.Interrupt = "did.interrupt", e.SttLanguage = "did.stt-language", e.Presentation = "did.presentation", e))(Re || {}), L = /* @__PURE__ */ ((e) => (e.Functional = "Functional", e.TextOnly = "TextOnly", e.Maintenance = "Maintenance", e.Playground = "Playground", e.DirectPlayback = "DirectPlayback", e.Off = "Off", e))(L || {}), F = /* @__PURE__ */ ((e) => (e.Embed = "embed", e.Query = "query", e.Partial = "partial", e.Answer = "answer", e.Transcribe = "transcribe", e.Complete = "done", e))(F || {}), pe = /* @__PURE__ */ ((e) => (e.Clip = "clip", e.Talk = "talk", e.Expressive = "expressive", e))(pe || {}), C = /* @__PURE__ */ ((e) => (e.Start = "START", e.Stop = "STOP", e))(C || {}), me = /* @__PURE__ */ ((e) => (e.Strong = "STRONG", e.Weak = "WEAK", e.Unknown = "UNKNOWN", e))(me || {}), ye = /* @__PURE__ */ ((e) => (e.Idle = "IDLE", e.Loading = "LOADING", e.Talking = "TALKING", e.ToolActive = "TOOL_ACTIVE", e))(ye || {}), T = /* @__PURE__ */ ((e) => (e.ChatAnswer = "chat/answer", e.ChatPartial = "chat/partial", e.ChatAudioTranscribed = "chat/audio-transcribed", e.StreamDone = "stream/done", e.StreamStarted = "stream/started", e.StreamFailed = "stream/error", e.StreamReady = "stream/ready", e.StreamInterrupt = "stream/interrupt", e.StreamVideoCreated = "stream-video/started", e.StreamVideoDone = "stream-video/done", e.StreamVideoError = "stream-video/error", e.StreamVideoRejected = "stream-video/rejected", e.ToolCallStarted = "tool-call/started", e.ToolCallDone = "tool-call/done", e.ToolCallError = "tool-call/error", e.TurnStarted = "turn/started", e.TurnEnded = "turn/ended", e))(T || {}), Le = /* @__PURE__ */ ((e) => (e.Started = "tool-call/started", e.Done = "tool-call/done", e.Error = "tool-call/error", e))(Le || {}), Tt = /* @__PURE__ */ ((e) => (e.Presentation = "did.presentation", e))(Tt || {}), I = /* @__PURE__ */ ((e) => (e.New = "new", e.Fail = "fail", e.Connected = "connected", e.Connecting = "connecting", e.Closed = "closed", e.Completed = "completed", e.Disconnecting = "disconnecting", e.Disconnected = "disconnected", e))(I || {}), H = /* @__PURE__ */ ((e) => (e.Legacy = "legacy", e.Fluent = "fluent", e))(H || {}), ge = /* @__PURE__ */ ((e) => (e.Ok = "ok", e.UnknownError = "unknown_error", e.NetworkIssue = "network_issue", e.MessageLimit = "message_limit", e.TimeLimit = "time_limit", e.Inactivity = "inactivity", e.EndedByAgent = "ended_by_agent", e))(ge || {}), Oe = /* @__PURE__ */ ((e) => (e.Livekit = "livekit", e))(Oe || {}), kt = /* @__PURE__ */ ((e) => (e.Amazon = "amazon", e.AzureOpenAi = "azure-openai", e.Microsoft = "microsoft", e.Elevenlabs = "elevenlabs", e.Cartesia = "cartesia", e))(kt || {}), _t = /* @__PURE__ */ ((e) => (e.Public = "public", e.Premium = "premium", e.Private = "private", e.ExternalPrivate = "external-private", e))(_t || {});
|
|
5
5
|
const Jn = (...e) => {
|
|
6
6
|
}, ft = (e) => new Promise((t) => setTimeout(t, e)), Z = (e = 16) => {
|
|
7
7
|
const t = new Uint8Array(e);
|
|
@@ -531,7 +531,7 @@ function nt(e) {
|
|
|
531
531
|
function Pe(e) {
|
|
532
532
|
return e instanceof q ? e.toJson() : { kind: "UnknownError", message: qt(e) || "UnknownError" };
|
|
533
533
|
}
|
|
534
|
-
const Zt = "3.0.0-staging.
|
|
534
|
+
const Zt = "3.0.0-staging.420", en = "https://api-js.mixpanel.com/track/?verbose=1&ip=1", St = 50, Q = [];
|
|
535
535
|
let be = !1;
|
|
536
536
|
async function Ct(e) {
|
|
537
537
|
const t = await fetch(en, {
|
|
@@ -1357,7 +1357,7 @@ async function Pn(e, t, r, a) {
|
|
|
1357
1357
|
const { version: s, ...i } = t;
|
|
1358
1358
|
switch (i.transport.provider) {
|
|
1359
1359
|
case Oe.Livekit:
|
|
1360
|
-
const { createLiveKitStreamingManager: u } = await import("./livekit-manager-
|
|
1360
|
+
const { createLiveKitStreamingManager: u } = await import("./livekit-manager-me8pKdKj.js");
|
|
1361
1361
|
return u(o, i, r);
|
|
1362
1362
|
default:
|
|
1363
1363
|
throw new Error(`Unsupported transport provider: ${i.transport.provider}`);
|
|
@@ -1601,7 +1601,7 @@ async function Kn(e, t) {
|
|
|
1601
1601
|
const P = Fe(S.avatar.type);
|
|
1602
1602
|
if (P && te(u))
|
|
1603
1603
|
throw new R(xe);
|
|
1604
|
-
P && import("./livekit-manager-
|
|
1604
|
+
P && import("./livekit-manager-me8pKdKj.js").then(({ preloadLiveKit: c }) => c()).catch(() => {
|
|
1605
1605
|
}), d.enrich(Kt(S));
|
|
1606
1606
|
const { onMessage: U, clearQueue: j } = mn(d, n, p, S, (c) => {
|
|
1607
1607
|
var m, y;
|
|
@@ -2060,4 +2060,4 @@ export {
|
|
|
2060
2060
|
Hn as v,
|
|
2061
2061
|
wt as w
|
|
2062
2062
|
};
|
|
2063
|
-
//# sourceMappingURL=index-
|
|
2063
|
+
//# sourceMappingURL=index-BrPt8AuN.js.map
|