@d-id/client-sdk 1.1.57-staging.259 → 1.1.57-staging.267

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/index.js CHANGED
@@ -1069,15 +1069,15 @@ function Cn(e, n, i, r, o) {
1069
1069
  return;
1070
1070
  const a = r.messages[r.messages.length - 1];
1071
1071
  let s;
1072
- if (a != null && a.transcribed && a.role === "user")
1073
- e === X.Answer && n.content, s = {
1072
+ if ((a == null ? void 0 : a.role) === "assistant")
1073
+ s = a;
1074
+ else if (!a || a.transcribed && a.role === "user")
1075
+ s = {
1074
1076
  id: n.id || `assistant-${Date.now()}`,
1075
1077
  role: n.role || "assistant",
1076
1078
  content: n.content || "",
1077
1079
  created_at: n.created_at || (/* @__PURE__ */ new Date()).toISOString()
1078
1080
  }, r.messages.push(s);
1079
- else if ((a == null ? void 0 : a.role) === "assistant")
1080
- s = a;
1081
1081
  else
1082
1082
  return;
1083
1083
  const { content: d, sequence: t } = n;