@ai-group/chat-sdk 1.0.9 → 1.0.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/cjs/components/XAiChatbot/XAiChatbot.stories.js +0 -16
- package/dist/cjs/components/XAiChatbot/XAiChatbot.stories.js.map +2 -2
- package/dist/cjs/components/XAiChatbot/index.js +4 -6
- package/dist/cjs/components/XAiChatbot/index.js.map +2 -2
- package/dist/cjs/components/XAiChatbot/styles.js +1 -0
- package/dist/cjs/components/XAiChatbot/styles.js.map +2 -2
- package/dist/cjs/components/XAiProvider/XAiProvider.stories.js +2 -2
- package/dist/cjs/components/XAiProvider/XAiProvider.stories.js.map +1 -1
- package/dist/cjs/hooks/useAgentGenerator.d.ts +20 -16
- package/dist/cjs/hooks/useAgentGenerator.js +384 -266
- package/dist/cjs/hooks/useAgentGenerator.js.map +3 -3
- package/dist/cjs/types/XAiChatbot.d.ts +2 -1
- package/dist/cjs/types/XAiChatbot.js.map +1 -1
- package/dist/cjs/types/XAiMessage.d.ts +2 -16
- package/dist/cjs/types/XAiMessage.js.map +2 -2
- package/dist/cjs/types/node.d.ts +10 -0
- package/dist/cjs/types/node.js +18 -0
- package/dist/cjs/types/node.js.map +7 -0
- package/dist/cjs/utils/workflowNode.d.ts +2 -0
- package/dist/cjs/utils/workflowNode.js +169 -0
- package/dist/cjs/utils/workflowNode.js.map +7 -0
- package/dist/esm/components/XAiChatbot/XAiChatbot.stories.js +0 -15
- package/dist/esm/components/XAiChatbot/XAiChatbot.stories.js.map +1 -1
- package/dist/esm/components/XAiChatbot/index.js +4 -20
- package/dist/esm/components/XAiChatbot/index.js.map +1 -1
- package/dist/esm/components/XAiChatbot/styles.js +1 -1
- package/dist/esm/components/XAiChatbot/styles.js.map +1 -1
- package/dist/esm/components/XAiProvider/XAiProvider.stories.js +2 -2
- package/dist/esm/components/XAiProvider/XAiProvider.stories.js.map +1 -1
- package/dist/esm/hooks/useAgentGenerator.d.ts +20 -16
- package/dist/esm/hooks/useAgentGenerator.js +541 -339
- package/dist/esm/hooks/useAgentGenerator.js.map +1 -1
- package/dist/esm/types/XAiChatbot.d.ts +2 -1
- package/dist/esm/types/XAiChatbot.js.map +1 -1
- package/dist/esm/types/XAiMessage.d.ts +2 -16
- package/dist/esm/types/XAiMessage.js +0 -4
- package/dist/esm/types/XAiMessage.js.map +1 -1
- package/dist/esm/types/node.d.ts +10 -0
- package/dist/esm/types/node.js +2 -0
- package/dist/esm/types/node.js.map +1 -0
- package/dist/esm/utils/workflowNode.d.ts +2 -0
- package/dist/esm/utils/workflowNode.js +141 -0
- package/dist/esm/utils/workflowNode.js.map +1 -0
- package/dist/umd/chat-sdk.min.js +1 -1
- package/package.json +1 -1
|
@@ -23,14 +23,18 @@ export interface ContentDef {
|
|
|
23
23
|
}
|
|
24
24
|
export type Contents = ContentDef[];
|
|
25
25
|
export declare enum ActionType {
|
|
26
|
-
recallKnowledgeStart = "RECALL_KNOWLEDGE_START"
|
|
27
|
-
recallKnowledgeEnd = "RECALL_KNOWLEDGE_END"
|
|
28
|
-
invokeToolStart = "INVOKE_AGENT_TOOL_START"
|
|
29
|
-
invokeToolEnd = "INVOKE_AGENT_TOOL_END"
|
|
30
|
-
reasoning = "REASONING"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
recallKnowledgeStart = "RECALL_KNOWLEDGE_START",
|
|
27
|
+
recallKnowledgeEnd = "RECALL_KNOWLEDGE_END",
|
|
28
|
+
invokeToolStart = "INVOKE_AGENT_TOOL_START",
|
|
29
|
+
invokeToolEnd = "INVOKE_AGENT_TOOL_END",
|
|
30
|
+
reasoning = "REASONING",
|
|
31
|
+
reasoningStart = "REASONING_START",
|
|
32
|
+
reasoningEnd = "REASONING_END",
|
|
33
|
+
componentStart = "COMPONENT_START",
|
|
34
|
+
componentStream = "COMPONENT_STREAM",
|
|
35
|
+
componentEnd = "COMPONENT_END",
|
|
36
|
+
suggest = "FOLLOW_UP",
|
|
37
|
+
response = "RESPONSE",
|
|
34
38
|
finish = "FINISHED"
|
|
35
39
|
}
|
|
36
40
|
export declare enum ProcessStatus {
|
|
@@ -38,20 +42,20 @@ export declare enum ProcessStatus {
|
|
|
38
42
|
end = "END"
|
|
39
43
|
}
|
|
40
44
|
export declare enum ActionAvailability {
|
|
41
|
-
disabled = "disabled"
|
|
42
|
-
enabled = "enabled"
|
|
45
|
+
disabled = "disabled",
|
|
46
|
+
enabled = "enabled",
|
|
43
47
|
remote = "remote"
|
|
44
48
|
}
|
|
45
49
|
export type ThinkStep = any;
|
|
46
|
-
/**
|
|
47
|
-
* 工具/动作定义
|
|
48
|
-
*/
|
|
49
50
|
export interface Action {
|
|
50
51
|
name: string;
|
|
51
52
|
description: string;
|
|
52
53
|
jsonSchema: string;
|
|
53
54
|
available?: ActionAvailability;
|
|
54
|
-
|
|
55
|
+
}
|
|
56
|
+
export interface BaseFields {
|
|
57
|
+
textSpeed?: number;
|
|
58
|
+
onChatDone?: () => void;
|
|
55
59
|
}
|
|
56
60
|
export interface UseAgentGeneratorProps {
|
|
57
61
|
url: string;
|
|
@@ -61,7 +65,7 @@ export interface UseAgentGeneratorProps {
|
|
|
61
65
|
onSuccess?: (data: Success) => void;
|
|
62
66
|
onMessage?: (content: string, data: Messages) => void;
|
|
63
67
|
}
|
|
64
|
-
declare const useAgentGenerator: (
|
|
68
|
+
declare const useAgentGenerator: (params: UseAgentGeneratorProps) => {
|
|
65
69
|
appInfo: any;
|
|
66
70
|
messages: Messages[];
|
|
67
71
|
loading: boolean;
|
|
@@ -75,7 +79,7 @@ declare const useAgentGenerator: ({ url, token, config, onError, onMessage, onSu
|
|
|
75
79
|
};
|
|
76
80
|
initAppConversations: (fetchDetail?: boolean) => Promise<void>;
|
|
77
81
|
reChat: () => void;
|
|
78
|
-
chat: (content: any) => Promise<void>;
|
|
82
|
+
chat: <T = any>(content: T, extra?: any, insert?: boolean) => Promise<void>;
|
|
79
83
|
createNewChat: () => void;
|
|
80
84
|
setCurrentSessionId: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
81
85
|
setCurrentSessionDetail: (sessionId: string) => Promise<void>;
|