@d-id/client-sdk 1.2.9 → 1.2.10-staging.375
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 +12 -2
- package/dist/{index-Gnq_YadB.js → index-CppX2Esu.js} +523 -572
- package/dist/index.js +25 -28
- package/dist/index.umd.cjs +24 -24
- package/dist/{livekit-manager-DuYnmxDa.js → livekit-manager-n4G-1XJd.js} +1 -1
- package/dist/src/api/agents.d.ts +2 -6
- package/dist/src/types/entities/agents/agent.d.ts +26 -55
- package/dist/src/types/entities/agents/manager.d.ts +11 -0
- package/dist/src/types/stream-script.d.ts +7 -1
- package/dist/src/utils/agent.d.ts +3 -4
- package/dist/src/utils/analytics.d.ts +1 -15
- package/package.json +1 -1
- package/dist/src/types/entities/agents/knowledge.d.ts +0 -12
- package/dist/src/types/entities/agents/llm.d.ts +0 -22
- package/dist/src/types/entities/agents/presenter.d.ts +0 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as Ue, C as z, S as f, a as Oe, b as je, A as g, d as Ne, l as le, e as ze, t as Be, f as A, g as O, h as Je, i as Qe, j as R, n as We } from "./index-
|
|
1
|
+
import { c as Ue, C as z, S as f, a as Oe, b as je, A as g, d as Ne, l as le, e as ze, t as Be, f as A, g as O, h as Je, i as Qe, j as R, n as We } from "./index-CppX2Esu.js";
|
|
2
2
|
function qe() {
|
|
3
3
|
try {
|
|
4
4
|
return Intl.DateTimeFormat().resolvedOptions().timeZone ?? "";
|
package/dist/src/api/agents.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { Agent,
|
|
1
|
+
import { Agent, Auth, Chat, ChatPayload, ChatResponse, RatingEntity, RatingPayload, STTTokenResponse, SubmitFeedbackResponse } from '../types/index';
|
|
2
2
|
import { RequestOptions } from './apiClient';
|
|
3
3
|
|
|
4
4
|
export declare function createAgentsApi(auth: Auth, host?: string, onError?: (error: Error, errorData: object) => void, externalId?: string): {
|
|
5
|
-
|
|
6
|
-
getAgents(tag?: string, options?: RequestOptions): Promise<Agent[]>;
|
|
7
|
-
getById(id: string, options?: RequestOptions): Promise<Agent>;
|
|
8
|
-
delete(id: string, options?: RequestOptions): Promise<any>;
|
|
9
|
-
update(id: string, payload: AgentPayload, options?: RequestOptions): Promise<Agent>;
|
|
5
|
+
getRuntimeById(id: string, options?: RequestOptions): Promise<Agent>;
|
|
10
6
|
newChat(agentId: string, payload: {
|
|
11
7
|
persist: boolean;
|
|
12
8
|
}, options?: RequestOptions): Promise<Chat>;
|
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
import { Chat, ChatPayload, ChatResponse } from './chat';
|
|
2
|
-
import { Knowledge } from './knowledge';
|
|
3
|
-
import { LLM } from './llm';
|
|
4
|
-
import { Presenter } from './presenter';
|
|
5
2
|
|
|
6
|
-
export declare enum UserPlan {
|
|
7
|
-
TRIAL = "trial",
|
|
8
|
-
BASIC = "basic",
|
|
9
|
-
ENTERPRISE = "enterprise",
|
|
10
|
-
LITE = "lite",
|
|
11
|
-
ADVANCED = "advanced"
|
|
12
|
-
}
|
|
13
|
-
export declare enum PlanGroup {
|
|
14
|
-
TRIAL = "deid-trial",
|
|
15
|
-
PRO = "deid-pro",
|
|
16
|
-
ENTERPRISE = "deid-enterprise",
|
|
17
|
-
LITE = "deid-lite",
|
|
18
|
-
ADVANCED = "deid-advanced",
|
|
19
|
-
BUILD = "deid-api-build",
|
|
20
|
-
LAUNCH = "deid-api-launch",
|
|
21
|
-
SCALE = "deid-api-scale"
|
|
22
|
-
}
|
|
23
|
-
export declare enum AgentStatus {
|
|
24
|
-
Created = "created",
|
|
25
|
-
Started = "started",
|
|
26
|
-
Done = "done",
|
|
27
|
-
Error = "error",
|
|
28
|
-
Rejected = "rejected",
|
|
29
|
-
Ready = "ready"
|
|
30
|
-
}
|
|
31
|
-
export interface Vision {
|
|
32
|
-
enabled: boolean;
|
|
33
|
-
}
|
|
34
3
|
export interface EndOfCallFeedbackConfig {
|
|
35
4
|
enabled: boolean;
|
|
36
5
|
closing_message?: string;
|
|
@@ -43,35 +12,37 @@ export interface EndOfCallFeedbackConfig {
|
|
|
43
12
|
}
|
|
44
13
|
export interface Agent {
|
|
45
14
|
id: string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
vision?: Vision;
|
|
51
|
-
use_case?: string;
|
|
52
|
-
tags?: string[];
|
|
53
|
-
chats?: number;
|
|
15
|
+
owner_id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
access?: 'public';
|
|
18
|
+
thumbnail?: string;
|
|
54
19
|
greetings?: string[];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
20
|
+
starter_message?: string[];
|
|
21
|
+
idle_video?: string;
|
|
22
|
+
knowledge?: {
|
|
23
|
+
id: string;
|
|
24
|
+
embedder?: {
|
|
25
|
+
is_limited_language?: boolean;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
avatar: {
|
|
29
|
+
type: 'talk' | 'clip' | 'expressive';
|
|
30
|
+
voice?: {
|
|
31
|
+
language?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
vision?: {
|
|
35
|
+
enabled: boolean;
|
|
58
36
|
};
|
|
59
|
-
preview_name?: string;
|
|
60
|
-
preview_description?: string;
|
|
61
|
-
preview_thumbnail?: string;
|
|
62
|
-
logo?: string;
|
|
63
|
-
preview_url?: string;
|
|
64
|
-
owner_id?: string;
|
|
65
|
-
status?: AgentStatus;
|
|
66
37
|
end_of_call_feedback?: EndOfCallFeedbackConfig;
|
|
38
|
+
triggers_available?: boolean;
|
|
39
|
+
advanced_settings?: {
|
|
40
|
+
ui_debug_mode?: boolean;
|
|
41
|
+
vm_account_id?: string;
|
|
42
|
+
};
|
|
67
43
|
}
|
|
68
|
-
export type AgentPayload = Omit<Agent, 'type' | 'created_at' | 'modified_at' | 'id' | 'owner_id' | 'metadata' | 'idle_video_url'>;
|
|
69
44
|
export interface AgentsAPI {
|
|
70
|
-
|
|
71
|
-
getAgents(tag?: string, options?: RequestInit): Promise<Agent[]>;
|
|
72
|
-
getById(id: string, options?: RequestInit): Promise<Agent>;
|
|
73
|
-
delete(id: string, options?: RequestInit): Promise<void>;
|
|
74
|
-
update(id: string, payload: AgentPayload, options?: RequestInit): Promise<Agent>;
|
|
45
|
+
getRuntimeById(id: string, options?: RequestInit): Promise<Agent>;
|
|
75
46
|
newChat(agentId: string, payload: {
|
|
76
47
|
persist: boolean;
|
|
77
48
|
}, options?: RequestInit): Promise<Chat>;
|
|
@@ -147,7 +147,18 @@ export interface AgentManagerOptions {
|
|
|
147
147
|
wsURL?: string;
|
|
148
148
|
debug?: boolean;
|
|
149
149
|
verbose?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Whether to enable analytics (Mixpanel) tracking.
|
|
152
|
+
* @default true
|
|
153
|
+
* @deprecated Use `enableAnalytics` instead. This misspelled prop is kept for backwards compatibility.
|
|
154
|
+
*/
|
|
150
155
|
enableAnalitics?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Whether to enable analytics (Mixpanel) tracking.
|
|
158
|
+
* Takes precedence over the deprecated `enableAnalitics` prop when both are set.
|
|
159
|
+
* @default true
|
|
160
|
+
*/
|
|
161
|
+
enableAnalytics?: boolean;
|
|
151
162
|
mixpanelKey?: string;
|
|
152
163
|
mixpanelAdditionalProperties?: Record<string, any>;
|
|
153
164
|
externalId?: string;
|
|
@@ -28,10 +28,16 @@ export interface Stream_Text_Script extends BaseStreamScript {
|
|
|
28
28
|
*/
|
|
29
29
|
ssml?: boolean;
|
|
30
30
|
/**
|
|
31
|
-
* Queue this speak behind the current speech instead of interrupting it.
|
|
31
|
+
* Queue this speak behind the current speech instead of interrupting it (expressive avatars only).
|
|
32
32
|
* @default false
|
|
33
33
|
*/
|
|
34
34
|
should_queue_speaks?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Sentiment name to speak with (expressive avatars only).
|
|
37
|
+
* If the sentiment is not supported by the agent, the default sentiment is used.
|
|
38
|
+
* @example "friendly"
|
|
39
|
+
*/
|
|
40
|
+
sentiment?: string;
|
|
35
41
|
}
|
|
36
42
|
export interface Stream_Audio_Script extends BaseStreamScript {
|
|
37
43
|
/**
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Agent } from '../types';
|
|
2
2
|
|
|
3
|
-
type AgentType = 'clip_v2' | Agent['
|
|
3
|
+
type AgentType = 'clip_v2' | Agent['avatar']['type'];
|
|
4
4
|
export type PresenterType = 'v4' | 'v3-pro' | 'v2';
|
|
5
|
-
export declare const getAgentType: (presenter: Agent["
|
|
6
|
-
export declare const getPresenterType: (presenter: Agent["
|
|
7
|
-
export declare const getPresenterIdentifier: (presenter: Agent["presenter"]) => string;
|
|
5
|
+
export declare const getAgentType: (presenter: Agent["avatar"]) => AgentType;
|
|
6
|
+
export declare const getPresenterType: (presenter: Agent["avatar"]) => PresenterType;
|
|
8
7
|
export declare const isStreamsV2Agent: (type: AgentType) => boolean;
|
|
9
8
|
export {};
|
|
@@ -7,29 +7,15 @@ export declare function getAnalyticsInfo(agent: Agent): {
|
|
|
7
7
|
origin: string;
|
|
8
8
|
agentType: "talk" | "clip" | "expressive" | "clip_v2";
|
|
9
9
|
agentVoice: {
|
|
10
|
-
|
|
11
|
-
provider: import('../types/index').Providers | undefined;
|
|
10
|
+
language: string | undefined;
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
export declare function getAgentInfo(agent: Agent): {
|
|
15
|
-
from?: string | undefined;
|
|
16
14
|
agentType: "talk" | "clip" | "expressive" | "clip_v2";
|
|
17
15
|
presenterType: import('./agent').PresenterType;
|
|
18
|
-
presenter: string;
|
|
19
16
|
owner_id: string;
|
|
20
|
-
promptVersion: "v1" | "v2" | null | undefined;
|
|
21
|
-
behavior: {
|
|
22
|
-
role: string | undefined;
|
|
23
|
-
personality: string | undefined;
|
|
24
|
-
instructions: string | undefined;
|
|
25
|
-
};
|
|
26
|
-
temperature: number | undefined;
|
|
27
|
-
knowledgeSource: "base_knowledge" | "documents" | null | undefined;
|
|
28
17
|
starterQuestionsCount: number | undefined;
|
|
29
|
-
topicsToAvoid: string[] | undefined;
|
|
30
|
-
maxResponseLength: number | undefined;
|
|
31
18
|
agentId: string;
|
|
32
|
-
access: "public" | "private" | "rejected" | "pending-public" | "unlisted" | undefined;
|
|
33
19
|
agentName: string | undefined;
|
|
34
20
|
};
|
|
35
21
|
export declare const getErrorMessage: (error: unknown) => string;
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export type KnowledgeProvider = 'pinecone' | 'redis';
|
|
2
|
-
export interface KnowledgeEmbedder {
|
|
3
|
-
provider: string;
|
|
4
|
-
model: string;
|
|
5
|
-
is_limited_language?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface Knowledge {
|
|
8
|
-
id: string;
|
|
9
|
-
provider: KnowledgeProvider;
|
|
10
|
-
starter_message?: string[];
|
|
11
|
-
embedder?: KnowledgeEmbedder;
|
|
12
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type LLMProvider = 'openai' | 'custom';
|
|
2
|
-
export type AgentTemplate = 'rag-grounded' | 'rag-ungrounded' | 'assistant';
|
|
3
|
-
export interface PromptCustomization {
|
|
4
|
-
role?: string;
|
|
5
|
-
personality?: string;
|
|
6
|
-
topics_to_avoid?: string[];
|
|
7
|
-
max_response_length?: number;
|
|
8
|
-
knowledge_source?: 'base_knowledge' | 'documents' | null;
|
|
9
|
-
}
|
|
10
|
-
export interface LLM {
|
|
11
|
-
provider: LLMProvider;
|
|
12
|
-
prompt_version?: 'v1' | 'v2' | null;
|
|
13
|
-
instructions?: string;
|
|
14
|
-
template?: AgentTemplate;
|
|
15
|
-
prompt_customization?: PromptCustomization;
|
|
16
|
-
temperature?: number;
|
|
17
|
-
custom?: {
|
|
18
|
-
api_key?: string;
|
|
19
|
-
url?: string;
|
|
20
|
-
streaming?: boolean;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ExtendedTextToSpeechProviders } from '../../voice/tts';
|
|
2
|
-
import { Rect } from '../../face-rect';
|
|
3
|
-
|
|
4
|
-
export type videoType = 'talk' | 'clip' | 'expressive';
|
|
5
|
-
export type Presenter = TalkPresenter | ClipPresenter | ExpresivePresenter;
|
|
6
|
-
export interface BasePresenter {
|
|
7
|
-
type: videoType;
|
|
8
|
-
voice?: ExtendedTextToSpeechProviders & {
|
|
9
|
-
language?: string;
|
|
10
|
-
};
|
|
11
|
-
idle_video?: string;
|
|
12
|
-
thumbnail?: string;
|
|
13
|
-
}
|
|
14
|
-
export interface TalkPresenter extends BasePresenter {
|
|
15
|
-
type: 'talk';
|
|
16
|
-
source_url: string;
|
|
17
|
-
driver_url?: string;
|
|
18
|
-
stitch?: boolean;
|
|
19
|
-
face?: Rect;
|
|
20
|
-
}
|
|
21
|
-
export interface ClipPresenter extends BasePresenter {
|
|
22
|
-
type: 'clip';
|
|
23
|
-
driver_id: string;
|
|
24
|
-
background?: string;
|
|
25
|
-
presenter_id: string;
|
|
26
|
-
is_greenscreen?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface ExpresivePresenter extends BasePresenter {
|
|
29
|
-
type: 'expressive';
|
|
30
|
-
presenter_id: string;
|
|
31
|
-
}
|