Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,23 @@
|
|
1 |
from hugchat import hugchat
|
2 |
import streamlit as st
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
17 |
|
|
|
1 |
from hugchat import hugchat
|
2 |
import streamlit as st
|
3 |
|
4 |
+
cookie_path = 'cookies.json'
|
5 |
+
chatbot = hugchat.ChatBot(cookie_path=cookie_path)
|
6 |
+
|
7 |
+
response = await chatbot.start_conversation('Hello!')
|
8 |
+
print(response)
|
9 |
+
|
10 |
+
# chatbot = hugchat.ChatBot(cookie_path="home/user/cookies.json")
|
11 |
+
# with st.chat_message:
|
12 |
+
# st.markdown(chatbot.chat("Hi"))
|
13 |
|
14 |
+
# # Create a new conversation
|
15 |
+
# id = chatbot.new_conversation()
|
16 |
+
# chatbot.change_conversation(id)
|
17 |
|
18 |
+
# # Get conversation list
|
19 |
+
# conversation_list = chatbot.get_conversation_list()
|
20 |
+
# uinput = st.chat_input("How can I help you?")
|
21 |
+
# with st.chat_message:
|
22 |
+
# st.markdown(chatbot.chat(uinput))
|
23 |
|