File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
frontend/components/chatPlayground Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ export default function ChatContainer() {
6161 setStopSequences ( stopSequences . filter ( ( _ , i ) => i !== index ) ) ;
6262 } ;
6363
64+ const clearChat = ( ) => {
65+ setConversation ( [ ] ) ;
66+ setHistory ( [ ] ) ;
67+ } ;
68+
6469 const sendMessage = async ( ) => {
6570 const newMessage = { sender : "Human" , message : inputValue } ;
6671 setConversation ( prevConversation => [ ...prevConversation , newMessage ] ) ;
@@ -106,7 +111,16 @@ export default function ChatContainer() {
106111 < div className = "flex flex-col flex-auto flex-shrink-0 rounded-2xl bg-gray-100 p-4 mt-8" >
107112 { /* model and parameter selection */ }
108113 < div className = "sticky top-0 z-10 bg-gray-100 py-4" >
109- < ChatModelSelector model = { selectedModel } onModelChange = { onModelChange } />
114+ < div className = "flex justify-between items-center mb-4" >
115+ < ChatModelSelector model = { selectedModel } onModelChange = { onModelChange } />
116+ < button
117+ onClick = { clearChat }
118+ className = "bg-red-500 hover:bg-red-600 text-white px-4 py-2 rounded-xl"
119+ >
120+ Clear Chat
121+ </ button >
122+ </ div >
123+
110124 < div className = "flex flex-row items-center h-16 rounded-xl bg-white w-full px-4 sticky" >
111125 { /* maxTokens */ }
112126 < div className = "ml-4" >
You can’t perform that action at this time.
0 commit comments