Analysis
Browse files
main.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
# Your GA4 tracking script
|
| 5 |
+
tracking_script = """
|
| 6 |
+
<!-- Google tag (gtag.js) -->
|
| 7 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CLNDQ829HZ"></script>
|
| 8 |
+
<script>
|
| 9 |
+
window.dataLayer = window.dataLayer || [];
|
| 10 |
+
function gtag(){dataLayer.push(arguments);}
|
| 11 |
+
gtag('js', new Date());
|
| 12 |
+
gtag('config', 'G-CLNDQ829HZ');
|
| 13 |
+
</script>
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
# Simple chatbot function
|
| 17 |
+
def chatbot_response(message):
|
| 18 |
+
return f"👋 Hi there! You said: {message}"
|
| 19 |
+
|
| 20 |
+
# Create the UI
|
| 21 |
+
with gr.Blocks() as demo:
|
| 22 |
+
gr.HTML(tracking_script)
|
| 23 |
+
gr.Markdown("## 🤖 Welcome to Sambit AI!")
|
| 24 |
+
gr.ChatInterface(fn=chatbot_response)
|
| 25 |
+
|
| 26 |
+
# Launch the app (Gradio handles this on Spaces)
|
| 27 |
+
demo.launch()
|