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.
MIT License
927
stars
117
forks
source link
Add documentaion and/or type annotations for the response objects #212
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.
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, isDict
:https://github.com/deedy5/duckduckgo_search/blob/fce7fab463934f9e4d844ca5ca40a185a656a468/duckduckgo_search/duckduckgo_search_async.py#L181
https://github.com/deedy5/duckduckgo_search/blob/fce7fab463934f9e4d844ca5ca40a185a656a468/duckduckgo_search/duckduckgo_search_async.py#L192
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 astitle
andbody
should be documented.