Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add screenshots #4

Merged
merged 4 commits into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ consult-web provides wrappers and macros around [[https://github.com/minad/consu

Here is the mandatory screenshot:

#+ATTR_ORG: :width 800px
#+ATTR_LATEX: :width 800px
#+ATTR_HTML: :width 800px
[[https://github.com/armindarvish/consult-web/blob/screenshots/screenshots/dynamic-omni-screenshot.gif]]

* Getting Started
Before you start, make sure you understand three points:
Expand Down Expand Up @@ -105,7 +109,6 @@ This limits the sources that =consult-web-sources= loads to ONLY those defined i
| [[https://github.com/armindarvish/consult-web/tree/develop?tab=readme-ov-file#youtube][YouTube]] | Videos |
|--------------------------+-------------------------|


**** Web Search Sources
***** Google

Expand Down Expand Up @@ -198,7 +201,6 @@ consult-web-sources provides =consult-web-chatgpt= and =consult-web-dynamic-chat
Note that these commands are cimple one-time http requests. For a more extended conversation and a full-feature experience, you can use consult-web-gptel below.

***** gptel
****** only a placeholder to send to gptel
Another easy way to integrate AI assistants with consult-web is to use the amazing package, [[https://github.com/karthink/gptel][gptel]]. This is by far my favorite generative AI package in emacs becuase of how easy it is to integrate it with other things in emacs. To use this with consult-web, install gptel following the packages's documentation here: [[https://github.com/karthink/gptel][gptel]]. Once you have gptel setup, you can call =consult-web-gptel=, or =consult-web-dynamic-gptel= to get answers to your prompts. Note that, these functions do not fetch the answers to your prompt right away and wait for either a preview or for selecting the candidate to send the prompt to the backend AI. This is becuase sending the prompt to the backend can be expensive (in terms of paid services) and can also be slow depending on the backend and how long the answer is. Therefore, by design the user needs to actively decide to send the prompt to the backend.

You can add any of the gptel sources to any of the multi-source interactive commands. For example:
Expand Down Expand Up @@ -465,17 +467,47 @@ consult-web does provide a few interactive commands. These are provided as good

1. =consult-web-multi=: This is an interactive command that uses multiple sources, as defined by =consult-web-multi-sources=, and shows the results in minibuffer completion. Here is an example screenshot:

Note that consult-web-multi does not provide dynamic completion but some might find using this more intuitive for narrowing down the results. The user provides one search term, and once the results are retrieved, typing in the minibuffer will narrow down the candidates. In addition, depending on your minibuffer config for sorting, it is possible to remeber the candidates you selected before by sorting them on top (by using packages like [[https://github.com/oantolin/orderless][orderless]] or [[https://github.com/radian-software/prescient.el][prescient.el]]).

#+ATTR_ORG: :width 800px
#+ATTR_LATEX: :width 800px
#+ATTR_HTML: :width 800px
[[https://github.com/armindarvish/consult-web/blob/screenshots/screenshots/multi-screenshot.gif]]

Note that consult-web-multi does not provide dynamic completion but some might find using this more intuitive for narrowing down the results. The user provides one search term, and once the results are retrieved, typing in the minibuffer will narrow down the candidates. In addition, as can be seen in the screenshot above, depending on your minibuffer config for sorting, it is possible to remeber the candidates you selected before by sorting them on top (by using packages like [[https://github.com/oantolin/orderless][orderless]] or [[https://github.com/radian-software/prescient.el][prescient.el]]).

2. =onsult-web-dynamic=: This is a “multi-source” interactive command that uses “dynamic” collection. This allows dynamic completion of the search results (results are fetched as the user types). Here is a screenshot:

3. =consult-web-scholar=: This is similar to consult-web-dynamic, and is provided as an extra example to show how to make combination of sources for a specific purpose, in this case searching academic research literature.
#+ATTR_ORG: :width 800px
#+ATTR_LATEX: :width 800px
#+ATTR_HTML: :width 800px
[[https://github.com/armindarvish/consult-web/blob/screenshots/screenshots/dynamic-screenshot.gif]]

3. =consult-web-scholar=: This is similar to consult-web-dynamic, and is provided as an extra example to show how to make combination of sources for a specific purpose, in this case searching academic research literature. Here is a screenshot:

#+ATTR_ORG: :width 800px
#+ATTR_LATEX: :width 800px
#+ATTR_HTML: :width 800px
[[https://github.com/armindarvish/consult-web/blob/screenshots/screenshots/scholar-screenshot.gif]]



4. =consult-web-omni=: This is another static multi-source command provided for combining web sources and local sources to do omni searches. Here is a screenshot:

#+ATTR_ORG: :width 800px
#+ATTR_LATEX: :width 800px
#+ATTR_HTML: :width 800px
[[https://github.com/armindarvish/consult-web/blob/screenshots/screenshots/omni-screenshot.gif]]



5. =consult-web-dynamic-omni=: This is the dynamic version of the omni search for combination of web and local sources. For exampe, in the screenshot below you see results form org-roam notes, brave search engine, wikipedia, as well as gptel AI assistant:


#+ATTR_ORG: :width 800px
#+ATTR_LATEX: :width 800px
#+ATTR_HTML: :width 800px
[[https://github.com/armindarvish/consult-web/blob/screenshots/screenshots/dynamic-omni-screenshot.gif]]

Note that the difference between =consult-web-multi= and =consult-web-omni= (and similarly between =consult-web-dynamic=, =consult-web-scholar=, =consult-web-dynamic-omni=) is the list of sources they use and therefore you cna use them as you wish for any combination of sources. You can also define more interative commands with various variation of sources folowwing these examples.

** Dynamic Completion: Passing Arguments and Narrow Down
Expand Down