Added GPT-4-vision
This commit is contained in:
@@ -150,8 +150,9 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
|
||||
if (!plugin) {
|
||||
if (updatedConversation.messages.length === 1) {
|
||||
const { content } = message;
|
||||
var textContent = content.filter(c => c.type == "text").map(c => c.text).join();
|
||||
const customName =
|
||||
content.length > 30 ? content.substring(0, 30) + '...' : content;
|
||||
textContent.length > 30 ? textContent.substring(0, 30) + '...' : textContent;
|
||||
updatedConversation = {
|
||||
...updatedConversation,
|
||||
name: customName,
|
||||
@@ -177,7 +178,7 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
|
||||
isFirst = false;
|
||||
const updatedMessages: Message[] = [
|
||||
...updatedConversation.messages,
|
||||
{ role: 'assistant', content: chunkValue },
|
||||
{ role: 'assistant', content: [{type: "text", text: chunkValue}] },
|
||||
];
|
||||
updatedConversation = {
|
||||
...updatedConversation,
|
||||
@@ -193,7 +194,7 @@ export const Chat = memo(({ stopConversationRef }: Props) => {
|
||||
if (index === updatedConversation.messages.length - 1) {
|
||||
return {
|
||||
...message,
|
||||
content: text,
|
||||
content: [{type:"text", text}],
|
||||
};
|
||||
}
|
||||
return message;
|
||||
|
||||
Reference in New Issue
Block a user