Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from agent import ad_copy_agent, sentiment_agent, timing_agent
|
3 |
+
|
4 |
+
# Gradio UI definition
|
5 |
+
with gr.Blocks() as demo:
|
6 |
+
gr.Markdown("# 📈 Marketing AI Dashboard")
|
7 |
+
|
8 |
+
with gr.Tab("Ad Copy Generator"):
|
9 |
+
prod = gr.Textbox(label="Product")
|
10 |
+
desc = gr.Textbox(label="Description")
|
11 |
+
audience = gr.Textbox(label="Audience")
|
12 |
+
tone = gr.Textbox(label="Tone")
|
13 |
+
ad_output = gr.Textbox(label="Generated Ads")
|
14 |
+
ad_button = gr.Button("Generate Ads")
|
15 |
+
ad_button.click(ad_copy_agent, [prod, desc, audience, tone], ad_output)
|
16 |
+
|
17 |
+
with gr.Tab("Sentiment Analyzer"):
|
18 |
+
social_input = gr.Textbox(label="Social Media Mentions / Input")
|
19 |
+
sentiment_output = gr.Textbox(label="Sentiment Analysis")
|
20 |
+
sentiment_button = gr.Button("Analyze Sentiment")
|
21 |
+
sentiment_button.click(sentiment_agent, social_input, sentiment_output)
|
22 |
+
|
23 |
+
with gr.Tab("Post Timing Recommender"):
|
24 |
+
platform_input = gr.Textbox(label="Platform (e.g., Facebook, Instagram)")
|
25 |
+
timing_output = gr.Textbox(label="Recommended Times")
|
26 |
+
timing_button = gr.Button("Get Recommendations")
|
27 |
+
timing_button.click(timing_agent, platform_input, timing_output)
|
28 |
+
|
29 |
+
demo.launch()
|