-
Notifications
You must be signed in to change notification settings - Fork 0
UI updates, user feedback fixes #87
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
Changes from all commits
ab21991
448a3f9
e08b1ef
391608a
8dd0a69
55f939f
8a47532
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| data/ | ||
| embeddings/ | ||
| embeddings_bak/ | ||
| csv_files/ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -288,15 +288,17 @@ async def landing_page(): | |
| <body> | ||
| <div class="container"> | ||
| <div class="logo"> | ||
| <img src="https://reactome.org/templates/favourite/images/logo/logo.png" alt="Reactome Logo"> | ||
| <a href="https://reactome.org" target="_blank"> | ||
| <img src="https://reactome.org/templates/favourite/images/logo/logo.png" alt="Reactome Logo"> | ||
| </a> | ||
| </div> | ||
| <h1>Meet the React-to-Me AI Chatbot!</h1> | ||
| <p class="centered-text">Your new guide to Reactome. Whether you're looking for specific genes and pathways or just browsing, our AI Chatbot is here to assist you!</p> | ||
|
|
||
| <div class="button-container"> | ||
| <a class="button" href="$CHAINLIT_URL/chat/guest/" target="_blank">Guest Access</a> | ||
| <a class="button" href="$CHAINLIT_URL/chat/personal/" target="_blank">Log In</a> | ||
| <a class="button feedback-button" href="https://forms.gle/Rvzb8EA73yZs7wd38" target="_blank">Feedback</a> | ||
| <a class="button feedback-button" href="mailto:help@reactome.org" target="_blank">Feedback</a> | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feedback button link to Reactome Help email instead of old survey |
||
| </div> | ||
|
|
||
| <p class="left-justified">Choose <strong>Guest Access</strong> to try the chatbot out. <strong>Log In</strong> will give an increased query allowance and securely stores your chat history so you can save and continue conversations.</p> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,3 +35,10 @@ Explore pathways such as: | |
|
|
||
| Happy exploring with React-to-me! | ||
|
|
||
| ## _Disclaimer_ | ||
|
|
||
| _This chatbot uses large language model (LLM) technology to assist with questions about the Reactome Knowledgebase. Responses are generated automatically and may contain inaccuracies, outdated information or speculative language._ | ||
|
|
||
| _The information you provide may be retained in accordance with Reactome’s AI provider’s retention policy, which is located [here](https://openai.com/enterprise-privacy/). Do not share sensitive, personal or confidential information._ | ||
|
|
||
| _The chatbot does not substitute for expert curation or peer-reviewed sources and is not a suitable resource for clinical decisions. Users are responsible for validating any output before using it for research, publication, or medical decisions. Any use of this chatbot is subject to Reactome’s [disclaimer](https://reactome.org/about/disclaimer)._ | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add long disclaimer to Readme section |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,17 +18,11 @@ messages: | |
|
|
||
| welcome: | ||
| message: |- | ||
| Welcome to {chat_profile}, your interactive chatbot for exploring Reactome! | ||
| Welcome to {chat_profile}, your interactive chatbot for exploring **[Reactome](https://reactome.org/)**! | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. link to Reactome.org at chat start |
||
| Ask me about biological pathways and processes. | ||
| trigger: | ||
| event: on_chat_start | ||
|
|
||
| survey_message: | ||
| message: |- | ||
| We hope you're enjoying your experience with React-to-me! We'd love to hear your feedback to make it even better. Please take a few minutes to fill out our [survey](https://forms.gle/Rvzb8EA73yZs7wd38). | ||
| trigger: | ||
| after_messages: 3 | ||
|
|
||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove survey message |
||
| demo-message: | ||
| message: |- | ||
| Hello! | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /* | ||
| * Replace the contents of the Chainlit watermark/footer | ||
| */ | ||
| (function () { | ||
| const CUSTOM_FOOTER_HTML = ` | ||
| <div class="text-xs text-muted-foreground text-center"> | ||
| <span> | ||
| <em> | ||
| <strong>Disclaimer:</strong> | ||
| Our chatbot uses AI to assist you. | ||
| Responses are generated automatically and may not always be accurate. | ||
| Do not share sensitive, personal or confidential information. | ||
| For more information, please click on the “Readme” icon at the top-right of this window. | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add short disclaimer in place of "Built with Chainlit" footer |
||
| </em> | ||
| </span> | ||
| </div> | ||
| `.trim(); | ||
|
|
||
| const WATERMARK_SELECTOR = 'a.watermark'; | ||
| const APPLIED_ATTR = 'data-custom-watermark'; | ||
|
|
||
| function replaceFooterContents(root = document) { | ||
| const nodes = root instanceof Element | ||
| ? root.querySelectorAll(WATERMARK_SELECTOR) | ||
| : document.querySelectorAll(WATERMARK_SELECTOR); | ||
|
|
||
| nodes.forEach((el) => { | ||
| if (!(el instanceof HTMLElement)) return; | ||
| if (el.getAttribute(APPLIED_ATTR) === '1') return; | ||
|
|
||
| el.innerHTML = CUSTOM_FOOTER_HTML; | ||
|
|
||
| // disable the link behaviour | ||
| el.removeAttribute('href'); | ||
| el.removeAttribute('target'); | ||
| el.style.pointerEvents = 'none'; | ||
|
|
||
| el.setAttribute(APPLIED_ATTR, '1'); | ||
| }); | ||
| } | ||
|
|
||
| // Initial run (in case the element is already present). | ||
| if (document.readyState === 'loading') { | ||
| document.addEventListener('DOMContentLoaded', () => replaceFooterContents(document)); | ||
| } else { | ||
| replaceFooterContents(document); | ||
| } | ||
|
|
||
| // Re-apply on future UI updates (SPA re-renders). | ||
| const mo = new MutationObserver((mutations) => { | ||
| for (const m of mutations) { | ||
| for (const node of m.addedNodes) { | ||
| if (node instanceof Element) { | ||
| // If the watermark itself is added or its parent subtree changes, update. | ||
| if (node.matches?.(WATERMARK_SELECTOR) || node.querySelector?.(WATERMARK_SELECTOR)) { | ||
| replaceFooterContents(node); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| mo.observe(document.documentElement, { childList: true, subtree: true }); | ||
| })(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ const SearchResults = () => { | |
| <a | ||
| key={result.id} | ||
| href={result.url} | ||
| target="_blank" | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. open search result links in a new tab |
||
| className="flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-accent" | ||
| > | ||
| <div className="flex w-full flex-col gap-1"> | ||
|
|
||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using SVG favicon instead of low-resolution image - no longer appears pixelated when enlarged for login interface |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,8 +27,11 @@ def get_dict(cls) -> dict[str, Path]: | |
| return cls._get().embeddings | ||
|
|
||
| @classmethod | ||
| def get_dir(cls, key: str) -> Path: | ||
| return EM_ARCHIVE / cls._get().embeddings[key] | ||
| def get_dir(cls, key: str) -> Path | None: | ||
| if key in cls._get().embeddings: | ||
| return EM_ARCHIVE / cls._get().embeddings[key] | ||
| else: | ||
| return None | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixes KeyError bug when an unused embeddings bundle is missing |
||
|
|
||
| @classmethod | ||
| def get_model(cls, key: str) -> str: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding reactome.org hyperlink to /chat landing page Reactome header logo image