render tool reponse

This commit is contained in:
2023-11-10 20:33:24 +08:00
parent 1217513ae3
commit 8f9d508a18
5 changed files with 125 additions and 61 deletions

24
src/messageToolResp.tsx Normal file
View File

@@ -0,0 +1,24 @@
import { ChatStoreMessage } from "./app";
interface Props {
chat: ChatStoreMessage;
copyToClipboard: (text: string) => void;
}
export function MessageToolResp({ chat, copyToClipboard }: Props) {
return (
<div className="message-content">
<div className="bg-blue-300 dark:bg-blue-800 p-1 rounded my-1">
<strong>
Tool Response ID:{" "}
<span
className="p-1 m-1 rounded cursor-pointer hover:opacity-50 hover:underline"
onClick={() => copyToClipboard(String(chat.tool_call_id))}
>
{chat.tool_call_id}
</span>
</strong>
<p>{chat.content}</p>
</div>
</div>
);
}