|
import gradio as gr |
|
from ai_generator import generate_content |
|
from seo_optimizer import optimize_content |
|
|
|
def generate_and_optimize_content(topic: str): |
|
|
|
generated_content = generate_content(topic) |
|
|
|
|
|
optimized_content = optimize_content(generated_content) |
|
|
|
|
|
return optimized_content["content"], optimized_content["metadata"]["title"], optimized_content["metadata"]["description"] |
|
|
|
|
|
iface = gr.Interface( |
|
fn=generate_and_optimize_content, |
|
inputs=[gr.Textbox(label="Enter Topic", placeholder="Enter YouTube topic here...")], |
|
outputs=[ |
|
gr.Textbox(label="Generated Content"), |
|
gr.Textbox(label="SEO Title"), |
|
gr.Textbox(label="SEO Description") |
|
], |
|
live=True, |
|
title="YouTube AI Content Generator", |
|
description="Generate SEO-optimized YouTube content on any topic using AI." |
|
) |
|
|
|
|
|
iface.launch() |
|
|