Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import datetime
|
| 3 |
import random
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
def generate_horoscope(name, birth_date, birth_time, birth_place):
|
| 6 |
-
#
|
|
|
|
|
|
|
|
|
|
| 7 |
lucky_number = random.randint(1, 9)
|
| 8 |
lucky_color = random.choice(["Red", "Blue", "Green", "Yellow", "Purple"])
|
| 9 |
messages = [
|
|
@@ -15,7 +23,7 @@ def generate_horoscope(name, birth_date, birth_time, birth_place):
|
|
| 15 |
]
|
| 16 |
daily_message = random.choice(messages)
|
| 17 |
|
| 18 |
-
return f"Hello {name},\n\nLucky Number: {lucky_number}\nLucky Color: {lucky_color}\nDaily Insight: {daily_message}\n\n(Generated based on planetary positions on {datetime.date.today()})"
|
| 19 |
|
| 20 |
with gr.Blocks() as app:
|
| 21 |
gr.Markdown("# π AstroGuide β Your Daily Horoscope & Insights")
|
|
@@ -27,7 +35,7 @@ with gr.Blocks() as app:
|
|
| 27 |
birth_place = gr.Textbox(label="Birth Place")
|
| 28 |
|
| 29 |
submit_btn = gr.Button("Generate Horoscope")
|
| 30 |
-
output = gr.Textbox(label="Your
|
| 31 |
|
| 32 |
submit_btn.click(generate_horoscope, inputs=[name, birth_date, birth_time, birth_place], outputs=output)
|
| 33 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import datetime
|
| 3 |
import random
|
| 4 |
+
import requests
|
| 5 |
+
|
| 6 |
+
def get_planetary_transits():
|
| 7 |
+
# Placeholder function (Replace with an API call if available)
|
| 8 |
+
return "Sun in Pisces, Moon in Leo, Mars in Capricorn"
|
| 9 |
|
| 10 |
def generate_horoscope(name, birth_date, birth_time, birth_place):
|
| 11 |
+
# Get planetary transits
|
| 12 |
+
transits = get_planetary_transits()
|
| 13 |
+
|
| 14 |
+
# Simulating a detailed astrology prediction
|
| 15 |
lucky_number = random.randint(1, 9)
|
| 16 |
lucky_color = random.choice(["Red", "Blue", "Green", "Yellow", "Purple"])
|
| 17 |
messages = [
|
|
|
|
| 23 |
]
|
| 24 |
daily_message = random.choice(messages)
|
| 25 |
|
| 26 |
+
return f"Hello {name},\n\nLucky Number: {lucky_number}\nLucky Color: {lucky_color}\nPlanetary Transits: {transits}\nDaily Insight: {daily_message}\n\n(Generated based on planetary positions on {datetime.date.today()})"
|
| 27 |
|
| 28 |
with gr.Blocks() as app:
|
| 29 |
gr.Markdown("# π AstroGuide β Your Daily Horoscope & Insights")
|
|
|
|
| 35 |
birth_place = gr.Textbox(label="Birth Place")
|
| 36 |
|
| 37 |
submit_btn = gr.Button("Generate Horoscope")
|
| 38 |
+
output = gr.Textbox(label="Your Detailed Horoscope")
|
| 39 |
|
| 40 |
submit_btn.click(generate_horoscope, inputs=[name, birth_date, birth_time, birth_place], outputs=output)
|
| 41 |
|