import gradio as gr import openai, os, time client = openai.OpenAI(api_key = os.getenv("OPENAI_API_KEY")) def chat(message, history): for i in range(len(message)): time.sleep(0.3) yield "You typed: " + message[: i+1] gr.ChatInterface(chat).launch()