hsr-builds-llm / app.py
aika42's picture
Update app.py
80fb06b verified
raw
history blame
825 Bytes
import streamlit as st
from rag_engine import RAGEngine
st.title("๐Ÿ”ฎ Honkai Star Rail - Build Advisor (DeepSeek RAG)")
st.markdown("Ask me how to build any character, and I will tell you the **optimal setup**!")
# Initialize RAG
rag = RAGEngine()
# User Input
query = st.text_input("Enter your build question (e.g., How to build Jingliu?)")
if query:
st.write("Generating answer...")
with st.spinner("Consulting the Stellaron Hunters..."):
stream = rag.stream_answer(query)
response = st.empty() # Create a container for streamed content
text = ""
# Stream and display each chunk as it comes in
for chunk in stream:
text += chunk # Add the chunk to the accumulated text
response.markdown(text) # Update the Streamlit app with the current text