Spaces:
Sleeping
Sleeping
Jesus Sanchez commited on
Commit ·
82afe3d
1
Parent(s): 1d53447
trying with tab container
Browse files
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 |
-
|
| 169 |
-
|
|
|
|
|
|
| 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 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
)
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
def
|
| 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
|