Skip to content

Commit 1832299

Browse files
doc: add shell example for using duckduckgo
Signed-off-by: thiswillbeyourgithub <[email protected]>
1 parent e6c4641 commit 1832299

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

wdoc/docs/examples.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ wdoc --task=query \
214214

215215
Data sent using shell pipes (be it for strings or binary data) will be automatically saved to a temporary file which is then passed as `--path=[temp_file]` argument. For example `cat **/*.txt | wdoc --task=query`, `echo $my_url | wdoc parse` or even `cat my_file.pdf | wdoc parse --filetype=pdf`. For binary input it is strongly recommended to use a `--filetype` argument because `python-magic` version <=0.4.27 chokes otherwise (see [that issue](https://github.com/ahupp/python-magic/issues/261).
216216

217+
10. You can also search the web for results using [DuckDuckGo](https://en.wikipedia.org/wiki/DuckDuckGo):
218+
219+
It's implemented like if `ddg` was a `recursive_filetype`. Hence, the idea is to use `wdoc --task=query --path='How is NVidia doing this month?' --query='How is NVidia doing this month' --filetype=ddg` (remember: `path` specifies the document and `query` the question to ask about the documents). To make it more natural, if any of `path` or `query` is missing, we replace it by the value of the other one. It can be shortened to: `wdoc web 'How is NVidia doing this month?'`. With `--ddg_max_result=5` you can specify the maximum number of results to get, use `--ddg_region=us-US` to get US only result, `--ddg_safesearch=on` to filter out NSFW results.
220+
221+
217222
# Python Script Examples
218223

219224
1. Basic document summarization

0 commit comments

Comments
 (0)