File size: 1,229 Bytes
409166a |
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 27 28 29 |
import gradio as gr
from agent import ad_copy_agent, sentiment_agent, timing_agent
# Gradio UI definition
with gr.Blocks() as demo:
gr.Markdown("# 📈 Marketing AI Dashboard")
with gr.Tab("Ad Copy Generator"):
prod = gr.Textbox(label="Product")
desc = gr.Textbox(label="Description")
audience = gr.Textbox(label="Audience")
tone = gr.Textbox(label="Tone")
ad_output = gr.Textbox(label="Generated Ads")
ad_button = gr.Button("Generate Ads")
ad_button.click(ad_copy_agent, [prod, desc, audience, tone], ad_output)
with gr.Tab("Sentiment Analyzer"):
social_input = gr.Textbox(label="Social Media Mentions / Input")
sentiment_output = gr.Textbox(label="Sentiment Analysis")
sentiment_button = gr.Button("Analyze Sentiment")
sentiment_button.click(sentiment_agent, social_input, sentiment_output)
with gr.Tab("Post Timing Recommender"):
platform_input = gr.Textbox(label="Platform (e.g., Facebook, Instagram)")
timing_output = gr.Textbox(label="Recommended Times")
timing_button = gr.Button("Get Recommendations")
timing_button.click(timing_agent, platform_input, timing_output)
demo.launch() |