ai-lawyer-agent/app/components/sidebar.py
2025-12-12 08:41:11 +01:00

33 lines
872 B
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import streamlit as st
from agents import SQLiteSession
sidebar_style = """
<style>
[data-testid="stSidebar"][aria-expanded="true"]{
min-width: 300px;
max-width: 300px;
}
div.stButton > button {
background-color: #D6EDFF;
border: none;
}
div.stButton > button:hover {
background-color: #D6EDFF;
}
</style>
"""
def add_sidebar():
st.markdown(sidebar_style, unsafe_allow_html=True)
with st.sidebar:
st.title("⚖️ LawGPT")
st.markdown(":blue-badge[⚙Tool] :orange-badge[⚠Current chat will be deleted]")
if st.button(":material/note_stack_add: Create new chat"):
st.session_state.messages = []
st.session_state.chat_session = SQLiteSession(":memory:")