From 62c4d88320fbcdf15c1e410874467d73af49632b Mon Sep 17 00:00:00 2001 From: Kartik Date: Mon, 17 Jun 2024 00:07:40 +0530 Subject: [PATCH] add: animated query input --- apps/web/app/(dash)/chat/page.tsx | 127 ++++++++++++++------------ apps/web/app/(dash)/header.tsx | 2 +- packages/ui/components/QueryInput.tsx | 60 ++++++++++++ 3 files changed, 130 insertions(+), 59 deletions(-) create mode 100644 packages/ui/components/QueryInput.tsx diff --git a/apps/web/app/(dash)/chat/page.tsx b/apps/web/app/(dash)/chat/page.tsx index f98c761f..12b1bd2a 100644 --- a/apps/web/app/(dash)/chat/page.tsx +++ b/apps/web/app/(dash)/chat/page.tsx @@ -1,6 +1,9 @@ import ChatWindow from "./chatWindow"; import { chatSearchParamsCache } from "../../helpers/lib/searchParams"; import { ChevronDownIcon, ClipboardIcon, SpeakerWaveIcon } from '@heroicons/react/24/outline' +import Image from "next/image"; +import { ArrowRightIcon } from "@repo/ui/icons"; +import QueryInput from "@repo/ui/components/QueryInput"; // @ts-expect-error await import("katex/dist/katex.min.css"); @@ -14,80 +17,88 @@ function Page({ console.log(spaces); return ( -
+
{/* */} -
+
{/* single q&A */} -
+ {Array.from({ length: 1 }).map((_, i) => ( - {/* header */} -
- {/* query */} -

Why is Retrieval-Augmented Generation important?

-
+
- {/* response */} -
- - {/* related memories */} -
- {/* section header */} -
-

Related memories

- -
- - {/* section content */} - {/* collection of memories */} -
- {/* related memory */} - {Array.from({ length: 3 }).map((_, i) => ( -
- -

Webpage

-

What is RAG? - Retrieval-Augmented Generation Explained - AWS

-
- ))} -
+ {/* header */} +
+ {/* query */} +

Why is Retrieval-Augmented Generation important?

- {/* summary */} -
- {/* section header */} -
-

Summary

- -
+ {/* response */} +
- {/* section content */} -
-

- Retrieval-Augmented Generation is crucial because it combines the strengths of retrieval-based methods, ensuring relevance and accuracy, with generation-based models, enabling creativity and flexibility. By integrating retrieval mechanisms, it addresses data sparsity issues, improves content relevance, offers fine-tuned control over output, handles ambiguity, and allows for continual learning, making it highly adaptable and effective across various natural language processing tasks and domains. -

+ {/* related memories */} +
+ {/* section header */} +
+

Related memories

+ +
- {/* response actions */} -
- {/* speak response */} - - {/* copy response */} - + {/* section content */} + {/* collection of memories */} +
+ {/* related memory */} + {Array.from({ length: 3 }).map((_, i) => ( +
+ +

Webpage

+

What is RAG? - Retrieval-Augmented Generation Explained - AWS

+
+ ))}
+ {/* summary */} +
+ {/* section header */} +
+

Summary

+ +
+ + {/* section content */} +
+

+ Retrieval-Augmented Generation is crucial because it combines the strengths of retrieval-based methods, ensuring relevance and accuracy, with generation-based models, enabling creativity and flexibility. By integrating retrieval mechanisms, it addresses data sparsity issues, improves content relevance, offers fine-tuned control over output, handles ambiguity, and allows for continual learning, making it highly adaptable and effective across various natural language processing tasks and domains. +

+ + {/* response actions */} +
+ {/* speak response */} + + {/* copy response */} + +
+
+ +
+
+ ))} -
+
+ +
+
diff --git a/apps/web/app/(dash)/header.tsx b/apps/web/app/(dash)/header.tsx index 4af5c569..040097fa 100644 --- a/apps/web/app/(dash)/header.tsx +++ b/apps/web/app/(dash)/header.tsx @@ -8,7 +8,7 @@ import DynamicIsland from "./dynamicisland"; function Header() { return ( -
+
diff --git a/packages/ui/components/QueryInput.tsx b/packages/ui/components/QueryInput.tsx new file mode 100644 index 00000000..7188d667 --- /dev/null +++ b/packages/ui/components/QueryInput.tsx @@ -0,0 +1,60 @@ +import React from 'react' +import Divider from '../shadcn/divider' +import { ArrowRightIcon } from '../icons' +import Image from 'next/image' + +function QueryInput() { + return ( +
+
+ {/* input and action button */} +
+