Merge branch 'chatUpdate' of https://github.com/logspace-ai/langflow into streaming

This commit is contained in:
Gabriel Almeida 2023-05-08 15:40:28 -03:00
commit 3a412510d8
4 changed files with 907 additions and 13 deletions

File diff suppressed because it is too large Load diff

View file

@ -29,6 +29,7 @@
"react-error-boundary": "^4.0.2",
"react-icons": "^4.8.0",
"react-laag": "^2.0.5",
"react-markdown": "^8.0.7",
"react-router-dom": "^6.8.1",
"react-scripts": "5.0.1",
"react-tabs": "^6.0.0",
@ -62,4 +63,4 @@
]
},
"proxy": "http://127.0.0.1:7860"
}
}

View file

@ -5,6 +5,7 @@ import { classNames } from "../../../utils";
import AiIcon from "../../../assets/Gooey Ring-5s-271px.svg";
import { UserIcon } from "@heroicons/react/24/solid";
import FileCard from "../fileComponent";
import ReactMarkdown from "react-markdown";
var Convert = require("ansi-to-html");
var convert = new Convert({ newline: true });
@ -50,7 +51,7 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) {
{chat.thought && chat.thought !== "" && !hidden && <br></br>}
<div className="w-full px-4 pb-3 pt-3 pr-8">
<span className="dark:text-white">
{chat.message}
<ReactMarkdown>{chat.message}</ReactMarkdown>
{chat.files && (
<div className="my-2 w-full">
{chat.files.map((file, index) => {
@ -73,7 +74,7 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) {
) : (
<div className="w-full flex items-center">
<div className="text-start inline-block px-3 text-sm text-gray-600 dark:text-white">
{chat.message}
<ReactMarkdown>{chat.message}</ReactMarkdown>
</div>
</div>
)}

View file

@ -140,16 +140,6 @@ export default function ChatModal({
}
setLockChat(false);
isStream = false;
// if (data.files) {
// addChatHistory(
// data.message,
// false,
// data.intermediate_steps,
// data.files
// );
// } else {
// addChatHistory(data.message, false, data.intermediate_steps);
// }
}
if (data.type === "file") {
console.log(data);