@@ -97,10 +97,9 @@ type ChatProps = {
97
97
entries : ChatElement [ ] ;
98
98
humanText ? : string ;
99
99
onPrompt : ( prompt : string ) => void ;
100
- onResponse : ( { prompt, response, contentType, entryId} : { prompt : string , response : string , contentType : ChatContent , entryId : number } ) => void ;
101
100
clearConversation : ( ) => void ;
102
101
} ;
103
- function Chat ( { entries, humanText, onPrompt, onResponse , clearConversation} : ChatProps ) : JSX . Element {
102
+ function Chat ( { entries, humanText, onPrompt, clearConversation} : ChatProps ) : JSX . Element {
104
103
const styles = React . useContext ( StylesContext ) ;
105
104
const chatHistory = React . useContext ( ChatHistoryContext ) ;
106
105
const [ showFeedbackPopup , setShowFeedbackPopup ] = React . useState ( false ) ;
@@ -151,7 +150,8 @@ function Chat({entries, humanText, onPrompt, onResponse, clearConversation}: Cha
151
150
id = { entry . id }
152
151
prompt = { entry . prompt ?? "" }
153
152
intent = { entry . intent }
154
- onResponse = { ( { prompt, response, contentType} ) => onResponse ( { prompt : prompt , response : response , contentType : contentType , entryId : entry . id } ) } />
153
+ onResponse = { ( { prompt, response, contentType} ) =>
154
+ chatHistory . modifyResponse ( entry . id , { prompt : prompt , text : response , contentType : contentType } ) } />
155
155
}
156
156
</ View >
157
157
) ) }
0 commit comments