Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 36 additions & 18 deletions src/webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def get_random_loading_message():
text-align: left !important;
width: 100% !important;
}
/* Example prompt button styling to match panel buttons */
/* Enhanced prompt selector styling */
div[data-testid="stExpander"] .stButton > button {
border-radius: 8px !important;
width: 100% !important;
Expand All @@ -98,14 +98,38 @@ def get_random_loading_message():
background-color: transparent !important;
border: 1px solid #e0e0e0 !important;
margin-bottom: 4px !important;
transition: all 0.2s ease !important;
}
div[data-testid="stExpander"] .stButton > button:hover {
background-color: #d2d2d2 !important;
background-color: #f0f0f0 !important;
border-color: #c0c0c0 !important;
transform: translateY(-1px) !important;
}
div[data-testid="stExpander"] .stButton > button > div {
text-align: left !important;
width: 100% !important;
}
/* Primary button styling for prompt actions */
.stButton > button[data-baseweb="button"][data-kind="primary"] {
background-color: #0066cc !important;
border-color: #0066cc !important;
}
.stButton > button[data-baseweb="button"][data-kind="primary"]:hover {
background-color: #0052a0 !important;
border-color: #0052a0 !important;
}
/* Prompt card styling */
.prompt-card {
padding: 12px !important;
border: 1px solid #e0e0e0 !important;
border-radius: 8px !important;
margin-bottom: 12px !important;
background-color: #fafafa !important;
}
.prompt-card:hover {
border-color: #c0c0c0 !important;
background-color: #f5f5f5 !important;
}
div[data-testid="stChatMessage"] div img,
.stChatMessage img {
width: 40px !important;
Expand Down Expand Up @@ -478,23 +502,17 @@ def format_chat_history(conversation_id: str):
# Force rerun to display feedback widget in history
st.rerun()

# Display example prompts only on a new chat
# Simple prompt suggestions - only show on new chat
if len(st.session_state.messages) <= 1:
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(
example["title"],
key=f"example_{example['title']}",
on_click=handle_prompt_click,
args=[example["prompt"]],
use_container_width=True,
help=example["prompt"],
):
pass
with st.expander(" Example prompts", expanded=False):
cols = st.columns(2)
for i, example in enumerate(EXAMPLE_PROMPTS):
col = cols[i % 2]
with col:
if st.button(
example["title"], key=f"example_{i}", help=example["prompt"], use_container_width=True
):
st.session_state.clicked_prompt = example["prompt"]

# Handle chat input, prioritizing clicked examples
if "clicked_prompt" in st.session_state and st.session_state.clicked_prompt:
Expand Down
11 changes: 9 additions & 2 deletions src/webapp/example_prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

EXAMPLE_PROMPTS = [
{
"title": "Identifier une technologie utilisé",
"title": "Tools & Technology",
"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 ?"},
{"title": "Events & Updates", "prompt": "Que s'est-il passé lors de la matinale du 2 Juillet ?"},
{"title": "Prepare my onboarding", "prompt": "Can you give me Onboardings steps for a new employee at Isskar ?"},
{"title": "Project documentation", "prompt": "Où puis-je trouver la documentation du projet Teora ?"},
{
"title": "Linkedin prospection",
"prompt": "Quels sont les messages Linkedin de prospection que je peux utiliser ?",
},
{"title": "Informatic support", "prompt": "Quel est le support informatique chez Isskar ?"},
]