Spaces:
Runtime error
Runtime error
Commit
Β·
ab9a2de
1
Parent(s):
a4e29f0
Update app.py
Browse files
app.py
CHANGED
@@ -13,9 +13,9 @@ def clean_text(text):
|
|
13 |
return cleaned_text
|
14 |
|
15 |
# Function to generate response from Google GEMINI
|
16 |
-
def generate_response(cleaned_input, model
|
17 |
try:
|
18 |
-
response = model.generate_content(cleaned_input
|
19 |
full_response = ""
|
20 |
for chunk in response:
|
21 |
full_response += chunk.text
|
@@ -51,8 +51,7 @@ class SynastryAspectsWithRelevant(SynastryAspects):
|
|
51 |
return relevant_aspects_list
|
52 |
|
53 |
def main():
|
54 |
-
st.title("Astrological Chart
|
55 |
-
st.write("Enter information for you, your lover, or both, and get astrological and compatibility results!:")
|
56 |
|
57 |
# Astrological chart generation
|
58 |
st.write("Enter information for the first person:")
|
@@ -72,14 +71,14 @@ def main():
|
|
72 |
report_content = "\n".join([str(aspect) for aspect in aspect_list])
|
73 |
|
74 |
# Google GEMINI integration
|
75 |
-
genai.configure(api_key='
|
76 |
model = genai.GenerativeModel('gemini-pro')
|
77 |
|
78 |
st.write("Ask the WiseOracle using your astrological chart information as context")
|
79 |
user_query = st.text_input("Your question:")
|
80 |
if st.button("Get Astrological Insight"):
|
81 |
cleaned_input = clean_text(report_content + " " + user_query)
|
82 |
-
response = generate_response(cleaned_input, model
|
83 |
if response:
|
84 |
st.success(response)
|
85 |
|
|
|
13 |
return cleaned_text
|
14 |
|
15 |
# Function to generate response from Google GEMINI
|
16 |
+
def generate_response(cleaned_input, model):
|
17 |
try:
|
18 |
+
response = model.generate_content(cleaned_input, stream=True)
|
19 |
full_response = ""
|
20 |
for chunk in response:
|
21 |
full_response += chunk.text
|
|
|
51 |
return relevant_aspects_list
|
52 |
|
53 |
def main():
|
54 |
+
st.title("Astrological Chart and WiseOracle Integration")
|
|
|
55 |
|
56 |
# Astrological chart generation
|
57 |
st.write("Enter information for the first person:")
|
|
|
71 |
report_content = "\n".join([str(aspect) for aspect in aspect_list])
|
72 |
|
73 |
# Google GEMINI integration
|
74 |
+
genai.configure(api_key='Your_Gemini_API_Key') # Replace with your Gemini API key
|
75 |
model = genai.GenerativeModel('gemini-pro')
|
76 |
|
77 |
st.write("Ask the WiseOracle using your astrological chart information as context")
|
78 |
user_query = st.text_input("Your question:")
|
79 |
if st.button("Get Astrological Insight"):
|
80 |
cleaned_input = clean_text(report_content + " " + user_query)
|
81 |
+
response = generate_response(cleaned_input, model)
|
82 |
if response:
|
83 |
st.success(response)
|
84 |
|