Spaces:
Build error
Build error
Update app.py
Browse files45 unmodified lines464748495051524 unmodified lines5758595960616263646566666768697045 unmodified lines
# Function to load answer from the modeldef load_answer(question): # Add the user question to sessionMessages st.session_state.sessionMessages.append(HumanMessage(content=question)) assistant_answer = llm.invoke(st.session_state.sessionMessages) 4 unmodified lines st.session_state.sessionMessages.append(AIMessage(content=assistant_answer)) return assistant_answer
# Chat history display# Display the chat historyfor message in st.session_state.sessionMessages: if isinstance(message, HumanMessage): chat_bubble(message.content, is_user=True) elif isinstance(message, AIMessage): chat_bubble(message.content, is_user=False)
# Input area# Input area for new promptuser_input = st.text_input("You: ", key="input", placeholder="Type your question here...")
# Button for submissionapp.py+3-2