-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/ai rag tool #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
83cc50b
feat: ai-rag-tool
nedhmn 8944468
feat: add card ui
nedhmn e6d27b8
feat: start-messages
nedhmn 19d39f0
clean: removed old styles
nedhmn 5f73f2b
feat: tw theme
nedhmn 364a94c
feat: footnote
nedhmn 5c625ce
feat: metadata
nedhmn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| const Footnote = () => { | ||
| return ( | ||
| <div className="text-muted-foreground text-xs mt-2"> | ||
| This is an AI chatbot using{" "} | ||
| <a | ||
| className="underline text-primary" | ||
| href="https://www.pinecone.io/learn/retrieval-augmented-generation/" | ||
| target="_blank" | ||
| rel="noreferrer" | ||
| > | ||
| RAG | ||
| </a> | ||
| . It is trained on{" "} | ||
| <a | ||
| className="underline text-primary" | ||
| href="https://www.goatformat.com/whatisgoat.html" | ||
| target="_blank" | ||
| rel="noreferrer" | ||
| > | ||
| GOAT Format Yu-Gi-Oh! | ||
| </a>{" "} | ||
| rulings only. | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Footnote; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| "use client"; | ||
|
|
||
| import { useSendMessage } from "@/hooks/use-send-message"; | ||
| import { UseChatHelpers } from "@ai-sdk/react"; | ||
| import { Card } from "@repo/ui/components/ui/card"; | ||
|
|
||
| const STARTER_PROMPTS = [ | ||
| `Can Exiled Force be the target of its own effect?`, | ||
| `If Spirit Reaper is targeted by Snatch Steal, and Mystical Space Typhoon is chained, will Spirit Reaper still destroy itself?`, | ||
| `Does the effect of Dark Balter the Terrible or Dark Ruler Ha Des negate the effect of Injection Fairy Lily?`, | ||
| `If my opponent already has Set the card declared with Prohibition, can they activate the card?`, | ||
| ]; | ||
|
|
||
| interface StartMessagesProps { | ||
| chatHelpers: UseChatHelpers; | ||
| setInput: (value: string) => void; | ||
| } | ||
|
|
||
| const StartMessages = ({ chatHelpers, setInput }: StartMessagesProps) => { | ||
| const { status } = chatHelpers; | ||
| const isGeneratingResponse = ["streaming", "submitted"].includes(status); | ||
|
|
||
| const { handleSendMessage } = useSendMessage({ | ||
| chatHelpers, | ||
| isGeneratingResponse, | ||
| setInput, | ||
| }); | ||
|
|
||
| return ( | ||
| <div className="flex flex-col items-center justify-center min-h-[70vh]"> | ||
| <h1 className="w-full text-2xl mb-9 tracking-tight sm:text-3xl text-primary-100 flex flex-col items-center justify-center text-center"> | ||
| {"Welcome to Yu-Gi-Oh! Ruling Bot"} | ||
| <span className="text-gray-400"> | ||
| {"Ask me anything about Goat Format rulings and interactions."} | ||
| </span> | ||
| </h1> | ||
|
|
||
| <div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full max-w-2xl"> | ||
| {STARTER_PROMPTS.map((question, index) => ( | ||
| <Card | ||
| key={index} | ||
| className="p-4 cursor-pointer hover:bg-muted/50 transition-colors" | ||
| onClick={() => handleSendMessage(question)} | ||
| > | ||
| <p className="text-foreground">{question}</p> | ||
| </Card> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default StartMessages; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.