Jesus Sanchez commited on
Commit
82afe3d
·
1 Parent(s): 1d53447

trying with tab container

Browse files
Files changed (2) hide show
  1. app.py +4 -2
  2. chat.py +8 -8
app.py CHANGED
@@ -164,6 +164,8 @@ What trades did client {client} do in May 2022
164
  with st.sidebar:
165
  st.markdown(sidebar_text)
166
 
 
167
  prompt = chat.get_promt("Ask IDF Anything")
168
- with st.container():
169
- chat.get_input(prompt, get_response, llm)
 
 
164
  with st.sidebar:
165
  st.markdown(sidebar_text)
166
 
167
+ [tab] = st.tabs(["AskIDF"])
168
  prompt = chat.get_promt("Ask IDF Anything")
169
+
170
+ with tab:
171
+ chat.process(prompt, get_response, llm)
chat.py CHANGED
@@ -21,14 +21,14 @@ class Chat:
21
  st.session_state[TEXT_INPUT_LABEL] = ''
22
 
23
  def get_promt(self, placeholder: str):
24
- return st.text_input(
25
- label="ChatIDF",
26
- placeholder=placeholder,
27
- key="chat_widget",
28
- )
29
- # return st.chat_input(placeholder=placeholder)
30
-
31
- def get_input(self, prompt: str, process_prompt: Callable, *args):
32
  """
33
  process_prompt(promt: str, *args) -> tuple(Any, Callable)
34
  callback to process the chat promt, it takes the promt for input
 
21
  st.session_state[TEXT_INPUT_LABEL] = ''
22
 
23
  def get_promt(self, placeholder: str):
24
+ # return st.text_input(
25
+ # label="ChatIDF",
26
+ # placeholder=placeholder,
27
+ # key="chat_widget",
28
+ # )
29
+ return st.chat_input(placeholder=placeholder)
30
+
31
+ def process(self, prompt: str, process_prompt: Callable, *args):
32
  """
33
  process_prompt(promt: str, *args) -> tuple(Any, Callable)
34
  callback to process the chat promt, it takes the promt for input