import React, { useEffect, useState } from "react";
import {
GithubLogo,
GitMerge,
EnvelopeSimple,
Plus,
} from "@phosphor-icons/react";
import NewWorkspaceModal, {
useNewWorkspaceModal,
} from "../Modals/NewWorkspace";
import paths from "@/utils/paths";
import { isMobile } from "react-device-detect";
import { SidebarMobileHeader } from "../Sidebar";
import ChatBubble from "../ChatBubble";
import System from "@/models/system";
import UserIcon from "../UserIcon";
import { userFromStorage } from "@/utils/request";
import { AI_BACKGROUND_COLOR, USER_BACKGROUND_COLOR } from "@/utils/constants";
import useUser from "@/hooks/useUser";
export default function DefaultChatContainer() {
const [mockMsgs, setMockMessages] = useState([]);
const { user } = useUser();
const [fetchedMessages, setFetchedMessages] = useState([]);
const {
showing: showingNewWsModal,
showModal: showNewWsModal,
hideModal: hideNewWsModal,
} = useNewWorkspaceModal();
const popMsg = !window.localStorage.getItem("anythingllm_intro");
useEffect(() => {
const fetchData = async () => {
const fetchedMessages = await System.getWelcomeMessages();
setFetchedMessages(fetchedMessages);
};
fetchData();
}, []);
const MESSAGES = [
Create an issue on Github
The AI tooling ecosystem gets more powerful everyday.
AnythingLLM makes it easy to use.
You can add and remove files at anytime.
{(!user || user?.role !== "default") && (
)}
AnythingLLM offers two ways of talking with your data:
Query: Your chats will return data or inferences found with
the documents in your workspace it has access to. Adding more
documents to the Workspace make it smarter!
Conversational: Your documents + your on-going chat history
both contribute to the LLM knowledge at the same time. Great for
appending real-time text-based info or corrections and
misunderstandings the LLM might have.
You can toggle between either mode{" "}
in the middle of chatting!