esgimate token length after editing
This commit is contained in:
@@ -74,7 +74,7 @@ export default function Message(props: Props) {
|
|||||||
token{" "}
|
token{" "}
|
||||||
<input
|
<input
|
||||||
value={chat.token}
|
value={chat.token}
|
||||||
className='w-20'
|
className="w-20"
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
chat.token = parseInt(event.target.value);
|
chat.token = parseInt(event.target.value);
|
||||||
props.update_total_tokens();
|
props.update_total_tokens();
|
||||||
@@ -113,6 +113,7 @@ export default function Message(props: Props) {
|
|||||||
value={chat.content}
|
value={chat.content}
|
||||||
onChange={(event: any) => {
|
onChange={(event: any) => {
|
||||||
chat.content = event.target.value;
|
chat.content = event.target.value;
|
||||||
|
chat.token = calculate_token_length(chat.content);
|
||||||
setChatStore({ ...chatStore });
|
setChatStore({ ...chatStore });
|
||||||
}}
|
}}
|
||||||
></textarea>
|
></textarea>
|
||||||
|
|||||||
Reference in New Issue
Block a user