import os from openai import OpenAI import gradio as gr client = OpenAI(api_key=os.environ["Secret"]) def gpt3(texts): response = client.chat.completions.create( model="gpt-4", messages=[{"role": "user", "content": texts}], temperature=0, max_tokens=750, top_p=1, frequency_penalty=0.0, presence_penalty=0.0, stop=[";", "*/", ""] ) return response.choices[0].message.content def greet(prompt): txt = f'''/*Prompt: {prompt}*/ \nSQL code:''' sql = gpt3(txt) return sql e = gr.Interface( fn=greet, inputs=["text"], outputs="text", title="Natural Language to SQL Converter", description="Convert your natural language queries into SQL code." ) e.launch()