@deepdesk/deepdesk-sdk 18.2.1-beta.10 → 18.2.1-beta.12

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.d.mts CHANGED
@@ -409,15 +409,13 @@ declare enum FetchState {
409
409
  type LegacyCue = CamelCaseKeys<Server.LegacyCue> & {
410
410
  isLoading?: boolean;
411
411
  editable?: boolean;
412
- specialType?: 'summary';
413
412
  evaluationId: string;
414
413
  };
415
414
 
416
- type EvaluationOutput<T extends Server.ResponseFormat> = CamelCaseKeys<Server.EvaluationOutput<T>>;
415
+ type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
417
416
  type ArrayItemType<T> = T extends Array<infer I> ? I : never;
418
- type Cue = ArrayItemType<EvaluationOutput<'json-schema:cues'>> & {
417
+ type Cue = ArrayItemType<EvaluationOutput> & {
419
418
  isLoading?: boolean;
420
- specialType?: 'summary';
421
419
  evaluationId: string;
422
420
  };
423
421
  type AssistantAnswerSource = {
@@ -449,9 +447,7 @@ interface EvaluateInput {
449
447
  transcript?: TranscriptOption;
450
448
  includeMetadata?: boolean;
451
449
  skipState?: boolean;
452
- expectFormat: Server.ResponseFormat;
453
450
  }
454
- type SummaryInput = Omit<EvaluateInput, 'expectFormat'>;
455
451
 
456
452
  type Fetch = typeof window.fetch;
457
453
  type HTTPClientOptions = {
@@ -676,7 +672,6 @@ declare namespace Server {
676
672
  event: string;
677
673
  value?: string;
678
674
  }
679
- type ResponseFormat = 'text' | 'json-object' | 'json-schema:cues' | 'json-schema:knowledge-assist';
680
675
  interface LegacyCue {
681
676
  text: string;
682
677
  title: string;
@@ -690,24 +685,22 @@ declare namespace Server {
690
685
  MAX_RECURSION_LEVEL = "max_recursion_level",
691
686
  NO_ACCESS_TO_ASSISTANT = "no_access_to_assistant"
692
687
  }
693
- type EvaluationResponse<Output extends ResponseFormat> = {
688
+ type EvaluationResponse = {
694
689
  evaluation_id: string;
695
690
  evaluation_status: EvaluationStatus;
696
- output: EvaluationOutput<Output>;
691
+ output: EvaluationOutput;
697
692
  };
698
- type EvaluationOutput<T extends ResponseFormat> = T extends 'text' ? string : T extends 'json-object' ? unknown : T extends 'json-schema:cues' ? Array<{
693
+ type EvaluationOutput = Array<{
699
694
  code: string;
700
695
  name: string;
701
696
  response: string;
702
697
  editable?: boolean;
703
698
  call_to_action?: CallToAction;
704
- }> : T extends 'json-schema:knowledge-assist' ? {
705
- response: string;
706
699
  sources?: {
707
700
  name: string;
708
701
  url: string;
709
702
  }[];
710
- } : never;
703
+ }>;
711
704
  /**
712
705
  * Handling time event data
713
706
  */
@@ -1130,10 +1123,6 @@ declare class DeepdeskAPI {
1130
1123
  * Search
1131
1124
  */
1132
1125
  search(params: SearchOptions): Promise<CamelCaseKeys<Server.SearchResultsData>>;
1133
- knowledgeAssist(request: CamelCaseKeys<Server.KnowledgeRequest>, chatHistory: Server.KnowledgeResponse[], assistantCode: string, meta?: {
1134
- agentId?: string;
1135
- conversationId?: string;
1136
- }): Promise<CamelCaseKeys<Server.KnowledgeResponse['answer']>>;
1137
1126
  requestLoginByEmail(email: string): Promise<{
1138
1127
  code: string;
1139
1128
  message: string;
@@ -1143,8 +1132,7 @@ declare class DeepdeskAPI {
1143
1132
  verifyLoginToken(token: string): Promise<{
1144
1133
  isLoggedIn: boolean;
1145
1134
  }>;
1146
- evaluateAssistant<TOutput extends Server.ResponseFormat = 'text', TInput = Record<string, unknown>>(assistantCode: string, options?: {
1147
- expectFormat: TOutput;
1135
+ evaluateAssistant<TInput = Record<string, unknown>>(assistantCode: string, options?: {
1148
1136
  threadId?: number;
1149
1137
  input: TInput;
1150
1138
  transcript?: Array<{
@@ -1152,7 +1140,7 @@ declare class DeepdeskAPI {
1152
1140
  text: string;
1153
1141
  }>;
1154
1142
  externalConversationId?: string;
1155
- }): Promise<CamelCaseKeys<Server.EvaluationResponse<TOutput>>>;
1143
+ }): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
1156
1144
  createAssistantThread(init: {
1157
1145
  assistantCode: string;
1158
1146
  }): Promise<{
@@ -2022,7 +2010,6 @@ interface WidgetOptions {
2022
2010
  }
2023
2011
  interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
2024
2012
  customStyles?: WidgetCustomStyles;
2025
- isLegacyKnowledgeAssist?: boolean;
2026
2013
  title?: string;
2027
2014
  }
2028
2015
  declare class DeepdeskSDK {
@@ -2754,7 +2741,6 @@ declare class DeepdeskSDK {
2754
2741
  *
2755
2742
  * @param assistantCode - The assistant code to evaluate
2756
2743
  * @param options - Evaluation options
2757
- * @param options.expectFormat - Expected response format ('json-schema:cues', 'json-schema:knowledge-assist', 'text', 'json-object')
2758
2744
  * @param options.input - Additional input data for the assistant
2759
2745
  * @param options.transcript - Transcript option ('in-memory-transcript' or custom transcript)
2760
2746
  * @param options.includeMetadata - Whether to include metadata in the response
@@ -2765,7 +2751,6 @@ declare class DeepdeskSDK {
2765
2751
  * ```typescript
2766
2752
  * // Evaluate assistant with cues format
2767
2753
  * const result = await sdk.evaluateAssistant('assistant-code-123', {
2768
- * expectFormat: 'json-schema:cues',
2769
2754
  * input: {
2770
2755
  * customerType: 'premium',
2771
2756
  * issueType: 'technical'
@@ -2774,7 +2759,6 @@ declare class DeepdeskSDK {
2774
2759
  *
2775
2760
  * // Evaluate with custom transcript
2776
2761
  * const result = await sdk.evaluateAssistant('assistant-code-456', {
2777
- * expectFormat: 'text',
2778
2762
  * transcript: [
2779
2763
  * { source: 'visitor', text: 'I have a problem with my order' },
2780
2764
  * { source: 'agent', text: 'I can help you with that' }
@@ -2788,13 +2772,12 @@ declare class DeepdeskSDK {
2788
2772
  * });
2789
2773
  * ```
2790
2774
  */
2791
- evaluateAssistant<T extends Server.ResponseFormat = 'json-schema:cues'>(assistantCode: string, options?: {
2792
- expectFormat?: T;
2775
+ evaluateAssistant(assistantCode: string, options?: {
2793
2776
  input?: Record<string, any>;
2794
2777
  transcript?: TranscriptOption;
2795
2778
  includeMetadata?: boolean;
2796
2779
  showCuesInWidget?: boolean;
2797
- }): Promise<EvaluationOutput<T> | string>;
2780
+ }): Promise<EvaluationOutput | string>;
2798
2781
  /**
2799
2782
  * Evaluates conversation lifecycle assistants.
2800
2783
  *
@@ -2841,52 +2824,6 @@ declare class DeepdeskSDK {
2841
2824
  includeMetadata?: boolean;
2842
2825
  showCuesInWidget?: boolean;
2843
2826
  }): Promise<void>;
2844
- /**
2845
- * @deprecated Specific 'Summarizer' assistants are deprecated.
2846
- *
2847
- * Generates a summary of the current conversation.
2848
- *
2849
- * This method uses the summarizer assistant configured in the profile to
2850
- * generate a concise summary of the current conversation. It assumes that
2851
- * `setConversationQuery()` has been called before this method and will
2852
- * throw an error if this is not the case.
2853
- *
2854
- * @param args - Summary generation options
2855
- * @param args.includeMetadata - Whether to include metadata in the summary
2856
- * @param args.transcript - Custom transcript to use (optional)
2857
- * @returns Promise that resolves to the summary text or null if no summarizer is configured
2858
- *
2859
- * @example
2860
- * ```typescript
2861
- * // Set up conversation query first
2862
- * sdk.setConversationQuery(async () => {
2863
- * return [
2864
- * { source: 'visitor', text: 'I have a problem with my order' },
2865
- * { source: 'agent', text: 'I can help you with that' },
2866
- * { source: 'visitor', text: 'My order number is 12345' }
2867
- * ];
2868
- * });
2869
- *
2870
- * // Generate summary
2871
- * const summary = await sdk.getSummary();
2872
- * console.log('Conversation summary:', summary);
2873
- *
2874
- * // Generate summary with metadata
2875
- * const summaryWithMetadata = await sdk.getSummary({
2876
- * includeMetadata: true
2877
- * });
2878
- *
2879
- * // Generate summary with custom transcript
2880
- * const customSummary = await sdk.getSummary({
2881
- * transcript: [
2882
- * { source: 'visitor', text: 'Custom conversation data' },
2883
- * { source: 'agent', text: 'Agent response' }
2884
- * ]
2885
- * });
2886
- * ```
2887
- *
2888
- */
2889
- getSummary(args?: Omit<SummaryInput, 'assistantCode'>): Promise<string | null>;
2890
2827
  private handleKeyDown;
2891
2828
  private handleAfterSendMessage;
2892
2829
  /**
@@ -3061,9 +2998,6 @@ declare class DeepdeskSDK {
3061
2998
  * text: msg.content
3062
2999
  * }));
3063
3000
  * });
3064
- *
3065
- * // Now you can use features that require setConversationQuery to be set
3066
- * const summary = await sdk.getSummary();
3067
3001
  * ```
3068
3002
  */
3069
3003
  setConversationQuery(fetchFn: () => Promise<Array<{
@@ -3331,7 +3265,6 @@ declare class DeepdeskSDK {
3331
3265
  * @param options.customStyles - Custom styling for the widget
3332
3266
  * @param options.initialQuestion - Initial question to display
3333
3267
  * @param options.emptyState - Custom empty state configuration
3334
- * @param options.isLegacyKnowledgeAssist - Whether to use legacy knowledge assistant (default: false)
3335
3268
  * @param options.title - Custom title for the widget
3336
3269
  * @returns Object with unmount function to clean up the widget
3337
3270
  *
package/dist/index.d.ts CHANGED
@@ -409,15 +409,13 @@ declare enum FetchState {
409
409
  type LegacyCue = CamelCaseKeys<Server.LegacyCue> & {
410
410
  isLoading?: boolean;
411
411
  editable?: boolean;
412
- specialType?: 'summary';
413
412
  evaluationId: string;
414
413
  };
415
414
 
416
- type EvaluationOutput<T extends Server.ResponseFormat> = CamelCaseKeys<Server.EvaluationOutput<T>>;
415
+ type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
417
416
  type ArrayItemType<T> = T extends Array<infer I> ? I : never;
418
- type Cue = ArrayItemType<EvaluationOutput<'json-schema:cues'>> & {
417
+ type Cue = ArrayItemType<EvaluationOutput> & {
419
418
  isLoading?: boolean;
420
- specialType?: 'summary';
421
419
  evaluationId: string;
422
420
  };
423
421
  type AssistantAnswerSource = {
@@ -449,9 +447,7 @@ interface EvaluateInput {
449
447
  transcript?: TranscriptOption;
450
448
  includeMetadata?: boolean;
451
449
  skipState?: boolean;
452
- expectFormat: Server.ResponseFormat;
453
450
  }
454
- type SummaryInput = Omit<EvaluateInput, 'expectFormat'>;
455
451
 
456
452
  type Fetch = typeof window.fetch;
457
453
  type HTTPClientOptions = {
@@ -676,7 +672,6 @@ declare namespace Server {
676
672
  event: string;
677
673
  value?: string;
678
674
  }
679
- type ResponseFormat = 'text' | 'json-object' | 'json-schema:cues' | 'json-schema:knowledge-assist';
680
675
  interface LegacyCue {
681
676
  text: string;
682
677
  title: string;
@@ -690,24 +685,22 @@ declare namespace Server {
690
685
  MAX_RECURSION_LEVEL = "max_recursion_level",
691
686
  NO_ACCESS_TO_ASSISTANT = "no_access_to_assistant"
692
687
  }
693
- type EvaluationResponse<Output extends ResponseFormat> = {
688
+ type EvaluationResponse = {
694
689
  evaluation_id: string;
695
690
  evaluation_status: EvaluationStatus;
696
- output: EvaluationOutput<Output>;
691
+ output: EvaluationOutput;
697
692
  };
698
- type EvaluationOutput<T extends ResponseFormat> = T extends 'text' ? string : T extends 'json-object' ? unknown : T extends 'json-schema:cues' ? Array<{
693
+ type EvaluationOutput = Array<{
699
694
  code: string;
700
695
  name: string;
701
696
  response: string;
702
697
  editable?: boolean;
703
698
  call_to_action?: CallToAction;
704
- }> : T extends 'json-schema:knowledge-assist' ? {
705
- response: string;
706
699
  sources?: {
707
700
  name: string;
708
701
  url: string;
709
702
  }[];
710
- } : never;
703
+ }>;
711
704
  /**
712
705
  * Handling time event data
713
706
  */
@@ -1130,10 +1123,6 @@ declare class DeepdeskAPI {
1130
1123
  * Search
1131
1124
  */
1132
1125
  search(params: SearchOptions): Promise<CamelCaseKeys<Server.SearchResultsData>>;
1133
- knowledgeAssist(request: CamelCaseKeys<Server.KnowledgeRequest>, chatHistory: Server.KnowledgeResponse[], assistantCode: string, meta?: {
1134
- agentId?: string;
1135
- conversationId?: string;
1136
- }): Promise<CamelCaseKeys<Server.KnowledgeResponse['answer']>>;
1137
1126
  requestLoginByEmail(email: string): Promise<{
1138
1127
  code: string;
1139
1128
  message: string;
@@ -1143,8 +1132,7 @@ declare class DeepdeskAPI {
1143
1132
  verifyLoginToken(token: string): Promise<{
1144
1133
  isLoggedIn: boolean;
1145
1134
  }>;
1146
- evaluateAssistant<TOutput extends Server.ResponseFormat = 'text', TInput = Record<string, unknown>>(assistantCode: string, options?: {
1147
- expectFormat: TOutput;
1135
+ evaluateAssistant<TInput = Record<string, unknown>>(assistantCode: string, options?: {
1148
1136
  threadId?: number;
1149
1137
  input: TInput;
1150
1138
  transcript?: Array<{
@@ -1152,7 +1140,7 @@ declare class DeepdeskAPI {
1152
1140
  text: string;
1153
1141
  }>;
1154
1142
  externalConversationId?: string;
1155
- }): Promise<CamelCaseKeys<Server.EvaluationResponse<TOutput>>>;
1143
+ }): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
1156
1144
  createAssistantThread(init: {
1157
1145
  assistantCode: string;
1158
1146
  }): Promise<{
@@ -2022,7 +2010,6 @@ interface WidgetOptions {
2022
2010
  }
2023
2011
  interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
2024
2012
  customStyles?: WidgetCustomStyles;
2025
- isLegacyKnowledgeAssist?: boolean;
2026
2013
  title?: string;
2027
2014
  }
2028
2015
  declare class DeepdeskSDK {
@@ -2754,7 +2741,6 @@ declare class DeepdeskSDK {
2754
2741
  *
2755
2742
  * @param assistantCode - The assistant code to evaluate
2756
2743
  * @param options - Evaluation options
2757
- * @param options.expectFormat - Expected response format ('json-schema:cues', 'json-schema:knowledge-assist', 'text', 'json-object')
2758
2744
  * @param options.input - Additional input data for the assistant
2759
2745
  * @param options.transcript - Transcript option ('in-memory-transcript' or custom transcript)
2760
2746
  * @param options.includeMetadata - Whether to include metadata in the response
@@ -2765,7 +2751,6 @@ declare class DeepdeskSDK {
2765
2751
  * ```typescript
2766
2752
  * // Evaluate assistant with cues format
2767
2753
  * const result = await sdk.evaluateAssistant('assistant-code-123', {
2768
- * expectFormat: 'json-schema:cues',
2769
2754
  * input: {
2770
2755
  * customerType: 'premium',
2771
2756
  * issueType: 'technical'
@@ -2774,7 +2759,6 @@ declare class DeepdeskSDK {
2774
2759
  *
2775
2760
  * // Evaluate with custom transcript
2776
2761
  * const result = await sdk.evaluateAssistant('assistant-code-456', {
2777
- * expectFormat: 'text',
2778
2762
  * transcript: [
2779
2763
  * { source: 'visitor', text: 'I have a problem with my order' },
2780
2764
  * { source: 'agent', text: 'I can help you with that' }
@@ -2788,13 +2772,12 @@ declare class DeepdeskSDK {
2788
2772
  * });
2789
2773
  * ```
2790
2774
  */
2791
- evaluateAssistant<T extends Server.ResponseFormat = 'json-schema:cues'>(assistantCode: string, options?: {
2792
- expectFormat?: T;
2775
+ evaluateAssistant(assistantCode: string, options?: {
2793
2776
  input?: Record<string, any>;
2794
2777
  transcript?: TranscriptOption;
2795
2778
  includeMetadata?: boolean;
2796
2779
  showCuesInWidget?: boolean;
2797
- }): Promise<EvaluationOutput<T> | string>;
2780
+ }): Promise<EvaluationOutput | string>;
2798
2781
  /**
2799
2782
  * Evaluates conversation lifecycle assistants.
2800
2783
  *
@@ -2841,52 +2824,6 @@ declare class DeepdeskSDK {
2841
2824
  includeMetadata?: boolean;
2842
2825
  showCuesInWidget?: boolean;
2843
2826
  }): Promise<void>;
2844
- /**
2845
- * @deprecated Specific 'Summarizer' assistants are deprecated.
2846
- *
2847
- * Generates a summary of the current conversation.
2848
- *
2849
- * This method uses the summarizer assistant configured in the profile to
2850
- * generate a concise summary of the current conversation. It assumes that
2851
- * `setConversationQuery()` has been called before this method and will
2852
- * throw an error if this is not the case.
2853
- *
2854
- * @param args - Summary generation options
2855
- * @param args.includeMetadata - Whether to include metadata in the summary
2856
- * @param args.transcript - Custom transcript to use (optional)
2857
- * @returns Promise that resolves to the summary text or null if no summarizer is configured
2858
- *
2859
- * @example
2860
- * ```typescript
2861
- * // Set up conversation query first
2862
- * sdk.setConversationQuery(async () => {
2863
- * return [
2864
- * { source: 'visitor', text: 'I have a problem with my order' },
2865
- * { source: 'agent', text: 'I can help you with that' },
2866
- * { source: 'visitor', text: 'My order number is 12345' }
2867
- * ];
2868
- * });
2869
- *
2870
- * // Generate summary
2871
- * const summary = await sdk.getSummary();
2872
- * console.log('Conversation summary:', summary);
2873
- *
2874
- * // Generate summary with metadata
2875
- * const summaryWithMetadata = await sdk.getSummary({
2876
- * includeMetadata: true
2877
- * });
2878
- *
2879
- * // Generate summary with custom transcript
2880
- * const customSummary = await sdk.getSummary({
2881
- * transcript: [
2882
- * { source: 'visitor', text: 'Custom conversation data' },
2883
- * { source: 'agent', text: 'Agent response' }
2884
- * ]
2885
- * });
2886
- * ```
2887
- *
2888
- */
2889
- getSummary(args?: Omit<SummaryInput, 'assistantCode'>): Promise<string | null>;
2890
2827
  private handleKeyDown;
2891
2828
  private handleAfterSendMessage;
2892
2829
  /**
@@ -3061,9 +2998,6 @@ declare class DeepdeskSDK {
3061
2998
  * text: msg.content
3062
2999
  * }));
3063
3000
  * });
3064
- *
3065
- * // Now you can use features that require setConversationQuery to be set
3066
- * const summary = await sdk.getSummary();
3067
3001
  * ```
3068
3002
  */
3069
3003
  setConversationQuery(fetchFn: () => Promise<Array<{
@@ -3331,7 +3265,6 @@ declare class DeepdeskSDK {
3331
3265
  * @param options.customStyles - Custom styling for the widget
3332
3266
  * @param options.initialQuestion - Initial question to display
3333
3267
  * @param options.emptyState - Custom empty state configuration
3334
- * @param options.isLegacyKnowledgeAssist - Whether to use legacy knowledge assistant (default: false)
3335
3268
  * @param options.title - Custom title for the widget
3336
3269
  * @returns Object with unmount function to clean up the widget
3337
3270
  *