Spaces:
Sleeping
Sleeping
| import g4f | |
| import streamlit as st | |
| st.title("LearnGPT") | |
| prompt = st.chat_input("Chat") | |
| with st.chat_message("assistant"): | |
| st.write("Hello i am LearnGPT,How can I help you?") | |
| if prompt: | |
| with st.chat_message("user"): | |
| st.write(prompt) | |
| with st.chat_message("assistant"): | |
| response = g4f.ChatCompletion.create( | |
| model=g4f.models.gpt_4, | |
| messages=[{"role": "user", "content": prompt}], | |
| ) | |
| st.markdown(response) | |