FastAPI Re-rework#15
Conversation
ShafathZ
commented
Feb 22, 2026
- 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.
…en able to test chat message examples yet
…n case we want to use them to autofill the text box.
… full-chat buttons which do not work yet, cleaned UI up a bit
| "itsdangerous>=2.2.0", | ||
| "torch>=2.10.0", | ||
| "transformers>=5.0.0", | ||
| "flask>=3.1.2", |
There was a problem hiding this comment.
Can you remove this dependency now, as we are not using flask anymore?
Also, you can add fastapi using this:
uv add "fastapi[standard]"There was a problem hiding this comment.
Addressed in commit 0361e4b8be20f43cc29cef2d72ef5c8754896148
|
|
||
| if (!text) return; | ||
|
|
||
| addMessage({ role: "user", msg: text }); |
There was a problem hiding this comment.
where is this function defined? I am unable to find its definition?
There was a problem hiding this comment.
Addressed in Commit 71a01bb42b1900e65956f22af145db466982fd8b
| textDiv.textContent = msg; | ||
|
|
||
| // Combine into the row in correct order | ||
| if (role === "bot") { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
| actions.classList.add("actions"); | ||
|
|
||
| // Add buttons based on which role / side of conversation | ||
| if (role === "bot") { |
There was a problem hiding this comment.
same comment here regarding using "assistant" as the role
There was a problem hiding this comment.
Addressed in commit 71a01bb42b1900e65956f22af145db466982fd8b