@d-id/client-sdk 1.2.6-staging.360 → 1.2.7-staging.362

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,4 +1,4 @@
1
- import { c as Ne, C as B, S as l, a as Ue, b as je, A as p, d as xe, l as le, e as Oe, t as Be, f as w, g as j, h as Je, i as ze, j as P, n as Qe } from "./index-HpR0alTU.js";
1
+ import { c as Ne, C as B, S as l, a as Ue, b as je, A as p, d as xe, l as le, e as Oe, t as Be, f as w, g as j, h as Je, i as ze, j as P, n as Qe } from "./index-BgYYu10q.js";
2
2
  function qe(C, M, f, i) {
3
3
  const b = Ne(C, `${M}/v2/agents/${f}`, i);
4
4
  return {
@@ -1,4 +1,4 @@
1
- import { Agent, AgentPayload, Auth, Chat, ChatPayload, ChatResponse, RatingEntity, RatingPayload, STTTokenResponse } from '../types/index';
1
+ import { Agent, AgentPayload, 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): {
@@ -14,5 +14,9 @@ export declare function createAgentsApi(auth: Auth, host?: string, onError?: (er
14
14
  createRating(agentId: string, chatId: string, payload: RatingPayload, options?: RequestOptions): Promise<RatingEntity>;
15
15
  updateRating(agentId: string, chatId: string, ratingId: string, payload: Partial<RatingPayload>, options?: RequestOptions): Promise<RatingEntity>;
16
16
  deleteRating(agentId: string, chatId: string, ratingId: string, options?: RequestOptions): Promise<RatingEntity>;
17
+ submitFeedback(agentId: string, chatId: string, payload: {
18
+ rating: number;
19
+ answer?: string;
20
+ }, options?: RequestOptions): Promise<SubmitFeedbackResponse>;
17
21
  getSTTToken(agentId: string, options?: RequestOptions): Promise<STTTokenResponse>;
18
22
  };
@@ -31,6 +31,16 @@ export declare enum AgentStatus {
31
31
  export interface Vision {
32
32
  enabled: boolean;
33
33
  }
34
+ export interface EndOfCallFeedbackConfig {
35
+ enabled: boolean;
36
+ closing_message?: string;
37
+ follow_up_enabled?: boolean;
38
+ follow_up_messages?: {
39
+ low?: string;
40
+ four?: string;
41
+ five?: string;
42
+ };
43
+ }
34
44
  export interface Agent {
35
45
  id: string;
36
46
  username?: string;
@@ -53,6 +63,7 @@ export interface Agent {
53
63
  preview_url?: string;
54
64
  owner_id?: string;
55
65
  status?: AgentStatus;
66
+ end_of_call_feedback?: EndOfCallFeedbackConfig;
56
67
  }
57
68
  export type AgentPayload = Omit<Agent, 'type' | 'created_at' | 'modified_at' | 'id' | 'owner_id' | 'metadata' | 'idle_video_url'>;
58
69
  export interface AgentsAPI {
@@ -18,6 +18,12 @@ export interface RatingEntity {
18
18
  message_id: string;
19
19
  }
20
20
  export type RatingPayload = Omit<RatingEntity, 'owner_id' | 'id' | 'created_at' | 'modified_at' | 'created_by' | 'external_id' | 'agent_id' | 'chat_id'>;
21
+ export interface SubmitFeedbackResponse {
22
+ chat_id: string;
23
+ rating: number;
24
+ question_shown?: string;
25
+ submitted_at: string;
26
+ }
21
27
  export type MessagePart = {
22
28
  type: 'text';
23
29
  text: string;
@@ -4,7 +4,7 @@ import { AgentActivityState, ClientToolHandler, CompatibilityMode, ConnectionSta
4
4
  import { SupportedStreamScript } from '../../stream-script';
5
5
  import { ManagerCallbacks as StreamManagerCallbacks } from '../../stream/stream';
6
6
  import { Agent } from './agent';
7
- import { ChatMode, ChatResponse, Interrupt, Message, RatingEntity } from './chat';
7
+ import { ChatMode, ChatResponse, Interrupt, Message, RatingEntity, SubmitFeedbackResponse } from './chat';
8
8
 
9
9
  /**
10
10
  * Types of events provided in Chat Progress Callback
@@ -243,6 +243,12 @@ export interface AgentManager {
243
243
  * @param id - id of Rating entity.
244
244
  */
245
245
  deleteRate: (id: string) => Promise<RatingEntity>;
246
+ /**
247
+ * Method to submit end-of-call feedback for the chat
248
+ * @param rating - integer score from 1 to 5
249
+ * @param answer - optional free-text answer
250
+ */
251
+ submitFeedback: (rating: number, answer?: string) => Promise<SubmitFeedbackResponse>;
246
252
  /**
247
253
  * Method to make your agent read the text you provide or reproduce sound
248
254
  * @param payload
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@d-id/client-sdk",
3
3
  "private": false,
4
- "version": "1.2.6-staging.360",
4
+ "version": "1.2.7-staging.362",
5
5
  "type": "module",
6
6
  "description": "d-id client sdk",
7
7
  "repository": {