import { ChatStore, ChatStoreMessage } from "@/types/chatstore"; import { isVailedJSON } from "@/message"; import { calculate_token_length } from "@/chatgpt"; import { Tr } from "@/translate"; interface Props { chat: ChatStoreMessage; chatStore: ChatStore; setChatStore: (cs: ChatStore) => void; setShowEdit: (se: boolean) => void; } export function EditMessageString({ chat, chatStore, setChatStore, setShowEdit, }: Props) { if (typeof chat.content !== "string") return
error
; return (
{chat.tool_call_id && ( { chat.tool_call_id = event.target.value; setChatStore({ ...chatStore }); }} /> )} {chat.tool_calls && chat.tool_calls.map((tool_call) => (
Vailed JSON:{" "} {isVailedJSON(tool_call.function.arguments) ? "🆗" : "❌"}
))}
); }