| import gradio as gr | |
| import g4f | |
| # | |
| def chatbot_interaction(messages): | |
| response = g4f.ChatCompletion.create(model='gpt-4', provider=g4f.Provider.ChatgptAi, messages=messages, stream=False) | |
| return response | |
| iface = gr.Interface( | |
| fn=chatbot_interaction, | |
| inputs="text", | |
| outputs="text", | |
| layout="vertical", | |
| title="Chatbot", | |
| description="Isa Ibn Maryam. Dis moi tu viens encore fais quoi ici ? 😂😂 Vas dormir ! Espace fermé ! ") | |
| iface.launch() | |