@deepdesk/deepdesk-sdk 18.2.1-beta.10 → 18.2.1-beta.11
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.cjs.js +8 -8
- package/dist/index.d.mts +10 -69
- package/dist/index.d.ts +10 -69
- package/dist/index.esm.js +8 -8
- package/dist/index.iife.js +36 -36
- package/package.json +1 -1
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
|
|
415
|
+
type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
|
|
417
416
|
type ArrayItemType<T> = T extends Array<infer I> ? I : never;
|
|
418
|
-
type Cue = ArrayItemType<EvaluationOutput
|
|
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
|
|
688
|
+
type EvaluationResponse = {
|
|
694
689
|
evaluation_id: string;
|
|
695
690
|
evaluation_status: EvaluationStatus;
|
|
696
|
-
output: EvaluationOutput
|
|
691
|
+
output: EvaluationOutput;
|
|
697
692
|
};
|
|
698
|
-
type EvaluationOutput
|
|
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
|
-
}
|
|
703
|
+
}>;
|
|
711
704
|
/**
|
|
712
705
|
* Handling time event data
|
|
713
706
|
*/
|
|
@@ -1143,8 +1136,7 @@ declare class DeepdeskAPI {
|
|
|
1143
1136
|
verifyLoginToken(token: string): Promise<{
|
|
1144
1137
|
isLoggedIn: boolean;
|
|
1145
1138
|
}>;
|
|
1146
|
-
evaluateAssistant<
|
|
1147
|
-
expectFormat: TOutput;
|
|
1139
|
+
evaluateAssistant<TInput = Record<string, unknown>>(assistantCode: string, options?: {
|
|
1148
1140
|
threadId?: number;
|
|
1149
1141
|
input: TInput;
|
|
1150
1142
|
transcript?: Array<{
|
|
@@ -1152,7 +1144,7 @@ declare class DeepdeskAPI {
|
|
|
1152
1144
|
text: string;
|
|
1153
1145
|
}>;
|
|
1154
1146
|
externalConversationId?: string;
|
|
1155
|
-
}): Promise<CamelCaseKeys<Server.EvaluationResponse
|
|
1147
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1156
1148
|
createAssistantThread(init: {
|
|
1157
1149
|
assistantCode: string;
|
|
1158
1150
|
}): Promise<{
|
|
@@ -2022,7 +2014,6 @@ interface WidgetOptions {
|
|
|
2022
2014
|
}
|
|
2023
2015
|
interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
|
|
2024
2016
|
customStyles?: WidgetCustomStyles;
|
|
2025
|
-
isLegacyKnowledgeAssist?: boolean;
|
|
2026
2017
|
title?: string;
|
|
2027
2018
|
}
|
|
2028
2019
|
declare class DeepdeskSDK {
|
|
@@ -2754,7 +2745,6 @@ declare class DeepdeskSDK {
|
|
|
2754
2745
|
*
|
|
2755
2746
|
* @param assistantCode - The assistant code to evaluate
|
|
2756
2747
|
* @param options - Evaluation options
|
|
2757
|
-
* @param options.expectFormat - Expected response format ('json-schema:cues', 'json-schema:knowledge-assist', 'text', 'json-object')
|
|
2758
2748
|
* @param options.input - Additional input data for the assistant
|
|
2759
2749
|
* @param options.transcript - Transcript option ('in-memory-transcript' or custom transcript)
|
|
2760
2750
|
* @param options.includeMetadata - Whether to include metadata in the response
|
|
@@ -2765,7 +2755,6 @@ declare class DeepdeskSDK {
|
|
|
2765
2755
|
* ```typescript
|
|
2766
2756
|
* // Evaluate assistant with cues format
|
|
2767
2757
|
* const result = await sdk.evaluateAssistant('assistant-code-123', {
|
|
2768
|
-
* expectFormat: 'json-schema:cues',
|
|
2769
2758
|
* input: {
|
|
2770
2759
|
* customerType: 'premium',
|
|
2771
2760
|
* issueType: 'technical'
|
|
@@ -2774,7 +2763,6 @@ declare class DeepdeskSDK {
|
|
|
2774
2763
|
*
|
|
2775
2764
|
* // Evaluate with custom transcript
|
|
2776
2765
|
* const result = await sdk.evaluateAssistant('assistant-code-456', {
|
|
2777
|
-
* expectFormat: 'text',
|
|
2778
2766
|
* transcript: [
|
|
2779
2767
|
* { source: 'visitor', text: 'I have a problem with my order' },
|
|
2780
2768
|
* { source: 'agent', text: 'I can help you with that' }
|
|
@@ -2788,13 +2776,12 @@ declare class DeepdeskSDK {
|
|
|
2788
2776
|
* });
|
|
2789
2777
|
* ```
|
|
2790
2778
|
*/
|
|
2791
|
-
evaluateAssistant
|
|
2792
|
-
expectFormat?: T;
|
|
2779
|
+
evaluateAssistant(assistantCode: string, options?: {
|
|
2793
2780
|
input?: Record<string, any>;
|
|
2794
2781
|
transcript?: TranscriptOption;
|
|
2795
2782
|
includeMetadata?: boolean;
|
|
2796
2783
|
showCuesInWidget?: boolean;
|
|
2797
|
-
}): Promise<EvaluationOutput
|
|
2784
|
+
}): Promise<EvaluationOutput | string>;
|
|
2798
2785
|
/**
|
|
2799
2786
|
* Evaluates conversation lifecycle assistants.
|
|
2800
2787
|
*
|
|
@@ -2841,52 +2828,6 @@ declare class DeepdeskSDK {
|
|
|
2841
2828
|
includeMetadata?: boolean;
|
|
2842
2829
|
showCuesInWidget?: boolean;
|
|
2843
2830
|
}): 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
2831
|
private handleKeyDown;
|
|
2891
2832
|
private handleAfterSendMessage;
|
|
2892
2833
|
/**
|
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
|
|
415
|
+
type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
|
|
417
416
|
type ArrayItemType<T> = T extends Array<infer I> ? I : never;
|
|
418
|
-
type Cue = ArrayItemType<EvaluationOutput
|
|
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
|
|
688
|
+
type EvaluationResponse = {
|
|
694
689
|
evaluation_id: string;
|
|
695
690
|
evaluation_status: EvaluationStatus;
|
|
696
|
-
output: EvaluationOutput
|
|
691
|
+
output: EvaluationOutput;
|
|
697
692
|
};
|
|
698
|
-
type EvaluationOutput
|
|
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
|
-
}
|
|
703
|
+
}>;
|
|
711
704
|
/**
|
|
712
705
|
* Handling time event data
|
|
713
706
|
*/
|
|
@@ -1143,8 +1136,7 @@ declare class DeepdeskAPI {
|
|
|
1143
1136
|
verifyLoginToken(token: string): Promise<{
|
|
1144
1137
|
isLoggedIn: boolean;
|
|
1145
1138
|
}>;
|
|
1146
|
-
evaluateAssistant<
|
|
1147
|
-
expectFormat: TOutput;
|
|
1139
|
+
evaluateAssistant<TInput = Record<string, unknown>>(assistantCode: string, options?: {
|
|
1148
1140
|
threadId?: number;
|
|
1149
1141
|
input: TInput;
|
|
1150
1142
|
transcript?: Array<{
|
|
@@ -1152,7 +1144,7 @@ declare class DeepdeskAPI {
|
|
|
1152
1144
|
text: string;
|
|
1153
1145
|
}>;
|
|
1154
1146
|
externalConversationId?: string;
|
|
1155
|
-
}): Promise<CamelCaseKeys<Server.EvaluationResponse
|
|
1147
|
+
}): Promise<CamelCaseKeys<Server.EvaluationResponse>>;
|
|
1156
1148
|
createAssistantThread(init: {
|
|
1157
1149
|
assistantCode: string;
|
|
1158
1150
|
}): Promise<{
|
|
@@ -2022,7 +2014,6 @@ interface WidgetOptions {
|
|
|
2022
2014
|
}
|
|
2023
2015
|
interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
|
|
2024
2016
|
customStyles?: WidgetCustomStyles;
|
|
2025
|
-
isLegacyKnowledgeAssist?: boolean;
|
|
2026
2017
|
title?: string;
|
|
2027
2018
|
}
|
|
2028
2019
|
declare class DeepdeskSDK {
|
|
@@ -2754,7 +2745,6 @@ declare class DeepdeskSDK {
|
|
|
2754
2745
|
*
|
|
2755
2746
|
* @param assistantCode - The assistant code to evaluate
|
|
2756
2747
|
* @param options - Evaluation options
|
|
2757
|
-
* @param options.expectFormat - Expected response format ('json-schema:cues', 'json-schema:knowledge-assist', 'text', 'json-object')
|
|
2758
2748
|
* @param options.input - Additional input data for the assistant
|
|
2759
2749
|
* @param options.transcript - Transcript option ('in-memory-transcript' or custom transcript)
|
|
2760
2750
|
* @param options.includeMetadata - Whether to include metadata in the response
|
|
@@ -2765,7 +2755,6 @@ declare class DeepdeskSDK {
|
|
|
2765
2755
|
* ```typescript
|
|
2766
2756
|
* // Evaluate assistant with cues format
|
|
2767
2757
|
* const result = await sdk.evaluateAssistant('assistant-code-123', {
|
|
2768
|
-
* expectFormat: 'json-schema:cues',
|
|
2769
2758
|
* input: {
|
|
2770
2759
|
* customerType: 'premium',
|
|
2771
2760
|
* issueType: 'technical'
|
|
@@ -2774,7 +2763,6 @@ declare class DeepdeskSDK {
|
|
|
2774
2763
|
*
|
|
2775
2764
|
* // Evaluate with custom transcript
|
|
2776
2765
|
* const result = await sdk.evaluateAssistant('assistant-code-456', {
|
|
2777
|
-
* expectFormat: 'text',
|
|
2778
2766
|
* transcript: [
|
|
2779
2767
|
* { source: 'visitor', text: 'I have a problem with my order' },
|
|
2780
2768
|
* { source: 'agent', text: 'I can help you with that' }
|
|
@@ -2788,13 +2776,12 @@ declare class DeepdeskSDK {
|
|
|
2788
2776
|
* });
|
|
2789
2777
|
* ```
|
|
2790
2778
|
*/
|
|
2791
|
-
evaluateAssistant
|
|
2792
|
-
expectFormat?: T;
|
|
2779
|
+
evaluateAssistant(assistantCode: string, options?: {
|
|
2793
2780
|
input?: Record<string, any>;
|
|
2794
2781
|
transcript?: TranscriptOption;
|
|
2795
2782
|
includeMetadata?: boolean;
|
|
2796
2783
|
showCuesInWidget?: boolean;
|
|
2797
|
-
}): Promise<EvaluationOutput
|
|
2784
|
+
}): Promise<EvaluationOutput | string>;
|
|
2798
2785
|
/**
|
|
2799
2786
|
* Evaluates conversation lifecycle assistants.
|
|
2800
2787
|
*
|
|
@@ -2841,52 +2828,6 @@ declare class DeepdeskSDK {
|
|
|
2841
2828
|
includeMetadata?: boolean;
|
|
2842
2829
|
showCuesInWidget?: boolean;
|
|
2843
2830
|
}): 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
2831
|
private handleKeyDown;
|
|
2891
2832
|
private handleAfterSendMessage;
|
|
2892
2833
|
/**
|