@topthink/chat 1.0.5 → 1.0.7
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/package.json +3 -3
- package/types/hooks/use-chat.d.ts +1 -6
- package/types/types.d.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topthink/chat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"prebuild": "rimraf es types",
|
|
6
6
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.11.2",
|
|
20
|
-
"@topthink/components": "^1.0.
|
|
20
|
+
"@topthink/components": "^1.0.82",
|
|
21
21
|
"katex": "^0.16.9",
|
|
22
22
|
"react-markdown": "^8.0.7",
|
|
23
23
|
"react-textarea-autosize": "^8.5.3",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
},
|
|
56
56
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
57
57
|
"license": "MIT",
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "7a8e0fec1fc3f71f9cc2a2286b915fd5cffea89c"
|
|
59
59
|
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { MutableRefObject } from 'react';
|
|
2
|
-
import { Chat, Message } from '../types';
|
|
2
|
+
import { Chat, Conversation, Message } from '../types';
|
|
3
3
|
import { RequestConfig } from '@topthink/components';
|
|
4
|
-
interface Conversation {
|
|
5
|
-
id: string;
|
|
6
|
-
messages: Message[];
|
|
7
|
-
}
|
|
8
4
|
export interface ChatOptions {
|
|
9
5
|
url: string;
|
|
10
6
|
transformRequest?: Exclude<RequestConfig, string>['transformRequest'];
|
|
@@ -22,4 +18,3 @@ export default function useChat({ url, transformRequest, onboarding, onSuccess,
|
|
|
22
18
|
send: (query: string, files?: Message['files']) => Promise<void>;
|
|
23
19
|
reset: (conversation?: Conversation) => void;
|
|
24
20
|
};
|
|
25
|
-
export {};
|
package/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface Chat {
|
|
2
|
-
reset(): void;
|
|
2
|
+
reset(conversation?: Conversation): void;
|
|
3
3
|
send(query: string): void;
|
|
4
4
|
}
|
|
5
5
|
export interface ToolMessage {
|
|
@@ -32,3 +32,7 @@ export interface Message {
|
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
}
|
|
34
34
|
export type ShowProcess = 'stats' | 'all' | 'none';
|
|
35
|
+
export interface Conversation {
|
|
36
|
+
id: string;
|
|
37
|
+
messages: Message[];
|
|
38
|
+
}
|