Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions __init__.py → ..._skill_fallback_wolfram_alpha/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2025 Neongecko.com Inc.
# Copyright 2008-2026 Neongecko.com Inc.
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo
# BSD-3 License
Expand Down Expand Up @@ -137,35 +137,17 @@ def handle_get_sources(self, message):

def _query_wolfram(self, utterance, message) -> Tuple[str, str]:
query = normalize(utterance, remove_articles=False)
# parsed_question = self.question_parser.parse(utterance)
# LOG.debug(parsed_question)
# if not parsed_question:
# LOG.warning(f"No question pared from '{utterance}'")
# return None, None

# Try to store pieces of utterance (None if not parsed_question)
# utt_word = parsed_question.get('QuestionWord')
# utt_verb = parsed_question.get('QuestionVerb')
# utt_query = parsed_question.get('Query')
# LOG.debug(len(str(utt_query).split()))
# query = "%s %s %s" % (utt_word, utt_verb, utt_query)
# TODO: Better parsing of utterance into a question
LOG.info(f"Querying WolframAlpha: {query}")

preference_location = get_user_prefs(message)["location"]
lat = str(preference_location['lat'])
lng = str(preference_location['lng'])
units = str(get_user_prefs(message)["units"]["measure"])
query_type = "short" if message.context.get("klat_data") else "spoken"
key = (utterance, lat, lng, units, repr(query_type))

# if "convert" in query:
# to_convert = utt_query[:utt_query.index(utt_query.split(" ")[-1])]
# query = f'convert {to_convert} to {query.split("to")[1].split(" ")[-1]}'
# LOG.info(f"query={query}")

key = (query, lat, lng, units, query_type)
kwargs = {"lat": lat, "lon": lng, "api": query_type, "units": units,
"query": query}

try:
result = request_backend("proxy/wolframalpha",
kwargs).get("answer")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2025 Neongecko.com Inc.
# Copyright 2008-2026 Neongecko.com Inc.
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo
# BSD-3 License
Expand Down Expand Up @@ -30,7 +30,7 @@
from os import getenv, path, walk

SKILL_NAME = "skill-fallback_wolfram_alpha"
SKILL_PKG = SKILL_NAME.replace('-', '_')
SKILL_PKG = "neon_" + SKILL_NAME.replace('-', '_')
# skill_id=package_name:SkillClass
PLUGIN_ENTRY_POINT = f'{SKILL_NAME}.neongeckocom={SKILL_PKG}:WolframAlphaSkill'
BASE_PATH = path.abspath(path.dirname(__file__))
Expand Down Expand Up @@ -59,7 +59,7 @@ def get_requirements(requirements_filename: str):

def find_resource_files():
resource_base_dirs = ("locale", "ui", "vocab", "dialog", "regex")
base_dir = BASE_PATH
base_dir = path.join(BASE_PATH, SKILL_PKG)
package_data = ["skill.json"]
for res in resource_base_dirs:
if path.isdir(path.join(base_dir, res)):
Expand Down Expand Up @@ -93,7 +93,6 @@ def find_resource_files():
author_email='developers@neon.ai',
long_description=long_description,
long_description_content_type="text/markdown",
package_dir={SKILL_PKG: ""},
packages=[SKILL_PKG],
package_data={SKILL_PKG: find_resource_files()},
include_package_data=True,
Expand Down
45 changes: 24 additions & 21 deletions skill.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,42 @@
{
"title": "Wolfram Alpha",
"url": "https://github.com/NeonGeckoCom/skill-fallback_wolfram_alpha",
"title": "neon-skill-fallback_wolfram_alpha",
"icon": "https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/question.svg",
"summary": "General knowledge fallback handler based on [Wolfram Alpha](https://wolframalpha.com) services",
"short_description": "General knowledge fallback handler based on [Wolfram Alpha](https://wolframalpha.com) services",
"description": "Answers general knowledge, math, and definition questions by using Wolfram Alpha API services. If the user is interested in knowing where the information for the spoken answer came from, Neon can send the most recent source of the spoken details to user\u2019s email. Use of this skill requires use of third-party APIs. This skill will use Neon AI servers by default, but you can deploy your own instance of [Diana](https://github.com/NeonGeckoCom/neon-diana-utils).",
"examples": [
"What is 2 + 2?",
"Who won best picture in 2006?",
"How far away is the moon?",
"Send me the source for that."
],
"desktopFile": false,
"warning": "",
"systemDeps": false,
"credits": [
"Neongecko"
],
"category": "",
"package_name": "neon-skill-fallback_wolfram_alpha",
"pip_spec": "neon-skill-fallback_wolfram_alpha",
"license": "BSD-3-Clause",
"author": "Neongecko",
"tags": [],
"version": "3.0.0",
"url": "https://github.com/NeonGeckoCom/skill-fallback_wolfram_alpha",
"skill_id": "skill-fallback_wolfram_alpha.neongeckocom=neon_skill_fallback_wolfram_alpha:WolframAlphaSkill",
"skillname": "skill-fallback_wolfram_alpha",
"authorname": "NeonGeckoCom",
"name": "neon-skill-fallback_wolfram_alpha",
"requirements": {
"python": [
"requests>=2.13.0",
"neon-utils~=1.12",
"ovos-utils~=0.0,>=0.0.28",
"ovos-workshop~=0.0,>=0.0.15",
"requests>=2.13.0"
"ovos-workshop~=0.0,>=0.0.15"
],
"system": {},
"skill": []
},
"desktopFile": false,
"warning": "",
"systemDeps": false,
"incompatible_skills": [],
"platforms": [
"i386",
Expand All @@ -32,17 +46,6 @@
"arm"
],
"branch": "master",
"license": "BSD-3-Clause",
"icon": "https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/question.svg",
"category": "",
"categories": [],
"tags": [],
"credits": [
"Mycroft AI",
"NeonDaniel",
"reginaneon"
],
"skillname": "skill-fallback_wolfram_alpha",
"authorname": "NeonGeckoCom",
"foldername": null
"foldername": null,
"short_description": "General knowledge fallback handler based on [Wolfram Alpha](https://wolframalpha.com) services"
}
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework
# All trademark and other rights reserved by their respective owners
# Copyright 2008-2025 Neongecko.com Inc.
# Copyright 2008-2026 Neongecko.com Inc.
# Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds,
# Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kirill Hrymailo
# BSD-3 License
Expand Down