Skip to content

Commit 3b9f7c6

Browse files
authored
Merge pull request #31 from LindseyB/fix-28
Fix any genre beaking everything 🤦
2 parents 5d5c9df + d633ad3 commit 3b9f7c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def get_current_planets(today_chart):
186186

187187
def call_ai_api(system_content, user_prompt, temperature=1.0):
188188
"""Make AI API call with error handling"""
189+
189190
try:
190191
response = client.chat.completions.create(
191192
messages=[
@@ -227,7 +228,7 @@ def calculate_chart(birth_date, birth_time, timezone_offset, latitude, longitude
227228

228229
# Generate AI analysis with error handling
229230
# Prepare music genre preference text
230-
genre_text = prepare_music_genre_text(music_genre, "daily")
231+
genre_text = prepare_music_genre_text(music_genre, "daily") or "any"
231232

232233
# Build the user prompt
233234
user_prompt = "Only respond in a few sentences. Based on the following astrological chart data please recommend some activities to do or not to do ideally in bullet format the first sentence in your response should be what today's vibe will be like please also recommend a single song to listen to and recommend a beverage to drink given today's vibe:\n\n" + \
@@ -236,7 +237,7 @@ def calculate_chart(birth_date, birth_time, timezone_offset, latitude, longitude
236237
"\n".join([f"{HOUSE_NAMES[house_number]}: " + ", ".join([f"{p['name']} in {p['sign']}" for p in data['planets']]) for house_number, data in planets_in_houses.items()]) + "\n\n" + \
237238
"Current Planets status:\n" + \
238239
format_planets_for_api(current_planets) + \
239-
f"\n\nMusic Preference: {genre_text}" if genre_text else ""
240+
f"\n\nMusic Preference: {genre_text}"
240241

241242
# Log the prompt to console
242243
print("=== USER PROMPT ===")
@@ -357,7 +358,7 @@ def calculate_full_chart(birth_date, birth_time, timezone_offset, latitude, long
357358
# Build the user prompt for the full chart
358359
# Prepare music genre preference text
359360
genre_text = prepare_music_genre_text(music_genre, "natal")
360-
361+
361362
user_prompt = (
362363
"Only respond in a few sentences. Based on the following natal chart data, "
363364
"please give a concise, emoji-filled summary of this person's personality and life themes. "

0 commit comments

Comments
 (0)