regenerate and complte function

This commit is contained in:
2023-07-08 10:07:10 +08:00
parent 22b4d59b1c
commit 9d34189c96

View File

@@ -344,6 +344,33 @@ export default function ChatBOX(props: {
messageIndex={messageIndex}
/>
))}
{chatStore.develop_mode && (
<p className="text-center rounded">
<button
className="p-2 m-2 bg-teal-500 rounded"
onClick={async () => {
const messageIndex = chatStore.history.length - 1;
chatStore.history[messageIndex].hide = true;
//chatStore.totalTokens =
update_total_tokens();
setChatStore({ ...chatStore });
await complete();
}}
>
Re-Generate
</button>
<button
className="p-2 m-2 bg-yellow-500 rounded"
onClick={async () => {
await complete();
}}
>
Completion
</button>
</p>
)}
{showGenerating && (
<p className="p-2 my-2 animate-pulse dark:text-white message-content">
{generatingMessage || "生成中,最长可能需要一分钟,请保持网络稳定"}
@@ -375,10 +402,10 @@ export default function ChatBOX(props: {
{chatStore.chatgpt_api_web_version < "v1.4.0" && (
<p className="p-2 my-2 text-center dark:text-white">
<br />
{chatStore.chatgpt_api_web_version} {"< v1.4.0"}
{chatStore.chatgpt_api_web_version} {"< v1.4.0"}
<br />
v1.4.0
使
v1.4.0 使
<br />
</p>