import gradio as gr import os import openai openai.api_key = os.getenv("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") def greet(firstMsg): completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": firstMsg} ] ) return completion.choices[0].message iface = gr.Interface(fn=greet, inputs="text", outputs="text") iface.launch()