@@ -1280,6 +1331,7 @@ function _Chat() {
)}
= messages.length - 6}
/>
-
+ {!isUser && message.model == "gpt-4-vision-preview" && (
+
+ )}
{isContext
? Locale.Chat.IsContext
@@ -1328,6 +1392,9 @@ function _Chat() {
setUserInput("/");
onSearch("");
}}
+ imageSelected={(img: any) => {
+ setUserImage(img);
+ }}
/>
+ {userImage && (
+
+
+
+
+
+
+ )}
}
text={Locale.Chat.Send}
className={styles["chat-input-send"]}
type="primary"
- onClick={() => doSubmit(userInput)}
+ onClick={() => doSubmit(userInput, userImage)}
/>
diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx
index f3a916cc5..07ebc2371 100644
--- a/app/components/markdown.tsx
+++ b/app/components/markdown.tsx
@@ -116,38 +116,41 @@ function escapeDollarNumber(text: string) {
return escapedText;
}
-function _MarkDownContent(props: { content: string }) {
+function _MarkDownContent(props: { content: string; imageBase64?: string }) {
const escapedContent = useMemo(
() => escapeDollarNumber(props.content),
[props.content],
);
return (
-
+ {props.imageBase64 &&
}
+ ,
+ a: (aProps) => {
+ const href = aProps.href || "";
+ const isInternal = /^\/#/i.test(href);
+ const target = isInternal ? "_self" : aProps.target ?? "_blank";
+ return ;
},
- ],
- ]}
- components={{
- pre: PreCode,
- p: (pProps) => ,
- a: (aProps) => {
- const href = aProps.href || "";
- const isInternal = /^\/#/i.test(href);
- const target = isInternal ? "_self" : aProps.target ?? "_blank";
- return ;
- },
- }}
- >
- {escapedContent}
-
+ }}
+ >
+ {escapedContent}
+
+
);
}
@@ -160,6 +163,7 @@ export function Markdown(
fontSize?: number;
parentRef?: RefObject