diff --git a/src/message.tsx b/src/message.tsx index f46da2b..36b1790 100644 --- a/src/message.tsx +++ b/src/message.tsx @@ -74,7 +74,7 @@ export default function Message(props: Props) { token{" "} { chat.token = parseInt(event.target.value); props.update_total_tokens(); @@ -113,6 +113,7 @@ export default function Message(props: Props) { value={chat.content} onChange={(event: any) => { chat.content = event.target.value; + chat.token = calculate_token_length(chat.content); setChatStore({ ...chatStore }); }} >