Skip to content

FastAPI Re-rework#15

Merged
Suryanshg merged 10 commits into
mainfrom
fastapi-re-rework
Feb 23, 2026
Merged

FastAPI Re-rework#15
Suryanshg merged 10 commits into
mainfrom
fastapi-re-rework

Conversation

@ShafathZ
Copy link
Copy Markdown
Owner

  • Completed refactor of Flask -> FastAPI
  • Added Jinja2 templating for frontend. Frontend and Backend are currently connected and needs to be split in future commit.
  • Updated frontend UI to match Gradio with some extensions to make it look nicer + javascript. Note: JavaScript for deleting and editing are not implemented yet until JS for client-side chat storage is complete.

Comment thread static/js/home.js
Comment thread static/js/main.js
Comment thread pyproject.toml Outdated
"itsdangerous>=2.2.0",
"torch>=2.10.0",
"transformers>=5.0.0",
"flask>=3.1.2",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you remove this dependency now, as we are not using flask anymore?

Also, you can add fastapi using this:

uv add "fastapi[standard]"

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Comment thread static/js/chat_ui.js
Comment thread static/js/chat_ui.js Outdated

if (!text) return;

addMessage({ role: "user", msg: text });
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

where is this function defined? I am unable to find its definition?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Comment thread static/js/chat_ui.js
Comment thread static/js/chat_ui.js Outdated
textDiv.textContent = msg;

// Combine into the row in correct order
if (role === "bot") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I believe we should use the role value as "assistant" for AI, as its the standard for all API calls (whether remote or local) for interacting with LLMs

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Comment thread static/js/chat_ui.js Outdated
actions.classList.add("actions");

// Add buttons based on which role / side of conversation
if (role === "bot") {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same comment here regarding using "assistant" as the role

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@ShafathZ ShafathZ requested a review from Suryanshg February 23, 2026 04:47
@Suryanshg Suryanshg merged commit 11f2a4c into main Feb 23, 2026
1 check passed
@ShafathZ ShafathZ deleted the fastapi-re-rework branch March 14, 2026 06:52
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