change message type
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Tr, langCodeContext, LANG_OPTIONS } from "./translate";
|
import { Tr, langCodeContext, LANG_OPTIONS, tr } from "./translate";
|
||||||
import { useState, useEffect, StateUpdater } from "preact/hooks";
|
import { useState, useEffect, StateUpdater } from "preact/hooks";
|
||||||
import { ChatStore, ChatStoreMessage } from "./app";
|
import { ChatStore, ChatStoreMessage } from "./app";
|
||||||
import { calculate_token_length, getMessageText } from "./chatgpt";
|
import { calculate_token_length, getMessageText } from "./chatgpt";
|
||||||
@@ -44,6 +44,17 @@ export function EditMessage(props: EditMessageProps) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div className={"w-full flex justify-center"}>
|
<div className={"w-full flex justify-center"}>
|
||||||
|
{chatStore.develop_mode && <button
|
||||||
|
className="w-full m-2 p-1 rounded bg-red-500"
|
||||||
|
onClick={() => {
|
||||||
|
if (typeof chat.content === "string") {
|
||||||
|
chat.content = []
|
||||||
|
} else {
|
||||||
|
chat.content = ''
|
||||||
|
}
|
||||||
|
setChatStore({ ...chatStore })
|
||||||
|
}}
|
||||||
|
>Switch to {typeof chat.content === 'string' ? "media message" : "string message"}</button>}
|
||||||
<button
|
<button
|
||||||
className={"w-full m-2 p-1 rounded bg-purple-500"}
|
className={"w-full m-2 p-1 rounded bg-purple-500"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ export function EditMessageString({
|
|||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<hr className="my-2" />
|
|
||||||
{chat.tool_calls &&
|
{chat.tool_calls &&
|
||||||
chat.tool_calls.map((tool_call) => (
|
chat.tool_calls.map((tool_call) => (
|
||||||
<div className="flex flex-col w-full">
|
<div className="flex flex-col w-full">
|
||||||
|
|||||||
Reference in New Issue
Block a user