Spaces:
Sleeping
Sleeping
Update app.py
Browse filesadded mordor function
app.py
CHANGED
|
@@ -38,6 +38,24 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 38 |
except Exception as e:
|
| 39 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
final_answer = FinalAnswerTool()
|
| 43 |
|
|
|
|
| 38 |
except Exception as e:
|
| 39 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 40 |
|
| 41 |
+
@tool
|
| 42 |
+
def get_mordor_status() -> str:
|
| 43 |
+
"""
|
| 44 |
+
Returns a random outcome of current events in Fourth Age Mordor.
|
| 45 |
+
Each outcome has an equal (1 in 5) chance of occurring.
|
| 46 |
+
"""
|
| 47 |
+
outcomes = [
|
| 48 |
+
"Harvest Season in Núrn: The liberated peoples are bringing in a record crop of grain near the inland sea.",
|
| 49 |
+
"Rangers of Ithilien: A patrol led by Faramir's descendants is clearing out the last remnants of ancient Orc-holds in the Ephel Dúath.",
|
| 50 |
+
"Geological Rest: Mount Doom (Orodruin) remains dormant, though thin plumes of steam still rise from the Sammath Naur.",
|
| 51 |
+
"Reconstruction: Stonemasons from Gondor are surveying the ruins of the Morannon to build a new watchtower for the Reunited Kingdom.",
|
| 52 |
+
"Trade Caravans: A group of Easterlings has arrived at the Sea of Núrn to establish peaceful trade routes with the new land-holders."
|
| 53 |
+
]
|
| 54 |
+
|
| 55 |
+
# random.choice picks one element from the list with equal probability
|
| 56 |
+
current_event = random.choice(outcomes)
|
| 57 |
+
|
| 58 |
+
return f"Status: {current_event}"
|
| 59 |
|
| 60 |
final_answer = FinalAnswerTool()
|
| 61 |
|