mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 14:08:08 +01:00
Add pirate treasure goal and more info to documentation re: how to make goals and tools
This commit is contained in:
18
tools/guess_location.py
Normal file
18
tools/guess_location.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from .give_hint import TREASURE_LOCATION
|
||||
|
||||
def guess_location(args: dict) -> dict:
|
||||
|
||||
guess_address = args.get("address").lower()
|
||||
guess_city = args.get("city").lower()
|
||||
guess_state = args.get("state").lower()
|
||||
|
||||
if len(guess_state) == 2:
|
||||
compare_state = TREASURE_LOCATION.get("state_abbrev").lower()
|
||||
else:
|
||||
compare_state = TREASURE_LOCATION.get("state_full").lower()
|
||||
|
||||
#Check for the street address to be included in the guess to account for "st" vs "street" or leaving Street off entirely
|
||||
if TREASURE_LOCATION.get("address").lower() in guess_address and TREASURE_LOCATION.get("city").lower() == guess_city and compare_state == guess_state:
|
||||
return {"treasure_found": "True"}
|
||||
else:
|
||||
return {"treasure_found": "False"}
|
||||
Reference in New Issue
Block a user