Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
| 1 |
from hugchat import hugchat
|
|
|
|
|
|
|
| 2 |
chatbot = hugchat.ChatBot(cookie_path="cookies.json")
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
# Create a new conversation
|
| 5 |
id = chatbot.new_conversation()
|
| 6 |
chatbot.change_conversation(id)
|
|
|
|
| 7 |
# Get conversation list
|
| 8 |
conversation_list = chatbot.get_conversation_list()
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from hugchat import hugchat
|
| 2 |
+
import streamlit as st
|
| 3 |
+
|
| 4 |
chatbot = hugchat.ChatBot(cookie_path="cookies.json")
|
| 5 |
+
with st.chat_message:
|
| 6 |
+
st.markdown(chatbot.chat("Hi"))
|
| 7 |
+
|
| 8 |
# Create a new conversation
|
| 9 |
id = chatbot.new_conversation()
|
| 10 |
chatbot.change_conversation(id)
|
| 11 |
+
|
| 12 |
# Get conversation list
|
| 13 |
conversation_list = chatbot.get_conversation_list()
|
| 14 |
+
uinput = st.chat_input("How can I help you?")
|
| 15 |
+
with st.chat_message:
|
| 16 |
+
st.markdown(chatbot.chat(uinput))
|
| 17 |
+
|