forked from jonfairbanks/local-rag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
34 lines (23 loc) · 750 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import time
import streamlit as st
from components.chatbox import chatbox
from components.header import set_page_header
from components.sidebar import sidebar
from components.page_config import set_page_config
from components.page_state import set_initial_state
def generate_welcome_message(msg):
for char in msg:
time.sleep(0.025) # TODO: Find a better way -- This is blocking :(
yield char
### Setup Initial State
set_initial_state()
### Page Setup
set_page_config()
set_page_header()
for msg in st.session_state["messages"]:
st.chat_message(msg["role"]).write(msg["content"])
# st.chat_message(msg["role"]).write_stream(generate_welcome_message(msg['content']))
### Sidebar
sidebar()
### Chat Box
chatbox()