Merge branch 'chatUpdate' of https://github.com/logspace-ai/langflow into streaming
This commit is contained in:
commit
3a412510d8
4 changed files with 907 additions and 13 deletions
902
src/frontend/package-lock.json
generated
902
src/frontend/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -29,6 +29,7 @@
|
||||||
"react-error-boundary": "^4.0.2",
|
"react-error-boundary": "^4.0.2",
|
||||||
"react-icons": "^4.8.0",
|
"react-icons": "^4.8.0",
|
||||||
"react-laag": "^2.0.5",
|
"react-laag": "^2.0.5",
|
||||||
|
"react-markdown": "^8.0.7",
|
||||||
"react-router-dom": "^6.8.1",
|
"react-router-dom": "^6.8.1",
|
||||||
"react-scripts": "5.0.1",
|
"react-scripts": "5.0.1",
|
||||||
"react-tabs": "^6.0.0",
|
"react-tabs": "^6.0.0",
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { classNames } from "../../../utils";
|
||||||
import AiIcon from "../../../assets/Gooey Ring-5s-271px.svg";
|
import AiIcon from "../../../assets/Gooey Ring-5s-271px.svg";
|
||||||
import { UserIcon } from "@heroicons/react/24/solid";
|
import { UserIcon } from "@heroicons/react/24/solid";
|
||||||
import FileCard from "../fileComponent";
|
import FileCard from "../fileComponent";
|
||||||
|
import ReactMarkdown from "react-markdown";
|
||||||
var Convert = require("ansi-to-html");
|
var Convert = require("ansi-to-html");
|
||||||
var convert = new Convert({ newline: true });
|
var convert = new Convert({ newline: true });
|
||||||
|
|
||||||
|
|
@ -50,7 +51,7 @@ export default function ChatMessage({ chat }: { chat: ChatMessageType }) {
|
||||||
{chat.thought && chat.thought !== "" && !hidden && <br></br>}
|
{chat.thought && chat.thought !== "" && !hidden && <br></br>}
|
||||||
<div className="w-full px-4 pb-3 pt-3 pr-8">
|
<div className="w-full px-4 pb-3 pt-3 pr-8">
|
||||||
<span className="dark:text-white">
|
<span className="dark:text-white">
|
||||||
{chat.message}
|
<ReactMarkdown>{chat.message}</ReactMarkdown>
|
||||||
{chat.files && (
|
{chat.files && (
|
||||||
<div className="my-2 w-full">
|
<div className="my-2 w-full">
|
||||||
{chat.files.map((file, index) => {
|
{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="w-full flex items-center">
|
||||||
<div className="text-start inline-block px-3 text-sm text-gray-600 dark:text-white">
|
<div className="text-start inline-block px-3 text-sm text-gray-600 dark:text-white">
|
||||||
{chat.message}
|
<ReactMarkdown>{chat.message}</ReactMarkdown>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -140,16 +140,6 @@ export default function ChatModal({
|
||||||
}
|
}
|
||||||
setLockChat(false);
|
setLockChat(false);
|
||||||
isStream = 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") {
|
if (data.type === "file") {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue