From 40534e1299b992c85a51531ef25cd2d659a2b2b4 Mon Sep 17 00:00:00 2001 From: hyusap Date: Sat, 11 Nov 2023 23:38:38 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor=20all=20of=20?= =?UTF-8?q?the=20api=20stuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit a redo of the old refactor branch, but cleaner. moved all api calls to api.ts and supabase.ts --- www/app/page.tsx | 206 +++----------- .../{message.tsx => messagebox.tsx} | 6 +- www/components/sidebar.tsx | 251 ++++++++---------- www/utils/api.ts | 150 +++++++++++ www/utils/supabase.ts | 16 ++ 5 files changed, 315 insertions(+), 314 deletions(-) rename www/components/{message.tsx => messagebox.tsx} (89%) create mode 100644 www/utils/api.ts create mode 100644 www/utils/supabase.ts diff --git a/www/app/page.tsx b/www/app/page.tsx index fc31452..8db7287 100644 --- a/www/app/page.tsx +++ b/www/app/page.tsx @@ -2,26 +2,18 @@ import Image from "next/image"; import banner from "@/public/bloom2x1.svg"; -import Message from "@/components/message"; +import MessageBox from "@/components/messagebox"; import Thoughts from "@/components/thoughts"; import Sidebar from "@/components/sidebar"; -import { - FaLightbulb, - FaPaperPlane, - FaBars, - FaTrash, - FaEdit, -} from "react-icons/fa"; -// import { IoIosArrowDown } from "react-icons/io"; -// import { GrClose } from "react-icons/gr"; +import { FaLightbulb, FaPaperPlane, FaBars } from "react-icons/fa"; import { useRef, useEffect, useState, useCallback, - use, ElementRef, + use, } from "react"; import { v4 as uuidv4 } from "uuid"; @@ -32,16 +24,7 @@ import { Session } from "@supabase/supabase-js"; import { createClientComponentClient } from "@supabase/auth-helpers-nextjs"; import Link from "next/link"; import MarkdownWrapper from "@/components/markdownWrapper"; - -interface Message { - text: string; - isUser: boolean; -} - -interface Conversation { - conversation_id: string; - name: string; -} +import { Message, Conversation, API } from "@/utils/api"; const URL = process.env.NEXT_PUBLIC_API_URL; const defaultMessage: Message = { @@ -52,115 +35,40 @@ const defaultMessage: Message = { export default function Home() { const [isThoughtsOpen, setIsThoughtsOpen] = useState(false); const [isSidebarOpen, setIsSidebarOpen] = useState(false); + const [thought, setThought] = useState(""); - const [userId, setUserId] = useState("LOADING"); const [canSend, setCanSend] = useState(false); - const [messages, setMessages] = useState>([defaultMessage]); - const [authSession, setAuthSession] = useState(null); - const [conversations, setConversations] = useState>([]); - const [currentConversation, setCurrentConversation] = useState({ - conversation_id: "", - name: "", - }); - const input = useRef>(null); - const supabase = createClientComponentClient(); + const [api, setApi] = useState(); + + const [messages, setMessages] = useState([defaultMessage]); + const [conversations, setConversations] = useState([]); + const [currentConversation, setCurrentConversation] = + useState(); + const input = useRef>(null); const isAtBottom = useRef(true); const messageContainerRef = useRef>(null); - const newChat = useCallback(async () => { - return await fetch(`${URL}/api/conversations/insert?user_id=${userId}`) - .then((res) => res.json()) - .then(({ conversation_id }) => { - return conversation_id; - }) - .catch((err) => console.error(err)); - }, [userId]); - - useEffect(() => { - supabase.auth.getSession().then(({ data: { session } }) => { - setAuthSession(session); - if (session) { - setUserId(session.user.id); - } else { - setUserId(`anon_${uuidv4()}`); - } - }); - }, [supabase]); - - useEffect(() => { - // console.log(authSession) - // console.log(userId) - const getConversations = async () => { - return await fetch(`${URL}/api/conversations/get?user_id=${userId}`) - .then((res) => res.json()) - .then(({ conversations }) => { - // console.log(conversations) - return conversations; - }); - }; - if (authSession) { - getConversations().then((conversations) => { - if (conversations.length > 0) { - setConversations(conversations); - setCurrentConversation(conversations[0]); - } else { - newChat().then((conversation_id) => { - let newConversation: Conversation = { - name: "", - conversation_id, - }; - setCurrentConversation(newConversation); - setConversations((c) => [...c, newConversation]); - }); - } - }); - } else { - // TODO store anonymous chats in localstorage or cookies - if (userId !== "LOADING") { - newChat().then((conversation_id) => { - const newConversation: Conversation = { - name: "", - conversation_id, - }; - setCurrentConversation(newConversation); - setConversations((c) => [...c, newConversation]); - }); - } - } - }, [authSession, userId, newChat]); - useEffect(() => { - const getMessages = async () => { - return await fetch( - `${URL}/api/messages?user_id=${userId}&conversation_id=${currentConversation.conversation_id}` - ) - .then((res) => res.json()) - .then(({ messages }) => { - const formattedMessages = messages.map((message: any) => { - return { - text: message.data.content, - isUser: message.type === "human", - }; - }); - return formattedMessages; - }); - }; - - if (currentConversation.conversation_id) { + (async () => { + const api = await API.create(URL!); + setApi(api); + const conversations = await api.getConversations(); + setConversations(conversations); + setCurrentConversation(conversations[0]); setCanSend(true); - getMessages().then((messages) => { - setMessages([defaultMessage, ...messages]); - }); - } + })(); + }, []); - // scroll to bottom - const messageContainer = messageContainerRef.current; - if (messageContainer) { - messageContainer.scrollTop = messageContainer.scrollHeight; - } - }, [currentConversation, userId]); + useEffect(() => { + (async () => { + if (!currentConversation) return; + const messages = await currentConversation.getMessages(); + setMessages([defaultMessage, ...messages]); + // console.log("set messages", messages); + })(); + }, [currentConversation]); useEffect(() => { const messageContainer = messageContainerRef.current; @@ -181,32 +89,6 @@ export default function Home() { }; }, []); - // async function newChat() { - // return await fetch(`${URL}/api/conversations/insert?user_id=${userId}`) - // .then((res) => res.json()) - // .then(({ conversation_id }) => { - // return conversation_id - // }) - // .catch((err) => console.error(err)) - // } - // const chatContainerRef = useRef(null); - // const shouldAutoScroll = useRef(true); - - // useEffect(() => { - // if (chatContainerRef.current) { - // const container = chatContainerRef.current; - // // Detect if user is at the bottom of the messages - // shouldAutoScroll.current = container.scrollHeight - container.scrollTop === container.clientHeight; - // } - // }, [messages]); - - // useEffect(() => { - // if (shouldAutoScroll.current && chatContainerRef.current) { - // const container = chatContainerRef.current; - // container.scrollTop = container.scrollHeight; - // } - // }, [messages]); - async function chat() { const textbox = input.current!; const message = textbox.value; @@ -226,33 +108,13 @@ export default function Home() { }, ]); - const data = await fetch(`${URL}/api/stream`, { - method: "POST", - body: JSON.stringify({ - user_id: userId, - conversation_id: currentConversation.conversation_id, - message: message, - }), - // no cors - // mode: "no-cors", - headers: { - "Content-Type": "application/json", - }, - }); - - const reader = data.body?.pipeThrough(new TextDecoderStream()).getReader()!; + const reader = await currentConversation!.chat(message); const messageContainer = messageContainerRef.current; if (messageContainer) { messageContainer.scrollTop = messageContainer.scrollHeight; } - // clear the last message - setMessages((prev) => { - prev[prev.length - 1].text = ""; - return [...prev]; - }); - let isThinking = true; setThought(""); @@ -295,12 +157,10 @@ export default function Home() {
@@ -319,7 +179,7 @@ export default function Home() { - {!authSession && ( + {!api?.session && (

To save your conversation history and personalize your messages{" "} @@ -337,9 +197,9 @@ export default function Home() { ref={messageContainerRef} > {messages.map((message, i) => ( - + - + ))}

; - authSession: Session | null; - currentConversation: Conversation; + conversations: Conversation[]; + currentConversation: Conversation | undefined; setCurrentConversation: Function; setConversations: Function; - newChat: Function; - userId: string; isSidebarOpen: boolean; setIsSidebarOpen: Function; + api: API | undefined; }) { - // const [isSidebarOpen, setIsSidebarOpen] = useState(false) - const router = useRouter(); - const supabase = createClientComponentClient(); - - async function handleSignOut() { - await supabase.auth.signOut(); - // console.log("Signed out"); - location.reload(); - } - async function editConversation(cur: Conversation) { const { value: newName } = await Swal.fire({ title: "Enter a new name for the conversation", @@ -57,31 +41,12 @@ export default function Sidebar({ } }, }); - // console.log(newName); - if (!newName || newName === cur.name) return; - const data = await fetch(`${URL}/api/conversations/update`, { - method: "POST", - body: JSON.stringify({ - conversation_id: cur.conversation_id, - name: newName, - }), - headers: { - "Content-Type": "application/json", - }, - }); - const copy = { ...cur }; - copy.name = newName; - setConversations( - conversations.map((conversation) => - conversation.conversation_id === copy.conversation_id - ? copy - : conversation - ) - ); + + await cur.setName(newName); } async function deleteConversation(conversation: Conversation) { - Swal.fire({ + const { isConfirmed } = await Swal.fire({ title: "Are you sure you want to delete this conversation?", text: "You won't be able to revert this!", icon: "warning", @@ -89,56 +54,62 @@ export default function Sidebar({ confirmButtonColor: "#3085d6", cancelButtonColor: "#d33", confirmButtonText: "Yes, delete it!", - }).then(async (result) => { - if (result.isConfirmed) { - const { conversation_id } = conversation; - await fetch( - `${URL}/api/conversations/delete?user_id=${userId}&conversation_id=${conversation_id}` - ).then((res) => res.json()); - // Delete the conversation_id from the conversations state variable - setConversations((conversations: Array) => { - const newConversations = conversations.filter( - (cur: Conversation) => cur.conversation_id !== conversation_id - ); - // console.log("New Conversations", newConversations); - // If it was the currentConversation, change the currentConversation to the next one in the list - if (conversation === currentConversation) { - if (newConversations.length > 1) { - setCurrentConversation(newConversations[0]); - // console.log("Current Conversation", newConversations[0]); - } else { - // If there is no current conversation create a new one - newChat().then((newConversationId: string) => { - setCurrentConversation(newConversationId); - // console.log("Current Conversation", newConversationId); - setConversations([newConversationId]); - }); - } - } - return newConversations; - }); - } }); + + if (isConfirmed) { + await conversation.delete(); + // Delete the conversation_id from the conversations state variable + const newConversations = conversations.filter( + (cur) => cur.conversationId != conversation.conversationId + ); + if (conversation == currentConversation) { + if (newConversations.length > 1) { + setCurrentConversation(newConversations[0]); + } else { + const newConv = await api?.new(); + setCurrentConversation(newConv); + setConversations([newConv]); + } + } + setConversations(newConversations); + // setConversations((oldConversations: Conversation[]) => { + // const newConversations = oldConversations.filter( + // (cur) => cur.conversationId != conversation.conversationId + // ); + // console.log("check type", Array.isArray(newConversations)); + + // // If it was the currentConversation, change the currentConversation to the next one in the list + // if (conversation == currentConversation) { + // if (newConversations.length > 1) { + // setCurrentConversation(newConversations[0]); + // } else { + // // If there is no current conversation create a new one + // const newConv = await api?.new(); + // setCurrentConversation(newConv); + // return [newConv]; + // } + // } + // return newConversations; + // }); + } } async function addChat() { - const conversationId = await newChat(); - const newConversation: Conversation = { - name: "Untitled", - conversation_id: conversationId, - }; - setCurrentConversation(newConversation); - setConversations([newConversation, ...conversations]); + const conversation = await api?.new(); + setCurrentConversation(conversation); + setConversations([conversation, ...conversations]); } return (
{/* Section 1: Top buttons */}
@@ -154,62 +125,64 @@ export default function Sidebar({ > -
+
- {/* Section 2: Scrollable items */} -
- {conversations.map((cur, i) => ( -
setCurrentConversation(cur)} - > -
-

- {cur.name || "Untitled"} -

-
-
- - -
-
+ {/* Section 2: Scrollable items */} +
+ {conversations.map((cur, i) => ( +
setCurrentConversation(cur)} + > +
+

+ {cur.name || "Untitled"} +

+
+
+ + +
+
))} -
+
- {/* Section 3: Authentication information */} -
- {/* Replace this with your authentication information */} - { - authSession ? ( - - ) : ( - - ) - } -
-
- + {/* Section 3: Authentication information */} +
+ {/* Replace this with your authentication information */} + {api?.session ? ( + + ) : ( + + Sign In + + )} +
+ + ); } diff --git a/www/utils/api.ts b/www/utils/api.ts new file mode 100644 index 0000000..7643a0a --- /dev/null +++ b/www/utils/api.ts @@ -0,0 +1,150 @@ +import { Session } from "@supabase/supabase-js"; +import { getId } from "./supabase"; + +export interface Message { + text: string; + isUser: boolean; +} + +export class Conversation { + api: API; + name: string; + conversationId: string; + + constructor({ + api, + name, + conversationId, + }: { + api: API; + name: string; + conversationId: string; + }) { + this.api = api; + this.name = name; + this.conversationId = conversationId; + } + + async getMessages() { + const req = await fetch( + `${this.api.url}/api/messages?` + + new URLSearchParams({ + conversation_id: this.conversationId, + user_id: this.api.userId, + }) + ); + const { messages: rawMessages } = await req.json(); + console.log(rawMessages); + if (!rawMessages) return []; + const messages = rawMessages.map((rawMessage: any) => { + return { + text: rawMessage.data.content, + isUser: rawMessage.type === "human", + }; + }); + + return messages; + } + + async setName(name: string) { + if (!name || name === this.name) return; + + await fetch(`${this.api.url}/api/conversations/update`, { + method: "POST", + body: JSON.stringify({ + conversation_id: this.conversationId, + name, + }), + headers: { + "Content-Type": "application/json", + }, + }); + this.name = name; + } + + async delete() { + await fetch( + `${this.api.url}/api/conversations/delete?user_id=${this.api.userId}&conversation_id=${this.conversationId}` + ).then((res) => res.json()); + } + + async chat(message: string) { + const req = await fetch(`${this.api.url}/api/stream`, { + method: "POST", + body: JSON.stringify({ + conversation_id: this.conversationId, + user_id: this.api.userId, + message, + }), + headers: { + "Content-Type": "application/json", + }, + }); + + const reader = req.body?.pipeThrough(new TextDecoderStream()).getReader()!; + return reader; + } +} + +interface RawConversation { + conversation_id: string; + name: string; +} + +export class API { + url: string; + userId: string; + session: Session | null; + + constructor({ + url, + userId, + session, + }: { + url: string; + userId: string; + session: Session | null; + }) { + this.url = url; + this.userId = userId; + this.session = session; + } + + static async create(url: string) { + const { userId, session } = await getId(); + const api = new API({ url, userId, session }); + return api; + } + + async new() { + const req = await fetch( + `${this.url}/api/conversations/insert?user_id=${this.userId}` + ); + const { conversation_id } = await req.json(); + return new Conversation({ + api: this, + name: "", + conversationId: conversation_id, + }); + } + + async getConversations() { + const req = await fetch( + `${this.url}/api/conversations/get?user_id=${this.userId}` + ); + const { conversations }: { conversations: RawConversation[] } = + await req.json(); + + if (conversations.length === 0) { + return [await this.new()]; + } + return conversations.map( + (conversation) => + new Conversation({ + api: this, + name: conversation.name, + conversationId: conversation.conversation_id, + }) + ); + } +} diff --git a/www/utils/supabase.ts b/www/utils/supabase.ts new file mode 100644 index 0000000..2709dda --- /dev/null +++ b/www/utils/supabase.ts @@ -0,0 +1,16 @@ +import { createClientComponentClient } from "@supabase/auth-helpers-nextjs"; +import { v4 as uuidv4 } from "uuid"; + +export async function getId() { + const supabase = createClientComponentClient(); + const { + data: { session }, + } = await supabase.auth.getSession(); + const userId = session ? session.user.id : `anon_${uuidv4()}`; + return { userId, session }; +} + +export async function signOut() { + const supabase = createClientComponentClient(); + await supabase.auth.signOut(); +} From 0dcec0e20fb89f0ed461566261ca7dd9c9f9c315 Mon Sep 17 00:00:00 2001 From: Vineeth Voruganti <13438633+VVoruganti@users.noreply.github.com> Date: Tue, 28 Nov 2023 18:12:05 -0800 Subject: [PATCH 2/2] Minor Bug Fixes - Add `build-essential` to dockerfile - Fix signin button size - Add await for signout - Force re-render on conversation name change --- Dockerfile | 2 + poetry.lock | 138 +++++++++++++++++++------------------ pyproject.toml | 2 +- www/app/auth/page.tsx | 1 - www/app/page.tsx | 13 +--- www/components/sidebar.tsx | 34 +++++---- 6 files changed, 97 insertions(+), 93 deletions(-) diff --git a/Dockerfile b/Dockerfile index e20b0ba..c8bd4fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ # https://testdriven.io/blog/docker-best-practices/ FROM python:3.10-slim-bullseye +RUN apt-get update && apt-get install -y build-essential + WORKDIR /app # https://stackoverflow.com/questions/53835198/integrating-python-poetry-with-docker diff --git a/poetry.lock b/poetry.lock index 49becbe..f0e5d57 100644 --- a/poetry.lock +++ b/poetry.lock @@ -138,25 +138,25 @@ files = [ [[package]] name = "anyio" -version = "4.0.0" +version = "3.7.1" description = "High level compatibility layer for multiple asynchronous event loop implementations" category = "main" optional = false -python-versions = ">=3.8" +python-versions = ">=3.7" files = [ - {file = "anyio-4.0.0-py3-none-any.whl", hash = "sha256:cfdb2b588b9fc25ede96d8db56ed50848b0b649dca3dd1df0b11f683bb9e0b5f"}, - {file = "anyio-4.0.0.tar.gz", hash = "sha256:f7ed51751b2c2add651e5747c891b47e26d2a21be5d32d9311dfe9692f3e5d7a"}, + {file = "anyio-3.7.1-py3-none-any.whl", hash = "sha256:91dee416e570e92c64041bd18b900d1d6fa78dff7048769ce5ac5ddad004fbb5"}, + {file = "anyio-3.7.1.tar.gz", hash = "sha256:44a3c9aba0f5defa43261a8b3efb97891f2bd7d804e0e1f56419befa1adfc780"}, ] [package.dependencies] -exceptiongroup = {version = ">=1.0.2", markers = "python_version < \"3.11\""} +exceptiongroup = {version = "*", markers = "python_version < \"3.11\""} idna = ">=2.8" sniffio = ">=1.1" [package.extras] -doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] -trio = ["trio (>=0.22)"] +doc = ["Sphinx", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme (>=1.2.2)", "sphinxcontrib-jquery"] +test = ["anyio[trio]", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +trio = ["trio (<0.22)"] [[package]] name = "async-timeout" @@ -674,24 +674,53 @@ files = [ {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] +[[package]] +name = "jsonpatch" +version = "1.33" +description = "Apply JSON-Patches (RFC 6902)" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*" +files = [ + {file = "jsonpatch-1.33-py2.py3-none-any.whl", hash = "sha256:0ae28c0cd062bbd8b8ecc26d7d164fbbea9652a1a3693f3b956c1eae5145dade"}, + {file = "jsonpatch-1.33.tar.gz", hash = "sha256:9fcd4009c41e6d12348b4a0ff2563ba56a2923a7dfee731d004e212e1ee5030c"}, +] + +[package.dependencies] +jsonpointer = ">=1.9" + +[[package]] +name = "jsonpointer" +version = "2.4" +description = "Identify specific nodes in a JSON document (RFC 6901)" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*" +files = [ + {file = "jsonpointer-2.4-py2.py3-none-any.whl", hash = "sha256:15d51bba20eea3165644553647711d150376234112651b4f1811022aecad7d7a"}, + {file = "jsonpointer-2.4.tar.gz", hash = "sha256:585cee82b70211fa9e6043b7bb89db6e1aa49524340dde8ad6b63206ea689d88"}, +] + [[package]] name = "langchain" -version = "0.0.286" +version = "0.0.342" description = "Building applications with LLMs through composability" category = "main" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langchain-0.0.286-py3-none-any.whl", hash = "sha256:487caa0eb92abf8bab574429fbb064e76569510cc7225ab7a96ae8d40cc19585"}, - {file = "langchain-0.0.286.tar.gz", hash = "sha256:3a5dae7e8726ae755f3671105610911a7cf2d3e1fb4b0531b6e0b4336051ea2f"}, + {file = "langchain-0.0.342-py3-none-any.whl", hash = "sha256:83c37898226666e0176d093f57fa49e176486608ef4c617a65aadf0b038ba0ec"}, + {file = "langchain-0.0.342.tar.gz", hash = "sha256:06341ee0b034847cbcea4b40a0a26b270abb6fd1237437735187c44d30a7a24d"}, ] [package.dependencies] aiohttp = ">=3.8.3,<4.0.0" +anyio = "<4.0" async-timeout = {version = ">=4.0.0,<5.0.0", markers = "python_version < \"3.11\""} -dataclasses-json = ">=0.5.7,<0.6.0" -langsmith = ">=0.0.21,<0.1.0" -numexpr = ">=2.8.4,<3.0.0" +dataclasses-json = ">=0.5.7,<0.7" +jsonpatch = ">=1.33,<2.0" +langchain-core = ">=0.0.7,<0.1" +langsmith = ">=0.0.63,<0.1.0" numpy = ">=1,<2" pydantic = ">=1,<3" PyYAML = ">=5.3" @@ -700,29 +729,48 @@ SQLAlchemy = ">=1.4,<3" tenacity = ">=8.1.0,<9.0.0" [package.extras] -all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "amadeus (>=8.1.0)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.9,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (>=9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=4,<5)", "deeplake (>=3.6.8,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.6,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "libdeeplake (>=0.0.60,<0.0.61)", "librosa (>=0.10.0.post2,<0.11.0)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=1.2.4,<2.0.0)", "momento (>=1.5.0,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<3.0.0)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "python-arango (>=7.5.9,<8.0.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.3.1,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.4.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] -azure = ["azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "azure-search-documents (==11.4.0b8)", "openai (>=0,<1)"] +all = ["O365 (>=2.0.26,<3.0.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "amadeus (>=8.1.0)", "arxiv (>=1.4,<2.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "awadb (>=0.3.9,<0.4.0)", "azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-textanalytics (>=5.3.0,<6.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "beautifulsoup4 (>=4,<5)", "clarifai (>=9.1.0)", "clickhouse-connect (>=0.5.14,<0.6.0)", "cohere (>=4,<5)", "deeplake (>=3.8.3,<4.0.0)", "docarray[hnswlib] (>=0.32.0,<0.33.0)", "duckduckgo-search (>=3.8.3,<4.0.0)", "elasticsearch (>=8,<9)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "google-api-python-client (==2.70.0)", "google-auth (>=2.18.1,<3.0.0)", "google-search-results (>=2,<3)", "gptcache (>=0.1.7)", "html2text (>=2020.1.16,<2021.0.0)", "huggingface_hub (>=0,<1)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lancedb (>=0.1,<0.2)", "langkit (>=0.0.6,<0.1.0)", "lark (>=1.1.5,<2.0.0)", "librosa (>=0.10.0.post2,<0.11.0)", "lxml (>=4.9.2,<5.0.0)", "manifest-ml (>=0.0.1,<0.0.2)", "marqo (>=1.2.4,<2.0.0)", "momento (>=1.13.0,<2.0.0)", "nebula3-python (>=3.4.0,<4.0.0)", "neo4j (>=5.8.1,<6.0.0)", "networkx (>=2.6.3,<4)", "nlpcloud (>=1,<2)", "nltk (>=3,<4)", "nomic (>=1.0.43,<2.0.0)", "openai (<2)", "openlm (>=0.0.5,<0.0.6)", "opensearch-py (>=2.0.0,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pexpect (>=4.8.0,<5.0.0)", "pgvector (>=0.1.6,<0.2.0)", "pinecone-client (>=2,<3)", "pinecone-text (>=0.4.2,<0.5.0)", "psycopg2-binary (>=2.9.5,<3.0.0)", "pymongo (>=4.3.3,<5.0.0)", "pyowm (>=3.3.0,<4.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pytesseract (>=0.3.10,<0.4.0)", "python-arango (>=7.5.9,<8.0.0)", "pyvespa (>=0.33.0,<0.34.0)", "qdrant-client (>=1.3.1,<2.0.0)", "rdflib (>=6.3.2,<7.0.0)", "redis (>=4,<5)", "requests-toolbelt (>=1.0.0,<2.0.0)", "sentence-transformers (>=2,<3)", "singlestoredb (>=0.7.1,<0.8.0)", "tensorflow-text (>=2.11.0,<3.0.0)", "tigrisdb (>=1.0.0b6,<2.0.0)", "tiktoken (>=0.3.2,<0.6.0)", "torch (>=1,<3)", "transformers (>=4,<5)", "weaviate-client (>=3,<4)", "wikipedia (>=1,<2)", "wolframalpha (==5.0.0)"] +azure = ["azure-ai-formrecognizer (>=3.2.1,<4.0.0)", "azure-ai-textanalytics (>=5.3.0,<6.0.0)", "azure-ai-vision (>=0.11.1b1,<0.12.0)", "azure-cognitiveservices-speech (>=1.28.0,<2.0.0)", "azure-core (>=1.26.4,<2.0.0)", "azure-cosmos (>=4.4.0b1,<5.0.0)", "azure-identity (>=1.12.0,<2.0.0)", "azure-search-documents (==11.4.0b8)", "openai (<2)"] clarifai = ["clarifai (>=9.1.0)"] +cli = ["typer (>=0.9.0,<0.10.0)"] cohere = ["cohere (>=4,<5)"] docarray = ["docarray[hnswlib] (>=0.32.0,<0.33.0)"] embeddings = ["sentence-transformers (>=2,<3)"] -extended-testing = ["amazon-textract-caller (<2)", "assemblyai (>=0.17.0,<0.18.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.1.0,<0.2.0)", "chardet (>=5.1.0,<6.0.0)", "dashvector (>=1.0.1,<2.0.0)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "feedparser (>=6.0.10,<7.0.0)", "geopandas (>=0.13.1,<0.14.0)", "gitpython (>=3.1.32,<4.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "lxml (>=4.9.2,<5.0.0)", "markdownify (>=0.11.6,<0.12.0)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "newspaper3k (>=0.2.8,<0.3.0)", "openai (>=0,<1)", "openapi-schema-pydantic (>=1.2,<2.0)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "rapidfuzz (>=3.1.1,<4.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "sqlite-vss (>=0.1.2,<0.2.0)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "tqdm (>=4.48.0)", "xata (>=1.0.0a7,<2.0.0)", "xmltodict (>=0.13.0,<0.14.0)"] +extended-testing = ["aiosqlite (>=0.19.0,<0.20.0)", "aleph-alpha-client (>=2.15.0,<3.0.0)", "anthropic (>=0.3.11,<0.4.0)", "arxiv (>=1.4,<2.0)", "assemblyai (>=0.17.0,<0.18.0)", "atlassian-python-api (>=3.36.0,<4.0.0)", "beautifulsoup4 (>=4,<5)", "bibtexparser (>=1.4.0,<2.0.0)", "cassio (>=0.1.0,<0.2.0)", "chardet (>=5.1.0,<6.0.0)", "dashvector (>=1.0.1,<2.0.0)", "databricks-vectorsearch (>=0.21,<0.22)", "esprima (>=4.0.1,<5.0.0)", "faiss-cpu (>=1,<2)", "feedparser (>=6.0.10,<7.0.0)", "fireworks-ai (>=0.6.0,<0.7.0)", "geopandas (>=0.13.1,<0.14.0)", "gitpython (>=3.1.32,<4.0.0)", "google-cloud-documentai (>=2.20.1,<3.0.0)", "gql (>=3.4.1,<4.0.0)", "html2text (>=2020.1.16,<2021.0.0)", "javelin-sdk (>=0.1.8,<0.2.0)", "jinja2 (>=3,<4)", "jq (>=1.4.1,<2.0.0)", "jsonschema (>1)", "lxml (>=4.9.2,<5.0.0)", "markdownify (>=0.11.6,<0.12.0)", "motor (>=3.3.1,<4.0.0)", "msal (>=1.25.0,<2.0.0)", "mwparserfromhell (>=0.6.4,<0.7.0)", "mwxml (>=0.3.3,<0.4.0)", "newspaper3k (>=0.2.8,<0.3.0)", "numexpr (>=2.8.6,<3.0.0)", "openai (<2)", "openapi-pydantic (>=0.3.2,<0.4.0)", "pandas (>=2.0.1,<3.0.0)", "pdfminer-six (>=20221105,<20221106)", "pgvector (>=0.1.6,<0.2.0)", "psychicapi (>=0.8.0,<0.9.0)", "py-trello (>=0.19.0,<0.20.0)", "pymupdf (>=1.22.3,<2.0.0)", "pypdf (>=3.4.0,<4.0.0)", "pypdfium2 (>=4.10.0,<5.0.0)", "pyspark (>=3.4.0,<4.0.0)", "rank-bm25 (>=0.2.2,<0.3.0)", "rapidfuzz (>=3.1.1,<4.0.0)", "rapidocr-onnxruntime (>=1.3.2,<2.0.0)", "requests-toolbelt (>=1.0.0,<2.0.0)", "rspace_client (>=2.5.0,<3.0.0)", "scikit-learn (>=1.2.2,<2.0.0)", "sqlite-vss (>=0.1.2,<0.2.0)", "streamlit (>=1.18.0,<2.0.0)", "sympy (>=1.12,<2.0)", "telethon (>=1.28.5,<2.0.0)", "timescale-vector (>=0.0.1,<0.0.2)", "tqdm (>=4.48.0)", "upstash-redis (>=0.15.0,<0.16.0)", "xata (>=1.0.0a7,<2.0.0)", "xmltodict (>=0.13.0,<0.14.0)"] javascript = ["esprima (>=4.0.1,<5.0.0)"] -llms = ["clarifai (>=9.1.0)", "cohere (>=4,<5)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (>=0,<1)", "openlm (>=0.0.5,<0.0.6)", "torch (>=1,<3)", "transformers (>=4,<5)"] -openai = ["openai (>=0,<1)", "tiktoken (>=0.3.2,<0.4.0)"] +llms = ["clarifai (>=9.1.0)", "cohere (>=4,<5)", "huggingface_hub (>=0,<1)", "manifest-ml (>=0.0.1,<0.0.2)", "nlpcloud (>=1,<2)", "openai (<2)", "openlm (>=0.0.5,<0.0.6)", "torch (>=1,<3)", "transformers (>=4,<5)"] +openai = ["openai (<2)", "tiktoken (>=0.3.2,<0.6.0)"] qdrant = ["qdrant-client (>=1.3.1,<2.0.0)"] text-helpers = ["chardet (>=5.1.0,<6.0.0)"] +[[package]] +name = "langchain-core" +version = "0.0.7" +description = "Building applications with LLMs through composability" +category = "main" +optional = false +python-versions = ">=3.8.1,<4.0" +files = [ + {file = "langchain_core-0.0.7-py3-none-any.whl", hash = "sha256:368ae70a1da56971642df0a9ede5f480d762224238ba84d0f9b2cd7c776150de"}, + {file = "langchain_core-0.0.7.tar.gz", hash = "sha256:2310df8b783194ec2dfe01c2864bd8b3ccb4adecb02b17cf1d63cc773c252b4a"}, +] + +[package.dependencies] +jsonpatch = ">=1.33,<2.0" +langsmith = ">=0.0.63,<0.1.0" +pydantic = ">=1,<3" +tenacity = ">=8.1.0,<9.0.0" + [[package]] name = "langsmith" -version = "0.0.35" +version = "0.0.67" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." category = "main" optional = false python-versions = ">=3.8.1,<4.0" files = [ - {file = "langsmith-0.0.35-py3-none-any.whl", hash = "sha256:96b5cf69952a218d881a27817381fa67ebd283eba9c6814b72180530f9748348"}, - {file = "langsmith-0.0.35.tar.gz", hash = "sha256:127fee806b475430b530bdf9bc397ea1c65ec144a23fa1b5bba2bba31d9d1e76"}, + {file = "langsmith-0.0.67-py3-none-any.whl", hash = "sha256:66a257b97dabd43a7e62af271b2ddb7566167ce4e446fd7b7760e97d6ce84a5e"}, + {file = "langsmith-0.0.67.tar.gz", hash = "sha256:cef00bac2e7455a5943f3afaea91c032db1a1f2adb83003159a71e884fb5a9a2"}, ] [package.dependencies] @@ -861,49 +909,6 @@ files = [ {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, ] -[[package]] -name = "numexpr" -version = "2.8.5" -description = "Fast numerical expression evaluator for NumPy" -category = "main" -optional = false -python-versions = ">=3.7" -files = [ - {file = "numexpr-2.8.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:51f3ab160c3847ebcca93cd88f935a7802b54a01ab63fe93152994a64d7a6cf2"}, - {file = "numexpr-2.8.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:de29c77f674e4eb8f0846525a475cab64008c227c8bc4ba5153ab3f72441cc63"}, - {file = "numexpr-2.8.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf85ba1327eb87ec82ae7936f13c8850fb969a0ca34f3ba9fa3897c09d5c80d7"}, - {file = "numexpr-2.8.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c00be69f747f44a631830215cab482f0f77f75af2925695adff57c1cc0f9a68"}, - {file = "numexpr-2.8.5-cp310-cp310-win32.whl", hash = "sha256:c46350dcdb93e32f033eea5a21269514ffcaf501d9abd6036992d37e48a308b0"}, - {file = "numexpr-2.8.5-cp310-cp310-win_amd64.whl", hash = "sha256:894b027438b8ec88dea32a19193716c79f4ff8ddb92302dcc9731b51ba3565a8"}, - {file = "numexpr-2.8.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6df184d40d4cf9f21c71f429962f39332f7398147762588c9f3a5c77065d0c06"}, - {file = "numexpr-2.8.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:178b85ad373c6903e55d75787d61b92380439b70d94b001cb055a501b0821335"}, - {file = "numexpr-2.8.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:578fe4008e4d5d6ff01bbeb2d7b7ba1ec658a5cda9c720cd26a9a8325f8ef438"}, - {file = "numexpr-2.8.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef621b4ee366a5c6a484f6678c9259f5b826569f8bfa0b89ba2306d5055468bb"}, - {file = "numexpr-2.8.5-cp311-cp311-win32.whl", hash = "sha256:dd57ab1a3d3aaa9274aff1cefbf93b8ddacc7973afef5b125905f6bf18fabab0"}, - {file = "numexpr-2.8.5-cp311-cp311-win_amd64.whl", hash = "sha256:783324ba40eb804ecfc9ebae86120a1e339ab112d0ab8a1f0d48a26354d5bf9b"}, - {file = "numexpr-2.8.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:183d5430db76826e54465c69db93a3c6ecbf03cda5aa1bb96eaad0147e9b68dc"}, - {file = "numexpr-2.8.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:39ce106f92ccea5b07b1d6f2f3c4370f05edf27691dc720a63903484a2137e48"}, - {file = "numexpr-2.8.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b594dc9e2d6291a0bc5c065e6d9caf3eee743b5663897832e9b17753c002947a"}, - {file = "numexpr-2.8.5-cp37-cp37m-win32.whl", hash = "sha256:62b4faf8e0627673b0210a837792bddd23050ecebc98069ab23eb0633ff1ef5f"}, - {file = "numexpr-2.8.5-cp37-cp37m-win_amd64.whl", hash = "sha256:db5c65417d69414f1ab31302ea01d3548303ef31209c38b4849d145be4e1d1ba"}, - {file = "numexpr-2.8.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:eb36ffcfa1606e41aa08d559b4277bcad0e16b83941d1a4fee8d2bd5a34f8e0e"}, - {file = "numexpr-2.8.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:34af2a0e857d02a4bc5758bc037a777d50dacb13bcd57c7905268a3e44994ed6"}, - {file = "numexpr-2.8.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5a8dad2bfaad5a5c34a2e8bbf62b9df1dfab266d345fda1feb20ff4e264b347a"}, - {file = "numexpr-2.8.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b93f5a866cd13a808bc3d3a9c487d94cd02eec408b275ff0aa150f2e8e5191f8"}, - {file = "numexpr-2.8.5-cp38-cp38-win32.whl", hash = "sha256:558390fea6370003ac749ed9d0f38d708aa096f5dcb707ddb6e0ca5a0dd37da1"}, - {file = "numexpr-2.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:55983806815035eb63c5039520688c49536bb7f3cc3fc1d7d64c6a00cf3f353e"}, - {file = "numexpr-2.8.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1510da20e6f5f45333610b1ded44c566e2690c6c437c84f2a212ca09627c7e01"}, - {file = "numexpr-2.8.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9e8b5bf7bcb4e8dcd66522d8fc96e1db7278f901cb4fd2e155efbe62a41dde08"}, - {file = "numexpr-2.8.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ed0e1c1ef5f34381448539f1fe9015906d21c9cfa2797c06194d4207dadb465"}, - {file = "numexpr-2.8.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aea6ab45c87c0a7041183c08a798f0ad4d7c5eccbce20cfe79ce6f1a45ef3702"}, - {file = "numexpr-2.8.5-cp39-cp39-win32.whl", hash = "sha256:cbfd833ee5fdb0efb862e152aee7e6ccea9c596d5c11d22604c2e6307bff7cad"}, - {file = "numexpr-2.8.5-cp39-cp39-win_amd64.whl", hash = "sha256:283ce8609a7ccbadf91a68f3484558b3e36d27c93c98a41ec205efb0ab43c872"}, - {file = "numexpr-2.8.5.tar.gz", hash = "sha256:45ed41e55a0abcecf3d711481e12a5fb7a904fe99d42bc282a17cc5f8ea510be"}, -] - -[package.dependencies] -numpy = ">=1.13.3" - [[package]] name = "numpy" version = "1.25.2" @@ -2055,5 +2060,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "544baee8968b203cfab0a5d4cab2147919e5b42ad794cac95b8cc3c7713def29" - +content-hash = "de65f7b1a717885db91dfb3339f4c308bb37ebc0de4a2560ea47e60cec3ade91" diff --git a/pyproject.toml b/pyproject.toml index 348a707..953b2dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.10" -langchain = "~0.0.2" +langchain = "~0.0.3" py-cord = "^2.4.1" python-dotenv = "^1.0.0" validators = "^0.20.0" diff --git a/www/app/auth/page.tsx b/www/app/auth/page.tsx index 1927a0c..991f0bf 100644 --- a/www/app/auth/page.tsx +++ b/www/app/auth/page.tsx @@ -10,7 +10,6 @@ import icon from "@/public/bloomicon.jpg"; import SignUp from '@/components/signUp'; import SignIn from '@/components/signIn'; import Forgot from '@/components/forgot' -import Reset from '@/components/reset' export default function Auth() { const [formType, setFormType] = useState('LOGIN'); diff --git a/www/app/page.tsx b/www/app/page.tsx index 8db7287..c7d8ebd 100644 --- a/www/app/page.tsx +++ b/www/app/page.tsx @@ -11,17 +11,9 @@ import { useRef, useEffect, useState, - useCallback, ElementRef, - use, } from "react"; -import { v4 as uuidv4 } from "uuid"; -import Typing from "@/components/typing"; - -// Supabase -import { Session } from "@supabase/supabase-js"; -import { createClientComponentClient } from "@supabase/auth-helpers-nextjs"; import Link from "next/link"; import MarkdownWrapper from "@/components/markdownWrapper"; import { Message, Conversation, API } from "@/utils/api"; @@ -217,9 +209,8 @@ export default function Home() { type="text" ref={input} placeholder="Type a message..." - className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-gray-100 text-gray-400 rounded-2xl border-2 ${ - canSend ? " border-green-200" : "border-red-200 opacity-50" - }`} + className={`flex-1 px-3 py-1 lg:px-5 lg:py-3 bg-gray-100 text-gray-400 rounded-2xl border-2 ${canSend ? " border-green-200" : "border-red-200 opacity-50" + }`} disabled={!canSend} /> ) : ( - Sign In + )}