Skip to main content

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

Metadata

Release files for skill-ddg 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skill-ddg 0.3.0
File Size Uploaded
skill-ddg-0.3.0.tar.gz 68.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for skill-ddg 0.3.0
File Interpreter ABI Platform
skill_ddg-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 175.1 kB

Release files / skill-ddg-0.3.0.tar.gz

Download URL skill-ddg-0.3.0.tar.gz
Size 68.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b542512c75cccc0be8b00c5b4a45ab5dfe8ecdff67427299d320a321cc8aaba7
BLAKE2b-256 checksum
How to use checksums
d4a4c66c95915bda6cdcbe97638333afa48b660bd7a6c1febd717a233f0ec233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Release files / skill_ddg-0.3.0-py3-none-any.whl

Download URL skill_ddg-0.3.0-py3-none-any.whl
Size 107.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cdfae5aef78998581b21b401c52acf327a1509b4c824c64617c5a9764cc4178
BLAKE2b-256 checksum
How to use checksums
33c0e4da8acbaf7da74f87a5e92166219f646c0a61b95be6954f8d9650678e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.22

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page