Spaces:
Sleeping
Sleeping
[email protected]
commited on
Commit
·
e49d193
1
Parent(s):
0d7fb92
feat: uncomment prompt_system in app.py and enable system message display in chatbot.py; adjust text area settings in prompt_system.py
Browse files- app.py +1 -1
- pages/chatbot.py +3 -3
- pages/prompt_system.py +1 -1
app.py
CHANGED
|
@@ -62,7 +62,7 @@ def main():
|
|
| 62 |
documents,
|
| 63 |
],
|
| 64 |
"Configurations": [
|
| 65 |
-
|
| 66 |
form,
|
| 67 |
],
|
| 68 |
"Dialogue": [
|
|
|
|
| 62 |
documents,
|
| 63 |
],
|
| 64 |
"Configurations": [
|
| 65 |
+
prompt_system,
|
| 66 |
form,
|
| 67 |
],
|
| 68 |
"Dialogue": [
|
pages/chatbot.py
CHANGED
|
@@ -21,9 +21,9 @@ def display_messages():
|
|
| 21 |
with st.chat_message("Moi"):
|
| 22 |
st.write(message.content)
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
|
| 28 |
def show_retrieved_documents(query: str = ''):
|
| 29 |
if query == '':
|
|
|
|
| 21 |
with st.chat_message("Moi"):
|
| 22 |
st.write(message.content)
|
| 23 |
|
| 24 |
+
elif isinstance(message, SystemMessage):
|
| 25 |
+
with st.chat_message("System"):
|
| 26 |
+
st.write(message.content)
|
| 27 |
|
| 28 |
def show_retrieved_documents(query: str = ''):
|
| 29 |
if query == '':
|
pages/prompt_system.py
CHANGED
|
@@ -4,7 +4,7 @@ def page():
|
|
| 4 |
|
| 5 |
st.subheader("Renseignez votre prompt système")
|
| 6 |
|
| 7 |
-
prompt = st.text_area("Prompt system", st.session_state.prompt_system if 'prompt_system' in st.session_state else "")
|
| 8 |
|
| 9 |
# Session State also supports attribute based syntax
|
| 10 |
st.session_state['prompt_system'] = prompt
|
|
|
|
| 4 |
|
| 5 |
st.subheader("Renseignez votre prompt système")
|
| 6 |
|
| 7 |
+
prompt = st.text_area("Prompt system", st.session_state.prompt_system if 'prompt_system' in st.session_state else "", height=400, max_chars=None)
|
| 8 |
|
| 9 |
# Session State also supports attribute based syntax
|
| 10 |
st.session_state['prompt_system'] = prompt
|