|
import gradio as gr |
|
from agent import ad_copy_agent, sentiment_agent, timing_agent |
|
|
|
|
|
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() |