Skip to content

Add RAG postprocessing step; config.yml messages; chat-fastspi.py improvements; Chainlit 2.0#63

Merged
adamjohnwright merged 11 commits intomainfrom
followup-messages
Jan 16, 2025
Merged

Add RAG postprocessing step; config.yml messages; chat-fastspi.py improvements; Chainlit 2.0#63
adamjohnwright merged 11 commits intomainfrom
followup-messages

Conversation

@GFJHogue
Copy link
Copy Markdown
Collaborator

@GFJHogue GFJHogue commented Jan 16, 2025

New Features:

  • Added postprocess node to main graph for upcoming completeness check / web search enhancement.
    • Adds additional_text to the state. When non-empty, sends the text as an additional message after graph execution completes.
  • Added config.yml to allow for configurable static messages triggered by various events.
    • See config_default.yml for examples. This file is used as a fallback if config.yml isn't present.

Updates:

  • Upgraded Chainlit 2.0
    • Re-generated .chainlit/config.toml
    • Styling variables have moved to public/theme.json

Fixes / Improvements:

  • FastAPI middleware should redirect to HTTPS.
  • 400-status errors should return with an HTML page with a "Try Again" button.
  • Removed / factored out old redundant RAG chain code.
  • Exporting records includes user feedback 👍👎+ feedback message

@GFJHogue GFJHogue self-assigned this Jan 16, 2025
Comment thread bin/chat-chainlit.py
chat_profile: str = cl.user_session.get("chat_profile")
initial_message = (
f"Welcome to {chat_profile}, your interactive chatbot for exploring Reactome!"
" Ask me about biological pathways and processes."
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved this to config.yml

Comment thread bin/chat-fastapi.py
<h1>$error_title</h1>
<p>If you believe this to be in error, please contact the maintainers to report an issue.</p>
<form action="{CHAINLIT_URI}" method="get">
<button type="submit">Try again</button>
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking for feedback on this message. Should we include an email or link?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now it could be help@reactome.org

Comment thread bin/chat-fastapi.py
async def captcha_page(request: Request):

host = request.headers.get('X-Forwarded-Host', request.headers.get('Host'))
form_action = f"https://{host}{CHAINLIT_URI}/verify_captcha"
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted this since the new HTTPS middleware redirect should handle this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

@GFJHogue GFJHogue marked this pull request as ready for review January 16, 2025 19:31
Comment thread bin/chat-fastapi.py
<h1>$error_title</h1>
<p>If you believe this to be in error, please contact the maintainers to report an issue.</p>
<form action="{CHAINLIT_URI}" method="get">
<button type="submit">Try again</button>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now it could be help@reactome.org

Comment thread bin/chat-fastapi.py
async def captcha_page(request: Request):

host = request.headers.get('X-Forwarded-Host', request.headers.get('Host'))
form_action = f"https://{host}{CHAINLIT_URI}/verify_captcha"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true

@adamjohnwright adamjohnwright merged commit 281af4a into main Jan 16, 2025
@adamjohnwright adamjohnwright deleted the followup-messages branch January 16, 2025 19:50
GFJHogue pushed a commit that referenced this pull request Apr 17, 2025
Add RAG postprocessing step; config.yml messages; chat-fastspi.py improvements; Chainlit 2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants