From 75e81ad8f4c2c1e5036b78170eac93e81bb459ee Mon Sep 17 00:00:00 2001 From: NicolasLMP Date: Fri, 25 Jul 2025 10:10:29 +0200 Subject: [PATCH] feat : changed example prompts --- src/webapp/app.py | 24 ++++++++++++++++++++++-- src/webapp/example_prompts.py | 5 ++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/webapp/app.py b/src/webapp/app.py index dd5e60b..def2a4f 100644 --- a/src/webapp/app.py +++ b/src/webapp/app.py @@ -59,6 +59,25 @@ text-align: left !important; width: 100% !important; } + /* Example prompt button styling to match panel buttons */ + div[data-testid="stExpander"] .stButton > button { + border-radius: 8px !important; + width: 100% !important; + text-align: left !important; + justify-content: flex-start !important; + display: flex !important; + align-items: center !important; + background-color: transparent !important; + border: 1px solid #e0e0e0 !important; + margin-bottom: 4px !important; + } + div[data-testid="stExpander"] .stButton > button:hover { + background-color: #d2d2d2 !important; + } + div[data-testid="stExpander"] .stButton > button > div { + text-align: left !important; + width: 100% !important; + } div[data-testid="stChatMessage"] div img, .stChatMessage img { width: 40px !important; @@ -422,18 +441,19 @@ def format_chat_history(conversation_id: str, max_turns=10): # Display example prompts only on a new chat if len(st.session_state.messages) <= 1: - with st.expander("Not sure where to start? Try these examples..."): + with st.expander("Not sure where to start? Try these examples :", expanded=False): # Function to handle prompt click def handle_prompt_click(prompt_text): st.session_state.clicked_prompt = prompt_text for example in EXAMPLE_PROMPTS: if st.button( - f"**{example['title']}** - {example['prompt']}", + example["title"], key=f"example_{example['title']}", on_click=handle_prompt_click, args=[example["prompt"]], use_container_width=True, + help=example["prompt"], ): pass diff --git a/src/webapp/example_prompts.py b/src/webapp/example_prompts.py index 60af7f9..7f466f4 100644 --- a/src/webapp/example_prompts.py +++ b/src/webapp/example_prompts.py @@ -1,6 +1,9 @@ # src/webapp/example_prompts.py EXAMPLE_PROMPTS = [ - {"title": "Identifier une équipe projet", "prompt": "Quelle équipe travaille sur le projet Isschat ?"}, + { + "title": "Identifier une technologie utilisé", + "prompt": "What tool does Isskar use for data versioning and pipeline management ?", + }, {"title": "Résumer un événement", "prompt": "Que s’est-il passé lors de la matinale du 2 Juillet ?"}, ]