Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -18,24 +18,24 @@ def destiny_still_arrives(name:str, dob:str)-> str: #it's import to specify the
|
|
18 |
name: A string representing a person's name
|
19 |
dob: A string representing a person's date of birth
|
20 |
"""
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
|
39 |
|
40 |
# model = HfApiModel(
|
41 |
# max_tokens=2096,
|
@@ -69,10 +69,10 @@ def destiny_still_arrives(name:str, dob:str)-> str: #it's import to specify the
|
|
69 |
# response = agent.run(f"Please find out the meaning of the following name: {name}, then Generate an image of the following birthstone: {birthstone} and finally a horoscope reading of the current day")
|
70 |
# else:
|
71 |
# response = agent.run(f"Please find out the meaning of the following name: {name}, then finally a horoscope reading of the current day")
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
return response
|
77 |
|
78 |
@tool
|
|
|
18 |
name: A string representing a person's name
|
19 |
dob: A string representing a person's date of birth
|
20 |
"""
|
21 |
+
|
22 |
+
birthstones = {
|
23 |
+
"January": "Garnet",
|
24 |
+
"February": "Amethyst",
|
25 |
+
"March": "Aquamarine",
|
26 |
+
"April": "Diamond",
|
27 |
+
"May": "Emerald",
|
28 |
+
"June": "Pearl",
|
29 |
+
"July": "Ruby",
|
30 |
+
"August": "Peridot",
|
31 |
+
"September": "Sapphire",
|
32 |
+
"October": "Opal",
|
33 |
+
"November": "Topaz",
|
34 |
+
"December": "Turquoise"
|
35 |
+
}
|
36 |
|
37 |
+
month = datetime.strptime(dob, "%Y-%m-%d").strftime("%B")
|
38 |
+
birthstone = birthstones.get(month, "Unknown")
|
39 |
|
40 |
# model = HfApiModel(
|
41 |
# max_tokens=2096,
|
|
|
69 |
# response = agent.run(f"Please find out the meaning of the following name: {name}, then Generate an image of the following birthstone: {birthstone} and finally a horoscope reading of the current day")
|
70 |
# else:
|
71 |
# response = agent.run(f"Please find out the meaning of the following name: {name}, then finally a horoscope reading of the current day")
|
72 |
+
if birthstone in image_urls:
|
73 |
+
response = f"Please find out the meaning of the following name: {name}, then Generate an image of the following birthstone: {birthstone} and finally a horoscope reading of the current day"
|
74 |
+
else:
|
75 |
+
response = f"Please find out the meaning of the following name: {name}, then finally a horoscope reading of the current day"
|
76 |
return response
|
77 |
|
78 |
@tool
|