@blueking/ai-ui-sdk 0.0.12-beta.7 → 0.0.12-beta.9
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/hooks/use-chat.d.ts +11 -54
- package/dist/types/type.d.ts +7 -7
- package/package.json +1 -1
package/dist/hooks/use-chat.d.ts
CHANGED
@@ -1,57 +1,14 @@
|
|
1
1
|
import type { ISessionContent, ISession, ISessionPrompt, ChatCallbacks, BasicChatContent, ShortcutChatContent } from '../types/type.ts';
|
2
|
-
|
3
|
-
|
4
|
-
[key: string]: ISessionContent[];
|
2
|
+
type SessionContentsMap<P extends ISessionContent = ISessionContent> = {
|
3
|
+
[key: string]: P[];
|
5
4
|
};
|
6
5
|
type SessionLoadingMap = {
|
7
6
|
[key: string]: boolean;
|
8
7
|
};
|
9
|
-
export declare const useChat: <T extends ISession = ISession>({ handleStart, handleText, handleReferenceDoc, handleThink, handleEnd, handleError, requestOptions, }?: ChatCallbacks) => {
|
8
|
+
export declare const useChat: <T extends ISession = ISession, P extends ISessionContent = ISessionContent>({ handleStart, handleText, handleReferenceDoc, handleThink, handleEnd, handleError, requestOptions, }?: ChatCallbacks<P>) => {
|
10
9
|
currentSession: import("vue").Ref<T | undefined, T | undefined>;
|
11
|
-
sessionContents: import("vue").Ref<
|
12
|
-
|
13
|
-
createdAt?: string | undefined;
|
14
|
-
createdBy?: string | undefined;
|
15
|
-
updatedAt?: string | undefined;
|
16
|
-
updatedBy?: string | undefined;
|
17
|
-
spaceId?: string | undefined;
|
18
|
-
liked?: boolean | undefined;
|
19
|
-
role: SessionContentRole;
|
20
|
-
content: string;
|
21
|
-
rate?: number | undefined;
|
22
|
-
status?: SessionContentStatus | undefined;
|
23
|
-
sessionCode: string;
|
24
|
-
cite?: string | undefined;
|
25
|
-
time?: string | undefined;
|
26
|
-
property?: {
|
27
|
-
extra?: {
|
28
|
-
tools?: object[] | undefined;
|
29
|
-
anchorPathResources?: object | undefined;
|
30
|
-
} | undefined;
|
31
|
-
} | undefined;
|
32
|
-
}[], ISessionContent<object, object>[] | {
|
33
|
-
id?: number | undefined;
|
34
|
-
createdAt?: string | undefined;
|
35
|
-
createdBy?: string | undefined;
|
36
|
-
updatedAt?: string | undefined;
|
37
|
-
updatedBy?: string | undefined;
|
38
|
-
spaceId?: string | undefined;
|
39
|
-
liked?: boolean | undefined;
|
40
|
-
role: SessionContentRole;
|
41
|
-
content: string;
|
42
|
-
rate?: number | undefined;
|
43
|
-
status?: SessionContentStatus | undefined;
|
44
|
-
sessionCode: string;
|
45
|
-
cite?: string | undefined;
|
46
|
-
time?: string | undefined;
|
47
|
-
property?: {
|
48
|
-
extra?: {
|
49
|
-
tools?: object[] | undefined;
|
50
|
-
anchorPathResources?: object | undefined;
|
51
|
-
} | undefined;
|
52
|
-
} | undefined;
|
53
|
-
}[]>;
|
54
|
-
sessionContentsMap: SessionContentsMap;
|
10
|
+
sessionContents: import("vue").Ref<import("@vue/reactivity").UnwrapRefSimple<P>[], P[] | import("@vue/reactivity").UnwrapRefSimple<P>[]>;
|
11
|
+
sessionContentsMap: SessionContentsMap<P>;
|
55
12
|
sessionLoadingMap: import("vue").Ref<SessionLoadingMap, SessionLoadingMap>;
|
56
13
|
prompts: import("vue").ComputedRef<ISessionPrompt[]>;
|
57
14
|
currentSessionLoading: import("vue").ComputedRef<boolean>;
|
@@ -63,13 +20,13 @@ export declare const useChat: <T extends ISession = ISession>({ handleStart, han
|
|
63
20
|
}) => void;
|
64
21
|
sendChat: (content: BasicChatContent | ShortcutChatContent, callback?: () => void) => void;
|
65
22
|
stopChat: (sessionCode: string) => void;
|
66
|
-
plusSessionContent: (sessionCode: string, sessionContent:
|
67
|
-
updateSessionContent: (sessionContent:
|
68
|
-
getSessionContentById: (id: number, sessionCode: string) =>
|
69
|
-
getLastSessionContentBySessionCode: (sessionCode: string) =>
|
70
|
-
getSessionContentsBySessionCode: (sessionCode: string) =>
|
23
|
+
plusSessionContent: (sessionCode: string, sessionContent: P) => void;
|
24
|
+
updateSessionContent: (sessionContent: P) => void;
|
25
|
+
getSessionContentById: (id: number, sessionCode: string) => P | undefined;
|
26
|
+
getLastSessionContentBySessionCode: (sessionCode: string) => P;
|
27
|
+
getSessionContentsBySessionCode: (sessionCode: string) => P[];
|
71
28
|
setCurrentSession: (session?: T) => void;
|
72
|
-
setSessionContents: (data:
|
29
|
+
setSessionContents: (data: P[]) => void;
|
73
30
|
deleteSessionContent: (sessionCode: string, contentId: number) => number[];
|
74
31
|
deleteSessionContents: (sessionCode: string, contentIds: number[]) => number[];
|
75
32
|
handleStartChat: (sessionCode: string) => void | undefined;
|
package/dist/types/type.d.ts
CHANGED
@@ -47,13 +47,13 @@ export interface ISessionPrompt {
|
|
47
47
|
content: string;
|
48
48
|
role: SessionPromptRole;
|
49
49
|
}
|
50
|
-
export interface ChatCallbacks {
|
51
|
-
handleStart?: (sessionCode: string, sessionContent:
|
52
|
-
handleText?: (sessionCode: string, sessionContent:
|
53
|
-
handleReferenceDoc?: (sessionCode: string, sessionContent:
|
54
|
-
handleThink?: (sessionCode: string, sessionContent:
|
55
|
-
handleEnd?: (sessionCode: string, sessionContent:
|
56
|
-
handleError?: (sessionCode: string, sessionContent:
|
50
|
+
export interface ChatCallbacks<T extends ISessionContent = ISessionContent> {
|
51
|
+
handleStart?: (sessionCode: string, sessionContent: T) => void;
|
52
|
+
handleText?: (sessionCode: string, sessionContent: T) => void;
|
53
|
+
handleReferenceDoc?: (sessionCode: string, sessionContent: T) => void;
|
54
|
+
handleThink?: (sessionCode: string, sessionContent: T) => void;
|
55
|
+
handleEnd?: (sessionCode: string, sessionContent: T) => void;
|
56
|
+
handleError?: (sessionCode: string, sessionContent: T, code: string | undefined) => void;
|
57
57
|
requestOptions?: {
|
58
58
|
url: string;
|
59
59
|
headers?: Record<string, string>;
|