@@ -10,6 +10,7 @@ import Message from './message';
1010import Pagination from './pagination' ;
1111import Prompt from './prompt' ;
1212import Tag from './tag' ;
13+ import Think from './think' ;
1314import useChat from './useChat' ;
1415import { context , type IChatContext , useContext } from './useContext' ;
1516import Welcome from './welcome' ;
@@ -21,7 +22,24 @@ const DEFAULT_MAX_REGENERATE_COUNT = 5;
2122type ChatProviderConfig = Omit < IChatProps , 'maxRegenerateCount' > &
2223 Partial < Pick < IChatProps , 'maxRegenerateCount' > > ;
2324
24- function Chat ( {
25+ type ChatComponent = React . FC < PropsWithChildren < ChatProviderConfig > > & {
26+ useChat : typeof useChat ;
27+ useContext : typeof useContext ;
28+ Loading : typeof Loading ;
29+ Button : typeof Button ;
30+ CodeBlock : typeof CodeBlock ;
31+ Input : typeof Input ;
32+ Markdown : typeof Markdown ;
33+ Pagination : typeof Pagination ;
34+ Message : typeof Message ;
35+ Prompt : typeof Prompt ;
36+ Content : typeof Content ;
37+ Tag : typeof Tag ;
38+ Welcome : typeof Welcome ;
39+ Think : typeof Think ;
40+ } ;
41+
42+ const Chat : ChatComponent = function Chat ( {
2543 chat,
2644 components,
2745 maxRegenerateCount = DEFAULT_MAX_REGENERATE_COUNT ,
@@ -50,11 +68,10 @@ function Chat({
5068 { children }
5169 </ context . Provider >
5270 ) ;
53- }
71+ } ;
5472
5573Chat . useChat = useChat ;
5674Chat . useContext = useContext ;
57-
5875Chat . Loading = Loading ;
5976Chat . Button = Button ;
6077Chat . CodeBlock = CodeBlock ;
@@ -66,6 +83,7 @@ Chat.Prompt = Prompt;
6683Chat . Content = Content ;
6784Chat . Tag = Tag ;
6885Chat . Welcome = Welcome ;
86+ Chat . Think = Think ;
6987
7088export { type IContentRef } from './content' ;
7189export default Chat ;
0 commit comments