Skip to content

Commit

Permalink
drop tts_prefs from sessionfix units
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Apr 25, 2024
1 parent 50c4ffe commit c1efdd4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_image(self, query: str, units: str = None):

class WolframAlphaSolver(QuestionSolver):
priority = 25
enable_cache = True
enable_cache = False
enable_tx = True

def __init__(self, config=None):
Expand Down Expand Up @@ -274,6 +274,9 @@ def CQS_action(self, phrase: str, data: dict):
# wolfram integration
def ask_the_wolf(self, query: str, lang: str = None, units: str = None):
units = units or self.system_unit
if units != "metric":
units = "nonmetric" # what wolfram api expects

lang = lang or self.lang
if lang.startswith("en"):
self.log.debug(f"skipping auto translation for wolfram alpha, "
Expand Down Expand Up @@ -315,7 +318,12 @@ def stop_session(self, sess):

d = WolframAlphaSkill(bus=FakeBus(), skill_id="fake.wolf")

print(d.ask_the_wolf("what is the speed of light"))
print(d.ask_the_wolf("what is the speed of light", units="nonmetric")) # SI units regardless
# The speed of light has a value of about 300 million meters per second
print(d.ask_the_wolf("how tall is the eiffel tower", units="metric"))
print(d.ask_the_wolf("how tall is the eiffel tower", units="nonmetric"))
# The total height of the Eiffel Tower is 330 meters
# The total height of the Eiffel Tower is about 1083 feet

exit()

Expand Down

0 comments on commit c1efdd4

Please sign in to comment.