File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -17,16 +17,16 @@ form.addEventListener("submit", async (e) => {
1717 body : JSON . stringify ( { message } )
1818 } ) ;
1919
20- const text = await response . text ( ) ;
21- console . log ( "Responsetekst:" , text ) ;
22-
2320 if ( ! response . ok ) {
2421 throw new Error ( `Serverfout: ${ response . status } ` ) ;
2522 }
2623
27- appendMessage ( "Agent" , text ) ;
24+ const data = await response . json ( ) ;
25+ const output = data . tool_output || "Geen antwoord ontvangen." ;
26+ appendMessage ( "Agent" , output ) ;
27+
2828 } catch ( err ) {
29- appendMessage ( "Agent" , "Er ging iets mis bij het ophalen van het zorgdocument ." ) ;
29+ appendMessage ( "Agent" , "Er ging iets mis." ) ;
3030 console . error ( "Fout in fetch:" , err ) ;
3131 }
3232} ) ;
@@ -37,3 +37,4 @@ 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