File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,16 @@ form.addEventListener("submit", async (e) => {
1818 } ) ;
1919
2020 if ( ! response . ok ) {
21+ const errorText = await response . text ( ) ;
22+ appendMessage ( "Agent" , `Fout: ${ errorText } ` ) ;
2123 throw new Error ( `Serverfout: ${ response . status } ` ) ;
2224 }
2325
2426 const data = await response . json ( ) ;
25- const output = data . tool_output || "Geen antwoord ontvangen." ;
26- appendMessage ( "Agent" , output ) ;
27-
27+ appendMessage ( "Agent" , data . text ) ;
2828 } catch ( err ) {
29- appendMessage ( "Agent" , "Er ging iets mis." ) ;
3029 console . error ( "Fout in fetch:" , err ) ;
30+ appendMessage ( "Agent" , "Er ging iets mis." ) ;
3131 }
3232} ) ;
3333
@@ -37,4 +37,3 @@ function appendMessage(sender, text) {
3737 chat . appendChild ( msg ) ;
3838 chat . scrollTop = chat . scrollHeight ;
3939}
40-
You can’t perform that action at this time.
0 commit comments