deedy5 / duckduckgo_search

Search for words, documents, images, videos, news, maps and text translation using the DuckDuckGo.com search engine. Downloading files and images to a local hard drive.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add documentaion and/or type annotations for the response objects

yifeikong opened this issue · comments

Recently, I've been using this package to write a RAG application, however, I need to actually run the lib to know the response fields.

The current return type of .text() etc, is Dict:

List of dictionaries with search results.

which is too generic for the users and linters.

Describe the solution you'd like

Can we change the return type to a TypedDict or a pydantic model? The fields would be more explicit this way. At least, common fields such as title and body should be documented.

TypedDict is a good idea 👍
But there is no time yet, I will update README or add TypedDict later.