CahtGPT4-ChatUI / app.py
Kvikontent's picture
Update app.py
a5a848e verified
raw
history blame
828 Bytes
import streamlit as st
import logging
from bing_chat import UnlimBotChat
st.title("ChatGPT4 UI")
cont = st.container(height=600)
prompt = st.chat_input(placeholder="Eg. How are you?")
logging.basicConfig(level=logging.INFO)
chat = UnlimBotChat("")
def main():
st.title("ChatGPT4 UI")
cont = st.container(height=600)
prompt = st.chat_input(placeholder="Eg. How are you?")
if st.button("Send"):
messages = chat.run(prompt)
for message in messages:
if message['source'] == 'user':
user_msg = cont.chat_message("user")
user_msg.write(message['message'])
elif message['source'] == 'bing':
out_msg = cont.chat_message("assistant")
out_msg.write(message['message'])
if __name__ == "__main__":
main()