Skip to content
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

feat: Add an OOTB Chat uI to the Feature Server to support RAG demo #5106

Conversation

franciscojavierarceo
Copy link
Member

@franciscojavierarceo franciscojavierarceo commented Feb 27, 2025

What this PR does / why we need it:

This pull request introduces several enhancements to the Feast feature server, including the addition of a chat UI, WebSocket support, and improvements to the server's API documentation.

  1. MANIFEST.in:
    • Added a new line to include static files in the package.
  2. sdk/python/feast/feature_server.py:
    • Imported new modules and libraries (asyncio, os, importlib_resources, WebSocket, WebSocketDisconnect, StaticFiles).
    • Added new classes for chat functionality (ChatMessage, ChatRequest).
    • Extended get_app function to document its purpose and endpoints in detail.
    • Introduced new endpoints:
      - /chat: POST endpoint to process chat requests.
      - /chat: GET endpoint to serve the chat UI.
      - /ws/chat: WebSocket endpoint for real-time chat communication.
    • Created a ConnectionManager class to manage WebSocket connections and handle incoming messages.
  3. sdk/python/feast/ui_server.py:
    • Added a check to return a 503 status code if the registry is unavailable.
      4.sdk/python/feast/static/chat/index.html:
    • Added a new HTML file to provide a basic chat UI for the Feast feature server.
      - The UI includes an input box for user messages and a container for displaying chat messages.
      - Integrated WebSocket for real-time chat functionality.

Which issue(s) this PR fixes:

N/A

Misc

The chat looks like this and supports streaming output:

Screenshot 2025-02-27 at 9 09 18 PM

@franciscojavierarceo franciscojavierarceo changed the title Feature/chat application feat: Feature/chat application Feb 27, 2025
@franciscojavierarceo franciscojavierarceo marked this pull request as ready for review February 28, 2025 02:19
@franciscojavierarceo franciscojavierarceo requested a review from a team as a code owner February 28, 2025 02:19
@franciscojavierarceo franciscojavierarceo changed the title feat: Feature/chat application feat: Add an OOTB Chat uI to the Feature Server to support RAG demo Feb 28, 2025
Copy link
Collaborator

@shuchu shuchu left a comment

Choose a reason for hiding this comment

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

Lgtm

@franciscojavierarceo franciscojavierarceo merged commit 40ea7a9 into feast-dev:master Feb 28, 2025
38 checks passed
@dmartinol
Copy link
Contributor

What’s the idea behind this change? 🤔 is this a temporary endpoint or are you prototyping a future enhancement?

@franciscojavierarceo
Copy link
Member Author

Temporary endpoint fora future enhancement.

The goal will be to expose a lightweight chat capability so MLEs can see how to create their RAG applications. Not meant for production but meant for fast prototyping. Streamlit would require more packages. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants