README / app.py
QRAGENT1243's picture
requirements.txt
a7d0dab verified
Raw History Blame Contribute Delete
690 Bytes
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()