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:
- mistralai/Mixtral-8x7B-Instruct-v0.1: A model trained by Mistral for instruction-based tasks with 8x7B parameters.
- meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo: Meta's large-scale model with 70 billion parameters designed for fast and accurate responses.
- claude-3-haiku-20240307: A model optimized for generating short, poetic, and haiku-style text, using Claude 3 architecture.
- 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file DuckDuckAI-1.0.1.tar.gz.
File metadata
- Download URL: DuckDuckAI-1.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46959c2b3c54269e1c5862f55eebf0a31772b3909a1c674def3a649d593df709
|
|
| MD5 |
4b0c30feb40fbda14fd7f2730ce2d86e
|
|
| BLAKE2b-256 |
9dc0c4c060a3b67c0ce025992058f8bb8b9e53919e1cd91d067d5856ab20fa74
|
File details
Details for the file DuckDuckAI-1.0.1-py3-none-any.whl.
File metadata
- Download URL: DuckDuckAI-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b0d6aff107135d6cc899c5870f30ac10bd0ba1813117627ea042d68897d7634
|
|
| MD5 |
db5481e44c0f435d57249f0abacd595d
|
|
| BLAKE2b-256 |
fc342de02e07fb66588697a01a28e6c393b1ee862ab5fb34601aa128d194c856
|