@@ -22,7 +22,7 @@ function ToolInvocation({
2222 part : any ;
2323 onApprove ?: ( approvalId : string ) => void ;
2424 onDeny ?: ( approvalId : string ) => void ;
25- onToolOutput ?: ( toolCallId : string , output : unknown ) => void ;
25+ onToolOutput ?: ( tool : string , toolCallId : string , output : unknown ) => void ;
2626} ) {
2727 const [ expanded , setExpanded ] = useState ( false ) ;
2828 const toolName = part . type . startsWith ( "tool-" ) ? part . type . slice ( 5 ) : "tool" ;
@@ -87,7 +87,7 @@ function ToolInvocation({
8787 key = { opt . id }
8888 type = "button"
8989 onClick = { ( ) =>
90- onToolOutput ?.( part . toolCallId , {
90+ onToolOutput ?.( toolName , part . toolCallId , {
9191 skipped : false ,
9292 answers : [ { questionId : args . question , optionId : opt . id , text : opt . label } ] ,
9393 } )
@@ -566,7 +566,7 @@ export function Chat({
566566 </ p >
567567 ) }
568568
569- { messages . map ( ( message , messageIndex ) => (
569+ { messages . map ( ( message ) => (
570570 < div
571571 key = { message . id }
572572 className = { `flex ${ message . role === "user" ? "justify-end" : "justify-start" } ` }
@@ -580,17 +580,7 @@ export function Chat({
580580 { message . parts . map ( ( part , i ) => {
581581 if ( part . type === "text" ) {
582582 if ( message . role === "assistant" ) {
583- return (
584- < Streamdown
585- key = { i }
586- animated
587- isAnimating = {
588- status === "streaming" && messageIndex === messages . length - 1
589- }
590- >
591- { part . text }
592- </ Streamdown >
593- ) ;
583+ return < Streamdown key = { i } > { part . text } </ Streamdown > ;
594584 }
595585 return < span key = { i } > { part . text } </ span > ;
596586 }
@@ -652,8 +642,8 @@ export function Chat({
652642 part = { part }
653643 onApprove = { handleApprove }
654644 onDeny = { handleDeny }
655- onToolOutput = { ( toolCallId , output ) =>
656- addToolOutput ( { toolCallId, output } )
645+ onToolOutput = { ( tool , toolCallId , output ) =>
646+ addToolOutput ( { tool , toolCallId, output } )
657647 }
658648 />
659649 ) ;
0 commit comments