From ebf00353f6fb7d20c3baba9093569096ca49b82b Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Fri, 10 Nov 2023 17:26:27 +0800 Subject: [PATCH] fix: render del bug --- src/message.tsx | 88 +++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/src/message.tsx b/src/message.tsx index 94c2a4b..483e33d 100644 --- a/src/message.tsx +++ b/src/message.tsx @@ -315,6 +315,47 @@ export default function Message(props: Props) { /> ) ) + ) : chat.tool_calls ? ( +
+
+ {chat.tool_calls?.map((tool_call) => ( +
+ + Tool Call ID:{" "} + copyToClipboard(String(tool_call.id))} + > + {tool_call?.id} + + +

Type: {tool_call?.type}

+

+ Function: + + copyToClipboard(tool_call.function.name) + } + > + {tool_call.function.name} + +

+

+ Arguments: + + copyToClipboard(tool_call.function.arguments) + } + > + {tool_call.function.arguments} + +

+
+ ))} +
+
) : renderMarkdown ? ( // @ts-ignore @@ -326,53 +367,6 @@ export default function Message(props: Props) { } )} - {chat.tool_calls && ( -
-
- {chat.tool_calls?.map((tool_call) => ( - <> -
-
- - Tool Call ID:{" "} - - copyToClipboard(String(tool_call.id)) - } - > - {tool_call?.id} - - -

Type: {tool_call?.type}

-

- Function: - - copyToClipboard(tool_call.function.name) - } - > - {tool_call.function.name} - -

-

- Arguments: - - copyToClipboard(tool_call.function.arguments) - } - > - {tool_call.function.arguments} - -

-
- - ))} -
-
- )}