Skip to main content

A package to interact with DuckDuckGo AI-powered search

Project description

DuckDuckAI

DuckDuckAI is a Python package for interacting with DuckDuckGo's chat API. It allows you to fetch responses from DuckDuckGo's AI models and print them in a streamed format or as a complete response.

Installation

To install the DuckDuckAI package, you can use pip:

pip install DuckDuckAI

Usage

You can interact with DuckDuckAI by calling the ask function. It supports both streaming responses or returning the entire message at once.

Example

from DuckDuckAI import ask

# Fetch response in streamed format (printing character by character)
ask("Tell me a joke", stream=True)

# Fetch response as a complete message
response = ask("Tell me a joke", stream=False)
print(response)

Parameters Table

Parameter Type Description Default
query str The search query string. Required
stream bool Whether to stream results or fetch them all at once. True
model str The model to use for the response (e.g., gpt-4o-mini). gpt-4o-mini

List of Models

Here is the list of available models:

  1. mistralai/Mixtral-8x7B-Instruct-v0.1: A model trained by Mistral for instruction-based tasks with 8x7B parameters.
  2. meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo: Meta's large-scale model with 70 billion parameters designed for fast and accurate responses.
  3. claude-3-haiku-20240307: A model optimized for generating short, poetic, and haiku-style text, using Claude 3 architecture.
  4. gpt-4o-mini: A smaller variant of GPT-4 designed for quick, concise responses with less computation.

License

This project is licensed under the Apache-2.0 license - see the LICENSE file for details.

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

duckduckai-1.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

DuckDuckAI-1.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file duckduckai-1.0.2.tar.gz.

File metadata

  • Download URL: duckduckai-1.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for duckduckai-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f1485816b32e4166cdc6b59f8684f35cae223eb136000e8f7f09dde881e32f6f
MD5 9b8791a3dcfd8c766fdbd749e8615c59
BLAKE2b-256 16d713cc53121e84b76bc7e6cf736a549efcee912f642c918a76ba2ba5498a3e

See more details on using hashes here.

File details

Details for the file DuckDuckAI-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: DuckDuckAI-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for DuckDuckAI-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7b0e4795b33c18f2ff9f6ef4718349f173c236ff4fb252e92425a4b40f9b9e13
MD5 1c1ccce01a926647082444247808b50d
BLAKE2b-256 c6565bf0b84bdc26119162d504b2ff2e02ed213e5dd9d839e171ed1189f91c6d

See more details on using hashes here.

Supported by

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