File size: 690 Bytes
a7d0dab | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import openai
import gradio as gr
# Set up OpenAI API Key (Replace with your actual API Key)
openai.api_key = "YOUR_OPENAI_API_KEY"
# Function to process AI commands
def nettopia_ai_engine(task):
response = openai.ChatCompletion.create(
model="gpt-4-turbo",
messages=[{"role": "system", "content": f"Automate: {task}"}]
)
return response["choices"][0]["message"]["content"]
# Create an interface to allow user interaction
iface = gr.Interface(
fn=nettopia_ai_engine,
inputs="text",
outputs="text",
title="NETTOPIA AI Engine",
description="Enter a command to automate NETTOPIA’s expansion.",
)
# Launch the AI Interface
iface.launch()
|