Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

components.py 1.7 KB

You have to be logged in to leave a comment. Sign In
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
52
53
54
  1. import streamlit as st
  2. def sidebar():
  3. # Omdena Logo
  4. with st.sidebar:
  5. st.image(image="images/omdena.png")
  6. st.markdown(
  7. body=(
  8. "<center>Welcome to Omdena interview preparation <strong>chatbot</strong>. "
  9. "Wish you all the luck 🤞🏼</center>"
  10. ),
  11. unsafe_allow_html=True,
  12. )
  13. st.divider()
  14. # Resume uploader label
  15. st.markdown(body="<center>Upload your Resume 📄</center>", unsafe_allow_html=True)
  16. # Resume uploader
  17. resume = st.file_uploader(label="upload file", type=["pdf", "docx"], label_visibility="hidden")
  18. st.divider()
  19. # Footer - Copyright info
  20. st.markdown(body="`© 2023 by Omdena. All rights reserved.`", unsafe_allow_html=True)
  21. return resume
  22. def chat():
  23. # Initialize chat history
  24. if "messages" not in st.session_state:
  25. st.session_state.messages = []
  26. # Display chat messages from history on app rerun
  27. for message in st.session_state.messages:
  28. with st.chat_message(message["role"]):
  29. st.markdown(message["content"])
  30. # React to user input
  31. if prompt := st.chat_input("Start typing ..."):
  32. # Display user message in chat message container
  33. st.chat_message("user").markdown(prompt)
  34. # Add user message to chat history
  35. st.session_state.messages.append({"role": "user", "content": prompt})
  36. response = f"HR: {prompt}"
  37. # Display assistant response in chat message container
  38. with st.chat_message("assistant"):
  39. st.markdown(response)
  40. # Add assistant response to chat history
  41. st.session_state.messages.append({"role": "assistant", "content": response})
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...