edit message token
This commit is contained in:
@@ -346,6 +346,7 @@ export default function ChatBOX(props: {
|
|||||||
chatStore={chatStore}
|
chatStore={chatStore}
|
||||||
setChatStore={setChatStore}
|
setChatStore={setChatStore}
|
||||||
messageIndex={messageIndex}
|
messageIndex={messageIndex}
|
||||||
|
update_total_tokens={update_total_tokens}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
{chatStore.develop_mode && (
|
{chatStore.develop_mode && (
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ interface Props {
|
|||||||
messageIndex: number;
|
messageIndex: number;
|
||||||
chatStore: ChatStore;
|
chatStore: ChatStore;
|
||||||
setChatStore: (cs: ChatStore) => void;
|
setChatStore: (cs: ChatStore) => void;
|
||||||
|
update_total_tokens: () => void;
|
||||||
}
|
}
|
||||||
export default function Message(props: Props) {
|
export default function Message(props: Props) {
|
||||||
const { chatStore, messageIndex, setChatStore } = props;
|
const { chatStore, messageIndex, setChatStore } = props;
|
||||||
@@ -70,7 +71,16 @@ export default function Message(props: Props) {
|
|||||||
</div>
|
</div>
|
||||||
{chatStore.develop_mode && (
|
{chatStore.develop_mode && (
|
||||||
<div>
|
<div>
|
||||||
token {chatStore.history[messageIndex].token}
|
token{" "}
|
||||||
|
<input
|
||||||
|
value={chat.token}
|
||||||
|
className='w-20'
|
||||||
|
onChange={(event: any) => {
|
||||||
|
chat.token = parseInt(event.target.value);
|
||||||
|
props.update_total_tokens();
|
||||||
|
setChatStore({ ...chatStore });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
chatStore.history.splice(messageIndex, 1);
|
chatStore.history.splice(messageIndex, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user