Skip to main content

ovos duck duck go skill plugin

Project description

DuckDuckGo

Use DuckDuckGo to answer questions

About

Uses the DuckDuckGo API to provide information.

Examples

  • "when was stephen hawking born"
  • "ask the duck about the big bang"
  • "tell me more"
  • "who is elon musk"
  • "continue"
  • "tell me more"

Adding more infobox intents

internal .intent files can be added to allow parsing infoboxes returned by duckduckgo

first print the target infobox to inspect the returned results

from skill_ovos_ddg import DuckDuckGoSolver
d = DuckDuckGoSolver()
info = d.get_infobox("Stephen Hawking")[0]
print(info)
# {'age at death': '76 years',
#  'born': {'after': 0,
#           'before': 0,
#           'calendarmodel': 'http://www.wikidata.org/entity/Q1985727',
#           'precision': 11,
#           'time': '+1942-01-08T00:00:00Z',
#           'timezone': 0},
#  'children': '3, including Lucy',
#  'died': {'after': 0,
#           'before': 0,
#           'calendarmodel': 'http://www.wikidata.org/entity/Q1985727',
#           'precision': 11,
#           'time': '+2018-03-14T00:00:00Z',
#           'timezone': 0},
#  'education': 'University College, Oxford (BA), Trinity Hall, Cambridge (PhD)',
#  'facebook profile': 'stephenhawking',
#  'fields': 'General relativity, quantum gravity',
#  'imdb id': 'nm0370071',
#  'instance of': {'entity-type': 'item', 'id': 'Q5', 'numeric-id': 5},
#  'institutions': 'University of Cambridge, California Institute of Technology, '
#                  'Perimeter Institute for Theoretical Physics',
#  'official website': 'https://hawking.org.uk',
#  'other academic advisors': 'Robert Berman',
#  'resting place': 'Westminster Abbey',
#  'rotten tomatoes id': 'celebrity/stephen_hawking',
#  'thesis': 'Properties of Expanding Universes (1966)',
#  'wikidata aliases': ['Stephen Hawking',
#                       'Hawking',
#                       'Stephen William Hawking',
#                       'S. W. Hawking',
#                       'stephen'],
#  'wikidata description': 'British theoretical physicist, cosmologist and '
#                          'author (1942–2018)',
#  'wikidata id': 'Q17714',
#  'wikidata label': 'Stephen Hawking',
#  'youtube channel': 'UCPyd4mR0p8zHd8Z0HvHc0fw'}

under DuckDuckGoSolver.register_from_file add your new xxx.intent file, where xxx needs to be a key present in the infobox, underscores are replaced with whitespaces

then that infobox value will be mapped to that intent file

Category

Information

Tags

#duckduckgo #query #search-engine #searchengine

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

skill-ddg-0.1.2.tar.gz (63.4 kB view details)

Uploaded Source

Built Distribution

skill_ddg-0.1.2-py3-none-any.whl (96.2 kB view details)

Uploaded Python 3

File details

Details for the file skill-ddg-0.1.2.tar.gz.

File metadata

  • Download URL: skill-ddg-0.1.2.tar.gz
  • Upload date:
  • Size: 63.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for skill-ddg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e48439ce59635d6b6581c5269b339d8eb4c49c5cbfc6076618041e4bf5ce0a78
MD5 2b9284f8b835bc272bb8b12e7bc4756c
BLAKE2b-256 0eb56cb0fea2c9ee08d976dcde9e2af3df40a66484cdfa6c00339c1f25bc2097

See more details on using hashes here.

File details

Details for the file skill_ddg-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: skill_ddg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 96.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for skill_ddg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 354b24d68abecf7223f741de564f42515c0a36e8d86a0fcf348083d899bdaff7
MD5 2c17bff05f92abc8e4a8a3ce43461169
BLAKE2b-256 339711ef683ffbf22fb118fe69c68732f927749cffc4f6654392dd968af8292d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page