File size: 1,540 Bytes
352d473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62f14a6
352d473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62f14a6
 
352d473
62f14a6
352d473
 
 
 
 
 
 
 
62f14a6
352d473
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import streamlit as st
import json

# Page configuration
st.set_page_config(
    page_title="Portfolio Chatbot Test",
    page_icon="🤖",
    layout="wide"
)

# Initialize session state
if 'messages' not in st.session_state:
    st.session_state.messages = []

def main():
    st.title("Portfolio Chatbot Testing Interface")
    st.write("Basic testing version")
    
    # Create two columns for layout
    col1, col2 = st.columns([2, 1])
    
    with col1:
        st.subheader("Chat Interface")
        # Display chat messages from history
        for message in st.session_state.messages:
            with st.chat_message(message["role"]):
                st.markdown(message["content"])
        
        # Accept user input
        if prompt := st.chat_input("What would you like to know?"):
            # Add user message to chat history
            st.session_state.messages.append({"role": "user", "content": prompt})
            
            # Simple echo response for testing
            response = f"You asked: {prompt}"
            
            # Display assistant response
            with st.chat_message("assistant"):
                st.markdown(response)
            
            # Add assistant response to chat history
            st.session_state.messages.append({"role": "assistant", "content": response})
    
    with col2:
        st.subheader("Testing Tools")
        if st.button("Clear Chat"):
            st.session_state.messages = []
            st.experimental_rerun()

if __name__ == "__main__":
    main()