RustX/CSV-ChatBot
1
1import streamlit as st2 3 4class Layout:5 def show_header(self):6 """7 Displays the header of the app8 """9 st.markdown(10 """11 <h1 style='text-align: center;'>CSV-ChatBot, Talk with your csv-data ! / CSV-ChatBot, csv 데이터로 대화하세요! 💬</h1>12 """,13 unsafe_allow_html=True,14 )15 16 def show_api_key_missing(self):17 """18 Displays a message if the user has not entered an API key19 """20 st.markdown(21 """22 <div style='text-align: center;'>23 <h4>Enter your <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API key</a> to start chatting / 채팅을 시작하려면 <a href="https://platform.openai.com/account/api-keys" target="_blank">OpenAI API 키</a>를 입력하세요. 😉</h4>24 </div>25 """,26 unsafe_allow_html=True,27 )28 29 def prompt_form(self):30 """31 Displays the prompt form32 """33 with st.form(key="my_form", clear_on_submit=True):34 user_input = st.text_area(35 "Query: / 질문:",36 placeholder="Ask me anything about the document... / 문서에 대해 무엇이든 물어보세요...",37 key="input",38 label_visibility="collapsed",39 )40 submit_button = st.form_submit_button(label="Send / 보내주세요")41 is_ready = submit_button and user_input42 return is_ready, user_input